ATLAS Offline Software
Loading...
Searching...
No Matches
ITkTrackTruthConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3
4# -------------------------------------------------------------------------
5#
6# ------- fragment to handle track truth association
7#
8# -------------------------------------------------------------------------
9
11 Tracks = "CombinedITkTracks",
12 DetailedTruth = "CombinedITkTracksDetailedTrackTruth",
13 TracksTruth = "CombinedITkTracksTrackTruthCollection"):
14 acc = ComponentAccumulator()
15 #
16 # --- Enable the detailed track truth
17 #
18 from InDetConfig.InDetTruthAlgsConfig import ITkDetailedTrackTruthMakerCfg
19 acc.merge(ITkDetailedTrackTruthMakerCfg(flags,
20 TrackCollectionName = Tracks,
21 DetailedTrackTruthName = DetailedTruth))
22 #
23 # --- Detailed to old TrackTruth
24 #
25 from TrkConfig.TrkTruthAlgsConfig import ITkTrackTruthSimilaritySelectorCfg
26 acc.merge(ITkTrackTruthSimilaritySelectorCfg(flags,
27 DetailedTrackTruthName = DetailedTruth,
28 OutputName = TracksTruth))
29
30 return acc
31
32
33if __name__ == "__main__":
34 from AthenaConfiguration.AllConfigFlags import initConfigFlags
35 flags = initConfigFlags()
36
37 numThreads=1
38 flags.Concurrency.NumThreads=numThreads
39 flags.Concurrency.NumConcurrentEvents=numThreads # Might change this later, but good enough for the moment.
40
41 flags.Detector.GeometryITkPixel = True
42 flags.Detector.GeometryITkStrip = True
43
44 from AthenaConfiguration.TestDefaults import defaultTestFiles
45 flags.Input.Files = defaultTestFiles.RDO_RUN2
46 flags.lock()
47 flags.dump()
48
49 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
50 top_acc = MainServicesCfg(flags)
51
52 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
53 top_acc.merge(PoolReadCfg(flags))
54
55
56 from InDetConfig.SiliconPreProcessing import ITkRecPreProcessingSiliconCfg
57 top_acc.merge(ITkRecPreProcessingSiliconCfg(flags))
58
59 #//// TrackingSiPatternConfig configurations from Temporary location /////
60
61
62 InputCollections = []
63
64 SiSPSeededTrackCollectionKey = 'SiSPSeededPixelTracks'
65 ResolvedTrackCollectionKey = 'ResolvedPixelTracks'
66 from InDetConfig.SiSPSeededTrackFinderConfig import ITkSiSPSeededTrackFinderCfg
67 top_acc.merge(ITkSiSPSeededTrackFinderCfg( flags,
68 InputCollections = InputCollections,
69 SiSPSeededTrackCollectionKey = SiSPSeededTrackCollectionKey))
70
72
73 InputTrackCollection = 'SiSPSeededPixelTracks'
74 InputDetailedTrackTruth = 'DetailedTrackTruth'
75 InputTrackCollectionTruth = 'TrackTruthCollection'
76
77 top_acc.merge(ITkTrackTruthCfg(flags,
78 Tracks = InputTrackCollection,
79 DetailedTruth = InputDetailedTrackTruth,
80 TracksTruth = InputTrackCollectionTruth))
81
82 top_acc.printConfig()
83 top_acc.run(25)
84 top_acc.store(open("test_TrackTruthConfig.pkl", "wb"))
ITkTrackTruthCfg(flags, Tracks="CombinedITkTracks", DetailedTruth="CombinedITkTracksDetailedTrackTruth", TracksTruth="CombinedITkTracksTrackTruthCollection")