ATLAS Offline Software
Loading...
Searching...
No Matches
python.LArCalib_CalibDigitsMakerConfig Namespace Reference

Functions

 patternToVars (Pattern)
 LArCalibDigitsMakerCfg (flags, DigitsKey="", ntrigg=100, notrun=False)

Function Documentation

◆ LArCalibDigitsMakerCfg()

python.LArCalib_CalibDigitsMakerConfig.LArCalibDigitsMakerCfg ( flags,
DigitsKey = "",
ntrigg = 100,
notrun = False )

Definition at line 43 of file LArCalib_CalibDigitsMakerConfig.py.

43def LArCalibDigitsMakerCfg(flags,DigitsKey="",ntrigg=100,notrun=False):
44
45 result = ComponentAccumulator()
46 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg,LArCalibIdMappingCfg
47 result.merge(LArOnOffIdMappingCfg(flags))
48 result.merge(LArCalibIdMappingCfg(flags))
49 if flags.LArCalib.isSC:
50 from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg,LArCalibIdMappingSCCfg
51 result.merge(LArOnOffIdMappingSCCfg(flags))
52 result.merge(LArCalibIdMappingSCCfg(flags))
53
54
55 BoardIDs = {}
56 BoardIDs["EMBA"] = [1023868928, 1040121856, 1024917504, 1024393216, 1025966080, 1025441792, 1027014656, 1026490368, 1028063232, 1027538944, 1029111808, 1028587520, 1030160384, 1029636096, 1031208960, 1030684672, 1032257536, 1031733248, 1033306112, 1032781824, 1034354688, 1033830400, 1035403264, 1034878976, 1036451840, 1035927552, 1037500416, 1036976128, 1038548992, 1038024704, 1039597568, 1039073280]
57 BoardIDs["EMBC"] = [1015480320, 1014956032, 1014431744, 1013907456, 1013383168, 1012858880, 1012334592, 1011810304, 1011286016, 1010761728, 1010237440, 1009713152, 1009188864, 1008664576, 1008140288, 1007616000, 1007091712, 1023344640, 1022820352, 1022296064, 1021771776, 1021247488, 1020723200, 1020198912, 1019674624, 1019150336, 1018626048, 1018101760, 1017577472, 1017053184, 1016528896, 1016004608]
58
59 BoardIDs["Barrel"] = BoardIDs["EMBA"] + BoardIDs["EMBC"]
60
61 BoardIDs["EMECAstd"] = [1057947648, 1057423360, 1060044800, 1059520512, 1061617664, 1061093376, 1063714816, 1063190528, 1064763392, 1064239104, 1066860544, 1066336256, 1067909120, 1067384832, 1070006272, 1069481984]
62 BoardIDs["EMECAspe"] = [1058603008, 1058635776, 1062273024, 1062305792, 1065418752, 1065451520, 1068564480, 1068597248]
63 BoardIDs["EMECCstd"] = [1046937600, 1046413312, 1044840448, 1044316160, 1043267584, 1042743296, 1041170432, 1040646144, 1053229056, 1052704768, 1051131904, 1050607616, 1050083328, 1049559040, 1047986176, 1047461888]
64 BoardIDs["EMECCspe"] = [1045495808, 1045528576, 1041825792, 1041858560, 1051787264, 1051820032, 1048641536, 1048674304]
65
66 BoardIDs["EMECspe"] = BoardIDs["EMECAspe"]+BoardIDs["EMECCspe"]
67 BoardIDs["EMECstd"] = BoardIDs["EMECAstd"]+BoardIDs["EMECCstd"]
68
69 BoardIDs["HECA"] = [1058897920, 1062567936, 1065713664, 1068859392]
70 BoardIDs["HECC"] = [1045790720, 1042120704, 1052082176, 1048936448]
71 BoardIDs["FCALA"] = [1060601856]
72 BoardIDs["FCALC"] = [1043824640]
73
74 BoardIDs["HEC"] = BoardIDs["HECA"] + BoardIDs["HECC"]
75 BoardIDs["FCAL"] = BoardIDs["FCALA"] + BoardIDs["FCALC"]
76
77 Boards = [ BoardIDs["Barrel"], BoardIDs["EMECstd"], BoardIDs["EMECspe"], BoardIDs["HEC"], BoardIDs["FCAL"] ]
78
79 # read and interpret parameters.dat
80
81 DACs,Delays,Patterns=patternToVars(flags.LArCalib.Input.paramsFile)
82 nPatterns=len(Patterns)
83
84 log = logging.getLogger('LArCalibDigitsMakerCfg ')
85 log.info(DACs,' ',Delays,' ',Patterns)
86 result.addEventAlgo(CompFactory.LArCalibDigitMaker("LArCalibDigitMaker", KeyList = [DigitsKey],
87 NTrigger = ntrigg, DAC = [DACs,DACs,DACs,DACs,DACs],
88 Delay = Delays, Pattern = [Patterns,Patterns,Patterns,Patterns,Patterns],
89 nPattern = [nPatterns,nPatterns,nPatterns,nPatterns,nPatterns],
90 BoardIDs = Boards,
91 DontRun=notrun))
92
93 if not notrun:
94 from AthenaCommon.SystemOfUnits import ns
95 scmap="LArOnOffIdMapSC" if flags.LArCalib.isSC else ""
96 scclmap="LArCalibIdMapSC" if flags.LArCalib.isSC else ""
97 result.addEventAlgo(CompFactory.LArCalibDigitsAccumulator("LArCalibDigitsAccumulator", KeyList = [DigitsKey],
98 LArAccuCalibDigitContainerName = "",
99 CalibMapSCKey=scclmap, ScCablingKey=scmap,
100 DelayScale = (25./240.)*ns, SampleShift = 0,
101 KeepFullyPulsedSC = True, KeepOnlyPulsed = True,
102 isSC = flags.LArCalib.isSC, DropPercentTrig = 0))
103
104 return result

◆ patternToVars()

python.LArCalib_CalibDigitsMakerConfig.patternToVars ( Pattern)

Definition at line 8 of file LArCalib_CalibDigitsMakerConfig.py.

8def patternToVars( Pattern):
9 f = open(Pattern)
10 lines = [line for line in f.readlines() if line.strip()]
11
12 f.close()
13 log = logging.getLogger('patternToVars')
14 for i in range(len(lines)):
15 lines[i] = (lines[i]).rstrip().split(' ')
16 if len(lines[0]) != 1:
17 log.error('1: The format of input pattern.dat is unknown.')
18 sys.exit(-1)
19 if int(lines[0][0]) != len(lines[1]):
20 log.error('2: The format of input pattern.dat is unknown.')
21 sys.exit(-1)
22 if len(lines[2]) != 1:
23 log.error('3: The format of input pattern.dat is unknown.')
24 sys.exit(-1)
25 if int(lines[2][0]) != len(lines[3]):
26 log.error('4: The format of input pattern.dat is unknown.')
27 sys.exit(-1)
28 if len(lines[4]) != 1:
29 log.error('5: The format of input pattern.dat is unknown.')
30 sys.exit(-1)
31 if int(lines[4][0]) != len(lines) - 5:
32 log.error('6: The format of input pattern.dat is unknown.')
33 sys.exit(-1)
34 DACs = list(map(int, lines[1]))
35 Delays = list(map(int, lines[3]))
36 ptrns = [ item for sublist in lines[5:] for item in sublist ]
37 Pattern = []
38 for i in range(0,len(ptrns)):
39 log.info(ptrns[i])
40 Pattern += [int(ptrns[i],16)]
41 return DACs, Delays, Pattern
42
STL class.
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:179