ATLAS Offline Software
Loading...
Searching...
No Matches
python.L1.Base.PrescaleHelper Namespace Reference

Functions

 getCutFromPrescale (prescale)
 getPrescaleFromCut (cut)

Variables

 log = logging.getLogger(__name__)
int maxPrescaleCut = 0xFFFFFF

Function Documentation

◆ getCutFromPrescale()

python.L1.Base.PrescaleHelper.getCutFromPrescale ( prescale)
C = 2**24-(2**24-1)/PS

PS =       1 --> C = 1
PS =       2 --> C = 8388609
PS =      10 --> C = 15099495
PS =    1000 --> C = 16760439
PS =   10000 --> C = 16775539
PS = 2**24-1 --> C = 2**24-1

Definition at line 24 of file PrescaleHelper.py.

24def getCutFromPrescale(prescale):
25 """
26 C = 2**24-(2**24-1)/PS
27
28 PS = 1 --> C = 1
29 PS = 2 --> C = 8388609
30 PS = 10 --> C = 15099495
31 PS = 1000 --> C = 16760439
32 PS = 10000 --> C = 16775539
33 PS = 2**24-1 --> C = 2**24-1
34 """
35
36 if prescale==0:
37 raise RuntimeError("L1 Prescale value of 0 is not allowed")
38
39 sign = -1 if prescale<0 else 1
40 prescale = abs(prescale)
41 cut=sign * ( 0x1000000 - (0xFFFFFF/prescale) )
42 cut = round( cut )
43 if prescale > 0xFFFFFF:
44 cut=sign * (0x1000000-1)
45
46 return int(cut)
47

◆ getPrescaleFromCut()

python.L1.Base.PrescaleHelper.getPrescaleFromCut ( cut)
PS = (2**24-1)/(2**24-C)

C =       1 --> PS =     1
C = 2**24-1 --> PS = 2**24-1

Definition at line 48 of file PrescaleHelper.py.

48def getPrescaleFromCut(cut):
49 """
50 PS = (2**24-1)/(2**24-C)
51
52 C = 1 --> PS = 1
53 C = 2**24-1 --> PS = 2**24-1
54 """
55
56 if cut==0:
57 raise RuntimeError("L1 Prescale cut of 0 is not allowed, use cut=1 for a prescale value of 1")
58
59 sign = -1 if cut<0 else 1
60 cut = abs(cut)
61 return (sign * 0xFFFFFF) / ( 0x1000000 - cut )

Variable Documentation

◆ log

python.L1.Base.PrescaleHelper.log = logging.getLogger(__name__)

Definition at line 4 of file PrescaleHelper.py.

◆ maxPrescaleCut

int python.L1.Base.PrescaleHelper.maxPrescaleCut = 0xFFFFFF

Definition at line 22 of file PrescaleHelper.py.