3from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator, ConfigurationError
4from AthenaConfiguration.ComponentFactory
import CompFactory
6from InDetTrackSelectionTool.InDetTrackSelectionToolConfig
import InDetTrackSelectionTool_HILoose_Cfg
9 acc = ComponentAccumulator()
12 trackSelectionTool = acc.popToolsAndMerge(InDetTrackSelectionTool_HILoose_Cfg(flags,
14 filterTool = CompFactory.HI.HIEventSelectionToolRun3(TrackSelectionTool=trackSelectionTool)
19 if zdcNeeded
and "ZDCModules" in flags.Input.Collections:
21 elif zdcNeeded
and "ZdcSums" in flags.Input.Collections:
24 if zdcNeeded
and not zdcKey:
25 raise ConfigurationError(
"The input file does not have any ZDCModules (any capitalisation) container and ZDC info is needed for selection")
27 filterAlg = CompFactory.HI.HIEventFilterAlgRun3(name=
"HIEventFilterAlgRun3",
28 SelectionTool=filterTool,
30 acc.addEventAlgo(filterAlg)
33if __name__ ==
'__main__':
34 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
36 from AthenaConfiguration.TestDefaults
import defaultTestFiles
38 inputAOD = f
"{defaultTestFiles.d}/DerivationFrameworkART/data18_hi.00365602.physics_HardProbes.merge.AOD.f1021_m2037._lb0203._0001.1"
42 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
44 flags = initConfigFlags()
45 flags.Exec.MaxEvents=10
46 flags.Input.Files=[inputAOD]
49 acc=MainServicesCfg(flags)
51 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
52 acc.merge(PoolReadCfg(flags))
56 acc.foreach_component(
"**/AthAlgSeq/*Run3*").OutputLevel=DEBUG
58 filterAlg = acc.getEventAlgo(
"HIEventFilterAlgRun3")
61 filterAlg.SelectionMask=ROOT.HI.SelectionMask.NoEventError & ROOT.HI.SelectionMask.PUFCalVsZDCAny
63 filterAlg.SelectionMask=ROOT.HI.SelectionMask.NoEventError
64 filterAlg.UseIonDataTypeDefaultMask=
False
65 acc.printConfig(withDetails=
True)
68 if status.isFailure():
HIEventSelectionRun3Cfg(flags)