ATLAS Offline Software
LArConfigFlags.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
4 from AthenaConfiguration.Enums import FlagEnum, LHCPeriod
5 from AthenaCommon.Logging import logging
6 
7 class RawChannelSource(FlagEnum):
8  Input="Input" # read from the input-file, bytestream or RDO
9  Calculated="Calculated" #re-computed by the offline LArRawChannelBuilder
10  Both="Both" # overwrite the digits computed
11 
12 
14  lcf=AthConfigFlags()
15 
16  lcf.addFlag("LAr.doAlign",lambda prevFlags : prevFlags.GeoModel.Layout=="atlas")
17  lcf.addFlag("LAr.doHVCorr",lambda prevFlags : not prevFlags.Input.isMC)
18  lcf.addFlag("LAr.doCellEmMisCalib",lambda prevFlags : prevFlags.Input.isMC)
19 
20  lcf.addFlag("LAr.RawChannelSource", _determineRawChannelSource, type=RawChannelSource)
21 
22  lcf.addFlag("LAr.doCellNoiseMasking",True)
23  lcf.addFlag("LAr.doCellSporadicNoiseMasking",True)
24  lcf.addFlag("LAr.doBadFebMasking",lambda prevFlags : not prevFlags.Input.isMC)
25  lcf.addFlag("LAr.doDeadOTxCorr",lambda prevFlags : not prevFlags.Input.isMC and prevFlags.GeoModel.Run >= LHCPeriod.Run3)
26 
27  # Include MC shape folder
28  lcf.addFlag("LAr.UseMCShape", True)
29  # Name of sqlite file containing Electronic Calibration values
30  lcf.addFlag("LAr.ElecCalibSqlite", "")
31  # Load Electronic Calibration constants
32  lcf.addFlag("LAr.LoadElecCalib", True)
33  # Folder name for Optimal Filtering coefficients (empty means default)
34  lcf.addFlag("LAr.OFCShapeFolder", "")
35  # Load conditions with this `run-number' string
36  lcf.addFlag("LAr.ForceIOVRunNumber", "")
37  # Include Shape folder
38  lcf.addFlag("LAr.UseShape", True)
39  # DataBase server string
40  lcf.addFlag("LAr.DBConnection", "")
41 
42  # Number of collisions to optimize OFC for pileup
43  lcf.addFlag("LAr.ROD.NumberOfCollisions",0)
44  # Number of samples in LAr digitization + ROD emulation
45  lcf.addFlag("LAr.ROD.nSamples", 5)
46  # Index of first sample in LAr digitization + ROD emulation
47  lcf.addFlag("LAr.ROD.FirstSample", 0)
48  # Number of preceeding samples (necessary for phase 2 simulation)
49  lcf.addFlag("LAr.ROD.nPreceedingSamples", 0)
50  # Force using the highest gain autocorrelation function
51  # when doing OFC optimization
52  lcf.addFlag("LAr.ROD.UseHighestGainAutoCorr", False)
53  # Flag not to use pileup noise neither average constrain in EMB and EMEC-OW,
54  # and both pileup noise and average constrain everywhere else
55  lcf.addFlag("LAr.ROD.DoOFCMixedOptimization", False)
56 
58  lcf.addFlag("LAr.ROD.UseDelta", 0)
59  # Force using the iterative OFC procedure
60  lcf.addFlag("LAr.ROD.forceIter",False)
61  # NN based energy reconstruction
62  lcf.addFlag("LAr.ROD.NNRawChannelBuilding", False)
63  lcf.addFlag("LAr.ROD.nnJson", "")
64  lcf.addFlag("LAr.ROD.nnOutputNode", "")
65  lcf.addFlag("LAr.ROD.nnInputNode", "")
66  # default LArRawSC container
67  lcf.addFlag("LAr.LATOME.DTInfoForL1","SC_ET_ID")
68  # storing SC CaloCellContainer with bcid'ed energies
69  lcf.addFlag("LAr.DT.storeET_ID",False)
70  lcf.addFlag("LAr.DT.ET_IDKey","SCell")
71  lcf.addFlag("LAr.DT.doSCMasking",True)
72  # storing SC CaloCellContainers +-1 around bcid'ed energies
73  lcf.addFlag("LAr.DT.storeET_additional",False)
74  lcf.addFlag("LAr.DT.ET_PlusKey","SCellPlus")
75  lcf.addFlag("LAr.DT.ET_MinusKey","SCellMinus")
76 
77 
79  lcf.addFlag("LAr.NoisyRO.CellQuality", 4000)
80  # Number of channels above quality cut
81  lcf.addFlag("LAr.NoisyRO.BadChanPerFEB", 30)
82  # Number of Bad FEBs per partition cut
83  lcf.addFlag("LAr.NoisyRO.BadFEBCut", 5)
84  # Number of channels to declare MNB-Loose
85  lcf.addFlag("LAr.NoisyRO.MNBLooseCut", 5)
86  # Number of channels to declare MNB-Tight
87  lcf.addFlag("LAr.NoisyRO.MNBTightCut", 17)
88  # Number of channels to declare MNB-Tight wir PS veto
89  lcf.addFlag("LAr.NoisyRO.MNBTight_PsVetoCut", [13,3])
90  # Number of noisy HVlines
91  lcf.addFlag("LAr.NoisyRO.BadHVCut", 3)
92  # Fraction of cells noisy on one HV line
93  lcf.addFlag("LAr.NoisyRO.BadHVlineFrac", 0.25)
94 
95  return lcf
96 
97 
98 _lArRunInfo=None
99 
100 def _getLArRunInfo(prevFlags):
101  log = logging.getLogger('LArConfigFlags.getLArRunInfo')
102  global _lArRunInfo #Cache of lar run info
103  if _lArRunInfo is None:
104  from LArConditionsCommon.LArRunFormat import getLArFormatForRun
105  runnbr=prevFlags.Input.RunNumbers[0] #If more than one run, assume config for first run is valid for all runs
106  dbStr="COOLONL_LAR/"+prevFlags.IOVDb.DatabaseInstance
107  _lArRunInfo=getLArFormatForRun(run=runnbr,connstring=dbStr)
108  log.info("Got LArRunInfo for run %d",runnbr)
109  return _lArRunInfo
110 
111 
113  log = logging.getLogger('LArConfigFlags.determineRawChannelSource')
114  if prevFlags.Input.isMC or prevFlags.Overlay.DataOverlay:
115  return RawChannelSource.Input
116 
117  lri=_getLArRunInfo(prevFlags)
118  #runType: 0=RawData, 1=RawDataResult, 2=Result
119  if lri is None or lri.runType is None:
120  log.warning("WARNING do not have LArRunInfo !")
121  return RawChannelSource.Both
122  log.info("runType %d",lri.runType())
123  if (lri.runType()==0):
124  return RawChannelSource.Calculated #Have only digits in bytestream
125  elif (lri.runType()==1 or lri.runType()==2):
126  return RawChannelSource.Both #Have both, digits and raw-channels in bytestream
127  else:
128  log.warning("Unknown LAr run type %i",lri.runType())
129  return RawChannelSource.Both
python.LArConfigFlags._getLArRunInfo
def _getLArRunInfo(prevFlags)
Definition: LArConfigFlags.py:100
LArRunFormat
python.LArConfigFlags.RawChannelSource
Definition: LArConfigFlags.py:7
python.LArConfigFlags.createLArConfigFlags
def createLArConfigFlags()
Definition: LArConfigFlags.py:13
python.LArRunFormat.getLArFormatForRun
def getLArFormatForRun(run, quiet=False, connstring="COOLONL_LAR/CONDBR2")
Definition: LArRunFormat.py:58
python.LArConfigFlags._determineRawChannelSource
def _determineRawChannelSource(prevFlags)
Definition: LArConfigFlags.py:112