ATLAS Offline Software
TileRawChannelBuilderFitConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 """Define method to construct configured Tile Fit raw channel builder tool"""
4 
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 from TileConfiguration.TileConfigFlags import TileRunType
8 
9 def TileRawChannelBuilderFitFilterCfg(flags, **kwargs):
10  """Return component accumulator with configured private Tile Fit raw channel builder tool
11 
12  Arguments:
13  flags -- Athena configuration flags
14  """
15 
16  name = kwargs.pop('name', 'TileRawChannelBuilderFitFilter')
17  kwargs.setdefault('TileRawChannelContainer', 'TileRawChannelFit')
18  kwargs.setdefault('correctTime', flags.Tile.correctTime)
19  kwargs.setdefault('FrameLength', 7)
20 
21  acc = ComponentAccumulator()
22 
23  if 'TileCondToolNoiseSample' not in kwargs:
24  from TileConditions.TileSampleNoiseConfig import TileCondToolNoiseSampleCfg
25  sampleNoiseTool = acc.popToolsAndMerge( TileCondToolNoiseSampleCfg(flags) )
26  kwargs['TileCondToolNoiseSample'] = sampleNoiseTool
27 
28  if flags.Tile.correctTime and 'TileCondToolTiming' not in kwargs:
29  from TileConditions.TileTimingConfig import TileCondToolTimingCfg
30  timingTool = acc.popToolsAndMerge( TileCondToolTimingCfg(flags) )
31  kwargs['TileCondToolTiming'] = timingTool
32 
33  TileRawChannelBuilderFitFilter=CompFactory.TileRawChannelBuilderFitFilter
34  from TileRecUtils.TileRawChannelBuilderConfig import TileRawChannelBuilderCfg
35  rawChanBuilder = acc.popToolsAndMerge(TileRawChannelBuilderCfg(flags, name, TileRawChannelBuilderFitFilter, **kwargs))
36  acc.setPrivateTools(rawChanBuilder)
37 
38  return acc
39 
40 
43  name = 'TileRawChannelBuilderFitOverflow',
44  TileRawChannelContainer = "")
45 
46 
47 if __name__ == "__main__":
48 
49  from AthenaConfiguration.AllConfigFlags import initConfigFlags
50  from AthenaConfiguration.TestDefaults import defaultGeometryTags, defaultTestFiles
51  from AthenaCommon.Logging import log
52  from AthenaCommon.Constants import DEBUG
53 
54  # Test setup
55  log.setLevel(DEBUG)
56 
57  flags = initConfigFlags()
58  flags.Input.Files = defaultTestFiles.RAW_RUN2
59  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
60  flags.Tile.RunType = TileRunType.PHY
61  flags.Tile.NoiseFilter = 1
62  flags.lock()
63 
64  flags.dump()
65 
67 
68  #printing Configurables isn't reliable with GaudiConfig2
69  acc.popToolsAndMerge( TileRawChannelBuilderFitFilterCfg(flags) )
70  acc.popToolsAndMerge( TileRawChannelBuilderFitOverflowCfg(flags) )
71 
72  acc.printConfig(withDetails = True, summariseProps = True)
73  acc.store( open('TileRawChannelBuilderFit.pkl','wb') )
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TileSampleNoiseConfig.TileCondToolNoiseSampleCfg
def TileCondToolNoiseSampleCfg(flags, **kwargs)
Definition: TileSampleNoiseConfig.py:69
python.TileTimingConfig.TileCondToolTimingCfg
def TileCondToolTimingCfg(flags, **kwargs)
Definition: TileTimingConfig.py:77
TileRawChannelBuilderFitConfig.TileRawChannelBuilderFitFilterCfg
def TileRawChannelBuilderFitFilterCfg(flags, **kwargs)
Definition: TileRawChannelBuilderFitConfig.py:9
Constants
some useful constants -------------------------------------------------—
TileRawChannelBuilderConfig.TileRawChannelBuilderCfg
def TileRawChannelBuilderCfg(flags, name, TileRawChannelBuilder, **kwargs)
Definition: TileRawChannelBuilderConfig.py:9
TileRawChannelBuilderFitConfig.TileRawChannelBuilderFitOverflowCfg
def TileRawChannelBuilderFitOverflowCfg(flags, **kwargs)
Definition: TileRawChannelBuilderFitConfig.py:41
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19