ATLAS Offline Software
Loading...
Searching...
No Matches
LArCalib_Delay_OFCCaliConfig.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
4from AthenaConfiguration.ComponentFactory import CompFactory
5from AthenaConfiguration.MainServicesConfig import MainServicesCfg
6
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(dbname=flags.LArCalib.Input.CoolOflP1Replica)
25 caliWaveTag=tagResolver.getFolderTag(flags.LArCalib.CaliWave.Folder)
26 caliOFCTag=tagResolver.getFolderTag(flags.LArCalib.OFCCali.Folder)
27 if (flags.LArCalib.Input.Database == "LAR_OFL" and flags.LArCalib.Input.Database2 == "LAR_OFL"):
28 pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder)
29 acTag=tagResolver.getFolderTag(flags.LArCalib.AutoCorr.Folder)
30 else:
31 pedestalTag=None
32 acTag=None
33
34 del tagResolver
35 from IOVDbSvc.IOVDbSvcConfig import addFolders
36 result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=pedestalTag, modifiers=chanSelStr(flags),
37 className="LArPedestalComplete"))
38 result.merge(addFolders(flags,flags.LArCalib.AutoCorr.Folder,detDb=flags.LArCalib.Input.Database, tag=acTag,modifiers=chanSelStr(flags)))
39
40 if not flags.LArCalib.isSC:
41 if flags.LArCalib.Input.isRawData:
42 result.addEventAlgo(CompFactory.LArRawDataReadingAlg(LArRawChannelKey="", LArDigitKey=digKey, LArFebHeaderKey="LArFebHeader",
43 SubCaloPreselection=flags.LArCalib.Input.SubDet,
44 PosNegPreselection=flags.LArCalib.Preselection.Side,
45 BEPreselection=flags.LArCalib.Preselection.BEC,
46 FTNumPreselection=flags.LArCalib.Preselection.FT))
47 from LArCalibProcessing.LArCalib_CalibDigitsMakerConfig import LArCalibDigitsMakerCfg
48 result.merge(LArCalibDigitsMakerCfg(flags,digKey))
49 else:
50 result.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArAccCalibDigitKey=digKey,
51 LArFebHeaderKey="LArFebHeader",
52 SubCaloPreselection=flags.LArCalib.Input.SubDet,
53 PosNegPreselection=flags.LArCalib.Preselection.Side,
54 BEPreselection=flags.LArCalib.Preselection.BEC,
55 FTNumPreselection=flags.LArCalib.Preselection.FT))
56
57 from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
58 result.merge(LArFebErrorSummaryMakerCfg(flags))
59 result.getEventAlgo("LArFebErrorSummaryMaker").CheckAllFEB=False
60
61 if flags.LArCalib.Input.SubDet == "EM":
62 theLArCalibShortCorrector = CompFactory.LArCalibShortCorrector(KeyList = [digKey,])
63 result.addEventAlgo(theLArCalibShortCorrector)
64
65 from LArCalibProcessing.LArStripsXtalkCorrConfig import LArStripsXtalkCorrCfg
66 result.merge(LArStripsXtalkCorrCfg(flags,[digKey,]))
67 else:
68 digKey="SC"
69 theLArLATOMEDecoder = CompFactory.LArLATOMEDecoder("LArLATOMEDecoder")
70 if flags.LArCalib.Input.isRawData:
71 result.addEventAlgo(CompFactory.LArRawSCDataReadingAlg(adcCollKey = digKey, adcBasCollKey = "", etCollKey = "",
72 etIdCollKey = "", LATOMEDecoder = theLArLATOMEDecoder))
73 from LArCalibProcessing.LArCalib_CalibDigitsMakerConfig import LArCalibDigitsMakerCfg
74 result.merge(LArCalibDigitsMakerCfg(flags,digKey))
75
76 else:
77 # this needs also legacy maps
78 from LArCabling.LArCablingConfig import LArCalibIdMappingCfg,LArOnOffIdMappingCfg
79 result.merge(LArOnOffIdMappingCfg(flags))
80 result.merge(LArCalibIdMappingCfg(flags))
81 result.addEventAlgo(CompFactory.LArRawSCCalibDataReadingAlg(LArSCAccCalibDigitKey = digKey,
82 CalibCablingKeyLeg="LArCalibLineMap",
83 OnOffMapLeg="LArOnOffIdMap",
84 LATOMEDecoder = theLArLATOMEDecoder, ))
85
86 bcKey = "LArBadChannelSC" if flags.LArCalib.isSC else "LArBadChannel"
87
88 theLArCaliWaveBuilder = CompFactory.LArCaliWaveBuilder()
89 theLArCaliWaveBuilder.KeyList= [digKey,]
90 theLArCaliWaveBuilder.KeyOutput="LArCaliWave"
91 theLArCaliWaveBuilder.GroupingType = flags.LArCalib.GroupingType
92 theLArCaliWaveBuilder.SubtractPed = True
93 theLArCaliWaveBuilder.NSteps = flags.LArCalib.CaliWave.Nsteps
94 theLArCaliWaveBuilder.CheckEmptyPhases = not flags.LArCalib.isSC
95 theLArCaliWaveBuilder.NBaseline = 0 # to avoid the use of the baseline when Pedestal are missing
96 theLArCaliWaveBuilder.UseDacAndIsPulsedIndex = False # should have an impact only for HEC
97 theLArCaliWaveBuilder.RecAllCells = False
98 theLArCaliWaveBuilder.CheckEmptyPhases = False
99 theLArCaliWaveBuilder.isSC = flags.LArCalib.isSC
100 result.addEventAlgo(theLArCaliWaveBuilder)
101
102
103 if flags.LArCalib.Input.SubDet == "HEC" or flags.LArCalib.Input.SubDet == "HECFCAL":
104 theLArCaliWaveBuilder.KeyOutput="LArCaliWave_multi"
105 theLArCaliWaveSelector = CompFactory.LArCaliWaveSelector("LArCaliWaveSelector")
106 theLArCaliWaveSelector.KeyList = ["LArCaliWave_multi",]
107 theLArCaliWaveSelector.KeyOutput = "LArCaliWave"
108 theLArCaliWaveSelector.GroupingType = flags.LArCalib.GroupingType
109 if flags.LArCalib.Gain==0: #HIGH gain
110 theLArCaliWaveSelector.SelectionList = [ "HEC/0/0/460","HEC/1/0/460","HEC/2/0/230","HEC/3/0/230" ]
111 theLArCaliWaveSelector.SelectionList += [ "FCAL/0/0/500","FCAL/1/0/500","FCAL/2/0/500","FCAL/3/0/500" ]
112
113 elif flags.LArCalib.Gain==1: #MEDIUM gain
114 theLArCaliWaveSelector.SelectionList = [ "HEC/0/1/3600","HEC/1/1/3600","HEC/2/1/1800","HEC/3/1/1800"]
115 theLArCaliWaveSelector.SelectionList += [ "FCAL/0/1/5000","FCAL/1/1/5000","FCAL/2/1/5000","FCAL/3/1/5000" ]
116
117 elif flags.LArCalib.Gain==2: #LOW gain
118 theLArCaliWaveSelector.SelectionList = [ "HEC/0/2/24000","HEC/1/2/24000","HEC/2/2/18000","HEC/3/2/18000" ]
119 theLArCaliWaveSelector.SelectionList += [ "FCAL/0/2/40000","FCAL/1/2/40000","FCAL/2/2/40000","FCAL/3/2/40000" ]
120
121 result.addEventAlgo(theLArCaliWaveSelector)
122 pass
123
124 if flags.LArCalib.CorrectBadChannels:
125 theLArCaliWavePatcher=CompFactory.getComp("LArCalibPatchingAlg<LArCaliWaveContainer>")("LArCaliWavePatch")
126 theLArCaliWavePatcher.ContainerKey = "LArCaliWave"
127 theLArCaliWavePatcher.BadChanKey = bcKey
128 theLArCaliWavePatcher.SuperCells = flags.LArCalib.isSC
129 #theLArCaliWavePatcher.PatchMethod="PhiNeighbor" ##take the first neigbour
130 theLArCaliWavePatcher.PatchMethod = "PhiAverage"
131 if flags.LArCalib.isSC:
132 theLArCaliWavePatcher.ProblemsToPatch = [
133 "deadCalib","deadReadout","deadPhys","maskedOSUM","OffOFCs","transmissionErrorFibre",]
134 theLArCaliWavePatcher.OnOffMap="LArOnOffIdMapSC"
135 theLArCaliWavePatcher.CalibLineKey="LArCalibIdMapSC"
136 else:
137 theLArCaliWavePatcher.ProblemsToPatch = [
138 "deadCalib","deadReadout","deadPhys","almostDead","short", ]
139
140 result.addEventAlgo(theLArCaliWavePatcher)
141 pass
142
143 if flags.LArCalib.doValidation:
144
145 result.merge(addFolders(flags,flags.LArCalib.CaliWave.Folder+"<key>LArCaliWaveRef</key>","LAR_OFL"))
146
147 from LArCalibDataQuality.Thresholds import cwAmpThr,cwFWHMThr,cwAmpThrFEB,cwFWHMThrFEB
148 from AthenaCommon.Constants import WARNING
149
150 theCaliWaveValidationAlg=CompFactory.LArCaliWaveValidationAlg("CaliWaveVal")
151 if flags.LArCalib.isSC:
152 theCaliWaveValidationAlg.ProblemsToMask=["deadCalib","deadReadout","deadPhys","maskedOSUM",
153 "OffOFCs","transmissionErrorFibre",]
154 else:
155 theCaliWaveValidationAlg.ProblemsToMask=["deadReadout","deadCalib","deadPhys","almostDead",
156 "highNoiseHG","highNoiseMG","highNoiseLG"]
157 theCaliWaveValidationAlg.ValidationKey="LArCaliWave"
158 theCaliWaveValidationAlg.ReferenceKey="LArCaliWaveRef"
159 theCaliWaveValidationAlg.MsgLevelForDeviations=WARNING
160 theCaliWaveValidationAlg.ListOfDevFEBs="caliWaveFebs.txt"
161 theCaliWaveValidationAlg.AmplitudeTolerance=cwAmpThr
162 theCaliWaveValidationAlg.CaliWaveFWHMTolerance=cwFWHMThr
163 theCaliWaveValidationAlg.AmplitudeToleranceFEB=cwAmpThrFEB
164 theCaliWaveValidationAlg.CaliWaveFWHMToleranceFEB=cwFWHMThrFEB
165 theCaliWaveValidationAlg.TimeShiftDetection=True
166 theCaliWaveValidationAlg.PatchMissingFEBs=True
167 theCaliWaveValidationAlg.UseCorrChannels=False
168 theCaliWaveValidationAlg.BadChanKey = bcKey
169 theCaliWaveValidationAlg.SuperCells = flags.LArCalib.isSC
170
171 if flags.LArCalib.isSC:
172 theCaliWaveValidationAlg.CablingKey = "LArOnOffIdMapSC"
173 theCaliWaveValidationAlg.CalibLineKey = "LArCalibIdMapSC"
174
175 result.addEventAlgo(theCaliWaveValidationAlg)
176
177
178 if flags.LArCalib.doOFCCali:
179
180 LArCaliOFCAlg = CompFactory.LArOFCAlg("LArCaliOFCAlg")
181 LArCaliOFCAlg.ReadCaliWave = True
182 LArCaliOFCAlg.KeyList = [ "LArCaliWave" ]
183 LArCaliOFCAlg.Nphase = 50
184 LArCaliOFCAlg.Dphase = 1
185 LArCaliOFCAlg.Ndelay = 24
186 LArCaliOFCAlg.Nsample = 5
187 LArCaliOFCAlg.Normalize = True
188 LArCaliOFCAlg.TimeShift = False
189 LArCaliOFCAlg.TimeShiftByIndex = -1
190 LArCaliOFCAlg.Verify = True
191 LArCaliOFCAlg.FillShape = False
192 #LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat"
193 LArCaliOFCAlg.GroupingType = flags.LArCalib.GroupingType
194 LArCaliOFCAlg.isSC = flags.LArCalib.isSC
195 LArCaliOFCAlg.DecoderTool=CompFactory.LArAutoCorrDecoderTool(isSC=flags.LArCalib.isSC)
196 result.addEventAlgo(LArCaliOFCAlg)
197
198
199 #ROOT ntuple writing:
200 rootfile=flags.LArCalib.Output.ROOTFile
201 rootfile2=flags.LArCalib.Output.ROOTFile2
202 if rootfile != "":
203 result.addEventAlgo(CompFactory.LArCaliWaves2Ntuple(KeyList = ["LArCaliWave",],
204 NtupleName = "CALIWAVE",
205 AddFEBTempInfo = False,
206 RealGeometry = True,
207 SaveDerivedInfo = True,
208 ApplyCorrection = True,
209 isSC = flags.LArCalib.isSC,
210 BadChanKey = bcKey,
211 OffId=True,
212 AddCalib=True,
213 SaveJitter=True if flags.LArCalib.CaliWave.Nsteps >= 24 else False
214 ))
215
216 import os
217 if os.path.exists(rootfile):
218 os.remove(rootfile)
219 result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
220 result.setAppProperty("HistogramPersistency","ROOT")
221 pass # end if ROOT ntuple writing
222
223 if rootfile2 != "" and flags.LArCalib.doOFCCali:
224 result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
225 AddFEBTempInfo = False,
226 NtupleFile = "FILE2",
227 BadChanKey = bcKey,
228 isSC = flags.LArCalib.isSC,
229 AddCalib=True
230 ))
231
232 import os
233 if os.path.exists(rootfile2):
234 os.remove(rootfile2)
235 if rootfile == "":
236 result.addService(CompFactory.NTupleSvc(Output = [ "FILE2 DATAFILE='"+rootfile2+"' OPT='NEW'" ]))
237 else:
238 result.getService("NTupleSvc").Output += [ "FILE2 DATAFILE='"+rootfile2+"' OPT='NEW'" ]
239 result.setAppProperty("HistogramPersistency","ROOT")
240 pass # end if ROOT ntuple writing
241
242 #Output (POOL + sqlite) file writing:
243 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
244 result.merge(OutputConditionsAlgCfg(flags,
245 outputFile=flags.LArCalib.Output.POOLFile,
246 ObjectList=["LArCaliWaveContainer#LArCaliWave#"+flags.LArCalib.CaliWave.Folder,],
247 IOVTagList=[caliWaveTag,],
248 Run1=flags.LArCalib.IOVStart,
249 Run2=flags.LArCalib.IOVEnd
250 ))
251 if flags.LArCalib.doOFCCali:
252 result.getEventAlgo("OutputConditionsAlg").ObjectList += ["LArOFCComplete#LArOFC#"+flags.LArCalib.OFCCali.Folder]
253 result.getEventAlgo("OutputConditionsAlg").IOVTagList += [caliOFCTag]
254
255 #RegistrationSvc
256 result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
257
258
259 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
260 result.merge(PerfMonMTSvcCfg(flags))
261
262 return result
263
265
266 #Get basic services and cond-algos
267 from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
268 result=LArCalibBaseCfg(flags)
269
270 bcKey = "LArBadChannelSC" if flags.LArCalib.isSC else "LArBadChannel"
271
272 #CondProxyProvider
273 from EventSelectorAthenaPool.CondProxyProviderConfig import CondProxyProviderCfg
274 result.merge (CondProxyProviderCfg (flags, flags.LArCalib.Input.Files))
275
276 #ROOT ntuple writing:
277 rootfile=flags.LArCalib.Output.ROOTFile
278 rootfile2=flags.LArCalib.Output.ROOTFile2
279 if rootfile:
280 result.addEventAlgo(CompFactory.LArCaliWaves2Ntuple(KeyList = ["CaliWave",] if flags.LArCalib.isSC else ["LArCaliWave",],
281 NtupleName = "CALIWAVE",
282 AddFEBTempInfo = False,
283 SaveDerivedInfo = True,
284 ApplyCorrection = True,
285 BadChanKey = bcKey,
286 AddCalib=True,
287 SaveJitter=True if flags.LArCalib.CaliWave.Nsteps >= 24 else False,
288 isSC=flags.LArCalib.isSC
289 ))
290
291 if not rootfile2:
292 result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
293 AddFEBTempInfo = False,
294 BadChanKey = bcKey,
295 AddCalib=True,
296 isSC=flags.LArCalib.isSC
297 ))
298
299 import os
300 if os.path.exists(rootfile):
301 os.remove(rootfile)
302 result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
303 result.setAppProperty("HistogramPersistency","ROOT")
304
305 if rootfile2:
306 if rootfile == rootfile2:
307 result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
308 AddFEBTempInfo = False,
309 NtupleFile = "FILE1",
310 BadChanKey = bcKey,
311 AddCalib=True,
312 isSC=flags.LArCalib.isSC
313 ))
314 else:
315 result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
316 AddFEBTempInfo = False,
317 NtupleFile = "FILE2",
318 BadChanKey = bcKey,
319 AddCalib=True,
320 isSC=flags.LArCalib.isSC
321 ))
322
323 import os
324 if os.path.exists(rootfile2):
325 os.remove(rootfile2)
326 if not rootfile:
327 result.addService(CompFactory.NTupleSvc(Output = [ "FILE2 DATAFILE='"+rootfile2+"' OPT='NEW'" ]))
328 else:
329 result.getService("NTupleSvc").Output += [ "FILE2 DATAFILE='"+rootfile2+"' OPT='NEW'" ]
330 result.setAppProperty("HistogramPersistency","ROOT")
331
332
333 return result
334
336
337 #Get basic services and cond-algos
338 from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg,chanSelStr
339 result=LArCalibBaseCfg(flags)
340
341 #Add ByteStream reading
342 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
343 result.merge(ByteStreamReadCfg(flags))
344
345 #Calibration runs are taken in fixed gain.
346 #The SG key of the digit-container is name of the gain
347 gainStrMap={0:"HIGH",1:"MEDIUM",2:"LOW"}
348 digKey=gainStrMap[flags.LArCalib.Gain]
349
350 from IOVDbSvc.IOVDbSvcConfig import addFolders
351 if "ONL" in flags.LArCalib.Input.Database:
352 result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, className="CondAttrListCollection", db="CONDBR2"))
353 LArPedestalCondAlg = CompFactory.getComp("LArFlatConditionsAlg<LArPedestalFlat>")
354 result.addCondAlgo(LArPedestalCondAlg(ReadKey=flags.LArCalib.Pedestal.Folder, WriteKey="Pedestal"))
355 else:
356 from LArCalibProcessing.utils import FolderTagResolver
357 FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
358 tagResolver=FolderTagResolver()
359 pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder)
360 result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=pedestalTag, modifiers=chanSelStr(flags),
361 className="LArPedestalComplete"))
362
363
364 from LArCalibProcessing.LArCalib_CalibDigitsMakerConfig import LArCalibDigitsMakerCfg
365 result.merge(LArCalibDigitsMakerCfg(flags,DigitsKey=digKey,ntrigg=flags.LArCalib.OFC.Ncoll,notrun=True))
366
367 if not flags.LArCalib.isSC:
368 if flags.LArCalib.Input.isRawData:
369 result.addEventAlgo(CompFactory.LArRawDataReadingAlg(LArRawChannelKey="", LArDigitKey=digKey, LArFebHeaderKey="LArFebHeader"))
370 else:
371 result.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArAccCalibDigitKey=digKey,
372 LArFebHeaderKey="LArFebHeader",
373 SubCaloPreselection=flags.LArCalib.Input.SubDet,
374 PosNegPreselection=flags.LArCalib.Preselection.Side,
375 BEPreselection=flags.LArCalib.Preselection.BEC,
376 FTNumPreselection=flags.LArCalib.Preselection.FT))
377
378 from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
379 result.merge(LArFebErrorSummaryMakerCfg(flags))
380 result.getEventAlgo("LArFebErrorSummaryMaker").CheckAllFEB=False
381
382 else:
383 digKey="SC"
384 theLArLATOMEDecoder = CompFactory.LArLATOMEDecoder("LArLATOMEDecoder")
385 if flags.LArCalib.Input.isRawData:
386 result.addEventAlgo(CompFactory.LArRawSCDataReadingAlg(adcCollKey = digKey, adcBasCollKey = "", etCollKey = "",
387 etIdCollKey = "", LATOMEDecoder = theLArLATOMEDecoder))
388 from LArCalibProcessing.LArCalib_CalibDigitsMakerConfig import LArCalibDigitsMakerCfg
389 result.merge(LArCalibDigitsMakerCfg(flags,digKey))
390
391 else:
392 # this needs also legacy maps
393 from LArCabling.LArCablingConfig import LArCalibIdMappingCfg,LArOnOffIdMappingCfg
394 result.merge(LArOnOffIdMappingCfg(flags))
395 result.merge(LArCalibIdMappingCfg(flags))
396 result.addEventAlgo(CompFactory.LArRawSCCalibDataReadingAlg(LArSCAccCalibDigitKey = digKey,
397 CalibCablingKeyLeg="LArCalibLineMap",
398 OnOffMapLeg="LArOnOffIdMap",
399 LATOMEDecoder = theLArLATOMEDecoder, ))
400
401 bcKey = "LArBadChannelSC" if flags.LArCalib.isSC else "LArBadChannel"
402
403 theLArCaliWaveBuilder = CompFactory.LArCaliWaveBuilder()
404 theLArCaliWaveBuilder.KeyList= [digKey,]
405 theLArCaliWaveBuilder.KeyOutput="LArCaliWave"
406 theLArCaliWaveBuilder.GroupingType = flags.LArCalib.GroupingType
407 theLArCaliWaveBuilder.SubtractPed = True
408 theLArCaliWaveBuilder.NSteps = flags.LArCalib.CaliWave.Nsteps
409 theLArCaliWaveBuilder.CheckEmptyPhases = False
410 theLArCaliWaveBuilder.NBaseline = 0 # to avoid the use of the baseline when Pedestal are missing
411 theLArCaliWaveBuilder.UseDacAndIsPulsedIndex = False # should have an impact only for HEC
412 theLArCaliWaveBuilder.RecAllCells = True
413 theLArCaliWaveBuilder.UseParamsSel = True
414 theLArCaliWaveBuilder.UsePattern = flags.LArCalib.OFC.Nsamples
415 theLArCaliWaveBuilder.NumSubStep = flags.LArCalib.CaliWave.NSubSteps
416 theLArCaliWaveBuilder.isSC = flags.LArCalib.isSC
417 result.addEventAlgo(theLArCaliWaveBuilder)
418
419
420
421 #ROOT ntuple writing:
422 rootfile=flags.LArCalib.Output.ROOTFile
423 if rootfile != "":
424 result.addEventAlgo(CompFactory.LArCaliWaves2Ntuple(KeyList = ["LArCaliWave",],
425 NtupleName = "CALIWAVE",
426 AddFEBTempInfo = False,
427 RealGeometry = True,
428 SaveDerivedInfo = True,
429 ApplyCorrection = False,
430 isSC = flags.LArCalib.isSC,
431 BadChanKey = bcKey,
432 OffId=True,
433 AddCalib=True,
434 SaveJitter=True if flags.LArCalib.CaliWave.Nsteps >= 24 else False
435 ))
436
437 import os
438 if os.path.exists(rootfile):
439 os.remove(rootfile)
440 result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
441 result.setAppProperty("HistogramPersistency","ROOT")
442 pass # end if ROOT ntuple writing
443
444 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
445 result.merge(PerfMonMTSvcCfg(flags))
446
447 return result
448
449if __name__ == "__main__":
450 from AthenaConfiguration.AllConfigFlags import initConfigFlags
451 from AthenaConfiguration.TestDefaults import defaultGeometryTags
452 from LArCalibProcessing.LArCalibConfigFlags import addLArCalibFlags
453 import sys
454 ConfigFlags=initConfigFlags()
455 addLArCalibFlags(ConfigFlags)
456 ConfigFlags.LArCalib.Input.Dir = "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/LArCalibProcessing"
457 ConfigFlags.LArCalib.Input.Type="calibration_LArElec-Delay"
458 ConfigFlags.LArCalib.Input.RunNumbers=[441251,]
459 ConfigFlags.LArCalib.Input.Database="output.sqlite"
460 ConfigFlags.Input.Files=ConfigFlags.LArCalib.Input.Files
461
462
463 ConfigFlags.LArCalib.Output.ROOTFile="ofccali.root"
464 ConfigFlags.LArCalib.Output.POOLFile="ofccali.pool.root"
465
466 ConfigFlags.IOVDb.DBConnection="sqlite://;schema=output.sqlite;dbname=CONDBR2"
467 ConfigFlags.IOVDb.GlobalTag="LARCALIB-RUN2-02"
468 ConfigFlags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
469
470 #ConfigFlags.Exec.OutputLevel=1
471 ConfigFlags.fillFromArgs()
472 print ("Input files to be processed:")
473 for f in ConfigFlags.Input.Files:
474 print (f)
475
476 ConfigFlags.lock()
477 cfg=MainServicesCfg(ConfigFlags)
478 cfg.merge(LArDelay_OFCCaliCfg(ConfigFlags))
479 cfg.getService("IOVDbSvc").DBInstance=""
480 print("Start running...")
481 sys.exit(cfg.run().isFailure())
482
void print(char *figname, TCanvas *c1)