ATLAS Offline Software
TrkExAlgsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 def PropResultRootWriterSvcCfg(flags, name="PropResultRootWriterSvc", **kwargs) :
6  result = ComponentAccumulator()
7  result.addService(CompFactory.Trk.PropResultRootWriterSvc(name, **kwargs))
8  return result
9 
10 def ExtrapolatorComparisonTestCfg(flags, name = "ExtrapolatorComparisonTest", **kwargs ) :
11  result=ComponentAccumulator()
12 
13  if "Extrapolator" not in kwargs:
14  from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
15  kwargs.setdefault("Extrapolator", result.popToolsAndMerge(
16  AtlasExtrapolatorCfg(flags)))
17 
18  if "ExtrapolationTool" not in kwargs:
19  from ActsConfig.ActsGeometryConfig import ActsExtrapolationToolCfg
20  kwargs.setdefault("ExtrapolationTool", result.popToolsAndMerge(
21  ActsExtrapolationToolCfg(flags))) # PrivateToolHandle
22 
23  result.addEventAlgo(CompFactory.Trk.ExtrapolatorComparisonTest(name, **kwargs))
24  return result
25 
26 if __name__=="__main__":
27  from AthenaCommon.Logging import log
28  from AthenaCommon.Constants import VERBOSE
29  from AthenaConfiguration.AllConfigFlags import initConfigFlags
30  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
31  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
32 
33  #log.setLevel(VERBOSE)
34 
35  flags = initConfigFlags()
36  # Need some actual input to get flags properly configured
37  flags.Input.Files = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc20_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.AOD.e3601_s3681_r13167/AOD.27312826._000061.pool.root.1']
38 
39 
40  flags.Detector.GeometryBpipe = True
41  flags.Detector.GeometryID = True
42  flags.Detector.GeometryPixel = True
43  flags.Detector.GeometrySCT = True
44  flags.Detector.GeometryCalo = False
45  flags.Detector.GeometryMuon = False
46  #flags.Detector.GeometryTRT = True
47  flags.TrackingGeometry.MaterialSource = "Input"
48 
49  # This should run serially for the moment.
50  flags.Concurrency.NumThreads = 1
51  flags.Concurrency.NumConcurrentEvents = 1
52 
53  log.debug('Lock config flags now.')
54  flags.lock()
55 
56  flags.dump()
57 
58  cfg=MainServicesCfg(flags)
59  cfg.merge(PoolReadCfg(flags))
60 
61  histSvc = CompFactory.THistSvc(Output = ["ExtrapolationStudies DATAFILE='ExtrapolationStudies.root' OPT='RECREATE'"])
62  histSvc.OutputLevel=VERBOSE
63  cfg.addService( histSvc )
64 
65  cfg.merge(PropResultRootWriterSvcCfg(flags,
66  name="ATLASPropResultRootWriterSvc",
67  TreeName="ATLAS"))
68 
69  cfg.merge(PropResultRootWriterSvcCfg(flags,
70  name="ACTSPropResultRootWriterSvc",
71  TreeName="ACTS"))
72 
74  flags,
75  EventsPerExecute = 1000,
76  StartPerigeeMinPt = 10000,
77  StartPerigeeMaxPt = 10000,
78  ReferenceSurfaceRadius = [80],
79  ReferenceSurfaceHalfZ = [500],
80  ATLASPropResultRootWriter = cfg.getService("ATLASPropResultRootWriterSvc"),
81  ACTSPropResultRootWriter = cfg.getService("ACTSPropResultRootWriterSvc")))
82 
83  cfg.printConfig()
84 
85  cfg.run(10)
86  f=open("ExtrapolatorComparisonTestConfig.pkl","w")
87  cfg.store(f)
88  f.close()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TrkExAlgsConfig.ExtrapolatorComparisonTestCfg
def ExtrapolatorComparisonTestCfg(flags, name="ExtrapolatorComparisonTest", **kwargs)
Definition: TrkExAlgsConfig.py:10
python.AtlasExtrapolatorConfig.AtlasExtrapolatorCfg
def AtlasExtrapolatorCfg(flags, name='AtlasExtrapolator')
Definition: AtlasExtrapolatorConfig.py:63
ActsGeometryConfig.ActsExtrapolationToolCfg
ComponentAccumulator ActsExtrapolationToolCfg(flags, str name="ActsExtrapolationTool", **kwargs)
Definition: ActsGeometryConfig.py:109
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.TrkExAlgsConfig.PropResultRootWriterSvcCfg
def PropResultRootWriterSvcCfg(flags, name="PropResultRootWriterSvc", **kwargs)
Definition: TrkExAlgsConfig.py:5