ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
top::ConfigurationSettings Class Reference

Hold the configuration information for the whole run. More...

#include <ConfigurationSettings.h>

Collaboration diagram for top::ConfigurationSettings:

Public Member Functions

const std::string & value (const std::string &key) const
 The user wants to know the value for the specified key. More...
 
void retrieve (std::string const &key, bool &value) const
 The user wants to know the boolean value for the specified key. More...
 
bool retrieve (std::string const &key) const
 same as above, but directly returning the boolean More...
 
bool configured () const
 Have the configuration settings been read from a file? More...
 
void loadFromFile (const std::string &filename)
 Read the settings from a text file given by. More...
 
void checkSettings ()
 Validate that configured options make sense. More...
 
const std::map< std::string, StringData > & stringData () const
 All the user input that is stored as strings. More...
 
const std::vector< SelectionConfigurationDataselections () const
 Get all the data needed to configure the selections. More...
 
void registerParameter (const std::string &name, const std::string &message, const std::string &default_val="", const std::vector< std::string > allowed_values={})
 Add a variable to the configuration settings. More...
 
bool feature (std::string const &name) const
 test whether an (experimental) feature should be enabled More...
 

Static Public Member Functions

static ConfigurationSettingsget (bool reset=false)
 Design patterns 101. More...
 

Private Member Functions

 ConfigurationSettings ()
 private constructor More...
 
 ConfigurationSettings (const ConfigurationSettings &)
 Here but not implemented, resulting in a happy compile error if you try and use them. More...
 
ConfigurationSettings operator= (const ConfigurationSettings &)
 Here but not implemented, resulting in a happy compile error if you try and use them. More...
 

Private Attributes

bool m_configured
 True if the class has read the settings from a file or something. More...
 
std::map< std::string, StringDatastrings_
 Hold the configuration data. More...
 
std::vector< SelectionConfigurationDatam_selections
 Data used when configuring the selections. More...
 
std::vector< std::string > m_killedFeatures
 Kill-switch for experimental features. More...
 

Static Private Attributes

static ConfigurationSettingsm_instance = 0
 Singletons: Good or bad, you decide. // John says they are bad. More...
 

Detailed Description

Hold the configuration information for the whole run.

A singleton, so only one of these exists. It needs populating with a call to loadFromFile early on. Otherwise it'll be full of rubbish and will refuse to run properly

Definition at line 21 of file ConfigurationSettings.h.

Constructor & Destructor Documentation

◆ ConfigurationSettings() [1/2]

top::ConfigurationSettings::ConfigurationSettings ( )
private

private constructor

Definition at line 24 of file ConfigurationSettings.cxx.

24  : m_configured(false) {
25  setMsgLevel(MSG::Level::INFO);
26  registerParameter("ElectronCollectionName", "Name of the Electron container");
27  registerParameter("FwdElectronCollectionName", "Name of the Forward Electrons container, ForwardElectrons or None (default)", "None");
28  registerParameter("MuonCollectionName", "Name of the Muon container");
29  registerParameter("PhotonCollectionName", "Name of the Photon container");
30  registerParameter("JetCollectionName", "Name of the Jet container");
31  registerParameter("LargeJetCollectionName", "Name of the large-R Jet container");
32  registerParameter("LargeJetSubstructure", "Setup to use when applying grooming on the large-R jet", "None");
33  registerParameter("TrackJetCollectionName", "Name of the track Jet container", "None");
34  registerParameter("TrackCollectionName", "Name of the track container", "None");
35  registerParameter("TauCollectionName", "Name of the Tau container");
36  registerParameter("JetGhostTrackDecoName", "Name of the jet decoration that holds the ghost-associated track.", "None");
37 
38  registerParameter("TruthCollectionName", "Name of the Truth container");
39  registerParameter("TruthElectronCollectionName", "Name of the Truth Electron container", "TruthElectrons");
40  registerParameter("TruthMuonCollectionName", "Name of the Truth Muon container", "TruthMuons");
41  registerParameter("TruthPhotonCollectionName", "Name of the Truth Photon container", "None");
42  registerParameter("TruthMETCollectionName", "Name of the Truth MET container", "MET_Truth");
43  registerParameter("TruthJetCollectionName", "Name of the Truth Jet container");
44  registerParameter("TruthLargeRJetCollectionName", "Name of the Truth Large R Jet container", "None");
45  registerParameter("TruthTauCollectionName", "Name of the Truth tau container", "None");
46 
47  registerParameter("applyTTVACut", "Decide if to apply lepton z0/d0 cuts", "True");
48 
49  registerParameter("GRLDir", "Location of GRL File", "TopAnalysis");
50  registerParameter("GRLFile", "Name of GRL File", " ");
51 
52  registerParameter("TDPPath", "Path to TopDataPreparation file (accessible via PathResolver)",
53  "dev/AnalysisTop/TopDataPreparation/XSection-MC16-13TeV.data");
54 
55  registerParameter("DumpBtagSystsInSystTrees",
56  "Dump systematics-shifted b-tagging SFs in systematic TTrees, True or False (default: False)",
57  "False");
58  registerParameter("StorePerJetBtagSFs", "Store per-jet btag SFs", "False");
59 
60  registerParameter("ElectronID", "Type of electron. Likelihood LooseAndBLayerLH, MediumLH, TightLH", "TightLH");
61  registerParameter("ElectronIDLoose",
62  "Type of electron for background. Likelihood LooseAndBLayerLH, MediumLH, TightLH", "MediumLH");
63  registerParameter("ElectronPt", "Electron pT cut for object selection (in MeV). Default 25 GeV.", "25000.");
64  registerParameter("Electrond0Sig", "Electron d0 significance cut for object selection. Default 5", "5.");
65  registerParameter("Electrondeltaz0", "Electron delta z0 cut for object selection. Default 0.5 mm", "0.5");
66  registerParameter("ElectronIDSFFilePath", "EXPERIMENTAL! Path to a root file containing custom electron ID SFs, e.g. "
67  "dev/ElectronEfficiencyCorrection/2015_2018/rel21.2/Precision_Summer2020_v1/offline/efficiencySF.offline.TightLLH_d0z0_v13.root."
68  "This should only be used by experts for testing SFs! Default: Using the most recent recommended map.", "Default");
69  registerParameter("ElectronIDSFFilePathLoose", "EXPERIMENTAL! Path to a root file containing custom electron ID SFs, e.g. dev/ElectronEfficiencyCorrection/2015_2018/rel21.2/Precision_Summer2020_v1/offline/efficiencySF.offline.TightLLH_d0z0_v13.root."
70  "This should only be used by experts for testing SFs! Default: Using the most recent recommended map.", "Default");
71  registerParameter("EgammaSystematicModel", "Egamma Calibration Systematic model : FULL_v1 , 1NP_v1 (default)",
72  "1NP_v1");
73  registerParameter("ElectronEfficiencySystematicModelNToys",
74  "Electron Efficiency Toy Systematics Number of Toys: ","40");
75  registerParameter("ElectronEfficiencySystematicModelToySeed",
76  "Electron Efficiency Toy Systematics Seed of Toys: ","12345");
77  registerParameter("ElectronEfficiencySystematicModel",
78  "Electron Efficiency Systematic model : FULL, SIMPLIFIED, TOTAL (default), COMBMCTOYS", "TOTAL");
79  registerParameter("ElectronEfficiencySystematicModelEtaBinning",
80  "Electron Efficiency Systematic model eta binning (option for SIMPLIFIED model, do not specify to use default; format XXX:YYY:ZZZ, e.g. 0.0:1.37:4.9)",
81  "default");
82  registerParameter("ElectronEfficiencySystematicModelEtBinning",
83  "Electron Efficiency Systematic model E_T binning (option for SIMPLIFIED model, do not specify to use default; format XXX:YYY:ZZZ. e.g. 4000:7000:10000:15000:13000000)",
84  "default");
85  registerParameter("ElectronIsolationWPs",
86  "Space-separated list of electron isolation WPs for which to store decisions as auxdecor<char> AnalysisTop_Isol_nameOfWorkingPoint.",
87  " ");
88  registerParameter("ElectronIsolation", "Which isolation working point for electron selection", "FCTight");
89  registerParameter("ElectronIsolationLoose", "Which isolation working point for electron selection", "None");
90  registerParameter("ElectronIsolationSF", "Force electron isolation SF to specific WP (e.g. None).", " ");
91  registerParameter("ElectronIsolationSFLoose", "Force electron isolation SF to specific WP (e.g. None).", " ");
92  registerParameter("ElectronVetoLArCrack", "True/False. Set to False to disable LAr crack veto (not recommended).",
93  "True");
94  registerParameter("UseElectronChargeIDSelection",
95  "True/False. Switch on/off electron charge ID selection (Default False).", "False");
96  registerParameter("UseEgammaLeakageCorrection",
97  "True/False. Switch on/off leakage correction -- REQUIRES ptag>p3947 (Default True).", "True");
98  registerParameter("EnablePromptLeptonImprovedVetoStudies",
99  "True/False. Adds the (many!) variables necessary to validate the PromptLeptonImprovedVeto electron+muon isolation -- TEMPORARY, for studies only (Default False).", "False");
100  registerParameter("ElectronTriggerEfficiencyConfig",
101  "Electron trigger efficiency SF configuration. REQUIRED!",
102  " ");
103 
104  registerParameter("FwdElectronID", "Type of fwd electron. Loose, Medium, Tight (default)", "Tight");
105  registerParameter("FwdElectronIDLoose", "Type of fwd loose electrons. Loose, Medium, Tight (default)", "Tight");
106  registerParameter("FwdElectronPt", "Fwd Electron pT cut for object selection (in MeV). Default 25 GeV.", "25000.");
107  registerParameter("FwdElectronMinEta", "Fwd Electron lower |eta| cut for object selection. Default 2.5", "2.5");
108  registerParameter("FwdElectronMaxEta", "Fwd Electron upper |eta| cut for object selection. Default 4.9", "4.9");
109  registerParameter("FwdElectronBCIDCleaningRunRange",
110  "Specify run range for which the BCID cleaning must be applied for fwd el. in data: \"XXX:YYY\"; the cleaning will be applied for XXX<=runNumber<=YYY",
111  "266904:311481");
112 
113 
114  registerParameter("PhotonPt", "Photon pT cut for object selection (in MeV). Default 25 GeV.", "25000.");
115  registerParameter("PhotonEta", "Absolute Photon eta cut for object selection. Default 2.5.", "2.5");
116  registerParameter("PhotonID", "Type of photon. Definition to use : Tight, Loose and None.", "Tight");
117  registerParameter("PhotonIDLoose", "Type of photon for background. Definition to use : Tight, Loose, None.",
118  "Loose");
119  registerParameter("PhotonIsolation", "Which isolation working point for photon selection", "FixedCutTight");
120  registerParameter("PhotonIsolationLoose", "Which isolation working point for photon selection", "FixedCutLoose");
121  registerParameter("PhotonIsolationWPs",
122  "Space-separated list of photon isolation WPs for which to store decisions as auxdecor<char> AnalysisTop_Isol_nameOfWorkingPoint.",
123  " ");
124 
125  registerParameter("MuonPt", "Muon pT cut for object selection (in MeV). Default 25 GeV.", "25000");
126  registerParameter("MuonEta", "Absolute Muon eta cut for object selection. Default 2.5.", "2.5");
127  registerParameter("Muond0Sig", "Muon d0 significance cut for object selection. Default 3", "3.");
128  registerParameter("Muondeltaz0", "Muon delta z0 cut for object selection. Default 0.5 mm", "0.5");
129  registerParameter("MuonQuality",
130  "Muon quality cut for object selection. Options are VeryLoose, Loose, Medium (default) and Tight",
131  "Medium");
132  registerParameter("MuonQualityLoose",
133  "Muon quality cut for object selection. Options are VeryLoose, Loose, Medium (default) and Tight",
134  "Medium");
135  registerParameter("MuonUseMVALowPt",
136  "Turn on MVA for low-pT muons (only for LowPt WP). Optimized to improve efficiency and hadron rejection. - Default: False",
137  "False");
138  registerParameter("MuonUse2stationHighPt",
139  "Allows muon reconstruction using 2-station muons with missing inner MS station for |eta|<1.3 - Default: True (only for HighPt)",
140  "True");
141  registerParameter("MuonUseMVALowPtLoose",
142  "Turn on MVA for low-pT muons (only for LowPt WP) for Loose tree. Optimized to improve efficiency and hadron rejection. - Default: False",
143  "False");
144  registerParameter("MuonUse2stationHighPtLoose",
145  "Allows muon reconstruction using 2-station muons with missing inner MS station for |eta|<1.3 for Loose tree - Default: True (only for HighPt)",
146  "True");
147  registerParameter("MuonIsolationWPs",
148  "Space-separated list of muon isolation WPs for which to store decisions as auxdecor<char> AnalysisTop_Isol_nameOfWorkingPoint.",
149  " ");
150  registerParameter("MuonIsolation", "Which isolation working point for muon selection", "PflowTight_FixedRad");
151  registerParameter("MuonIsolationLoose", "Which isolation working point for loose muon selection", "PflowTight_FixedRad");
152  registerParameter("MuonIsolationSF", "Force muon isolation SF to specific WP (e.g. None).", " ");
153  registerParameter("MuonIsolationSFLoose", "Force loose muon isolation SF to specific WP (e.g. None).", " ");
154  registerParameter("MuonDoSmearing2stationHighPt", "True/False, to turn on/off spacial corrections for 2-station muons reconstruction with missing inner MS station allowed for abs(eta)<1.3, only with MuonQuality HighPt. - Default: True", "True");
155  registerParameter("MuonDoExtraSmearingHighPt", "True/False, To be used by analyses using willing to check their sensitivity to momentum resolution effects at large muon momenta and in case move to the HighPt WP - Default: false", "false");
156  registerParameter("MuonCalibrationMode", "Calibration method for muon momentum.", "correctData_CB", {"correctData_CB", "correctData_IDMS", "notCorrectData_IDMS"});
157  registerParameter("MuonSmearingSystematicModel", "Systematic scheme for momentum scale and resolution.", "Corr_Scale", {"Corr_Scale", "Decorr_Scale"});
158  registerParameter("UseAntiMuons", "Use AntiMuons for fake estimate. Default: false", "false");
159  registerParameter("UseSoftMuons", "True to use soft muons, False (default) otherwise", "False");
160  registerParameter("SoftMuonPt", "Soft Muon pT cut for object selection (in MeV). Default 4 GeV.", "4000");
161  registerParameter("SoftMuonEta", "Absolute Soft Muon eta cut for object selection. Default 2.5.", "2.5");
162  registerParameter("SoftMuonQuality",
163  "Soft Muon quality cut for object selection. Options are Loose, Medium, Tight (default), LowPt",
164  "Tight");
165  registerParameter("SoftMuonUseMVALowPt",
166  "Turn on MVA for low-pT soft muons (only for LowPt WP). Optimized to improve efficiency and hadron rejection. - Default: False",
167  "False");
168  registerParameter("SoftMuonDRJet",
169  "Soft Muon maximum dR wrt nearest selected jet. Can be set to 999. to keep all soft muons. Default 0.4",
170  "0.4");
171  registerParameter("SoftMuonDRJetUseRapidity",
172  "How to calculate DR(soft muon,jet) for the SoftMuonDRJet cut: True -> use rapidity; False -> use pseudorapidity. Default False",
173  "False");
174  registerParameter("SoftMuonAdditionalTruthInfo",
175  "Experimental: store additional truth information on soft muons particle-level origin: True or False (default)",
176  "False");
177  registerParameter("SoftMuonAdditionalTruthInfoCheckPartonOrigin",
178  "Experimental: store additional truth information on soft muons parton-level origin; requires SoftMuonAdditionalTruthInfo to be true; automatically disabled if PS!=pythia8 and PS!=herwigpp : True or False (default)",
179  "False");
180  registerParameter("SoftMuonAdditionalTruthInfoDoVerbose",
181  "Debug output for soft muon additional truth-level information: True or False (default)",
182  "False");
183 
184  registerParameter("MuonSFCustomInputFolder",
185  "EXPERT OPTION! Tells the MuonEfficiencyScaleFactors tools to use a custom input folder path. If set to \" \" will use the default",
186  " ");
187  registerParameter("MuonSFCustomInputFolderTrigger",
188  "EXPERT OPTION! Tells the MuonEfficiencyScaleFactors trigger tools to use a custom input folder path. If set to \" \" will use the default",
189  " ");
190  registerParameter("MuonForceYear",
191  "EXPERT OPTION! Tells the MuonEfficiencyScaleFactors tools to use a custom Year. If set to -1 will use the default",
192  "-1");
193  registerParameter("MuonForcePeriod",
194  "EXPERT OPTION! Tells the MuonEfficiencyScaleFactors tools to use a custom Period. If set to \" \" will use the default",
195  " ");
196  registerParameter("MuonForceTrigger",
197  "EXPERT OPTION! Tells the MuonEfficiencyScaleFactors tools to use a custom Trigger. If set to \" \" will use the default",
198  " ");
199  registerParameter("MuonBreakDownSystematics",
200  "Tells the MuonEfficiencyScaleFactors tools to use a more complex systematic model, if set to True. Default is False",
201  "False", {"True", "False"});
202 
203  registerParameter("JetPt", "Jet pT cut for object selection (in MeV). Default 25 GeV.", "25000.");
204  registerParameter("JetEta", "Absolute Jet eta cut for object selection. Default 2.5.", "2.5");
205 
206  registerParameter("JVTinMETCalculation",
207  "Perfom a JVT cut on the jets in the MET recalculation? True (default) or False.", "True");
208  registerParameter("SaveFailJVTJets", "Save the jets that failed the JVT cut? False (default) or True.", "False");
209  registerParameter("JVTWP", "Set JVT WP, default is set to \'Default\' (FixedEffPt for PFlow NNJvt, Tight for PFlow Jvt, and Medium for Topo Jvt).",
210  "Default");
211  registerParameter("ForwardJVTWP", "Set fJVT Working Point for selecting forward jets (|eta|>2.5 & 20GeV<pT<60GeV)"
212  "\'None\': No fJVT (doesn't run tool for selection) - use this if you don't have forward jets in your selection or if using using PFlow jets with a derivation older than p4173, \'Tight\' (fJVT<0.4, recommended), \'Medium\': (fJVT<0.5, if combined with ForwardJVTinMETCalculation this will set MET WP to Tenacious with stricter JVTinMET requirements",
213  "None");
214  registerParameter("ForwardJVTinMETCalculation",
215  "Use fJVT cut on forward jets to improve resolution in the MET recalculation? \'False\' (default - must set false if using pflow jets with derivations older than P4173), or \'True\'", "False");
216  registerParameter("SaveFailForwardJVTJets", "Save the jets that failed the fJVT cut? \'False\' (default), or \'True\'", "False");
217  registerParameter("AdvancedUsage_METUncertaintiesConfigDir", "Path to directory containing MET uncertainties configs (including trailing /) \'Latest\' (default), or previous \'METUtilities/data17_13TeV/prerec_Jan16/\'", "Latest");
218  registerParameter("METSignificance",
219  "Setting that provide option to turn on/off METSignificance",
220  "False", {"True", "False"});
221  registerParameter("METSignificanceSoftTermParam",
222  "String that sets the type of resolutions that are used for the soft term, Random(met::Random), PthardParam(met::PthardParam), TSTParam(met::TSTParam)",
223  "Random", {"Random", "PthardParam", "TSTParam"});
224  registerParameter("METJetSelectionWP",
225  "Set JetSelection WP to use within MetMaker with NNJvt, by default \'Tight\' is used.",
226  "Tight", {"Loose", "Tight", "Tighter"});
227  registerParameter("JetPtGhostTracks",
228  "Jet pT threshold for ghost track systematic variations calculation (in MeV). Default 25 GeV.",
229  "25000.");
230  registerParameter("JetEtaGhostTracks",
231  "Jet eta threshold for ghost track systematic variations calculation. Default 2.5",
232  "2.5");
233  registerParameter("GhostTrackspT",
234  "PT of the ghost tracks associated small-R jets (in MeV). Default 500 MeV.",
235  "500.");
236  registerParameter("GhostTracksVertexAssociation",
237  "WP of the ghost track vertex association. Option: none, nominal and tight. Default nominal.","nominal");
238  registerParameter("GhostTracksQuality",
239  "WP of the ghost track quality. Option: TightPrimary, LoosePrimary. Loose, NoCut. Default TightPrimary.","TightPrimary");
240  registerParameter("JetUncertainties_NPModel",
241  "Model used for JetUncertainties. Possible choices:"
242  " \"AllNuisanceParameters\", \"CategoryReduction\" (default and only option for R22 pre-recs),"
243  " \"GlobalReduction\", \"StrongReduction\","
244  " \"SR_Scenario1\" (ONLY to be used for FTAG calibrations!),"
245  " or other specific StrongReduction scenarios.",
246  "CategoryReduction");
247  registerParameter("JetUncertainties_QGFracFile", "To specify a root file with quark/gluon fractions,"
248  " in order to reduce FlavourComposition and response uncertainties."
249  " Default: None (i.e. no file is used and default flat 50+/-50% fraction is used).",
250  "None");
251  registerParameter("JetUncertainties_QGHistPatterns", "To specify a pattern for the name of the quark/gluon fractions histograms, or a list of DSIDs which will have their specific histogram."
252  " Two syntaxes are possible, either a single string or a list of DSIDs separated by commas:"
253  " \"MyQGHisto\" (the histograms with \"MyQGHisto\" in their names will be used for all DSIDs),"
254  " \"410470,410472,345873,345874,345875\" (for the listed DSIDs, histograms with the processed DSID will be used, while the flat 50+/-50% fraction will be used for the other DSIDs)."
255  " Default: None (i.e. no specific pattern is looked for in the name of the provided histograms).",
256  "None");
257  registerParameter("JetJERSmearingModel",
258  "JER smearing model to use. Possible choices (\"Full\" is the only R22 pre-rec option):"
259  " \"All\" (inc. data smearing), \"All_PseudoData\" (use MC as pseudo-data),"
260  " \"Full\" (inc. data smearing), \"Full_PseudoData\" (use MC as pseudo-data - default),"
261  " or \"Simple\" (MC only).",
262  "Full_PseudoData", {"All", "All_PseudoData", "Full", "Full_PseudoData", "Simple"});
263  registerParameter("JetJMSOption",
264  "None (default),"
265  " JMS_frozen (The shape and magnitude of the uncertainties at m/pT = 0.25 are also used for m/pT > 0.25),"
266  " JMS_scaled (The magnitude of the uncertainties at m/pT = 0.25 was scaled linearly with increasing m/pT).",
267  "None");
268  registerParameter("DoLargeRPseudodataJER",
269  "If set to True, produce additional JER smearing systematics treating MC as pseudo-data, provided FullJER or AllJER is specified with LargeRJetUncertainties_JESJERJMS_NPModel.",
270  "True",{"True", "False"});
271  registerParameter("JetCalibSequence", "Jet calibaration sequence.", "GSC", {"GSC", "JMS"});
272  registerParameter("AllowJMSforAFII", "Enable use of UNSUPPORTED small-R jet JMS calibration use on AFII samples.", "False", {"True", "False"});
273  registerParameter("StoreJetTruthLabels", "Flag to store truth labels for jets - True (default) or False", "True");
274 
275  registerParameter("JSF", "Used for top mass analysis, default is 1.0", "1.0");
276  registerParameter("bJSF", "Used for top mass analysis, default is 1.0", "1.0");
277 
278  registerParameter("LargeRJetPt", "LargeRJet pT cut for object selection (in MeV). Default 150 GeV.", "150000.");
279  registerParameter("LargeRJetMass", "LargeRJet min. mass cut for object selection (in MeV).", "0");
280  registerParameter("LargeRJetEta", "Absolute large-R jet eta cut for object selection. Default 2.0.", "2.0");
281  registerParameter("LargeRJetSubstructureVariables",
282  "List of substructure variables stored in the output separated by commas. By default no variable is added to output.",
283  " ");
284  registerParameter("LargeRJetUncertainties_JESJERJMS_NPModel",
285  "Input form: {A}JES_{B}JER_{C}JMS, see https://twiki.cern.ch/twiki/bin/view/AtlasProtected/JetUncertaintiesRel21ConsolidatedLargeRScaleRes for configuration options, - for LCTopo large-R jet energy scale, energy resolution, and mass scale uncertainties",
286  "CategoryJES_FullJER_FullJMS");
287  registerParameter("LargeRJetUncertainties_JMR_NPModel",
288  "FullJMR_COMB_newBinning (10 NP; aimed at the most precise jet-dependent measurements), SimpleJMR_COMB_newBinning (1 NP; flat 20 percent uncertainty, as it was recommended in the past) - for LCTopo large-R jet mass resolution uncertainties",
289  "FullJMR_COMB_newBinning", {"FullJMR_COMB","FullJMR_COMB_newBinning", "SimpleJMR_COMB_newBinning"});
290  registerParameter("AdvancedUsage_LargeRJetUncertaintiesConfigDir",
291  "Path to directory containing large-R jet uncertainties config",
292  "rel21/Winter2021");
293  registerParameter("LargeRJESJMSConfig",
294  "Calibration for large-R JES/JMS. Choices are 'UFOSDMass' (default 'UFOSDMass').",
295  "UFOSDMass",
296  {"UFOSDMass"});
297  registerParameter("BoostedJetTagging",
298  "Boosted jet taggers to use in the analysis, separated by commas or white spaces."
299  " By default, no tagger is used.",
300  " ");
301 
302  registerParameter("TrackJetPt", "Track Jet pT cut for object selection (in MeV). Default 10 GeV.", "10000.");
303  registerParameter("TrackJetEta", "Absolute Track Jet eta cut for object selection. Default 2.5.", "2.5");
304 
305  registerParameter("TrackPt", "Track pT cut for object selection (in MeV). Default 0.5 GeV.", "0.5");
306  registerParameter("TrackEta", "Absolute Track eta cut for object selection. Default 2.5.", "2.5");
307  registerParameter("TrackQuality",
308  "Track quality cut for object selection. Options are TightPrimary,...",
309  "TightPrimary");
310 
311 
312  registerParameter("RCJetPt", "Reclustered Jet pT cut for object selection (in MeV). Default 100000 MeV.",
313  "100000.");
314  registerParameter("RCJetEta", "Reclustered Jet eta cut for object selection. Default 2.0.", "2.0");
315  registerParameter("RCInputJetPtMin", "Min Pt cut for RC jet inputs collection. Parameter is shared between RC and VarRC jets. Default 30000. [MeV]", "30000.");
316  registerParameter("RCInputJetEtaMax", "Max |Eta| cut for RC jet inputs collection. Parameter is shared between RC and VarRC jets. Default 2.5", "2.5");
317  registerParameter("RCJetTrim", "Reclustered Jet trimming cut for object selection. Default 0.05.", "0.05");
318  registerParameter("RCJetRadius", "Reclustered Jet radius for object selection. Default 1.0", "1.0");
319  registerParameter("UseRCJetSubstructure", "Calculate Reclustered Jet Substructure Variables. Default False",
320  "False");
321  registerParameter("UseRCJetAdditionalSubstructure",
322  "Calculate Additional Reclustered Jet Substructure Variables. Default False", "False");
323 
324  registerParameter("UseRCJets", "Use Reclustered Jets. Default False.", "False");
325 
326  registerParameter("VarRCJetPt",
327  "Reclustered Jet (variable-R) pT cut for object selection (in MeV). Default 100000 MeV.",
328  "100000.");
329  registerParameter("VarRCJetEta", "Reclustered Jet (variable-R) eta cut for object selection. Default 2.0.", "2.0");
330  registerParameter("VarRCJetTrim", "Reclustered Jet (variable-R) trimming cut for object selection. Default 0.05.",
331  "0.05");
332  registerParameter("VarRCJetMaxRadius",
333  "Reclustered Jet (variable-R) max. radius cut for object selection. Default 1.0", "1.0");
334  registerParameter("VarRCJetRho", "Reclustered Jet (variable-R) list of rho values (). Default 2.", "2");
335  registerParameter("VarRCJetMassScale",
336  "Reclustered Jet (variable-R) list of mass scale values (m_w,m_z,m_h,m_t). By default use all.",
337  "m_w,m_z,m_h,m_t");
338  registerParameter("UseVarRCJets", "Use Reclustered Jets (Variable-R Jets). Default False.", "False");
339  registerParameter("UseVarRCJetSubstructure",
340  "Calculate Variable-R Reclustered Jet Substructure Variables. Default False", "False");
341  registerParameter("UseVarRCJetAdditionalSubstructure",
342  "Calculate Additional Variable-R Reclustered Jet Substructure Variables. Default False", "False");
343 
344  registerParameter("TauPt",
345  "Pt cut applied to both tight and loose taus (in MeV)."
346  "Default 25 GeV.",
347  "25000");
348  registerParameter("TauEtaRegions",
349  "Eta regions used for both tight and loose taus."
350  "Default vetoing crack region [0., 1.37, 1.52, 2.5]",
351  "[0., 1.37, 1.52, 2.5]");
352 
353  registerParameter("TauJetIDWP", "Tau jet ID WP.", "RNNMedium",
354  {"None", "RNNLoose", "RNNMedium", "RNNTight"});
355  registerParameter("TauJetIDWPLoose", "Loose Tau jet ID WP.", "RNNLoose",
356  {"None", "RNNLoose", "RNNMedium", "RNNTight"});
357 
358  registerParameter("TauEleIDWP", "Tau electron ID WP.", "RNNLoose",
359  {"None", "RNNLoose", "RNNMedium", "RNNTight"});
360  registerParameter("TauEleIDWPLoose", "Loose Tau electron ID WP.", "RNNLoose",
361  {"None", "RNNLoose", "RNNMedium", "RNNTight"});
362 
363  registerParameter("TauMuOLR", "Apply tau-electron overlap removal.", "True", {"True","False"});
364  registerParameter("TauMuOLRLoose", "Apply loose tau-electron overlap removal.", "True", {"True", "False"});
365 
366  registerParameter("TauJetConfigFile",
367  "Config file to configure tau selection. "
368  "If anything other than 'Default'"
369  "then all cuts are taken from the "
370  "config file rather than other options.",
371  "Default");
372  registerParameter("TauJetConfigFileLoose",
373  "Config file to configure loose tau selection. "
374  "If anything other than 'Default'"
375  "then all cuts are taken from the "
376  "config file rather than other options.",
377  "Default");
378  registerParameter("ApplyTauMVATES",
379  "Apply new Tau energy calibration based on substructure information and regression. Must be True. Deprecated.",
380  "True");
381 
382  registerParameter("Systematics", "What to run? Nominal (just the nominal), All(do all systematics) ", "Nominal");
383 
384  registerParameter("LibraryNames", "Names of any libraries that need loading");
385  registerParameter("WriteTrackingData", "Whether to generate and store analysis-tracking data (default: True)",
386  "True");
387  registerParameter("ObjectSelectionName", "Code used to define objects, e.g. ObjectLoaderStandardCuts");
388  registerParameter("OutputFormat", "Format, can be user defined, e.g. top::EventSaverFlatNtuple");
389  registerParameter("OutputEvents",
390  "AllEvents (saves all events + decison bits), SelectedEvents (saves only the events passing your cuts)");
391  registerParameter("OutputFilename", "The file that will contain the output histograms and trees");
392  registerParameter("OutputFileSetAutoFlushZero",
393  "setAutoFlush(0) on EventSaverFlatNtuple for ANALYSISTO-44 workaround. (default: False)",
394  "False");
395  registerParameter("OutputFileNEventAutoFlush",
396  "Set the number of events after which the TTree cache is optimised, ie setAutoFlush(nEvents). (default: 1000)",
397  "1000");
398  registerParameter("OutputFileBasketSizePrimitive",
399  "Set the TTree basket size for primitive objects (int, float, ...). (default: 4096)", "4096");
400  registerParameter("OutputFileBasketSizeVector", "Set the TTree basket size for vector objects. (default: 40960)",
401  "40960");
402  registerParameter("RecomputeCPVariables",
403  "Run the CP tools to force computation of variables that may already exist in derivations? (default: True)",
404  "True");
405  registerParameter("EventVariableSaveList", "The list of event variables to save (EventSaverxAODNext only).",
406  "runNumber.eventNumber.eventTypeBitmask.averageInteractionsPerCrossing");
407  registerParameter("PhotonVariableSaveList", "The list of photon variables to save (EventSaverxAODNext only).",
408  "pt.eta.phi.m.charge.ptvarcone20.topoetcone20.passPreORSelection");
409  registerParameter("ElectronVariableSaveList", "The list of electron variables to save (EventSaverxAODNext only).",
410  "pt.eta.phi.m.charge.ptvarcone20.topoetcone20.passPreORSelection");
411  registerParameter("MuonVariableSaveList", "The list of muon variables to save (EventSaverxAODNext only).",
412  "pt.eta.phi.m.author.charge.ptvarcone30.topoetcone20.muonType.passPreORSelection");
413  registerParameter("TauVariableSaveList", "The list of tau variables to save (EventSaverxAODNext only).",
414  "pt.eta.phi.m.charge.passPreORSelection");
415  registerParameter("JetVariableSaveList", "The list of jet variables to save (EventSaverxAODNext only).",
416  "pt.eta.phi.m.passPreORSelection.btaggingLink.HadronConeExclTruthLabelID");
417  registerParameter("BTagVariableSaveList", "The list of b-tag variables to save (EventSaverxAODNext only).",
418  "MV2c20_discriminant");
419 
420  registerParameter("NEvents",
421  "The number of events that you want to run on (for testing). If 0 then all events are run.", "0");
422  registerParameter("FirstEvent",
423  "The number of events that you want to skip (for testing). If 0 then no events are skipped.",
424  "0");
425  registerParameter("PerfStats", " I/O Performance printouts. None, Summary or Full", "None");
426  registerParameter("IsAFII", "Define if you are running over a fastsim sample: True or False", " ");
427  registerParameter("IsDataOverlay", "Define if you are running over a data overlay MC sample: True or False", " ");
428  registerParameter("FilterBranches",
429  "Comma separated list of names of the branches that will be removed from the output", " ");
430  registerParameter("FilterPartonLevelBranches",
431  "Comma separated list of names of the parton-level branches that will be removed from the output", " ");
432  registerParameter("FilterParticleLevelBranches",
433  "Comma separated list of names of the particle-level branches that will be removed from the output", " ");
434  registerParameter("FilterNominalLooseBranches",
435  "Comma separated list of names of the nominal_Loose tree branches that will be removed from the output", " ");
436  registerParameter("FilterNominalBranches",
437  "Comma separated list of names of the nominal tree branches that will be removed from the output. If not provided, the branches from FilterBraches will be used", " ");
438  registerParameter("FilterTrees",
439  "Comma separated list of names of the trees that will be removed from the output", " ");
440 
441  registerParameter("FakesMMWeightsIFF",
442  "Calculate matrix-method weights for fake leptons estimate using FakeBkgTools from IFF: True (calculate weights), False (does nothing)",
443  "False");
444  registerParameter("FakesMMConfigIFF",
445  "Configurations for fake leptons estimate using FakeBkgTools from IFF: - default is $ROOTCOREBIN/data/TopFakes/efficiencies.xml:1T:1F[T]. Use as \n <ROOT/XML FILE>:<DEFNINITION>:<PROCESS>;<ROOT/XML FILE 2>:<DEFNINITION 2>:<PROCESS 2>; ...",
446  "$ROOTCOREBIN/data/TopFakes/efficiencies.xml:1T:1F[T]");
447  registerParameter("FakesMMIFFDebug",
448  "Enables debug mode for matrix-method weight calculation using FakeBkgTools from IFF: True, False (default)",
449  "False");
450 
451  registerParameter("DoTight", "Dumps the normal non-\"*_Loose\" trees : Data, MC, Both (default), False", "Both");
452  registerParameter("DoLoose", "Run Loose selection and dumps the Loose trees : Data (default), MC, Both, False",
453  "Data");
454  registerParameter("DoSysts", "Run systematics on given selection: Both (default), Tight, Loose", "Both");
455 
456  registerParameter("UseLooseObjectsInMETInLooseTree","Experimental: use loose objects when rebuilding the MET for the loose tree : True or False (default = False)","False");
457  registerParameter("UseLooseObjectsInMETInNominalTree","Experimental: use loose objects when rebuilding the MET for the nominal tree : True or False (default = False)","False");
458 
459  registerParameter("WriteMETBuiltWithLooseObjects","Write a separate branch with the met built with loose objects in the output for tests: True or False (default = False)","False");
460 
461  registerParameter("OverlapRemovalLeptonDef",
462  "Special: run overlap removal on : Tight (top default) or Loose (not top default) lepton definitions",
463  "Tight");
464  registerParameter("ApplyTightSFsInLooseTree",
465  "Special: in Loose trees, calculate electron/muon SFs with tight leptons only, and considering they are tight: True or False (default)",
466  "False");
467 
468  registerParameter("ApplyElectronInJetSubtraction",
469  "Subtract electrons close to jets for boosted analysis : True or False(top default)", "False");
470  registerParameter("TopPartonHistory", "Topology to be assumed when reconstructing parton-level history.", "False",
471  {"ttbar", "ttH", "ttbarlight", "tb", "Wtb", "tchannel", "ttz", "ttgamma", "tHq", "tZq", "False"});
472  registerParameter("TopPartonLevel", "Perform parton level analysis (stored in truth tree)? True or False", "True");
473 
474  registerParameter("TopParticleLevel", "Perform particle level selection (stored in particleLevel tree)? True or False", "False");
475  registerParameter("DoParticleLevelOverlapRemoval",
476  "Perform overlap removal at particle level? True (default), False, or any combination (comma separated) of MuonJet, ElectronJet, JetPhoton",
477  "True");
478 
479  registerParameter("PDFInfo",
480  "Do you want the PDF info? True (in truth tree), Nominal (save to the nominal tree if passes selection) or False (nothing, default)",
481  "False");
482  registerParameter("MCGeneratorWeights",
483  "Do you want the OTF-computed MC generator weights (if available)? True (in truth tree), Nominal (save to the nominal tree if passes selection) or False (nothing, default)",
484  "False");
485  registerParameter("NominalWeightNames",
486  "List of nominal weight names to attempt to retrieve. Attempts are made in the order as specified. If none of the names can be found, we will crash with error message. Use index instead in such case.",
487  "\" nominal \",\"nominal\",\"Default\",\"Weight\",\"1001\",\" muR=0.10000E+01 muF=0.10000E+01 \",\"\",\" \",\" dyn= 3 muR=0.10000E+01 muF=0.10000E+01 \",\" mur=1 muf=1 \", \" dyn= 0 muR=0.10000E+01 muF=0.10000E+01 \"");
488  registerParameter("NominalWeightFallbackIndex",
489  "Index of nominal weight in MC weights vector. This option is only used in case the MC sample has broken metadata. (Default: -1 means no fallback index specified, rely on metadata and crash if metadata cannot be read)",
490  "-1");
491  registerParameter("ForceNominalWeightFallbackIndex",
492  "Force usage of NominalWeightFallbackIndex, even if MC sample metadata is correct. (Default: False)",
493  "False");
494 
495  registerParameter("TruthBlockInfo", "Do you want to dump the full Truth block info? True or False", "False");
496 
497  registerParameter("TruthElectronPt",
498  "Electron pT cut for [Particle Level / Truth] object selection (in MeV). Default 25 GeV.",
499  "25000");
500  registerParameter("TruthElectronEta",
501  "Absolute electron eta cut for [Particle Level / Truth] object selection. Default 2.5.", "2.5");
502 
503  registerParameter("TruthMuonPt",
504  "Muon pT cut for [Particle Level / Truth] object selection (in MeV). Default 25 GeV.", "25000");
505  registerParameter("TruthMuonEta",
506  "Absolute Muon eta cut for [Particle Level / Truth] object selection. Default 2.5.", "2.5");
507 
508  registerParameter("TruthSoftMuonPt",
509  "Soft Muon pT cut for [Particle Level / Truth] object selection (in MeV). Default 4 GeV.", "4000");
510  registerParameter("TruthSoftMuonEta",
511  "Absolute Soft Muon eta cut for [Particle Level / Truth] object selection. Default 2.5.", "2.5");
512 
513  registerParameter("TruthPhotonPt",
514  "Photon pT cut for [Particle Level / Truth] object selection (in MeV). Default 25 GeV.",
515  "25000");
516  registerParameter("TruthPhotonEta",
517  "Absolute Photon eta cut for [Particle Level / Truth] object selection. Default 2.5.",
518  "2.5");
519  registerParameter("TruthPhotonOrigin",
520  "Potential origin of [Particle Level / Truth] photons. Comma separated list of particle origin values as given by MCTruthClassifier (string names).",
521  "WBoson,ZBoson,SinglePhot,Higgs,HiggsMSSM,WZMSSM,PromptPhot,SUSY,UndrPhot,FSRPhot");
522  registerParameter("TruthPhotonIsolation",
523  "Configuration option for isolation applied to [Particle Level / Truth] photons. "
524  "This can be False / None (isolation requirement disabled), "
525  "True (use default isolation), "
526  "or a configuration in the format `VAR CUT`, where VAR is one of the isolation variables and CUT is the cut applied as `VAR / pt < CUT`.",
527  "ptcone20 0.1");
528 
529 
530  registerParameter("TruthJetPt",
531  "Jet pT cut for [Particle Level / Truth] object selection (in MeV). Default 25 GeV.", "25000");
532  registerParameter("TruthJetEta", "Absolute Jet eta cut for [Particle Level / Truth] object selection. Default 2.5.",
533  "2.5");
534 
535  registerParameter("TruthLargeRJetPt",
536  "Large R Jet pT cut for [Particle Level / Truth] object selection (in MeV). Default 25 GeV.",
537  "25000");
538  registerParameter("TruthLargeRJetEta",
539  "Absolute Large R Jet eta cut for [Particle Level / Truth] object selection. Default 2.5.",
540  "2.5");
541 
542  registerParameter("TruthTauPt",
543  "Tau pT cut for [Particle Level / Truth] object selection (in MeV). Default 25 GeV.", "25000");
544  registerParameter("TruthTauEta", "Tau eta cut for [Particle Level / Truth] object selection. Default 2.5.", "2.5");
545 
546  registerParameter("LHAPDFSets",
547  "List of PDF sets to calculate weights for, seperated by spaces, use LHAPDF names e.g CT10nlo NNPDF30_nlo_as_0118 MMHT2014nlo68cl",
548  " ");
549  registerParameter("LHAPDFEventWeights",
550  "Save per event weights for all PDF sets/members: True (lots of info in truth tree!), Nominal (save to the nominal tree if passes selection) or False (nothing, default).",
551  "False");
552  registerParameter("LHAPDFBaseSet",
553  "Base PDF set used to recalculate XF1,XF2 values if they are zero. Will be added to LHAPDFSets.",
554  " ");
555  registerParameter("BTagCDIPath", "Path to the b-tagging CDI file. Default: Using the hardcoded path.", "Default");
556 
557  registerParameter("BTaggingTrackJetWP",
558  "b-tagging WPs to use for VR track jet collection in the analysis, separated by commas."
559  " The format should follow the convention of the b-tagging CP group, e.g. FixedCutBEff_60, FlatBEff_77, Continuous, etc."
560  " The specified WPs must be calibrated, otherwise use the BTaggingTrackJetWPUncalib option.",
561  " ");
562 
563  registerParameter("BTaggingTrackJetUncalibWP",
564  "List of uncalibrated b-tagging WPs for track jets. See BTaggingTrackJetWP option description",
565  " ");
566 
567  registerParameter("BTaggingCaloJetWP",
568  "b-tagging WPs to use for calo jet collection in the analysis, separated by commas."
569  " The format should follow the convention of the b-tagging CP group, e.g. FixedCutBEff_60, FlatBEff_77, Continuous, etc."
570  " The specified WPs must be calibrated, otherwise use the BTaggingCaloJetWPUncalib option.",
571  " ");
572 
573  registerParameter("BTaggingCaloJetUncalibWP",
574  "List of uncalibrated b-tagging WPs for calo jets. See BTaggingCaloJetWP option description",
575  " ");
576 
577  registerParameter("BTaggingSystExcludedFromEV",
578  "User-defined list of b-tagging systematics to be dextracted from eigenvector decomposition, separated by semi-colons (none by default)",
579  "none");
580 
581  registerParameter("BTaggingCalibrationB",
582  "The calibration to use for the b-tagging SFs (B-jets)."
583  " Default 'default'",
584  "default");
585 
586  registerParameter("BTaggingCalibrationC",
587  "The calibration to use for the b-tagging SFs (C- and T-jets)."
588  " Default 'default'",
589  "default");
590 
591  registerParameter("BTaggingCalibrationLight",
592  "The calibration to use for the b-tagging SFs (Light-jets)."
593  " Default 'default'",
594  "default");
595 
596  registerParameter("EGammaCalibrationModel", "To override default EGammaCalibration model, Default 'es2022_R22_PRE'", "es2022_R22_PRE");
597 
598  registerParameter("PRWConfigFiles",
599  "List of PU config files, seperated by spaces (nothing by default) - Not compatible with FS/AF options",
600  " ");
601  registerParameter("PRWConfigFiles_FS",
602  "List of PU config files only for full sim samples, seperated by spaces (nothing by default)",
603  " ");
604  registerParameter("PRWConfigFiles_AF",
605  "List of PU config files only for fast sim samples, seperated by spaces (nothing by default)",
606  " ");
607  registerParameter("PRWActualMu_FS",
608  "List of actual mu files for full sim samples, seperated by spaces (nothing by default)", " ");
609  registerParameter("PRWActualMu_AF",
610  "List of actual mu files only for fast sim samples, seperated by spaces (nothing by default)",
611  " ");
612  registerParameter("PRWLumiCalcFiles", "List of PU lumicalc files, seperated by spaces (nothing by default)", " ");
613  registerParameter("PRWUseGRLTool", "Pass the GRL tool to the PU reweighting tool (False by default)", "False");
614  registerParameter("PRWMuDependent",
615  "Use mu dependent random run numbers for MC. "
616  "True or False (default True)",
617  "True");
618  registerParameter("PRWCustomScaleFactor",
619  "Specify custom scale-factor and up/down variations, for specific studies."
620  "Format is \'nominal:up:down\'."
621  "If nothing is set, the default values will be used (recommended).",
622  " ");
623  registerParameter("PRWUnrepresentedDataTolerance",
624  "Specify value between 0 and 1 to represent acceptable fraction of unrepresented data in PRW [default: 0.05]",
625  "0.05");
626  registerParameter("PRWPeriodAssignments",
627  "Specify period number assignments to run numbers ranges in this form: \"XXX:XXX:XXX\", where XXX are runnumbers, first number is the associated run number, second number is the period block start, the third number is the period block end. You can pass any number of these sets (total number of provided RunNumbers needs to be divisible by 3). Default is used if not specified",
628  " ");
629 
630  registerParameter("ForceRandomRunNumber",
631  "If set to an integer, will disable PRW and use that value as the random run number for MC",
632  " ");
633 
634  registerParameter("IsRun3",
635  "Tells the code to setup congiguration for Run 3",
636  "False",
637  {"True", "False"});
638 
639  registerParameter("KLFitterTransferFunctionsPath", "Select the transfer functions to use", "mc12a/akt4_LCtopo_PP6");
640  registerParameter("KLFitterOutput", "Select the KLFitter output (FULL, FITTEDTOPS_ONLY, JETPERM_ONLY)", "FULL");
641  registerParameter("KLFitterJetSelectionMode",
642  "kLeadingThree , kLeadingFour , kLeadingFive , kLeadingSix , kLeadingSeven , kLeadingEight , kBtagPriorityThreeJets , kBtagPriorityFourJets , kBtagPriorityFiveJets, kBtagPrioritySixJets , kBtagPrioritySevenJets , kBtagPriorityEightJets",
643  "kBtagPriorityFourJets");
644  registerParameter("KLFitterBTaggingMethod", "Recommend use kNotag or kVetoNoFit - see KLFitter TWiki", "kNotag");
645  registerParameter("KLFitterLH",
646  "Select likelihood depending on signal, ttbar, ttbar_JetAngles, ttbar_Angular, ttH, ttZTrilepton, ttbar_AllHadronic, ttbar_BoostedLJets",
647  "ttbar");
648  registerParameter("KLFitterTopMassFixed", "Fix the mass of the top quark? True or False", "True");
649  registerParameter("KLFitterSaveAllPermutations",
650  "Save All permutations to the output file (False will save only the best)", "False");
651  registerParameter("KLFitterFailOnLessThanXJets",
652  "Fail if kLeadingX or kBtagPriorityXJets is set and the number of jets in the event is less than X (Default is False)",
653  "False");
654 
655  registerParameter("DynamicKeys", "Additional dynamic key list seperated by ,", "");
656 
657  registerParameter("OverlapRemovalProcedure", "Overlap removal procedure to be used. Options include:"
658  " recommended [default], jetmuApplyRelPt, harmonized,"
659  " Boosted, BoostedSlidingDREl, BoostedSlidingDRMu, BoostedSlidingDRElMu, noTauJetOLR, "
660  " noPhotonMuOR, noPhotonMuOrJetOR",
661  "recommended"
662  );
663 
664  registerParameter("OverlapRemovalSlidingInnerDRel",
665  "Overlap removal inner radius to be used for electron SlidingDR ,", "0.2");
666  registerParameter("OverlapRemovalSlidingInnerDRmu", "Overlap removal inner radius to be used for muon SlidingDR ,",
667  "0.2");
668  registerParameter("OverlapRemovalParticleLevelUseRapidity", "Use rapidity instead of pseudo-rapidity for DeltaR"
669  " calculation for overlap removal in particle level", "True", {"True", "False"});
670  registerParameter("LargeJetOverlapRemoval",
671  "Perform overlap removal including large-R jets. True or False (default: False).", "False");
672 
673  registerParameter("EleEleOverlapRemoval",
674  "Apply electron-electron overlap removal. True or False (default: False).", "False");
675 
676  registerParameter("SaveBootstrapWeights", "Set to true in order to save Poisson bootstrap weights,"
677  "True or False (default False)", "False");
678 
679  registerParameter("NumberOfBootstrapReplicas", "Define integer number of replicas to be stored with bootstrapping, "
680  "Default 100", "100");
681 
682  registerParameter("UseBadBatmanCleaning", "Switch to turn on BadBatman cleanig.", "False");
683  registerParameter("BadBatmanCleaningRange",
684  "Set a range of RunNumbers where the cleaning is applied in the form of XXXXX:YYYYY",
685  "276262:311481");
686  registerParameter("UseEventLevelJetCleaningTool",
687  "Switch to turn on event-level jet cleaning tool (for testing), True or False (default False)",
688  "False");
689 
690  registerParameter("UseGlobalLeptonTriggerSF",
691  "Switch to activate event-level trigger scale factors allowing multiple OR of single-, di-, tri- lepton triggers, True or False (default False)",
692  "False");
693  registerParameter("GlobalTriggers",
694  "Trigger list for GlobalLeptonTriggerSF - Format as 2015@trig1,trig2 2016@trig3,trig4 : Separate periods defined with @ using whitespace, triggers with comma (default: None)",
695  "None");
696  registerParameter("GlobalTriggersLoose",
697  "Trigger list for GlobalLeptonTriggerSF - Format as 2015@trig1,trig2 2016@trig3,trig4 : Separate periods defined with @ using whitespace, triggers with comma (default: None)",
698  "None");
699  registerParameter("ElectronTriggers", "Deprecated, use GlobalTriggers instead.", "None");
700  registerParameter("ElectronTriggersLoose", "Deprecated, use GlobalTriggersLoose instead.", "None");
701  registerParameter("MuonTriggers", "Deprecated, use GlobalTriggers instead.", "None");
702  registerParameter("MuonTriggersLoose", "Deprecated, use GlobalTriggersLoose instead.", "None");
703 
704  registerParameter("TriggerMatchingElementRelinking",
705  "Workaround for formats with broken trigger matching (e.g. MC20 p5226), relink offline and online objects.",
706  "True");
707 
708  registerParameter("DemandPrimaryVertex", "Wether at least one primary vertex in event is required. Default True. For debugging purposes only!", "True");
709 
710  registerParameter("KillExperimental", "Disable some specific experimental feature.", " ");
711  registerParameter("RedefineMCMCMap", "Dictionary for translating the shower names from TopDataPreparation. Format: \"shower1:shower2,shower3:shower4\".", " ");
712  }

◆ ConfigurationSettings() [2/2]

top::ConfigurationSettings::ConfigurationSettings ( const ConfigurationSettings )
private

Here but not implemented, resulting in a happy compile error if you try and use them.

Member Function Documentation

◆ checkSettings()

void top::ConfigurationSettings::checkSettings ( )

Validate that configured options make sense.

This involves checking if unsupported options are not specified.

Definition at line 942 of file ConfigurationSettings.cxx.

942  {
943  for (const std::pair<const std::string, StringData>& entry : strings_) {
944  const StringData& data = entry.second;
945  // if the config option restricts allowed values to some limited set,
946  // check that the configured value is valid
947  if (!data.m_allowed_values.empty()) {
948  if (std::find(data.m_allowed_values.begin(), data.m_allowed_values.end(),data.m_data) == data.m_allowed_values.end()) {
949  ATH_MSG_ERROR("Unsupported value specified for config option " << entry.first << ": " << data.m_data
950  << "\nAllowed values: " << boost::algorithm::join(data.m_allowed_values, ", "));
951  throw std::runtime_error("Unsupported value for config option");
952  }
953  }
954  }
955  }

◆ configured()

bool top::ConfigurationSettings::configured ( ) const

Have the configuration settings been read from a file?

Returns
True if configured (call to loadFromFile worked) otherwise false.

Definition at line 993 of file ConfigurationSettings.cxx.

993  {
994  return m_configured;
995  }

◆ feature()

bool top::ConfigurationSettings::feature ( std::string const name) const

test whether an (experimental) feature should be enabled

Note: It's not a particularly cheap operation, so avoid it in loops.

Definition at line 1033 of file ConfigurationSettings.cxx.

1033  {
1034  /* We search a list of strings, not a particularly efficient implementation.
1035  * If need be, we could abuse the aux registry and use integers instead of
1036  * strings. Anyhow, in most cases, the list should be empty. */
1037  return(m_killedFeatures.empty() ||
1039  }

◆ get()

ConfigurationSettings * top::ConfigurationSettings::get ( bool  reset = false)
static

Design patterns 101.

A singleton getter function.

Definition at line 714 of file ConfigurationSettings.cxx.

714  {
715  if (!m_instance || reset) {
716  delete m_instance;
718  }
719 
720  return m_instance;
721  }

◆ loadFromFile()

void top::ConfigurationSettings::loadFromFile ( const std::string &  filename)

Read the settings from a text file given by.

Parameters
filenameThe filename to read from.

Definition at line 723 of file ConfigurationSettings.cxx.

723  {
724  std::ifstream input(filename.c_str());
725 
726  if (!input) {
727  throw std::runtime_error("Configuration file does not exist: " + filename);
728  }
729 
730  struct SelectionData {
731  std::string name;
732  bool isSub;
733  std::vector<std::string> cuts;
734  };
735  std::string line;
736  std::vector<SelectionData> selections;
737 
738  //for the key-value pairs
739  while (std::getline(input, line)) {
740  std::string newstring(line);
741 
742  // search for '#' character to discard commented-out part of line
743  // however ignore '\#' -- used to be able to type # in our config
744  // and not be recognized as commenting character
745  size_t commentpos = size_t(-1);
746  while (true) {
747  // find next occurence of '#' -- after the already scanned chars
748  commentpos = newstring.find("#", commentpos+1);
749  if (commentpos == std::string::npos)
750  break;
751  if (commentpos == 0) { // the whole line is a comment, to be ignored
752  newstring = "";
753  break;
754  }
755  // if it's '\#', then do not erase this part, but remove the '\'
756  if (newstring.compare(commentpos-1, 1, "\\") == 0) {
757  newstring.erase(commentpos-1, 1);
758  --commentpos; // the position of the '#' shifted after removing '\'
759  continue;
760  } else {
761  newstring.resize(commentpos);
762  break;
763  }
764  }
765 
766  // remove (multiple) spaces hanging around relevant information
767  // if a pair of "" appears, the spaces in "" won't be touched
768  bool hasquote = (newstring.find("\"",0) != std::string::npos);
769  if (!hasquote) boost::algorithm::trim_all(newstring);
770  else {
771  //split the string into segments, separated by pairs of quotes
772  //e.g. the string "abc \"def\" ghi"
773  // becomes a vector of 3 strings: "abc", "\"def\"", "ghi"
774  std::vector<std::string> segments;
775  std::vector<bool> segments_isquote;
776  std::size_t strsize = newstring.size();
777  std::size_t tmppos = 0;
778  bool leftquote = true;
779  while (tmppos <= strsize-1) {
780  // find the position of the 1st quote after newstring[tmppos]
781  std::size_t tmppos2 = newstring.find_first_of("\"",tmppos);
782 
783  // when the quote found has \ ahead of it, jump over and update tmppos2
784  std::size_t tmppos3 = newstring.find_first_of("\\\"",tmppos);
785  while (tmppos2 == tmppos3+1) {
786  tmppos3 = newstring.find_first_of("\\\"",tmppos2+1);
787  tmppos2 = newstring.find_first_of("\"",tmppos2+1);
788  }
789 
790  // when no more quote found, save the segment from the last rightquote to the end, then quit the loop
791  if (tmppos2 == std::string::npos) {
792  segments.push_back(newstring.substr(tmppos,strsize-tmppos));
793  segments_isquote.push_back(false);
794  break;
795  }
796 
797  // check it's a left quote or right quote
798  if (leftquote) {
799  segments.push_back(newstring.substr(tmppos,tmppos2-tmppos));
800  segments_isquote.push_back(false);
801 
802  // update the position indicator and leftquote flag
803  tmppos = tmppos2+1;
804  leftquote = false;
805  } else {
806  segments.push_back(newstring.substr(tmppos-1,tmppos2-(tmppos-1)+1)); // have to include the two quotes, which is why +/-1 adjustment is introduced
807  segments_isquote.push_back(true);
808 
809  // update the position indicator and leftquote flag
810  tmppos = tmppos2+1;
811  leftquote = true;
812  }
813  }
814 
815  // sanity check: if leftquote = false after the loop, it means a left quote is found but not its associated rightquote
816  // in this case, crash the code
817  if (!leftquote) {
818  std::string message = "Problematic configuration line\n";
819  message.append(newstring.c_str());
820  throw std::invalid_argument(message);
821  }
822 
823  //run the original trim_all for each segment that is NOT a quote
824  for (uint i = 0; i < segments.size(); i++) {
825  std::string seg = segments.at(i);
826  if (seg.size() == 0) continue;
827  if (segments_isquote.at(i)) continue;
828  boost::algorithm::trim_all(seg);
829 
830  // if the segment has a space in the end and it's not the last segment, add the space back
831  if (i+1 != segments.size()) {
832  if (segments.at(i).at(segments.at(i).size()-1) == ' ') {
833  seg += " ";
834  }
835  }
836  // if the segment has a space in the head and it's not the first segment, add the space back
837  if (i != 0) {
838  if (segments.at(i).at(0) == ' ') {
839  seg = " " + seg;
840  }
841  }
842 
843  // update the segment
844  segments.at(i) = seg;
845  }
846 
847  // combine the segments back to newstring
848  newstring = "";
849  for (uint i = 0; i < segments.size(); i++) {
850  newstring += segments.at(i);
851  }
852  }
853 
854  if (newstring.empty()) continue;
855 
856  // handle start of a (sub)selection (implies end of key-value section)
857  if (newstring.starts_with( "SELECTION ")) {
858  selections.push_back({newstring.substr(10), false, {}});
859  continue;
860  }
861  if (newstring.starts_with( "SUB ")) {
862  selections.push_back({newstring.substr(4), true, {}});
863  continue;
864  }
865 
866  if (!selections.empty()) {
867  // read body of (sub)selection
868  auto& sel = selections.back();
869  if (newstring.starts_with( ". ")) {
870  // source another (sub)selection here
871  auto subselName = newstring.substr(2);
872  auto subselIt = std::find_if(selections.rbegin(), selections.rend(),
873  [subselName](SelectionData const& sel) {
874  return(subselName == sel.name);
875  });
876  if (subselIt == selections.rend()) throw std::invalid_argument(
877  "ConfigurationSettings: unknown selection: " + subselName);
878  sel.cuts.insert(sel.cuts.end(), subselIt->cuts.begin(), subselIt->cuts.end());
879  } else {
880  sel.cuts.push_back(newstring);
881  }
882  continue;
883  }
884 
885  // parse key-value pair
886  std::istringstream liness(newstring);
887  std::string key;
888  std::string value;
889 
890  std::getline(liness, key, ' '); //to the space
891  std::getline(liness, value); //to the end of the line
892 
893  auto its = strings_.find(key);
894  if (its != strings_.end()) {
895  its->second.m_data = value;
896  its->second.m_set = true;
897  } else {
898  ATH_MSG_ERROR("\n\nConfig file includes non-existant option: " << key
899  << "\nThis option either does not exist anymore, or you have a typo.");
900  throw std::runtime_error("Unsupported config option.");
901  }
902 
904  if ("DynamicKeys" == key) {
905  std::vector<std::string> listofkeys;
906  std::string separator = ",";
907  std::string::size_type start = 0, end = 0;
908  while ((end = value.find(separator, start)) != std::string::npos) {
909  std::string token = value.substr(start, end - start);
910  if (token.size()) listofkeys.push_back(token);
911  start = end + 1;
912  }
913 
914  std::string lasttoken = value.substr(start);
915  if (lasttoken.size()) listofkeys.push_back(lasttoken);
916 
917  for (auto par : listofkeys) {
918  registerParameter(par, "Dynamic parameter", "");
919  }
920  }
921  }
922 
923  for (auto& sel : selections) {
924  if (sel.isSub) continue;
925  m_selections.push_back({sel.name, sel.cuts});
926  }
927 
928  {
929  auto const& it = strings_.find("KillExperimental");
930  m_killedFeatures.clear();
931  if (it != strings_.end() && it->second.m_set) {
932  std::string strValue(it->second.m_data);
933  boost::trim(strValue);
934  boost::split(m_killedFeatures, strValue, boost::is_any_of(" "));
935  }
936  }
937 
938  input.close();
939  m_configured = true;
940  }

◆ operator=()

ConfigurationSettings top::ConfigurationSettings::operator= ( const ConfigurationSettings )
private

Here but not implemented, resulting in a happy compile error if you try and use them.

◆ registerParameter()

void top::ConfigurationSettings::registerParameter ( const std::string &  name,
const std::string &  message,
const std::string &  default_val = "",
const std::vector< std::string >  allowed_values = {} 
)

Add a variable to the configuration settings.

Parameters
nameThe key used to refer to this variable.
messageA human readable explanation.
default_valDefault value used for this setting.
allowed_valuesPossible choices for this setting (optional, by default all values are allowed).

Definition at line 957 of file ConfigurationSettings.cxx.

959  {
960  StringData data;
961 
962  data.m_data = default_val;
963  data.m_human_explanation = message;
964  data.m_default_val = default_val;
965  data.m_allowed_values = allowed_values;
966  data.m_set = (default_val.empty() ? false : true);
967  strings_[name] = data;
968  }

◆ retrieve() [1/2]

bool top::ConfigurationSettings::retrieve ( std::string const key) const

same as above, but directly returning the boolean

Definition at line 1027 of file ConfigurationSettings.cxx.

1027  {
1028  bool result=false;
1029  retrieve(key,result);
1030  return result;
1031  }

◆ retrieve() [2/2]

void top::ConfigurationSettings::retrieve ( std::string const key,
bool &  value 
) const

The user wants to know the boolean value for the specified key.

Parameters
keyThe string key used to identify this variable.
valueOn success, the setting for the given key (output).

Note: an attempt to retrieve a key with a non-boolean values raises an exception.

Definition at line 1005 of file ConfigurationSettings.cxx.

1005  {
1006  using boost::trim;
1007  using boost::equals;
1008  using boost::iequals;
1010  trim(stringValue);
1011 
1012  if (iequals(stringValue, "false") or iequals(stringValue, "0") or iequals(stringValue, "n") or iequals(stringValue,
1013  "no") or
1014  iequals(stringValue, "off")) {
1015  value = false;
1016  return;
1017  }
1018  if (iequals(stringValue, "true") or iequals(stringValue, "1") or iequals(stringValue, "y") or iequals(stringValue,
1019  "yes") or
1020  iequals(stringValue, "on")) {
1021  value = true;
1022  return;
1023  }
1024  throw std::invalid_argument(std::string("expected boolean value for configuration setting ") + key);
1025  }

◆ selections()

const std::vector< SelectionConfigurationData > top::ConfigurationSettings::selections ( ) const

Get all the data needed to configure the selections.

Returns
The selections in a vector.

Definition at line 1001 of file ConfigurationSettings.cxx.

1001  {
1002  return m_selections;
1003  }

◆ stringData()

const std::map< std::string, StringData > & top::ConfigurationSettings::stringData ( ) const

All the user input that is stored as strings.

Returns
a hased-map of the string name to the String data (description etc)

Definition at line 997 of file ConfigurationSettings.cxx.

997  {
998  return strings_;
999  }

◆ value()

const std::string & top::ConfigurationSettings::value ( const std::string &  key) const

The user wants to know the value for the specified key.

Parameters
keyThe string key used to identify this variable.
Returns
The setting for the given key.

Definition at line 970 of file ConfigurationSettings.cxx.

970  {
971  //This class never has loadFromFile called
972  if (!m_configured) {
973  std::string message = "ConfigurationSettings: Not correctly configured\n";
974  message.append("You need to call top::ConfigurationSettings::get()->loadFromFile(filename)\n");
975  message.append("Early in your program\n");
976  throw std::invalid_argument(message);
977  }
978 
979  std::map<std::string, StringData>::const_iterator its = strings_.find(key);
980  //The string is not in the map
981  if (its == strings_.end()) {
982  throw std::invalid_argument("ConfigurationSettings: The variable doesn't exist in the code " + key);
983  }
984 
985  //In the map, but never set to anything
986  if (!its->second.m_set) {
987  throw std::invalid_argument("ConfigurationSettings: You never set a value for " + key);
988  }
989 
990  return its->second.m_data;
991  }

Member Data Documentation

◆ m_configured

bool top::ConfigurationSettings::m_configured
private

True if the class has read the settings from a file or something.

Definition at line 104 of file ConfigurationSettings.h.

◆ m_instance

ConfigurationSettings * top::ConfigurationSettings::m_instance = 0
staticprivate

Singletons: Good or bad, you decide. // John says they are bad.

Definition at line 107 of file ConfigurationSettings.h.

◆ m_killedFeatures

std::vector<std::string> top::ConfigurationSettings::m_killedFeatures
private

Kill-switch for experimental features.

Definition at line 116 of file ConfigurationSettings.h.

◆ m_selections

std::vector<SelectionConfigurationData> top::ConfigurationSettings::m_selections
private

Data used when configuring the selections.

Definition at line 113 of file ConfigurationSettings.h.

◆ strings_

std::map<std::string, StringData> top::ConfigurationSettings::strings_
private

Hold the configuration data.

Definition at line 110 of file ConfigurationSettings.h.


The documentation for this class was generated from the following files:
top::ConfigurationSettings::m_instance
static ConfigurationSettings * m_instance
Singletons: Good or bad, you decide. // John says they are bad.
Definition: ConfigurationSettings.h:107
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
top::ConfigurationSettings::value
const std::string & value(const std::string &key) const
The user wants to know the value for the specified key.
Definition: ConfigurationSettings.cxx:970
checkFileSG.line
line
Definition: checkFileSG.py:75
get_generator_info.result
result
Definition: get_generator_info.py:21
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
trim
std::string trim(const std::string &str, const std::string &whitespace=" \t")
Definition: BTaggingTruthTaggingTool.cxx:1149
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
skel.it
it
Definition: skel.GENtoEVGEN.py:423
ReweightUtils.message
message
Definition: ReweightUtils.py:15
top::ConfigurationSettings::ConfigurationSettings
ConfigurationSettings()
private constructor
Definition: ConfigurationSettings.cxx:24
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
top::ConfigurationSettings::get
static ConfigurationSettings * get(bool reset=false)
Design patterns 101.
Definition: ConfigurationSettings.cxx:714
sel
sel
Definition: SUSYToolsTester.cxx:92
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
plotBeamSpotVert.cuts
string cuts
Definition: plotBeamSpotVert.py:93
top::ConfigurationSettings::strings_
std::map< std::string, StringData > strings_
Hold the configuration data.
Definition: ConfigurationSettings.h:110
top::ConfigurationSettings::m_configured
bool m_configured
True if the class has read the settings from a file or something.
Definition: ConfigurationSettings.h:104
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
top::ConfigurationSettings::registerParameter
void registerParameter(const std::string &name, const std::string &message, const std::string &default_val="", const std::vector< std::string > allowed_values={})
Add a variable to the configuration settings.
Definition: ConfigurationSettings.cxx:957
top::ConfigurationSettings::retrieve
void retrieve(std::string const &key, bool &value) const
The user wants to know the boolean value for the specified key.
Definition: ConfigurationSettings.cxx:1005
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
python.selection.stringValue
stringValue
Definition: selection.py:30
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:16
top::ConfigurationSettings::m_selections
std::vector< SelectionConfigurationData > m_selections
Data used when configuring the selections.
Definition: ConfigurationSettings.h:113
CxxUtils::reset
constexpr std::enable_if_t< is_bitmask_v< E >, E & > reset(E &lhs, E rhs)
Convenience function to clear bits in a class enum bitmask.
Definition: bitmask.h:243
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
top::ConfigurationSettings::selections
const std::vector< SelectionConfigurationData > selections() const
Get all the data needed to configure the selections.
Definition: ConfigurationSettings.cxx:1001
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
top::ConfigurationSettings::m_killedFeatures
std::vector< std::string > m_killedFeatures
Kill-switch for experimental features.
Definition: ConfigurationSettings.h:116