ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArConfiguration
python
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
13
def
createLArConfigFlags
():
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
# OFFC based energy reconstruction
64
lcf.addFlag(
"LAr.ROD.OFFCRawChannelBuilding"
,
False
)
65
66
lcf.addFlag(
"LAr.ROD.OFFCBelowThreshold"
, 3)
67
lcf.addFlag(
"LAr.ROD.OFFCBelowTillReset"
, 7)
68
lcf.addFlag(
"LAr.ROD.OFFCNPulse"
, 7)
69
lcf.addFlag(
"LAr.ROD.OFFCQ3Cut"
, 0.1)
# relative term, on Q3/A
70
lcf.addFlag(
"LAr.ROD.OFFCQ3Offset"
, 2.0)
# absolute term in ADC
71
lcf.addFlag(
"LAr.ROD.OFFCFilterThreshold"
, 2.0)
72
73
# Perform a minbias correct to the LArDigit energies before building the raw channels
74
# (SHOULD TURN OFF ConfigFlags.Calo.Cell.doPileupOffsetBCIDCorr to not double count)
75
lcf.addFlag(
"LAr.ROD.ApplyRODBCIDCorr"
,
False
)
76
77
# default LArRawSC container
78
lcf.addFlag(
"LAr.LATOME.DTInfoForL1"
,
"SC_ET_ID"
)
79
# storing SC CaloCellContainer with bcid'ed energies
80
lcf.addFlag(
"LAr.DT.storeET_ID"
,
False
)
81
lcf.addFlag(
"LAr.DT.ET_IDKey"
,
"SCell"
)
82
lcf.addFlag(
"LAr.DT.doSCMasking"
,
True
)
83
# storing SC CaloCellContainers +-1 around bcid'ed energies
84
lcf.addFlag(
"LAr.DT.storeET_additional"
,
False
)
85
lcf.addFlag(
"LAr.DT.ET_PlusKey"
,
"SCellPlus"
)
86
lcf.addFlag(
"LAr.DT.ET_MinusKey"
,
"SCellMinus"
)
87
88
90
lcf.addFlag(
"LAr.NoisyRO.CellQuality"
, 4000)
91
# Number of channels above quality cut
92
lcf.addFlag(
"LAr.NoisyRO.BadChanPerFEB"
, 30)
93
# Number of Bad FEBs per partition cut
94
lcf.addFlag(
"LAr.NoisyRO.BadFEBCut"
, 5)
95
# Number of channels to declare MNB-Loose
96
lcf.addFlag(
"LAr.NoisyRO.MNBLooseCut"
, 5)
97
# Number of channels to declare MNB-Tight
98
lcf.addFlag(
"LAr.NoisyRO.MNBTightCut"
, 17)
99
# Number of channels to declare MNB-Tight wir PS veto
100
lcf.addFlag(
"LAr.NoisyRO.MNBTight_PsVetoCut"
, [13,3])
101
# Number of noisy HVlines
102
lcf.addFlag(
"LAr.NoisyRO.BadHVCut"
, 3)
103
# Fraction of cells noisy on one HV line
104
lcf.addFlag(
"LAr.NoisyRO.BadHVlineFrac"
, 0.25)
105
106
return
lcf
107
108
109
_lArRunInfo=
None
110
111
def
_getLArRunInfo
(prevFlags):
112
log = logging.getLogger(
'LArConfigFlags.getLArRunInfo'
)
113
global
_lArRunInfo
#Cache of lar run info
114
if
_lArRunInfo
is
None
:
115
from
LArConditionsCommon.LArRunFormat
import
getLArFormatForRun
116
runnbr=prevFlags.Input.RunNumbers[0]
#If more than one run, assume config for first run is valid for all runs
117
dbStr=
"COOLONL_LAR/"
+prevFlags.IOVDb.DatabaseInstance
118
_lArRunInfo=getLArFormatForRun(run=runnbr,connstring=dbStr)
119
log.info(
"Got LArRunInfo for run %d"
,runnbr)
120
return
_lArRunInfo
121
122
123
def
_determineRawChannelSource
(prevFlags):
124
log = logging.getLogger(
'LArConfigFlags.determineRawChannelSource'
)
125
if
prevFlags.Input.isMC
or
prevFlags.Overlay.DataOverlay:
126
return
RawChannelSource.Input
127
128
lri=
_getLArRunInfo
(prevFlags)
129
#runType: 0=RawData, 1=RawDataResult, 2=Result
130
if
lri
is
None
or
lri.runType
is
None
:
131
log.warning(
"WARNING do not have LArRunInfo !"
)
132
return
RawChannelSource.Both
133
log.info(
"runType %d"
,lri.runType())
134
if
(lri.runType()==0):
135
return
RawChannelSource.Calculated
#Have only digits in bytestream
136
elif
(lri.runType()==1
or
lri.runType()==2):
137
return
RawChannelSource.Both
#Have both, digits and raw-channels in bytestream
138
else
:
139
log.warning(
"Unknown LAr run type %i"
,lri.runType())
140
return
RawChannelSource.Both
python.LArConfigFlags.RawChannelSource
Definition
LArConfigFlags.py:7
LArRunFormat
python.LArConfigFlags._getLArRunInfo
_getLArRunInfo(prevFlags)
Definition
LArConfigFlags.py:111
python.LArConfigFlags.createLArConfigFlags
createLArConfigFlags()
Definition
LArConfigFlags.py:13
python.LArConfigFlags._determineRawChannelSource
_determineRawChannelSource(prevFlags)
Definition
LArConfigFlags.py:123
Generated on
for ATLAS Offline Software by
1.17.0