ATLAS Offline Software
Functions | Variables
python.LArCalib_Delay_OFCCaliConfig Namespace Reference

Functions

def LArDelay_OFCCaliCfg (flags)
 
def LArDelay_OFCCali_PoolDumpCfg (flags)
 

Variables

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

Function Documentation

◆ LArDelay_OFCCali_PoolDumpCfg()

def python.LArCalib_Delay_OFCCaliConfig.LArDelay_OFCCali_PoolDumpCfg (   flags)

Definition at line 262 of file LArCalib_Delay_OFCCaliConfig.py.

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

◆ LArDelay_OFCCaliCfg()

def python.LArCalib_Delay_OFCCaliConfig.LArDelay_OFCCaliCfg (   flags)

Definition at line 6 of file LArCalib_Delay_OFCCaliConfig.py.

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

Variable Documentation

◆ AtlasVersion

python.LArCalib_Delay_OFCCaliConfig.AtlasVersion

Definition at line 354 of file LArCalib_Delay_OFCCaliConfig.py.

◆ cfg

python.LArCalib_Delay_OFCCaliConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 363 of file LArCalib_Delay_OFCCaliConfig.py.

◆ ConfigFlags

python.LArCalib_Delay_OFCCaliConfig.ConfigFlags = initConfigFlags()

Definition at line 339 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Database

python.LArCalib_Delay_OFCCaliConfig.Database

Definition at line 345 of file LArCalib_Delay_OFCCaliConfig.py.

◆ DBConnection

python.LArCalib_Delay_OFCCaliConfig.DBConnection

Definition at line 352 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Dir

python.LArCalib_Delay_OFCCaliConfig.Dir

Definition at line 342 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Files

python.LArCalib_Delay_OFCCaliConfig.Files

Definition at line 346 of file LArCalib_Delay_OFCCaliConfig.py.

◆ GlobalTag

python.LArCalib_Delay_OFCCaliConfig.GlobalTag

Definition at line 353 of file LArCalib_Delay_OFCCaliConfig.py.

◆ POOLFile

python.LArCalib_Delay_OFCCaliConfig.POOLFile

Definition at line 350 of file LArCalib_Delay_OFCCaliConfig.py.

◆ ROOTFile

python.LArCalib_Delay_OFCCaliConfig.ROOTFile

Definition at line 349 of file LArCalib_Delay_OFCCaliConfig.py.

◆ RunNumbers

python.LArCalib_Delay_OFCCaliConfig.RunNumbers

Definition at line 344 of file LArCalib_Delay_OFCCaliConfig.py.

◆ Type

python.LArCalib_Delay_OFCCaliConfig.Type

Definition at line 343 of file LArCalib_Delay_OFCCaliConfig.py.

OutputConditionsAlgConfig.OutputConditionsAlgCfg
def OutputConditionsAlgCfg(flags, name="OutputConditionsAlg", outputFile='condobjs.root', **kwargs)
Definition: OutputConditionsAlgConfig.py:5
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
python.LArCalibBaseConfig.chanSelStr
def chanSelStr(flags)
Definition: LArCalibBaseConfig.py:33
python.LArCalib_Delay_OFCCaliConfig.LArDelay_OFCCali_PoolDumpCfg
def LArDelay_OFCCali_PoolDumpCfg(flags)
Definition: LArCalib_Delay_OFCCaliConfig.py:262
python.LArFebErrorSummaryMakerConfig.LArFebErrorSummaryMakerCfg
def LArFebErrorSummaryMakerCfg(flags)
Definition: LArFebErrorSummaryMakerConfig.py:7
python.LArStripsXtalkCorrConfig.LArStripsXtalkCorrCfg
def LArStripsXtalkCorrCfg(flags, KeyList)
Definition: LArStripsXtalkCorrConfig.py:6
Constants
some useful constants -------------------------------------------------—
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
python.LArCalib_Delay_OFCCaliConfig.LArDelay_OFCCaliCfg
def LArDelay_OFCCaliCfg(flags)
Definition: LArCalib_Delay_OFCCaliConfig.py:6
python.LArCalibBaseConfig.LArCalibBaseCfg
def LArCalibBaseCfg(flags)
Definition: LArCalibBaseConfig.py:5
LArCablingConfig.LArCalibIdMappingCfg
def LArCalibIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:83