ATLAS Offline Software
Loading...
Searching...
No Matches
TileMuonReceiverDecisionConfig.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 muon receiver decision algorithm"""
4
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory import CompFactory
7from AthenaConfiguration.Enums import ProductionStep
8from TileConfiguration.TileConfigFlags import TileRunType
9
10def TileMuonReceiverDecisionCfg(flags, **kwargs):
11 """Return component accumulator with configured Tile muon receiver decision algorithm
12
13 Arguments:
14 flags -- Athena configuration flags
15 Keyword arguments:
16 Name -- name of TileMuonReceiverDecision algorithm. Defaults to TileMuonReceiverDecision.
17 """
18
19 name = kwargs.get('Name', 'TileMuonReceiverDecision')
20
21 acc = ComponentAccumulator()
22
23 TileMuonReceiverDecision=CompFactory.TileMuonReceiverDecision
24 muRcvDecisionAlg = TileMuonReceiverDecision(name,
25 MuonReceiverEneThreshCellD6Low = 500,
26 MuonReceiverEneThreshCellD6andD5Low = 500,
27 MuonReceiverEneThreshCellD6High = 600,
28 MuonReceiverEneThreshCellD6andD5High = 600)
29
30
31 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
32 muRcvDecisionAlg.TileMuonReceiverContainer = flags.Overlay.BkgPrefix + 'TileMuRcvCnt'
33
34 from TileConditions.TileInfoLoaderConfig import TileInfoLoaderCfg
35 acc.merge( TileInfoLoaderCfg(flags) )
36
37 from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
38 acc.merge(TileCablingSvcCfg(flags))
39
40 from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
41 acc.merge( TileEMScaleCondAlgCfg(flags) )
42
43 acc.addEventAlgo(muRcvDecisionAlg, primary = True)
44
45 return acc
46
47
49 """Return component accumulator with configured Tile muon receiver decision algorithm and Output stream
50
51 Arguments:
52 flags -- Athena configuration flags
53 """
54
55 acc = TileMuonReceiverDecisionCfg(flags, **kwargs)
56 muRcvDecisionAlg = acc.getPrimary()
57
58 if hasattr(muRcvDecisionAlg, 'TileMuonReceiverContainer'):
59 muRcvContainer = muRcvDecisionAlg.TileMuonReceiverContainer
60 else:
61 muRcvContainer = muRcvDecisionAlg.getDefaultProperty('TileMuonReceiverContainer')
62 muRcvContainer = str(muRcvContainer).split('+').pop()
63 outputItemList = ['TileMuonReceiverContainer#' + muRcvContainer]
64
65 if flags.Output.doWriteRDO:
66 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
67 acc.merge( OutputStreamCfg(flags, streamName = 'RDO', ItemList = outputItemList) )
68
69 return acc
70
71
72
73if __name__ == "__main__":
74
75 from AthenaConfiguration.AllConfigFlags import initConfigFlags
76 from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultTestFiles
77 from AthenaCommon.Logging import log
78 from AthenaCommon.Constants import DEBUG
79
80 # Test setup
81 log.setLevel(DEBUG)
82
83 flags = initConfigFlags()
84 flags.Input.Files = defaultTestFiles.RDO_RUN2
85 flags.Tile.RunType = TileRunType.PHY
86 flags.Output.RDOFileName = 'myRDO->TileMuonReceiverDecision.pool.root'
87 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_MC
88
89 flags.fillFromArgs()
90 flags.lock()
91 flags.dump()
92
93 # Construct our accumulator to run
94 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
95 acc = MainServicesCfg(flags)
96
97 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
98 acc.merge(PoolReadCfg(flags))
99
100 if 'EventInfo' not in flags.Input.Collections:
101 from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
102 acc.merge(EventInfoCnvAlgCfg(flags,
103 inputKey='McEventInfo',
104 outputKey='EventInfo'))
105
106 acc.merge( TileMuonReceiverDecisionOutputCfg(flags, TileMuonReceiverContainer = 'TileMuRcvCntNew') )
107
108 acc.printConfig(withDetails = True, summariseProps = True)
109 acc.store( open('TileMuonReceiverDecision.pkl','wb') )
110
111 sc = acc.run(maxEvents=3)
112 # Success should be 0
113 import sys
114 sys.exit(not sc.isSuccess())
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177