23from argcomplete.completers
import ChoicesCompleter
25from extramodules.choicesCompleterList
import ChoicesCompleterList
26from extramodules.helperOptions
import HelperOptions
27from extramodules.actionHandler
import NoAction
28from extramodules.actionHandler
import ChoicesAction
29from extramodules.converters
import O2Converters
31from commondeps.centralityTable
import CentralityTable
32from commondeps.eventSelection
import EventSelectionTask
33from commondeps.multiplicityTable
import MultiplicityTable
34from commondeps.pidTOFBase
import TofEventTime
35from commondeps.pidTOFBeta
import TofPidBeta
36from commondeps.pidTPCTOFFull
import TpcTofPidFull
37from commondeps.trackPropagation
import TrackPropagation
38from commondeps.trackselection
import TrackSelectionTask
39from commondeps.dplAodReader
import DplAodReader
41from extramodules.dqLibGetter
import DQLibGetter
47 Class for Interface -> tableMakerMC.cxx Task -> Configurable, Process Functions
50 object (parser_args() object): tableMakerMC.cxx Interface
54 self, parserTableMakerMC = argparse.ArgumentParser(
55 formatter_class = argparse.ArgumentDefaultsHelpFormatter,
56 description =
"Example Usage: ./runTableMakerMC.py <yourConfig.json> --arg value",
57 ), eventSelection = EventSelectionTask(), centralityTable = CentralityTable(), multiplicityTable = MultiplicityTable(),
58 tofEventTime = TofEventTime(), tofPidBeta = TofPidBeta(), tpcTofPidFull = TpcTofPidFull(), trackPropagation = TrackPropagation(),
59 trackSelection = TrackSelectionTask(), helperOptions = HelperOptions(), o2Converters = O2Converters(), dplAodReader = DplAodReader()
79 This function allows to add arguments for parser_args() function
83 tableMakerProcessSelections = {
84 "Full":
"Build full DQ skimmed data model, w/o centrality",
85 "FullWithCov":
"Build full DQ skimmed data model, w/ track and fwdtrack covariance tables",
86 "BarrelOnly":
"Build barrel-only DQ skimmed data model, w/o centrality",
87 "BarrelOnlyWithCov":
"Build barrel-only DQ skimmed data model, w/ track cov matrix",
88 "BarrelOnlyWithCent":
"Build barrel-only DQ skimmed data model, w/ centrality",
89 "MuonOnlyWithCov":
"Build muon-only DQ skimmed data model, w/ muon cov matrix",
90 "MuonOnlyWithCent":
"Build muon-only DQ skimmed data model, w/ centrality",
91 "OnlyBCs":
"Analyze the BCs to store sampled lumi",
93 tableMakerProcessSelectionsList = []
94 for k, v
in tableMakerProcessSelections.items():
95 tableMakerProcessSelectionsList.append(k)
97 booleanSelections = [
"true",
"false"]
100 allAnalysisCuts, allMCSignals, allSels, allMixing = DQLibGetter.getAnalysisSelections(self)
103 groupTableMakerConfigs = self.
parserTableMakerMC.add_argument_group(title =
"Data processor options: table-maker-m-c")
104 groupTableMakerConfigs.add_argument(
105 "--cfgEventCuts", help =
"Space separated list of event cuts", nargs =
"*", action =
"store", type = str,
106 metavar =
"CFGEVENTCUTS", choices = allAnalysisCuts,
107 ).completer = ChoicesCompleterList(allAnalysisCuts)
108 groupTableMakerConfigs.add_argument(
109 "--cfgBarrelTrackCuts", help =
" Space separated list of barrel track cuts", nargs =
"*", action =
"store", type = str,
110 metavar =
"CFGBARRELTRACKCUTS", choices = allAnalysisCuts,
111 ).completer = ChoicesCompleterList(allAnalysisCuts)
112 groupTableMakerConfigs.add_argument(
113 "--cfgMuonCuts", help =
"Space separated list of muon cuts in table-maker", action =
"store", nargs =
"*", type = str,
114 metavar =
"CFGMUONCUTS", choices = allAnalysisCuts,
115 ).completer = ChoicesCompleterList(allAnalysisCuts)
116 groupTableMakerConfigs.add_argument(
"--cfgBarrelLowPt", help =
"Low pt cut for tracks in the barrel", action =
"store", type = str)
117 groupTableMakerConfigs.add_argument(
"--cfgMuonLowPt", help =
"Low pt cut for muons", action =
"store", type = str)
118 groupTableMakerConfigs.add_argument(
119 "--cfgNoQA", help =
"If true, no QA histograms", action =
"store", type = str.lower, choices = booleanSelections,
120 ).completer = ChoicesCompleter(booleanSelections)
121 groupTableMakerConfigs.add_argument(
122 "--cfgDetailedQA", help =
"If true, include more QA histograms (BeforeCuts classes and more)", action =
"store",
123 type = str.lower, choices = booleanSelections,
124 ).completer = ChoicesCompleter(booleanSelections)
126 groupTableMakerConfigs.add_argument(
"--cfgMinTpcSignal", help =
"Minimum TPC signal", action =
"store", type = str)
127 groupTableMakerConfigs.add_argument(
"--cfgMaxTpcSignal", help =
"Maximum TPC signal", action =
"store", type = str)
128 groupTableMakerConfigs.add_argument(
129 "--cfgMCsignals", help =
"Space separated list of MC signals", action =
"store", nargs =
"*", type = str,
130 metavar =
"CFGMCSIGNALS", choices = allMCSignals,
131 ).completer = ChoicesCompleterList(allMCSignals)
133 groupProcessTableMaker = self.
parserTableMakerMC.add_argument_group(title =
"Data processor options: table-maker-m-c")
134 groupProcessTableMaker.add_argument(
135 "--process", help =
"Process Selection options for tableMaker/tableMakerMC Data Processing and Skimming", action =
"store",
136 type = str, nargs =
"*", metavar =
"PROCESS", choices = tableMakerProcessSelectionsList,
137 ).completer = ChoicesCompleterList(tableMakerProcessSelectionsList)
138 for key, value
in tableMakerProcessSelections.items():
139 groupProcessTableMaker.add_argument(key, help = value, action =
"none")
142 groupCoreSelections = self.
parserTableMakerMC.add_argument_group(title =
"Core configurations that must be configured")
143 groupCoreSelections.add_argument(
"-runMC", help =
"Run over MC", action =
"store_true", default =
True)
147 This function allows to save the obtained arguments to the parser_args() function
150 Namespace: returns parse_args()
157 This function allows to merge parser_args argument information from different classes
def __init__(self, parserTableMakerMC=argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description="Example Usage: ./runTableMakerMC.py <yourConfig.json> --arg value",), eventSelection=EventSelectionTask(), centralityTable=CentralityTable(), multiplicityTable=MultiplicityTable(), tofEventTime=TofEventTime(), tofPidBeta=TofPidBeta(), tpcTofPidFull=TpcTofPidFull(), trackPropagation=TrackPropagation(), trackSelection=TrackSelectionTask(), helperOptions=HelperOptions(), o2Converters=O2Converters(), dplAodReader=DplAodReader())