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

Functions

 LArDelay_OFCCaliCfg (flags)
 LArDelay_OFCCali_PoolDumpCfg (flags)

Variables

 ConfigFlags = initConfigFlags()
 Dir
 Type
 RunNumbers
 Database
 Files
 ROOTFile
 POOLFile
 DBConnection
 GlobalTag
 AtlasVersion
 cfg = MainServicesCfg(ConfigFlags)
 DBInstance

Function Documentation

◆ LArDelay_OFCCali_PoolDumpCfg()

python.LArCalib_Delay_OFCCaliConfig.LArDelay_OFCCali_PoolDumpCfg ( flags)

Definition at line 265 of file LArCalib_Delay_OFCCaliConfig.py.

265def LArDelay_OFCCali_PoolDumpCfg(flags):
266
267 #Get basic services and cond-algos
268 from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
269 result=LArCalibBaseCfg(flags)
270
271 bcKey = "LArBadChannelSC" if flags.LArCalib.isSC else "LArBadChannel"
272
273 #CondProxyProvider
274 from EventSelectorAthenaPool.CondProxyProviderConfig import CondProxyProviderCfg
275 result.merge (CondProxyProviderCfg (flags, flags.LArCalib.Input.Files))
276
277 #ROOT ntuple writing:
278 rootfile=flags.LArCalib.Output.ROOTFile
279 rootfile2=flags.LArCalib.Output.ROOTFile2
280 if rootfile:
281 result.addEventAlgo(CompFactory.LArCaliWaves2Ntuple(KeyList = ["CaliWave",] if flags.LArCalib.isSC else ["LArCaliWave",],
282 NtupleName = "CALIWAVE",
283 AddFEBTempInfo = False,
284 SaveDerivedInfo = True,
285 ApplyCorrection = True,
286 BadChanKey = bcKey,
287 AddCalib=True,
288 SaveJitter=True if flags.LArCalib.CaliWave.Nsteps >= 24 else False,
289 isSC=flags.LArCalib.isSC
290 ))
291
292 if not rootfile2:
293 result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
294 AddFEBTempInfo = False,
295 BadChanKey = bcKey,
296 AddCalib=True,
297 isSC=flags.LArCalib.isSC
298 ))
299
300 import os
301 if os.path.exists(rootfile):
302 os.remove(rootfile)
303 result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
304 result.setAppProperty("HistogramPersistency","ROOT")
305
306 if rootfile2:
307 if rootfile == rootfile2:
308 result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
309 AddFEBTempInfo = False,
310 NtupleFile = "FILE1",
311 BadChanKey = bcKey,
312 AddCalib=True,
313 isSC=flags.LArCalib.isSC
314 ))
315 else:
316 result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
317 AddFEBTempInfo = False,
318 NtupleFile = "FILE2",
319 BadChanKey = bcKey,
320 AddCalib=True,
321 isSC=flags.LArCalib.isSC
322 ))
323
324 import os
325 if os.path.exists(rootfile2):
326 os.remove(rootfile2)
327 if not rootfile:
328 result.addService(CompFactory.NTupleSvc(Output = [ "FILE2 DATAFILE='"+rootfile2+"' OPT='NEW'" ]))
329 else:
330 result.getService("NTupleSvc").Output += [ "FILE2 DATAFILE='"+rootfile2+"' OPT='NEW'" ]
331 result.setAppProperty("HistogramPersistency","ROOT")
332
333
334 return result
335
336

◆ LArDelay_OFCCaliCfg()

python.LArCalib_Delay_OFCCaliConfig.LArDelay_OFCCaliCfg ( flags)

Definition at line 7 of file LArCalib_Delay_OFCCaliConfig.py.

7def LArDelay_OFCCaliCfg(flags):
8
9 #Get basic services and cond-algos
10 from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg,chanSelStr
11 result=LArCalibBaseCfg(flags)
12
13 #Add ByteStream reading
14 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
15 result.merge(ByteStreamReadCfg(flags))
16
17 #Calibration runs are taken in fixed gain.
18 #The SG key of the digit-container is name of the gain
19 gainStrMap={0:"HIGH",1:"MEDIUM",2:"LOW"}
20 digKey=gainStrMap[flags.LArCalib.Gain]
21
22 from LArCalibProcessing.utils import FolderTagResolver
23 FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
24 tagResolver=FolderTagResolver()
25 pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder)
26 caliWaveTag=tagResolver.getFolderTag(flags.LArCalib.CaliWave.Folder)
27 caliOFCTag=tagResolver.getFolderTag(flags.LArCalib.OFCCali.Folder)
28 acTag=tagResolver.getFolderTag(flags.LArCalib.AutoCorr.Folder)
29 del tagResolver
30
31 from IOVDbSvc.IOVDbSvcConfig import addFolders
32 result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=pedestalTag, modifiers=chanSelStr(flags),
33 className="LArPedestalComplete"))
34 result.merge(addFolders(flags,flags.LArCalib.AutoCorr.Folder,detDb=flags.LArCalib.Input.Database, tag=acTag,modifiers=chanSelStr(flags)))
35
36
37 if not flags.LArCalib.isSC:
38 if flags.LArCalib.Input.isRawData:
39 result.addEventAlgo(CompFactory.LArRawDataReadingAlg(LArRawChannelKey="", LArDigitKey=digKey, LArFebHeaderKey="LArFebHeader"))
40 from LArCalibProcessing.LArCalib_CalibDigitsMakerConfig import LArCalibDigitsMakerCfg
41 result.merge(LArCalibDigitsMakerCfg(flags,digKey))
42 else:
43 result.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArAccCalibDigitKey=digKey,
44 LArFebHeaderKey="LArFebHeader",
45 SubCaloPreselection=flags.LArCalib.Input.SubDet,
46 PosNegPreselection=flags.LArCalib.Preselection.Side,
47 BEPreselection=flags.LArCalib.Preselection.BEC,
48 FTNumPreselection=flags.LArCalib.Preselection.FT))
49
50 from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
51 result.merge(LArFebErrorSummaryMakerCfg(flags))
52 result.getEventAlgo("LArFebErrorSummaryMaker").CheckAllFEB=False
53
54 if flags.LArCalib.Input.SubDet == "EM":
55 theLArCalibShortCorrector = CompFactory.LArCalibShortCorrector(KeyList = [digKey,])
56 result.addEventAlgo(theLArCalibShortCorrector)
57
58 from LArCalibProcessing.LArStripsXtalkCorrConfig import LArStripsXtalkCorrCfg
59 result.merge(LArStripsXtalkCorrCfg(flags,[digKey,]))
60 else:
61 digKey="SC"
62 theLArLATOMEDecoder = CompFactory.LArLATOMEDecoder("LArLATOMEDecoder")
63 if flags.LArCalib.Input.isRawData:
64 result.addEventAlgo(CompFactory.LArRawSCDataReadingAlg(adcCollKey = digKey, adcBasCollKey = "", etCollKey = "",
65 etIdCollKey = "", LATOMEDecoder = theLArLATOMEDecoder))
66 from LArCalibProcessing.LArCalib_CalibDigitsMakerConfig import LArCalibDigitsMakerCfg
67 result.merge(LArCalibDigitsMakerCfg(flags,digKey))
68
69 else:
70 # this needs also legacy maps
71 from LArCabling.LArCablingConfig import LArCalibIdMappingCfg,LArOnOffIdMappingCfg
72 result.merge(LArOnOffIdMappingCfg(flags))
73 result.merge(LArCalibIdMappingCfg(flags))
74 result.addEventAlgo(CompFactory.LArRawSCCalibDataReadingAlg(LArSCAccCalibDigitKey = digKey,
75 CalibCablingKeyLeg="LArCalibLineMap",
76 OnOffMapLeg="LArOnOffIdMap",
77 LATOMEDecoder = theLArLATOMEDecoder, ))
78
79 bcKey = "LArBadChannelSC" if flags.LArCalib.isSC else "LArBadChannel"
80
81 theLArCaliWaveBuilder = CompFactory.LArCaliWaveBuilder()
82 theLArCaliWaveBuilder.KeyList= [digKey,]
83 theLArCaliWaveBuilder.KeyOutput="LArCaliWave"
84 theLArCaliWaveBuilder.GroupingType = flags.LArCalib.GroupingType
85 theLArCaliWaveBuilder.SubtractPed = True
86 theLArCaliWaveBuilder.NSteps = flags.LArCalib.CaliWave.Nsteps
87 theLArCaliWaveBuilder.CheckEmptyPhases = not flags.LArCalib.isSC
88 theLArCaliWaveBuilder.NBaseline = 0 # to avoid the use of the baseline when Pedestal are missing
89 theLArCaliWaveBuilder.UseDacAndIsPulsedIndex = False # should have an impact only for HEC
90 theLArCaliWaveBuilder.RecAllCells = False
91 theLArCaliWaveBuilder.isSC = flags.LArCalib.isSC
92 result.addEventAlgo(theLArCaliWaveBuilder)
93
94
95 if flags.LArCalib.Input.SubDet == "HEC" or flags.LArCalib.Input.SubDet == "HECFCAL":
96 theLArCaliWaveBuilder.KeyOutput="LArCaliWave_multi"
97 theLArCaliWaveSelector = CompFactory.LArCaliWaveSelector("LArCaliWaveSelector")
98 theLArCaliWaveSelector.KeyList = ["LArCaliWave_multi",]
99 theLArCaliWaveSelector.KeyOutput = "LArCaliWave"
100 theLArCaliWaveSelector.GroupingType = flags.LArCalib.GroupingType
101 if flags.LArCalib.Gain==0: #HIGH gain
102 theLArCaliWaveSelector.SelectionList = [ "HEC/0/0/460","HEC/1/0/460","HEC/2/0/230","HEC/3/0/230" ]
103 theLArCaliWaveSelector.SelectionList += [ "FCAL/0/0/500","FCAL/1/0/500","FCAL/2/0/500","FCAL/3/0/500" ]
104
105 elif flags.LArCalib.Gain==1: #MEDIUM gain
106 theLArCaliWaveSelector.SelectionList = [ "HEC/0/1/3600","HEC/1/1/3600","HEC/2/1/1800","HEC/3/1/1800"]
107 theLArCaliWaveSelector.SelectionList += [ "FCAL/0/1/5000","FCAL/1/1/5000","FCAL/2/1/5000","FCAL/3/1/5000" ]
108
109 elif flags.LArCalib.Gain==2: #LOW gain
110 theLArCaliWaveSelector.SelectionList = [ "HEC/0/2/24000","HEC/1/2/24000","HEC/2/2/18000","HEC/3/2/18000" ]
111 theLArCaliWaveSelector.SelectionList += [ "FCAL/0/2/40000","FCAL/1/2/40000","FCAL/2/2/40000","FCAL/3/2/40000" ]
112
113 result.addEventAlgo(theLArCaliWaveSelector)
114 pass
115
116 if flags.LArCalib.CorrectBadChannels:
117 theLArCaliWavePatcher=CompFactory.getComp("LArCalibPatchingAlg<LArCaliWaveContainer>")("LArCaliWavePatch")
118 theLArCaliWavePatcher.ContainerKey = "LArCaliWave"
119 theLArCaliWavePatcher.BadChanKey = bcKey
120 theLArCaliWavePatcher.SuperCells = flags.LArCalib.isSC
121 #theLArCaliWavePatcher.PatchMethod="PhiNeighbor" ##take the first neigbour
122 theLArCaliWavePatcher.PatchMethod = "PhiAverage"
123 if flags.LArCalib.isSC:
124 theLArCaliWavePatcher.ProblemsToPatch = [
125 "deadCalib","deadReadout","deadPhys","maskedOSUM","OffOFCs","transmissionErrorFibre",]
126 theLArCaliWavePatcher.OnOffMap="LArOnOffIdMapSC"
127 theLArCaliWavePatcher.CalibLineKey="LArCalibIdMapSC"
128 else:
129 theLArCaliWavePatcher.ProblemsToPatch = [
130 "deadCalib","deadReadout","deadPhys","almostDead","short", ]
131
132 result.addEventAlgo(theLArCaliWavePatcher)
133 pass
134
135 if flags.LArCalib.doValidation:
136
137 result.merge(addFolders(flags,flags.LArCalib.CaliWave.Folder+"<key>LArCaliWaveRef</key>","LAR_OFL"))
138
139 from LArCalibDataQuality.Thresholds import cwAmpThr,cwFWHMThr,cwAmpThrFEB,cwFWHMThrFEB
140 from AthenaCommon.Constants import WARNING
141
142 theCaliWaveValidationAlg=CompFactory.LArCaliWaveValidationAlg("CaliWaveVal")
143 if flags.LArCalib.isSC:
144 theCaliWaveValidationAlg.ProblemsToMask=["deadCalib","deadReadout","deadPhys","maskedOSUM",
145 "OffOFCs","transmissionErrorFibre",]
146 else:
147 theCaliWaveValidationAlg.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead",
148 "highNoiseHG","highNoiseMG","highNoiseLG"]
149 theCaliWaveValidationAlg.ValidationKey="LArCaliWave"
150 theCaliWaveValidationAlg.ReferenceKey="LArCaliWaveRef"
151 theCaliWaveValidationAlg.MsgLevelForDeviations=WARNING
152 theCaliWaveValidationAlg.ListOfDevFEBs="caliWaveFebs.txt"
153 theCaliWaveValidationAlg.AmplitudeTolerance=cwAmpThr
154 theCaliWaveValidationAlg.CaliWaveFWHMTolerance=cwFWHMThr
155 theCaliWaveValidationAlg.AmplitudeToleranceFEB=cwAmpThrFEB
156 theCaliWaveValidationAlg.CaliWaveFWHMToleranceFEB=cwFWHMThrFEB
157 theCaliWaveValidationAlg.TimeShiftDetection=True
158 theCaliWaveValidationAlg.PatchMissingFEBs=True
159 theCaliWaveValidationAlg.UseCorrChannels=False
160 theCaliWaveValidationAlg.BadChanKey = bcKey
161 theCaliWaveValidationAlg.SuperCells = flags.LArCalib.isSC
162
163 if flags.LArCalib.isSC:
164 theCaliWaveValidationAlg.CablingKey = "LArOnOffIdMapSC"
165 theCaliWaveValidationAlg.CalibLineKey = "LArCalibIdMapSC"
166
167 result.addEventAlgo(theCaliWaveValidationAlg)
168
169
170 if flags.LArCalib.doOFCCali:
171
172 LArCaliOFCAlg = CompFactory.LArOFCAlg("LArCaliOFCAlg")
173 LArCaliOFCAlg.ReadCaliWave = True
174 LArCaliOFCAlg.KeyList = [ "LArCaliWave" ]
175 LArCaliOFCAlg.Nphase = 50
176 LArCaliOFCAlg.Dphase = 1
177 LArCaliOFCAlg.Ndelay = 24
178 LArCaliOFCAlg.Nsample = 5
179 LArCaliOFCAlg.Normalize = True
180 LArCaliOFCAlg.TimeShift = False
181 LArCaliOFCAlg.TimeShiftByIndex = -1
182 LArCaliOFCAlg.Verify = True
183 LArCaliOFCAlg.FillShape = False
184 #LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat"
185 LArCaliOFCAlg.GroupingType = flags.LArCalib.GroupingType
186 LArCaliOFCAlg.isSC = flags.LArCalib.isSC
187 LArCaliOFCAlg.DecoderTool=CompFactory.LArAutoCorrDecoderTool(isSC=flags.LArCalib.isSC)
188 result.addEventAlgo(LArCaliOFCAlg)
189
190
191 #ROOT ntuple writing:
192 rootfile=flags.LArCalib.Output.ROOTFile
193 rootfile2=flags.LArCalib.Output.ROOTFile2
194 if rootfile != "":
195 result.addEventAlgo(CompFactory.LArCaliWaves2Ntuple(KeyList = ["LArCaliWave",],
196 NtupleName = "CALIWAVE",
197 AddFEBTempInfo = False,
198 RealGeometry = True,
199 SaveDerivedInfo = True,
200 ApplyCorrection = True,
201 isSC = flags.LArCalib.isSC,
202 BadChanKey = bcKey,
203 OffId=True,
204 AddCalib=True,
205 SaveJitter=True if flags.LArCalib.CaliWave.Nsteps >= 24 else False
206 ))
207
208 import os
209 if os.path.exists(rootfile):
210 os.remove(rootfile)
211 result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
212 result.setAppProperty("HistogramPersistency","ROOT")
213 pass # end if ROOT ntuple writing
214
215 if rootfile2 != "" and flags.LArCalib.doOFCCali:
216 result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
217 AddFEBTempInfo = False,
218 NtupleFile = "FILE2",
219 BadChanKey = bcKey,
220 isSC = flags.LArCalib.isSC,
221 AddCalib=True
222 ))
223
224 import os
225 if os.path.exists(rootfile2):
226 os.remove(rootfile2)
227 if rootfile == "":
228 result.addService(CompFactory.NTupleSvc(Output = [ "FILE2 DATAFILE='"+rootfile2+"' OPT='NEW'" ]))
229 else:
230 result.getService("NTupleSvc").Output += [ "FILE2 DATAFILE='"+rootfile2+"' OPT='NEW'" ]
231 result.setAppProperty("HistogramPersistency","ROOT")
232 pass # end if ROOT ntuple writing
233
234
235 #Get the current folder tag by interrogating the database:
236 from LArCalibProcessing.utils import FolderTagResolver
237 tagResolver=FolderTagResolver()
238 caliWaveTag=tagResolver.getFolderTag(flags.LArCalib.CaliWave.Folder)
239 caliOFCTag=tagResolver.getFolderTag(flags.LArCalib.OFCCali.Folder)
240 del tagResolver
241
242
243 #Output (POOL + sqlite) file writing:
244 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
245 result.merge(OutputConditionsAlgCfg(flags,
246 outputFile=flags.LArCalib.Output.POOLFile,
247 ObjectList=["LArCaliWaveContainer#LArCaliWave#"+flags.LArCalib.CaliWave.Folder,],
248 IOVTagList=[caliWaveTag,],
249 Run1=flags.LArCalib.IOVStart,
250 Run2=flags.LArCalib.IOVEnd
251 ))
252 if flags.LArCalib.doOFCCali:
253 result.getEventAlgo("OutputConditionsAlg").ObjectList += ["LArOFCComplete#LArOFC#"+flags.LArCalib.OFCCali.Folder]
254 result.getEventAlgo("OutputConditionsAlg").IOVTagList += [caliOFCTag]
255
256 #RegistrationSvc
257 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
258
259
260 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
261 result.merge(PerfMonMTSvcCfg(flags))
262
263 return result
264

Variable Documentation

◆ AtlasVersion

python.LArCalib_Delay_OFCCaliConfig.AtlasVersion

Definition at line 357 of file LArCalib_Delay_OFCCaliConfig.py.

◆ cfg

python.LArCalib_Delay_OFCCaliConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 366 of file LArCalib_Delay_OFCCaliConfig.py.

◆ ConfigFlags

python.LArCalib_Delay_OFCCaliConfig.ConfigFlags = initConfigFlags()

Definition at line 342 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Database

python.LArCalib_Delay_OFCCaliConfig.Database

Definition at line 348 of file LArCalib_Delay_OFCCaliConfig.py.

◆ DBConnection

python.LArCalib_Delay_OFCCaliConfig.DBConnection

Definition at line 355 of file LArCalib_Delay_OFCCaliConfig.py.

◆ DBInstance

python.LArCalib_Delay_OFCCaliConfig.DBInstance

Definition at line 368 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Dir

python.LArCalib_Delay_OFCCaliConfig.Dir

Definition at line 345 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Files

python.LArCalib_Delay_OFCCaliConfig.Files

Definition at line 349 of file LArCalib_Delay_OFCCaliConfig.py.

◆ GlobalTag

python.LArCalib_Delay_OFCCaliConfig.GlobalTag

Definition at line 356 of file LArCalib_Delay_OFCCaliConfig.py.

◆ POOLFile

python.LArCalib_Delay_OFCCaliConfig.POOLFile

Definition at line 353 of file LArCalib_Delay_OFCCaliConfig.py.

◆ ROOTFile

python.LArCalib_Delay_OFCCaliConfig.ROOTFile

Definition at line 352 of file LArCalib_Delay_OFCCaliConfig.py.

◆ RunNumbers

python.LArCalib_Delay_OFCCaliConfig.RunNumbers

Definition at line 347 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Type

python.LArCalib_Delay_OFCCaliConfig.Type

Definition at line 346 of file LArCalib_Delay_OFCCaliConfig.py.