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 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
16 kwargs.setdefault("TrackingGeometryTool", result.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
17
18 the_alg = CompFactory.MuonValR4.TruthSegmentWriter(name, **kwargs)
19 result.addEventAlgo(the_alg, primary = True)
20 return result
21
22
23def SpacePointWriterCfg(flags, name="SpacePointWriter", outFile="MuonSpacePoints.root", **kwargs):
24 result = ComponentAccumulator()
25 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
26 kwargs.setdefault("TrackingGeometryTool", result.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
27 from MuonConfig.MuonConfigUtils import setupHistSvcCfg
28 result.merge(setupHistSvcCfg(flags, outFile=outFile,
29 outStream="ActsMuonSpacePointDump"))
30 the_alg = CompFactory.MuonValR4.SpacePointWriter(name, **kwargs)
31 result.addEventAlgo(the_alg, primary = True)
32
33 return result
34
35if __name__=="__main__":
36 from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, MuonPhaseIITestDefaults
37 from MuonConfig.MuonConfigUtils import executeTest
38 parser = SetupArgParser()
39 parser.set_defaults(nEvents = -1)
40 parser.set_defaults(inputFile=MuonPhaseIITestDefaults.RDO_R3)
41
42 args = parser.parse_args()
43 flags, cfg = setupGeoR4TestCfg(args)
44
45 from ActsConfig.ActsGeometryConfig import ActsWriteTrackingGeometryCfg
46 from MuonConfig.MuonDataPrepConfig import xAODUncalibMeasPrepCfg
47 from MuonSpacePointFormation.SpacePointFormationConfig import MuonSpacePointFormationCfg
48 cfg.merge(xAODUncalibMeasPrepCfg(flags))
49 cfg.merge(MuonSpacePointFormationCfg(flags))
50
51 cfg.merge(ActsWriteTrackingGeometryCfg(flags))
52 cfg.merge(SpacePointWriterCfg(flags))
53 cfg.merge(TruthSegmentWriterCfg(flags))
54 executeTest(cfg)
55
SpacePointWriterCfg(flags, name="SpacePointWriter", outFile="MuonSpacePoints.root", **kwargs)
TruthSegmentWriterCfg(flags, name="TruthSegmentWriter", outFile="MuonSpacePoints.root", **kwargs)