ATLAS Offline Software
InDetTrackPerfMonFlags.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 #from AthenaConfiguration.Enums import LHCPeriod
4 
5 
7  from AthenaConfiguration.AthConfigFlags import AthConfigFlags
8  icf = AthConfigFlags()
9 
10  icf.addFlag( "DirName", "InDetTrackPerfMonPlots/" )
11  icf.addFlag( "trkAnaNames", ["Default"] )
12  icf.addFlag( "plotsDefFormat", "JSON" )
13  icf.addFlag( "plotsDefFileList" , "InDetTrackPerfMon/PlotsDefFileList_default.txt" )
14  icf.addFlag( "plotsCommonValuesFile", "" )
15  icf.addFlag( "sortPlotsByChain", False )
16 
17  icf.addFlag( "trkAnaCfgFile", '' )
18  icf.addFlag( 'outputFilePrefix','myIDTPM_out')
19  icf.addFlag( 'unpackTrigChains', False )
20  return icf
21 
22 
23 
26  from AthenaConfiguration.AthConfigFlags import AthConfigFlags
27  icf = AthConfigFlags()
28 
29  # General properties
30  icf.addFlag( "enabled", True )
31  icf.addFlag( "anaTag", "" )
32  icf.addFlag( "SubFolder", "" )
33  # Test-Reference collections properties
34  icf.addFlag( "TestType", "Offline" )
35  icf.addFlag( "RefType", "Truth" )
36  icf.addFlag( "TrigTrkKey" , "" )
37  icf.addFlag( "OfflineTrkKey" , "InDetTrackParticles" )
38  icf.addFlag( "TruthPartKey" , "TruthParticles" )
39  icf.addFlag( "TrigVtxKey" , "" )
40  icf.addFlag( "OfflineVtxKey" , "PrimaryVertices" )
41  icf.addFlag( "TruthVtxKey" , "TruthVertices" )
42  icf.addFlag( "pileupSwitch" , "HardScatter" )
43  # Matching properties
44  icf.addFlag( "MatchingType" , "DeltaRMatch" )
45  icf.addFlag( "dRmax" , 0.05 )
46  icf.addFlag( "pTResMax" , -9.9 )
47  icf.addFlag( "truthProbCut" , 0.5 )
48  # Trigger-specific properties
49  icf.addFlag( "ChainNames" , [] )
50  icf.addFlag( "RoiKey" , "" )
51  icf.addFlag( "ChainLeg" , -1 )
52  icf.addFlag( "doTagNProbe" , False )
53  icf.addFlag( "RoiKeyTag" , "" )
54  icf.addFlag( "ChainLegTag" , 0 )
55  icf.addFlag( "RoiKeyProbe" , "" )
56  icf.addFlag( "ChainLegProbe" , 1 )
57  # Offline tracks selection properties
58  icf.addFlag( "SelectOfflineObject", "" )
59  icf.addFlag( "OfflineQualityWP" , "", help="Apply track quality selection cuts to the reconstructed tracks, if blank no selections is done" )
60  icf.addFlag( "DoOfflineSelection", False )
61  icf.addFlag( "offlMaxZ0SinTheta", -9999. )
62  icf.addFlag( "offlMinNInnermostLayerHits", -9999. )
63  icf.addFlag( "offlMinNBothInnermostLayersHits", -9999. )
64  icf.addFlag( "offlMaxNInnermostLayerSharedHits",-9999. )
65  icf.addFlag( "offlMinNSiHits", -9999. )
66  icf.addFlag( "offlMaxNSiSharedHits", -9999. )
67  icf.addFlag( "offlMaxNSiHoles", -9999. )
68  icf.addFlag( "offlMinNPixelHits", -9999. )
69  icf.addFlag( "offlMaxNPixelSharedHits", -9999. )
70  icf.addFlag( "offlMaxNPixelHoles", -9999. )
71  icf.addFlag( "offlMinNSctHits", -9999. )
72  icf.addFlag( "offlMaxNSctSharedHits", -9999.)
73  icf.addFlag( "offlMaxNSctHoles", -9999. )
74  icf.addFlag( "offlMaxChiSq", -9999. )
75  icf.addFlag( "offlMaxChiSqperNdf", -9999. )
76  icf.addFlag( "offlMinPt" , -9999.)
77  icf.addFlag( "offlMaxPt" , -9999. )
78  icf.addFlag( "offlMinEta" , -9999. )
79  icf.addFlag( "offlMaxEta" , -9999. )
80  icf.addFlag( "offlMinPhi" , -9999. )
81  icf.addFlag( "offlMaxPhi" , -9999. )
82  icf.addFlag( "offlMinD0" , -9999. )
83  icf.addFlag( "offlMaxD0" , -9999. )
84  icf.addFlag( "offlMinZ0" , -9999. )
85  icf.addFlag( "offlMaxZ0" , -9999. )
86  icf.addFlag( "offlMinQoPT" , -9999. )
87  icf.addFlag( "offlMaxQoPT" , -9999. )
88  icf.addFlag( "offlMaxAbsEta" , -9999. )
89  icf.addFlag( "offlMinAbsEta" , -9999. )
90  icf.addFlag( "offlMinAbsPhi" , -9999. )
91  icf.addFlag( "offlMaxAbsPhi" , -9999. )
92  icf.addFlag( "offlMinAbsD0" , -9999. )
93  icf.addFlag( "offlMaxAbsD0" , -9999. )
94  icf.addFlag( "offlMinAbsZ0" , -9999. )
95  icf.addFlag( "offlMaxAbsZ0" , -9999. )
96  icf.addFlag( "offlMinAbsQoPT" , -9999. )
97  icf.addFlag( "offlMaxAbsQoPT" , -9999. )
98  icf.addFlag( "offlMinProb", -9999. )
99  icf.addFlag( "ObjectQuality" , "Medium" )
100  icf.addFlag( "TauType" , "RNN" )
101  icf.addFlag( "TauNprongs" , 1 )
102  icf.addFlag( "TruthProbMin" , 0.5 )
103  # Truth particles selection properties
104  icf.addFlag( "SelectTruthObject" , "" )
105  icf.addFlag( "truthMinPt" , -9999., help="Apply minimum pt cut to truth particle" )
106  icf.addFlag( "truthMaxPt" , -9999., help="Apply maximum pt cut to truth particle" )
107  icf.addFlag( "truthMinEta" , -9999., help="Apply minimum eta cut to truth particle" )
108  icf.addFlag( "truthMaxEta" , -9999., help="Apply maximum eta cut to truth particle" )
109  icf.addFlag( "truthMinPhi" , -9999., help="Apply minimum phi cut to truth particle" )
110  icf.addFlag( "truthMaxPhi" , -9999., help="Apply maximum phi cut to truth particle" )
111  icf.addFlag( "truthMinD0" , -9999., help="Apply minimum d0 cut to truth particle" )
112  icf.addFlag( "truthMaxD0" , -9999., help="Apply maximum d0 cut to truth particle" )
113  icf.addFlag( "truthMinZ0" , -9999., help="Apply minimum z0 cut to truth particle" )
114  icf.addFlag( "truthMaxZ0" , -9999., help="Apply maximum z0 cut to truth particle" )
115  icf.addFlag( "truthMinQoPT" , -9999., help="Apply minimum q/pt cut to truth particle" )
116  icf.addFlag( "truthMaxQoPT" , -9999., help="Apply maximum q/pt cut to truth particle" )
117  icf.addFlag( "truthMinAbsEta" , -9999., help="Apply minimum |eta| cut to truth particle" )
118  icf.addFlag( "truthMaxAbsEta" , -9999., help="Apply maximum |eta| cut to truth particle" )
119  icf.addFlag( "truthMinAbsPhi" , -9999., help="Apply minimum |phi| cut to truth particle" )
120  icf.addFlag( "truthMaxAbsPhi" , -9999., help="Apply maximum |phi| cut to truth particle" )
121  icf.addFlag( "truthMinAbsD0" , -9999., help="Apply minimum |d0| cut to truth particle" )
122  icf.addFlag( "truthMaxAbsD0" , -9999., help="Apply maximum |d0| cut to truth particle" )
123  icf.addFlag( "truthMinAbsZ0" , -9999., help="Apply minimum |z0| cut to truth particle" )
124  icf.addFlag( "truthMaxAbsZ0" , -9999., help="Apply maximum |z0| cut to truth particle" )
125  icf.addFlag( "truthMinAbsQoPT" , -9999., help="Apply minimum |q/pt| cut to truth particle" )
126  icf.addFlag( "truthMaxAbsQoPT" , -9999., help="Apply maximum |q/pt| cut to truth particle" )
127  icf.addFlag( "truthPdgId" , -9999., help="Apply pdgId selection to truth particle" )
128  icf.addFlag( "truthIsHadron", False, help="Select hadrons" )
129  icf.addFlag( "truthIsPion", False, help="Select pions" )
130  # Histogram properties
131  icf.addFlag( "plotTrackParameters" , True )
132  icf.addFlag( "plotTrackMultiplicities" , True )
133  icf.addFlag( "plotEfficiencies" , True )
134  icf.addFlag( "plotTechnicalEfficiencies", False )
135  icf.addFlag( "plotResolutions" , True )
136  icf.addFlag( "plotFakeRates" , True )
137  icf.addFlag( "unlinkedAsFakes" , True )
138  icf.addFlag( "plotDuplicateRates" , False )
139  icf.addFlag( "plotHitsOnTracks" , True )
140  icf.addFlag( "plotHitsOnTracksReference", False )
141  icf.addFlag( "plotHitsOnMatchedTracks" , False )
142  icf.addFlag( "plotHitsOnFakeTracks" , False )
143  icf.addFlag( "plotVertexParameters" , True )
144  icf.addFlag( "useSelectedVertexTracks" , False )
145  icf.addFlag( "plotOfflineElectrons" , False )
146  icf.addFlag( "ResolutionMethod" , "iterRMS" )
147 
148  return icf
149 
150 
152  flags.addFlagsCategory( "PhysVal.IDTPM",
153  __createIDTPMConfigFlags , prefix=True )
154 
155  flags.addFlag( 'Output.doWriteAOD_IDTPM', False )
156  flags.addFlag( 'Output.AOD_IDTPMFileName', 'myIDTPM_out.AOD_IDTPM.pool.root' )
157  return flags
158 
159 
160 
162  # Set output file names
163  flags.PhysVal.OutputFileName = flags.PhysVal.IDTPM.outputFilePrefix + '.HIST.root'
164  flags.Output.AOD_IDTPMFileName = flags.PhysVal.IDTPM.outputFilePrefix + '.AOD_IDTPM.pool.root'
165 
166  # Default TrackAnalysis configuration flags category
167  flags.addFlagsCategory( "PhysVal.IDTPM.Default",
168  __createIDTPMTrkAnaConfigFlags,
169  prefix=True )
170 
171  from InDetTrackPerfMon.ConfigUtils import getTrkAnaDicts
172  analysesDict = getTrkAnaDicts( flags )
173  trkAnaNames = []
174  print (str(analysesDict))
175 
176  if analysesDict:
177  for trkAnaName, trkAnaDict in analysesDict.items():
178  # Append TrkAnalysisName to list
179  trkAnaNames.append( trkAnaName )
180 
181  # separate flag category for each TrkAnalysis
182  flags.addFlagsCategory( "PhysVal.IDTPM."+trkAnaName,
183  __createIDTPMTrkAnaConfigFlags,
184  prefix=True )
185 
186  # set flags from values in trkAnaDict
187  for fname, fvalue in trkAnaDict.items():
188  if fname.startswith( "_comment" ): continue
189  setattr( flags.PhysVal.IDTPM,
190  trkAnaName+"."+fname, fvalue )
191 
192  if trkAnaNames:
193  flags.PhysVal.IDTPM.trkAnaNames = trkAnaNames
194  return flags
InDetTrackPerfMonFlags.__createIDTPMConfigFlags
def __createIDTPMConfigFlags()
IDTPM whole job properties.
Definition: InDetTrackPerfMonFlags.py:6
InDetTrackPerfMonFlags.__createIDTPMTrkAnaConfigFlags
def __createIDTPMTrkAnaConfigFlags()
IDTPM individual TrkAnalysis properties to be read from trkAnaCfgFile in JSON format.
Definition: InDetTrackPerfMonFlags.py:25
ConfigUtils.getTrkAnaDicts
def getTrkAnaDicts(flags)
Definition: ConfigUtils.py:7
InDetTrackPerfMonFlags.initializeIDTPMConfigFlags
def initializeIDTPMConfigFlags(flags)
General config flag category for IDTPM tool job configuration.
Definition: InDetTrackPerfMonFlags.py:151
str
Definition: BTagTrackIpAccessor.cxx:11
InDetTrackPerfMonFlags.initializeIDTPMTrkAnaConfigFlags
def initializeIDTPMTrkAnaConfigFlags(flags)
Create flags category and corresponding set of flags.
Definition: InDetTrackPerfMonFlags.py:161