ATLAS Offline Software
Loading...
Searching...
No Matches
SpacePointDump.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3from AthenaConfiguration.ComponentFactory import CompFactory
4
5
6def TruthSegmentWriterCfg(flags, name="TruthSegmentWriter",
7 outFile="MuonSpacePoints.root", **kwargs):
8 result = ComponentAccumulator()
9 if not flags.Muon.setupTruthAlgorithms:
10 return result
11 from MuonConfig.MuonConfigUtils import setupHistSvcCfg
12 result.merge(setupHistSvcCfg(flags, outFile=outFile,
13 outStream="ActsMuonTruthDump"))
14
15 the_alg = CompFactory.MuonValR4.TruthSegmentWriter(name, **kwargs)
16 result.addEventAlgo(the_alg, primary = True)
17 return result
18
19
20def SpacePointWriterCfg(flags, name="SpacePointWriter", outFile="MuonSpacePoints.root", **kwargs):
21 result = ComponentAccumulator()
22 from MuonConfig.MuonConfigUtils import setupHistSvcCfg
23 result.merge(setupHistSvcCfg(flags, outFile=outFile,
24 outStream="ActsMuonSpacePointDump"))
25 the_alg = CompFactory.MuonValR4.SpacePointWriter(name, **kwargs)
26 result.addEventAlgo(the_alg, primary = True)
27
28 return result
29
30if __name__=="__main__":
31 from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, MuonPhaseIITestDefaults
32 from MuonConfig.MuonConfigUtils import executeTest
33 parser = SetupArgParser()
34 parser.set_defaults(nEvents = -1)
35 parser.set_defaults(inputFile=MuonPhaseIITestDefaults.RDO_R3)
36
37 args = parser.parse_args()
38 flags, cfg = setupGeoR4TestCfg(args)
39
40 from ActsConfig.ActsGeometryConfig import ActsWriteTrackingGeometryCfg
41 from MuonConfig.MuonDataPrepConfig import xAODUncalibMeasPrepCfg
42 from MuonSpacePointFormation.SpacePointFormationConfig import MuonSpacePointFormationCfg
43 cfg.merge(xAODUncalibMeasPrepCfg(flags))
44 cfg.merge(MuonSpacePointFormationCfg(flags))
45
46 cfg.merge(ActsWriteTrackingGeometryCfg(flags))
47 cfg.merge(SpacePointWriterCfg(flags))
48 cfg.merge(TruthSegmentWriterCfg(flags))
49 executeTest(cfg)
50
SpacePointWriterCfg(flags, name="SpacePointWriter", outFile="MuonSpacePoints.root", **kwargs)
TruthSegmentWriterCfg(flags, name="TruthSegmentWriter", outFile="MuonSpacePoints.root", **kwargs)