3 from AthenaConfiguration.AthConfigFlags
import AthConfigFlags
4 from AthenaConfiguration.Enums
import BeamType, Format, FlagEnum
16 UNDEFINED =
'UNDEFINED'
20 if self
in [TileRunType.PHY, TileRunType.PED]:
21 commonType = TileRunType.PHY
22 elif self
in [TileRunType.LAS, TileRunType.BILAS, TileRunType.GAPLAS]:
23 commonType = TileRunType.LAS
24 elif self
in [TileRunType.CIS, TileRunType.MONOCIS, TileRunType.GAPCIS]:
25 commonType = TileRunType.CIS
29 return self
if self
in [TileRunType.GAPLAS]
else self.
getCommonType()
32 _runTypeInt = {TileRunType.PHY: 1, TileRunType.LAS: 2,
33 TileRunType.GAPLAS: 2, TileRunType.BILAS: 2,
34 TileRunType.PED: 4, TileRunType.CIS: 8,
35 TileRunType.GAPCIS: 8, TileRunType.MONOCIS: 9}
36 return _runTypeInt.get(self, 0)
39 return True if self
in [TileRunType.CIS, TileRunType.PED]
else False
44 tcf = AthConfigFlags()
46 tcf.addFlag(
'Tile.doQIE',
False)
47 tcf.addFlag(
'Tile.doManyAmps',
False)
48 tcf.addFlag(
'Tile.doFlat',
False)
49 tcf.addFlag(
'Tile.doFit',
False)
50 tcf.addFlag(
'Tile.doFitCOOL',
False)
51 tcf.addFlag(
'Tile.doMF',
False)
52 tcf.addFlag(
'Tile.doOF1',
False)
53 tcf.addFlag(
'Tile.doWiener',
False)
54 tcf.addFlag(
'Tile.doOpt2', _doOpt2)
55 tcf.addFlag(
'Tile.doOptATLAS', _doOptATLAS)
56 tcf.addFlag(
'Tile.NoiseFilter',
lambda prevFlags : -1
if prevFlags.Input.isMC
else 1)
57 tcf.addFlag(
'Tile.RunType', _getRunType, type=TileRunType)
58 tcf.addFlag(
'Tile.correctTime',
lambda prevFlags :
not prevFlags.Input.isMC
and prevFlags.Beam.Type
is BeamType.Collisions)
59 tcf.addFlag(
'Tile.correctTimeNI',
True)
60 tcf.addFlag(
'Tile.correctAmplitude',
True)
61 tcf.addFlag(
'Tile.AmpMinForAmpCorrection', 15.0)
62 tcf.addFlag(
'Tile.TimeMinForAmpCorrection',
lambda prevFlags : (prevFlags.Beam.BunchSpacing / -2.))
63 tcf.addFlag(
'Tile.TimeMaxForAmpCorrection',
lambda prevFlags : (prevFlags.Beam.BunchSpacing / 2.))
64 tcf.addFlag(
'Tile.OfcFromCOOL',
True)
65 tcf.addFlag(
'Tile.BestPhaseFromCOOL',
lambda prevFlags :
not prevFlags.Input.isMC
and prevFlags.Beam.Type
is BeamType.Collisions)
66 tcf.addFlag(
'Tile.readDigits',
lambda prevFlags :
not prevFlags.Input.isMC)
67 tcf.addFlag(
'Tile.doOverflowFit',
True)
68 tcf.addFlag(
'Tile.zeroAmplitudeWithoutDigits', _zeroAmplitudeWithoutDigits)
69 tcf.addFlag(
'Tile.correctPedestalDifference', _correctPedestalDifference)
70 tcf.addFlag(
'Tile.correctTimeJumps', _correctTimeJumps)
71 tcf.addFlag(
'Tile.RawChannelContainer', _getRawChannelContainer)
72 tcf.addFlag(
'Tile.useDCS', _useDCS)
73 tcf.addFlag(
'Tile.doTimingHistogramsForGain', -1)
74 tcf.addFlag(
'Tile.useOnlineChannelStatus',
True)
82 if prevFlags.Common.isOnline:
83 if prevFlags.Beam.Type
is BeamType.Collisions:
88 runNumber = prevFlags.Input.RunNumbers[0]
91 if not prevFlags.Input.isMC
and runNumber > 0
and runNumber < 171194:
95 elif prevFlags.Beam.Type
is BeamType.Collisions:
103 if (prevFlags.Tile.doQIE
or prevFlags.Tile.doManyAmps
or prevFlags.Tile.doFlat
104 or prevFlags.Tile.doFit
or prevFlags.Tile.doFitCOOL
or prevFlags.Tile.doMF
105 or prevFlags.Tile.doOF1
or prevFlags.Tile.doWiener):
117 _flags = prevFlags.clone()
118 _flags.Tile.doOpt2 =
True
120 return not _flags.Tile.doOptATLAS
133 _flags = prevFlags.clone()
134 _flags.Tile.doOptATLAS =
True
135 return not _flags.Tile.doOpt2
141 if not prevFlags.Input.isMC:
142 runNumber = prevFlags.Input.RunNumbers[0]
144 return runNumber > 269101
and runNumber < 324320
150 if not prevFlags.Common.isOnline:
157 if not (prevFlags.Input.isMC
or prevFlags.Overlay.DataOverlay)
and prevFlags.Input.Format
is Format.BS:
165 from AthenaConfiguration.AutoConfigFlags
import GetFileMD
166 if not prevFlags.Input.isMC
and 'calibration_Tile' in GetFileMD(prevFlags.Input.Files).
get(
'triggerStreamOfFile',
''):
167 return TileRunType.UNDEFINED
169 return TileRunType.PHY
173 if not (prevFlags.Common.isOnline
or prevFlags.Input.isMC):
174 runNumber = prevFlags.Input.RunNumbers[0]
176 return (runNumber > 171194
and runNumber < 222222)
or runNumber > 232498
183 rawChannelContainer =
'UNDEFINED'
185 if prevFlags.Tile.doQIE:
186 rawChannelContainer =
'TileRawChannelQIE'
187 if prevFlags.Tile.doManyAmps:
188 rawChannelContainer =
'TileRawChannelManyAmp'
189 if prevFlags.Tile.doFlat:
190 rawChannelContainer =
'TileRawChannelFlat'
191 if prevFlags.Tile.doFit:
192 rawChannelContainer =
'TileRawChannelFit'
193 if prevFlags.Tile.doFitCOOL:
194 rawChannelContainer =
'TileRawChannelFitCool'
195 if prevFlags.Tile.doMF:
196 rawChannelContainer =
'TileRawChannelMF'
197 if prevFlags.Tile.doOF1:
198 rawChannelContainer =
'TileRawChannelOF1'
199 if prevFlags.Tile.doWiener:
200 rawChannelContainer =
'TileRawChannelWiener'
201 if prevFlags.Tile.doOpt2:
202 rawChannelContainer =
'TileRawChannelOpt2'
203 if prevFlags.Tile.doOptATLAS:
204 if not (prevFlags.Input.isMC
or prevFlags.Overlay.DataOverlay)
and prevFlags.Input.Format
is Format.BS:
205 rawChannelContainer =
'TileRawChannelFixed'
207 rawChannelContainer =
'TileRawChannelCnt'
209 return rawChannelContainer
212 if __name__==
"__main__":
214 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
215 from AthenaConfiguration.TestDefaults
import defaultTestFiles
217 flags.Input.Files = defaultTestFiles.RAW_RUN2
219 if len(sys.argv) > 1:
224 flags.needFlagsCategory(
'Tile')