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" , "HLT_IDTrack_Electron_IDTrig" )
37  icf.addFlag( "OfflineTrkKey" , "InDetTrackParticles" )
38  icf.addFlag( "TruthPartKey" , "TruthParticles" )
39  icf.addFlag( "pileupSwitch" , "HardScatter" )
40  # Matching properties
41  icf.addFlag( "MatchingType" , "DeltaRMatch" )
42  icf.addFlag( "dRmax" , 0.05 )
43  icf.addFlag( "pTResMax" , -9.9 )
44  icf.addFlag( "truthProbCut" , 0.5 )
45  # Trigger-specific properties
46  icf.addFlag( "ChainNames" , [] )
47  icf.addFlag( "RoiKey" , "" )
48  icf.addFlag( "ChainLeg" , -1 )
49  icf.addFlag( "doTagNProbe" , False )
50  icf.addFlag( "RoiKeyTag" , "" )
51  icf.addFlag( "ChainLegTag" , 0 )
52  icf.addFlag( "RoiKeyProbe" , "" )
53  icf.addFlag( "ChainLegProbe" , 1 )
54  # Offline tracks selection properties
55  icf.addFlag( "SelectOfflineObject", "" )
56  icf.addFlag( "OfflineQualityWP" , "", help="Apply track quality selection cuts to the reconstructed tracks, if blank no selections is done" )
57  icf.addFlag( "DoOfflineSelection", False )
58  icf.addFlag( "offlMaxZ0SinTheta", -9999. )
59  icf.addFlag( "offlMinNInnermostLayerHits", -9999. )
60  icf.addFlag( "offlMinNBothInnermostLayersHits", -9999. )
61  icf.addFlag( "offlMaxNInnermostLayerSharedHits",-9999. )
62  icf.addFlag( "offlMinNSiHits", -9999. )
63  icf.addFlag( "offlMaxNSiSharedHits", -9999. )
64  icf.addFlag( "offlMaxNSiHoles", -9999. )
65  icf.addFlag( "offlMinNPixelHits", -9999. )
66  icf.addFlag( "offlMaxNPixelSharedHits", -9999. )
67  icf.addFlag( "offlMaxNPixelHoles", -9999. )
68  icf.addFlag( "offlMinNSctHits", -9999. )
69  icf.addFlag( "offlMaxNSctSharedHits", -9999.)
70  icf.addFlag( "offlMaxNSctHoles", -9999. )
71  icf.addFlag( "offlMaxChiSq", -9999. )
72  icf.addFlag( "offlMaxChiSqperNdf", -9999. )
73  icf.addFlag( "offlMinPt" , -9999.)
74  icf.addFlag( "offlMaxPt" , -9999. )
75  icf.addFlag( "offlMinEta" , -9999. )
76  icf.addFlag( "offlMaxEta" , -9999. )
77  icf.addFlag( "offlMinPhi" , -9999. )
78  icf.addFlag( "offlMaxPhi" , -9999. )
79  icf.addFlag( "offlMinD0" , -9999. )
80  icf.addFlag( "offlMaxD0" , -9999. )
81  icf.addFlag( "offlMinZ0" , -9999. )
82  icf.addFlag( "offlMaxZ0" , -9999. )
83  icf.addFlag( "offlMinQoPT" , -9999. )
84  icf.addFlag( "offlMaxQoPT" , -9999. )
85  icf.addFlag( "offlMaxAbsEta" , -9999. )
86  icf.addFlag( "offlMinAbsEta" , -9999. )
87  icf.addFlag( "offlMinAbsPhi" , -9999. )
88  icf.addFlag( "offlMaxAbsPhi" , -9999. )
89  icf.addFlag( "offlMinAbsD0" , -9999. )
90  icf.addFlag( "offlMaxAbsD0" , -9999. )
91  icf.addFlag( "offlMinAbsZ0" , -9999. )
92  icf.addFlag( "offlMaxAbsZ0" , -9999. )
93  icf.addFlag( "offlMinAbsQoPT" , -9999. )
94  icf.addFlag( "offlMaxAbsQoPT" , -9999. )
95  icf.addFlag( "offlMinProb", -9999. )
96  icf.addFlag( "ObjectQuality" , "Medium" )
97  icf.addFlag( "TauType" , "RNN" )
98  icf.addFlag( "TauNprongs" , 1 )
99  icf.addFlag( "TruthProbMin" , 0.5 )
100  # Truth particles selection properties
101  icf.addFlag( "SelectTruthObject" , "" )
102  icf.addFlag( "truthMinPt" , -9999., help="Apply minimum pt cut to truth particle" )
103  icf.addFlag( "truthMaxPt" , -9999., help="Apply maximum pt cut to truth particle" )
104  icf.addFlag( "truthMinEta" , -9999., help="Apply minimum eta cut to truth particle" )
105  icf.addFlag( "truthMaxEta" , -9999., help="Apply maximum eta cut to truth particle" )
106  icf.addFlag( "truthMinPhi" , -9999., help="Apply minimum phi cut to truth particle" )
107  icf.addFlag( "truthMaxPhi" , -9999., help="Apply maximum phi cut to truth particle" )
108  icf.addFlag( "truthMinD0" , -9999., help="Apply minimum d0 cut to truth particle" )
109  icf.addFlag( "truthMaxD0" , -9999., help="Apply maximum d0 cut to truth particle" )
110  icf.addFlag( "truthMinZ0" , -9999., help="Apply minimum z0 cut to truth particle" )
111  icf.addFlag( "truthMaxZ0" , -9999., help="Apply maximum z0 cut to truth particle" )
112  icf.addFlag( "truthMinQoPT" , -9999., help="Apply minimum q/pt cut to truth particle" )
113  icf.addFlag( "truthMaxQoPT" , -9999., help="Apply maximum q/pt cut to truth particle" )
114  icf.addFlag( "truthMinAbsEta" , -9999., help="Apply minimum |eta| cut to truth particle" )
115  icf.addFlag( "truthMaxAbsEta" , -9999., help="Apply maximum |eta| cut to truth particle" )
116  icf.addFlag( "truthMinAbsPhi" , -9999., help="Apply minimum |phi| cut to truth particle" )
117  icf.addFlag( "truthMaxAbsPhi" , -9999., help="Apply maximum |phi| cut to truth particle" )
118  icf.addFlag( "truthMinAbsD0" , -9999., help="Apply minimum |d0| cut to truth particle" )
119  icf.addFlag( "truthMaxAbsD0" , -9999., help="Apply maximum |d0| cut to truth particle" )
120  icf.addFlag( "truthMinAbsZ0" , -9999., help="Apply minimum |z0| cut to truth particle" )
121  icf.addFlag( "truthMaxAbsZ0" , -9999., help="Apply maximum |z0| cut to truth particle" )
122  icf.addFlag( "truthMinAbsQoPT" , -9999., help="Apply minimum |q/pt| cut to truth particle" )
123  icf.addFlag( "truthMaxAbsQoPT" , -9999., help="Apply maximum |q/pt| cut to truth particle" )
124  icf.addFlag( "truthPdgId" , -9999., help="Apply pdgId selection to truth particle" )
125  icf.addFlag( "truthIsHadron", False, help="Select hadrons" )
126  # Histogram properties
127  icf.addFlag( "plotTrackParameters" , True )
128  icf.addFlag( "plotTrackMultiplicities" , True )
129  icf.addFlag( "plotEfficiencies" , True )
130  icf.addFlag( "plotTechnicalEfficiencies", False )
131  icf.addFlag( "plotResolutions" , True )
132  icf.addFlag( "plotFakeRates" , True )
133  icf.addFlag( "unlinkedAsFakes" , True )
134  icf.addFlag( "plotDuplicateRates" , False )
135  icf.addFlag( "plotHitsOnTracks" , True )
136  icf.addFlag( "plotHitsOnTracksReference", False )
137  icf.addFlag( "plotHitsOnMatchedTracks" , False )
138  icf.addFlag( "plotHitsOnFakeTracks" , False )
139  icf.addFlag( "plotOfflineElectrons" , False )
140  icf.addFlag( "ResolutionMethod" , "iterRMS" )
141 
142  return icf
143 
144 
146  flags.addFlagsCategory( "PhysVal.IDTPM",
147  __createIDTPMConfigFlags , prefix=True )
148 
149  flags.addFlag( 'Output.doWriteAOD_IDTPM', False )
150  flags.addFlag( 'Output.AOD_IDTPMFileName', 'myIDTPM_out.AOD_IDTPM.pool.root' )
151  return flags
152 
153 
154 
156  # Set output file names
157  flags.PhysVal.OutputFileName = flags.PhysVal.IDTPM.outputFilePrefix + '.HIST.root'
158  flags.Output.AOD_IDTPMFileName = flags.PhysVal.IDTPM.outputFilePrefix + '.AOD_IDTPM.pool.root'
159 
160  # Default TrackAnalysis configuration flags category
161  flags.addFlagsCategory( "PhysVal.IDTPM.Default",
162  __createIDTPMTrkAnaConfigFlags,
163  prefix=True )
164 
165  from InDetTrackPerfMon.ConfigUtils import getTrkAnaDicts
166  analysesDict = getTrkAnaDicts( flags )
167  trkAnaNames = []
168  print (str(analysesDict))
169 
170  if analysesDict:
171  for trkAnaName, trkAnaDict in analysesDict.items():
172  # Append TrkAnalysisName to list
173  trkAnaNames.append( trkAnaName )
174 
175  # separate flag category for each TrkAnalysis
176  flags.addFlagsCategory( "PhysVal.IDTPM."+trkAnaName,
177  __createIDTPMTrkAnaConfigFlags,
178  prefix=True )
179 
180  # set flags from values in trkAnaDict
181  for fname, fvalue in trkAnaDict.items():
182  if fname.startswith( "_comment" ): continue
183  setattr( flags.PhysVal.IDTPM,
184  trkAnaName+"."+fname, fvalue )
185 
186  if trkAnaNames:
187  flags.PhysVal.IDTPM.trkAnaNames = trkAnaNames
188  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:145
str
Definition: BTagTrackIpAccessor.cxx:11
InDetTrackPerfMonFlags.initializeIDTPMTrkAnaConfigFlags
def initializeIDTPMTrkAnaConfigFlags(flags)
Create flags category and corresponding set of flags.
Definition: InDetTrackPerfMonFlags.py:155