O2-DQ User Interface 1.0.0
Loading...
Searching...
No Matches
DQEfficiency Class Reference
Inheritance diagram for DQEfficiency:

Public Member Functions

def __init__ (self, parserDQEfficiency=argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description="Example Usage: ./runDQEfficiency.py <yourConfig.json> --arg value "), helperOptions=HelperOptions(), dplAodReader=DplAodReader())
 
def addArguments (self)
 
def mergeArgs (self)
 
def parseArgs (self)
 

Public Attributes

 dplAodReader
 
 helperOptions
 
 parserDQEfficiency
 

Detailed Description

Class for Interface -> dqEfficiency.cxx Task -> Configurable, Process Functions

Args:
    object (parser_args object): dqEfficiency.cxx Interface

Definition at line 38 of file dqEfficiency.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  parserDQEfficiency = argparse.ArgumentParser(             formatter_class = argparse.ArgumentDefaultsHelpFormatter,             description = "Example Usage: ./runDQEfficiency.py <yourConfig.json> --arg value "             ),
  helperOptions = HelperOptions(),
  dplAodReader = DplAodReader() 
)

Definition at line 47 of file dqEfficiency.py.

52 ):
53 super(DQEfficiency, self).__init__()
54 self.parserDQEfficiency = parserDQEfficiency
55 self.dplAodReader = dplAodReader
56 self.helperOptions = helperOptions
57 self.parserDQEfficiency.register("action", "none", NoAction)
58 self.parserDQEfficiency.register("action", "store_choice", ChoicesAction)
59

Member Function Documentation

◆ addArguments()

def addArguments (   self)
This function allows to add arguments for parser_args() function

Definition at line 60 of file dqEfficiency.py.

60 def addArguments(self):
61 """
62 This function allows to add arguments for parser_args() function
63 """
64
65 # Predefined Selections
66
67 readerPath = "configs/readerConfiguration_reducedEventMC.json"
68 writerPath = "configs/writerConfiguration_dileptonMC.json"
69
70 analysisSelections = {
71 "eventSelection": "Run event selection on DQ skimmed events",
72 "muonSelection": "Run muon selection on DQ skimmed muons",
73 "trackSelection": "Run barrel track selection on DQ skimmed tracks",
74 "sameEventPairing": "Run same event pairing selection on DQ skimmed data",
75 "dileptonTrackDimuonMuonSelection": "Run dimuon-muon pairing, using skimmed data",
76 "dileptonTrackDielectronKaonSelection": "Run dielectron-kaon pairing, using skimmed data",
77 }
78 analysisSelectionsList = []
79 for k, v in analysisSelections.items():
80 analysisSelectionsList.append(k)
81
82 sameEventPairingProcessSelections = {
83 "JpsiToEE": "Run electron-electron pairing, with skimmed tracks",
84 "JpsiToMuMu": "Run muon-muon pairing, with skimmed muons",
85 "JpsiToMuMuVertexing": "Run muon-muon pairing and vertexing, with skimmed muons",
86 }
87 sameEventPairingProcessSelectionsList = []
88 for k, v in sameEventPairingProcessSelections.items():
89 sameEventPairingProcessSelectionsList.append(k)
90
91 booleanSelections = ["true", "false"]
92
93 # init for get DQ libraries
94 allAnalysisCuts, allMCSignals, allSels, allMixing = DQLibGetter.getAnalysisSelections(self)
95
96 # Interface
97
98 # analysis task selections
99 groupAnalysisSelections = self.parserDQEfficiency.add_argument_group(
100 title = "Data processor options: analysis-event-selection, analysis-muon-selection, analysis-track-selection, analysis-dilepton-track"
101 )
102 groupAnalysisSelections.add_argument(
103 "--analysis", help = "Skimmed process selections for MC Analysis", action = "store", nargs = "*", type = str,
104 metavar = "ANALYSIS", choices = analysisSelectionsList,
105 ).completer = ChoicesCompleterList(analysisSelectionsList)
106
107 for key, value in analysisSelections.items():
108 groupAnalysisSelections.add_argument(key, help = value, action = "none")
109
110 # same event pairing process function selection
111 groupProcessSEPSelections = self.parserDQEfficiency.add_argument_group(
112 title = "Data processor options: analysis-same-event-pairing"
113 )
114 groupProcessSEPSelections.add_argument(
115 "--process", help = "Skimmed process selections for analysis-same-event-pairing task", action = "store", nargs = "*",
116 type = str, metavar = "PROCESS", choices = sameEventPairingProcessSelectionsList,
117 ).completer = ChoicesCompleterList(sameEventPairingProcessSelectionsList)
118 groupProcessSEPSelections.add_argument(
119 "--cfgBarrelMCRecSignals", help = "Space separated list of MC signals (reconstructed)", nargs = "*", action = "store",
120 type = str, metavar = "CFGBARRELMCRECSIGNALS", choices = allMCSignals,
121 ).completer = ChoicesCompleterList(allMCSignals)
122 groupProcessSEPSelections.add_argument(
123 "--cfgBarrelMCGenSignals", help = "Space separated list of MC signals (generated)", nargs = "*", action = "store", type = str,
124 metavar = "CFGBARRELMCGENSIGNALS", choices = allMCSignals,
125 ).completer = ChoicesCompleterList(allMCSignals)
126 groupProcessSEPSelections.add_argument(
127 "--cfgFlatTables", help = "Produce a single flat tables with all relevant information of the pairs and single tracks",
128 action = "store", type = str.lower, choices = booleanSelections,
129 ).completer = ChoicesCompleter(booleanSelections)
130 groupProcess = self.parserDQEfficiency.add_argument_group(
131 title = "Choice List for analysis-same-event-pairing task Process options"
132 )
133
134 for key, value in sameEventPairingProcessSelections.items():
135 groupProcess.add_argument(key, help = value, action = "none")
136
137 # cfg for QA
138 groupQASelections = self.parserDQEfficiency.add_argument_group(
139 title = "Data processor options: analysis-event-selection, analysis-muon-selection, analysis-track-selection, analysis-event-mixing, analysis-dilepton-hadron"
140 )
141 groupQASelections.add_argument(
142 "--cfgQA", help = "If true, fill QA histograms", action = "store", type = str.lower, choices = (booleanSelections),
143 ).completer = ChoicesCompleter(booleanSelections)
144
145 # analysis-event-selection
146 groupAnalysisEventSelection = self.parserDQEfficiency.add_argument_group(title = "Data processor options: analysis-event-selection")
147 groupAnalysisEventSelection.add_argument(
148 "--cfgEventCuts", help = "Space separated list of event cuts", nargs = "*", action = "store", type = str,
149 metavar = "CFGEVENTCUTS", choices = allAnalysisCuts,
150 ).completer = ChoicesCompleterList(allAnalysisCuts)
151
152 # analysis-track-selection
153 groupAnalysisTrackSelection = self.parserDQEfficiency.add_argument_group(title = "Data processor options: analysis-track-selection")
154 groupAnalysisTrackSelection.add_argument(
155 "--cfgTrackCuts", help = "Space separated list of barrel track cuts", nargs = "*", action = "store", type = str,
156 metavar = "CFGTRACKCUTS", choices = allAnalysisCuts,
157 ).completer = ChoicesCompleterList(allAnalysisCuts)
158 groupAnalysisTrackSelection.add_argument(
159 "--cfgTrackMCSignals", help = "Space separated list of MC signals", nargs = "*", action = "store", type = str,
160 metavar = "CFGTRACKMCSIGNALS", choices = allMCSignals,
161 ).completer = ChoicesCompleterList(allMCSignals)
162
163 # analysis-muon-selection
164 groupAnalysisMuonSelection = self.parserDQEfficiency.add_argument_group(title = "Data processor options: analysis-muon-selection")
165 groupAnalysisMuonSelection.add_argument(
166 "--cfgMuonCuts", help = "Space separated list of muon cuts", nargs = "*", action = "store", type = str, metavar = "CFGMUONCUTS",
167 choices = allAnalysisCuts,
168 ).completer = ChoicesCompleterList(allAnalysisCuts)
169 groupAnalysisMuonSelection.add_argument(
170 "--cfgMuonMCSignals", help = "Space separated list of MC signals", nargs = "*", action = "store", type = str,
171 metavar = "CFGMUONMCSIGNALS", choices = allMCSignals,
172 ).completer = ChoicesCompleterList(allMCSignals)
173
174 # analysis-dilepton-track
175 groupAnalysisDileptonTrack = self.parserDQEfficiency.add_argument_group(title = "Data processor options: analysis-dilepton-track")
176 groupAnalysisDileptonTrack.add_argument(
177 "--cfgLeptonCuts", help = "Space separated list of barrel track cuts", nargs = "*", action = "store", type = str,
178 metavar = "CFGLEPTONCUTS", choices = allAnalysisCuts,
179 ).completer = ChoicesCompleterList(allAnalysisCuts)
180 groupAnalysisDileptonTrack.add_argument(
181 "--cfgFillCandidateTable", help = "Produce a single flat tables with all relevant information dilepton-track candidates",
182 action = "store", type = str.lower, choices = booleanSelections,
183 ).completer = ChoicesCompleter(booleanSelections)
184 groupAnalysisDileptonTrack.add_argument(
185 "--cfgBarrelDileptonMCRecSignals", help = "Space separated list of MC signals (reconstructed)", nargs = "*", action = "store",
186 type = str, metavar = "CFGBARRELDILEPTONMCRECSIGNALS", choices = allMCSignals,
187 ).completer = ChoicesCompleterList(allMCSignals)
188 groupAnalysisDileptonTrack.add_argument(
189 "--cfgBarrelDileptonMCGenSignals", help = "Space separated list of MC signals (generated)", nargs = "*", action = "store",
190 type = str, metavar = "CFGBARRELDILEPTONMCRECSIGNALS", choices = allMCSignals,
191 ).completer = ChoicesCompleterList(allMCSignals)
192
193 # Aod Writer - Reader configs
194 groupDPLReader = self.parserDQEfficiency.add_argument_group(
195 title = "Data processor options: internal-dpl-aod-reader, internal-dpl-aod-writer"
196 )
197 groupDPLReader.add_argument(
198 "--reader",
199 help = "Reader config JSON with path. For Standart Analysis use as default, for dilepton analysis change to dilepton JSON config file",
200 action = "store", default = readerPath, type = str
201 )
202 groupDPLReader.add_argument(
203 "--writer", help = "Argument for producing dileptonAOD.root. Set false for disable", action = "store", default = writerPath,
204 type = str
205 )
206

◆ mergeArgs()

def mergeArgs (   self)
This function allows to merge parser_args argument information from different classes

Definition at line 218 of file dqEfficiency.py.

218 def mergeArgs(self):
219 """
220 This function allows to merge parser_args argument information from different classes
221 """
222
223 self.helperOptions.parserHelperOptions = self.parserDQEfficiency
224 self.helperOptions.addArguments()
225
226 self.dplAodReader.parserDplAodReader = self.parserDQEfficiency
227 self.dplAodReader.addArguments()
228
229 self.addArguments()

◆ parseArgs()

def parseArgs (   self)
This function allows to save the obtained arguments to the parser_args() function

Returns:
    Namespace: returns parse_args()

Definition at line 207 of file dqEfficiency.py.

207 def parseArgs(self):
208 """
209 This function allows to save the obtained arguments to the parser_args() function
210
211 Returns:
212 Namespace: returns parse_args()
213 """
214
215 argcomplete.autocomplete(self.parserDQEfficiency, always_complete_options = False)
216 return self.parserDQEfficiency.parse_args()
217

Member Data Documentation

◆ dplAodReader

dplAodReader

Definition at line 55 of file dqEfficiency.py.

◆ helperOptions

helperOptions

Definition at line 56 of file dqEfficiency.py.

◆ parserDQEfficiency

parserDQEfficiency

Definition at line 54 of file dqEfficiency.py.


The documentation for this class was generated from the following file: