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 264 of file LArCalib_Delay_OFCCaliConfig.py.

264def LArDelay_OFCCali_PoolDumpCfg(flags):
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
335

◆ LArDelay_OFCCaliCfg()

python.LArCalib_Delay_OFCCaliConfig.LArDelay_OFCCaliCfg ( flags)

Definition at line 6 of file LArCalib_Delay_OFCCaliConfig.py.

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

Variable Documentation

◆ AtlasVersion

python.LArCalib_Delay_OFCCaliConfig.AtlasVersion

Definition at line 356 of file LArCalib_Delay_OFCCaliConfig.py.

◆ cfg

python.LArCalib_Delay_OFCCaliConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 365 of file LArCalib_Delay_OFCCaliConfig.py.

◆ ConfigFlags

python.LArCalib_Delay_OFCCaliConfig.ConfigFlags = initConfigFlags()

Definition at line 341 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Database

python.LArCalib_Delay_OFCCaliConfig.Database

Definition at line 347 of file LArCalib_Delay_OFCCaliConfig.py.

◆ DBConnection

python.LArCalib_Delay_OFCCaliConfig.DBConnection

Definition at line 354 of file LArCalib_Delay_OFCCaliConfig.py.

◆ DBInstance

python.LArCalib_Delay_OFCCaliConfig.DBInstance

Definition at line 367 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Dir

python.LArCalib_Delay_OFCCaliConfig.Dir

Definition at line 344 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Files

python.LArCalib_Delay_OFCCaliConfig.Files

Definition at line 348 of file LArCalib_Delay_OFCCaliConfig.py.

◆ GlobalTag

python.LArCalib_Delay_OFCCaliConfig.GlobalTag

Definition at line 355 of file LArCalib_Delay_OFCCaliConfig.py.

◆ POOLFile

python.LArCalib_Delay_OFCCaliConfig.POOLFile

Definition at line 352 of file LArCalib_Delay_OFCCaliConfig.py.

◆ ROOTFile

python.LArCalib_Delay_OFCCaliConfig.ROOTFile

Definition at line 351 of file LArCalib_Delay_OFCCaliConfig.py.

◆ RunNumbers

python.LArCalib_Delay_OFCCaliConfig.RunNumbers

Definition at line 346 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Type

python.LArCalib_Delay_OFCCaliConfig.Type

Definition at line 345 of file LArCalib_Delay_OFCCaliConfig.py.