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

Functions

 patternToVars (Pattern)
 LArCalibDigitsMakerCfg (flags, DigitsKey="")

Function Documentation

◆ LArCalibDigitsMakerCfg()

python.LArCalib_CalibDigitsMakerConfig.LArCalibDigitsMakerCfg ( flags,
DigitsKey = "" )

Definition at line 41 of file LArCalib_CalibDigitsMakerConfig.py.

41def LArCalibDigitsMakerCfg(flags,DigitsKey=""):
42
43 result = ComponentAccumulator()
44 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg,LArCalibIdMappingCfg
45 result.merge(LArOnOffIdMappingCfg(flags))
46 result.merge(LArCalibIdMappingCfg(flags))
47 if flags.LArCalib.isSC:
48 from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg,LArCalibIdMappingSCCfg
49 result.merge(LArOnOffIdMappingSCCfg(flags))
50 result.merge(LArCalibIdMappingSCCfg(flags))
51
52
53 BoardIDs = {}
54 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]
55 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]
56
57 BoardIDs["Barrel"] = BoardIDs["EMBA"] + BoardIDs["EMBC"]
58
59 BoardIDs["EMECAstd"] = [1057947648, 1057423360, 1060044800, 1059520512, 1061617664, 1061093376, 1063714816, 1063190528, 1064763392, 1064239104, 1066860544, 1066336256, 1067909120, 1067384832, 1070006272, 1069481984]
60 BoardIDs["EMECAspe"] = [1058603008, 1058635776, 1062273024, 1062305792, 1065418752, 1065451520, 1068564480, 1068597248]
61 BoardIDs["EMECCstd"] = [1046937600, 1046413312, 1044840448, 1044316160, 1043267584, 1042743296, 1041170432, 1040646144, 1053229056, 1052704768, 1051131904, 1050607616, 1050083328, 1049559040, 1047986176, 1047461888]
62 BoardIDs["EMECCspe"] = [1045495808, 1045528576, 1041825792, 1041858560, 1051787264, 1051820032, 1048641536, 1048674304]
63
64 BoardIDs["EMECspe"] = BoardIDs["EMECAspe"]+BoardIDs["EMECCspe"]
65 BoardIDs["EMECstd"] = BoardIDs["EMECAstd"]+BoardIDs["EMECCstd"]
66
67 BoardIDs["HECA"] = [1058897920, 1062567936, 1065713664, 1068859392]
68 BoardIDs["HECC"] = [1045790720, 1042120704, 1052082176, 1048936448]
69 BoardIDs["FCALA"] = [1060601856]
70 BoardIDs["FCALC"] = [1043824640]
71
72 BoardIDs["HEC"] = BoardIDs["HECA"] + BoardIDs["HECC"]
73 BoardIDs["FCAL"] = BoardIDs["FCALA"] + BoardIDs["FCALC"]
74
75 Boards = [ BoardIDs["Barrel"], BoardIDs["EMECstd"], BoardIDs["EMECspe"], BoardIDs["HEC"], BoardIDs["FCAL"] ]
76
77 # read and interpret parameters.dat
78
79 DACs,Delays,Patterns=patternToVars(flags.LArCalib.Input.paramsFile)
80 nPatterns=len(Patterns)
81
82 print('CalibDigitsMakerConfig: ',DACs,' ',Delays,' ',Patterns)
83 result.addEventAlgo(CompFactory.LArCalibDigitMaker("LArCalibDigitMaker", KeyList = [DigitsKey],
84 NTrigger = 100, DAC = [DACs,DACs,DACs,DACs,DACs],
85 Delay = Delays, Pattern = [Patterns,Patterns,Patterns,Patterns,Patterns],
86 nPattern = [nPatterns,nPatterns,nPatterns,nPatterns,nPatterns],
87 BoardIDs = Boards))
88
89 from AthenaCommon.SystemOfUnits import ns
90 scmap="LArOnOffIdMapSC" if flags.LArCalib.isSC else ""
91 scclmap="LArCalibIdMapSC" if flags.LArCalib.isSC else ""
92 result.addEventAlgo(CompFactory.LArCalibDigitsAccumulator("LArCalibDigitsAccumulator", KeyList = [DigitsKey],
93 LArAccuCalibDigitContainerName = "",
94 CalibMapSCKey=scclmap, ScCablingKey=scmap,
95 DelayScale = (25./240.)*ns, SampleShift = 0,
96 KeepFullyPulsedSC = True, KeepOnlyPulsed = True,
97 isSC = flags.LArCalib.isSC, DropPercentTrig = 0))
98
99 return result
void print(char *figname, TCanvas *c1)

◆ patternToVars()

python.LArCalib_CalibDigitsMakerConfig.patternToVars ( Pattern)

Definition at line 7 of file LArCalib_CalibDigitsMakerConfig.py.

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