3"""Define method to construct configured Tile muon receiver decision algorithm"""
5from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory
import CompFactory
7from AthenaConfiguration.Enums
import ProductionStep
8from TileConfiguration.TileConfigFlags
import TileRunType
11 """Return component accumulator with configured Tile muon receiver decision algorithm
14 flags -- Athena configuration flags
16 Name -- name of TileMuonReceiverDecision algorithm. Defaults to TileMuonReceiverDecision.
19 name = kwargs.get(
'Name',
'TileMuonReceiverDecision')
21 acc = ComponentAccumulator()
23 TileMuonReceiverDecision=CompFactory.TileMuonReceiverDecision
25 MuonReceiverEneThreshCellD6Low = 500,
26 MuonReceiverEneThreshCellD6andD5Low = 500,
27 MuonReceiverEneThreshCellD6High = 600,
28 MuonReceiverEneThreshCellD6andD5High = 600)
31 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
32 muRcvDecisionAlg.TileMuonReceiverContainer = flags.Overlay.BkgPrefix +
'TileMuRcvCnt'
34 from TileConditions.TileInfoLoaderConfig
import TileInfoLoaderCfg
35 acc.merge( TileInfoLoaderCfg(flags) )
37 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
38 acc.merge(TileCablingSvcCfg(flags))
40 from TileConditions.TileEMScaleConfig
import TileEMScaleCondAlgCfg
41 acc.merge( TileEMScaleCondAlgCfg(flags) )
43 acc.addEventAlgo(muRcvDecisionAlg, primary =
True)
49 """Return component accumulator with configured Tile muon receiver decision algorithm and Output stream
52 flags -- Athena configuration flags
56 muRcvDecisionAlg = acc.getPrimary()
58 if hasattr(muRcvDecisionAlg,
'TileMuonReceiverContainer'):
59 muRcvContainer = muRcvDecisionAlg.TileMuonReceiverContainer
61 muRcvContainer = muRcvDecisionAlg.getDefaultProperty(
'TileMuonReceiverContainer')
62 muRcvContainer = str(muRcvContainer).
split(
'+').pop()
63 outputItemList = [
'TileMuonReceiverContainer#' + muRcvContainer]
65 if flags.Output.doWriteRDO:
66 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
67 acc.merge( OutputStreamCfg(flags, streamName =
'RDO', ItemList = outputItemList) )
73if __name__ ==
"__main__":
75 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
76 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultTestFiles
77 from AthenaCommon.Logging
import log
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
94 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
95 acc = MainServicesCfg(flags)
97 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
98 acc.merge(PoolReadCfg(flags))
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'))
108 acc.printConfig(withDetails =
True, summariseProps =
True)
109 acc.store( open(
'TileMuonReceiverDecision.pkl',
'wb') )
111 sc = acc.run(maxEvents=3)
114 sys.exit(
not sc.isSuccess())
std::vector< std::string > split(const std::string &s, const std::string &t=":")
TileMuonReceiverDecisionOutputCfg(flags, **kwargs)
TileMuonReceiverDecisionCfg(flags, **kwargs)