ATLAS Offline Software
TileMuonFitterConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
4 '''
5 @file TileMuonFitterConfig.py
6 @brief Python configuration of Tile Muon Fitter algorithm for the Run III
7 '''
8 
9 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10 from AthenaConfiguration.ComponentFactory import CompFactory
11 
12 def TileMuonFitterCfg(flags, **kwargs):
13 
14  acc = ComponentAccumulator()
15 
16  kwargs.setdefault('DoHoughTransform', True)
17  kwargs.setdefault('EThreshold', 250.0)
18  kwargs.setdefault('BeamType', flags.Beam.Type.value)
19  kwargs.setdefault('CaloCellContainer', 'AllCalo')
20 
21  if kwargs['DoHoughTransform']:
22  kwargs.setdefault('name', 'TileMuonFitter')
23  kwargs.setdefault('ComTimeKey', 'ComTimeTileMuon')
24  kwargs.setdefault('TileCosmicMuonKey', 'TileCosmicMuonHT')
25  else:
26  kwargs.setdefault('name', 'TileMuonFitterMF')
27  kwargs.setdefault('ComTimeKey', 'ComTimeTileMuonMF')
28  kwargs.setdefault('TileCosmicMuonKey', 'TileCosmicMuonMF')
29 
30  from TileGeoModel.TileGMConfig import TileGMCfg
31  acc.merge(TileGMCfg(flags))
32 
33  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
34  acc.merge(LArGMCfg(flags))
35 
36  TileMuonFitter=CompFactory.TileMuonFitter
37  acc.addEventAlgo(TileMuonFitter(**kwargs), primary = True)
38 
39  return acc
40 
41 
42 def TileMuonFitterOutputCfg(flags, streamName = 'ESD', **kwargs):
43 
44  acc = TileMuonFitterCfg(flags, **kwargs)
45  muonFitter = acc.getPrimary()
46 
47  cosmiMuonContainer = muonFitter.TileCosmicMuonKey
48  cosmiMuonContainer = cosmiMuonContainer.split('+').pop()
49  outputItemList = ['TileCosmicMuonContainer#' + cosmiMuonContainer]
50 
51  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
52  acc.merge( OutputStreamCfg(flags, streamName, ItemList = outputItemList) )
53 
54  return acc
55 
56 
57 if __name__=='__main__':
58 
59  # Setup logs
60  from AthenaCommon.Logging import log
61  from AthenaCommon.Constants import INFO
62  log.setLevel(INFO)
63 
64  # Set the Athena configuration flags
65  from AthenaConfiguration.AllConfigFlags import initConfigFlags
66  from AthenaConfiguration.TestDefaults import defaultTestFiles
67  flags = initConfigFlags()
68  flags.Input.Files = defaultTestFiles.ESD
69  flags.DQ.useTrigger = False
70  flags.DQ.enableLumiAccess = False
71  flags.lock()
72 
73  # Initialize configuration object, add accumulator, merge, and run.
74  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
75  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
76  cfg = MainServicesCfg(flags)
77  cfg.merge(PoolReadCfg(flags))
78 
79  cfg.merge( TileMuonFitterCfg(flags) )
80 
81  cfg.printConfig(withDetails = True, summariseProps = True)
82  flags.dump()
83 
84  cfg.store( open('TileMuonFitter.pkl','wb') )
85 
86  sc = cfg.run(maxEvents=3)
87 
88  import sys
89  # Success should be 0
90  sys.exit(not sc.isSuccess())
TileMuonFitter
Fits straight cosmic muon track to TileCal event.
Definition: TileMuonFitter.h:88
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
TileMuonFitterConfig.TileMuonFitterOutputCfg
def TileMuonFitterOutputCfg(flags, streamName='ESD', **kwargs)
Definition: TileMuonFitterConfig.py:42
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
Constants
some useful constants -------------------------------------------------—
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
TileMuonFitterConfig.TileMuonFitterCfg
def TileMuonFitterCfg(flags, **kwargs)
Definition: TileMuonFitterConfig.py:12
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7