This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================================================================================ | |
Generated periods | |
================================================================================ | |
Period Range Diagram | |
================================================================================ | |
P01 40-360 .##########................................................ | |
P02 180-420 .....#######............................................... | |
P03 220-540 ......##########........................................... | |
P04 660-1000 ....................##########............................. | |
P05 960-1140 ..............................#####........................ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--prescale', type=float, default=1.5) | |
parser.add_argument('--bx-range', type=int, default=10000) | |
args = parser.parse_args() | |
# Select prescale | |
prescale_int = int(args.prescale) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This module provides a simple signal and slot system. | |
>>> class Receiver: | |
... def write(self, name): | |
... print('Hello {}!'.format(name)) | |
... | |
>>> class Emitter: | |
... def __init__(self): | |
... self.read = Signal() | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Build script for self containing binary wheels for UTM | |
# | |
# Install Docker | |
# | |
# sudo apt install docker | |
# sudo usermod -a -G docker $USER # logout required | |
# | |
# Pull manylinux image | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
import traceback | |
from PyQt5 import QtCore, QtGui, QtWidgets | |
class WorkerSignals(QtCore.QObject): | |
"""Signals provided by class `Worker`.""" | |
finished = QtCore.pyqtSignal() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fixed point fractional prescale calculation using add and sub | |
# Proposed by Andrea Bocci, Sept. 2019 | |
import argparse | |
class PrescaleCounter(object): | |
precision = 1 | |
def __init__(self, prescale): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Build script for distribution independent binary Python wheels | |
# for utm library on Linux. | |
# | |
# Install Docker | |
# | |
# sudo apt install docker | |
# sudo usermod -a -G docker $USER # logout required | |
# | |
# Pull manylinux image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# An example workflow for setting up a virtual environment for UTM Python bindings. | |
# | |
# Select UTM version | |
UTM_VERSION="0.7.3" | |
# Select Python version | |
PYTHON_MAJOR=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc -DLINUX -I/opt/xdaq/include -L/opt/xdaq/lib -lCAENVME firmware.c -o firmware | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <CAENVMElib.h> | |
int main() | |
{ | |
char version[256]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parsing XML menu to JSON | |
# | |
# Usage: | |
# python xml2json.py sample.xml | |
# | |
# Example data: | |
# https://raw.githubusercontent.com/cms-l1-globaltrigger/cms-l1-menu/master/2019/L1Menu_Collisions2018_v2_1_0-d2/xml/L1Menu_Collisions2018_v2_1_0-d2.xml | |
# | |
import json |