Definition at line 46 of file dumpNPs.cxx.
◆ Config()
Config::Config |
( |
const char * |
name | ) |
|
|
inline |
◆ initialize()
bool Config::initialize |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 159 of file dumpNPs.cxx.
161 using namespace asg::msgUserCode;
164 Info(
MSGSOURCE,
"Usage (1): EgEfficiencyCorr_dumpNPs Year=<value> IdKey=<value> <property1=value1> ... <property N=value N>");
165 Info(
MSGSOURCE,
" ++ prints eta x pt region of influence of each nuisance parameter for the chosen year");
166 Info(
MSGSOURCE,
"Usage (2): EgEfficiencyCorr_dumpNPs AnalysisEta=<list> AnalysisPt=<list> IdKey=<value> <property1=value1> ... <property N=value N>");
167 Info(
MSGSOURCE,
" ++ prints a short list of all NPs relevant in the selected eta x pt (in MeV) region");
168 Info(
MSGSOURCE,
" ++ e.g. EgEfficiencyCorr_dumpNPs AnalysisEta=-2.0..2.0,nocrack AnalysisPt=20e3..150e3");
169 Info(
MSGSOURCE,
" ++ one of the Analysis* arguments can be omitted, in which case the full range is scanned");
170 Info(
MSGSOURCE,
" ++ several intervals can be specified, separated by commas, e.g. AnalysisEta=0..0.6,0.8..1.37");
171 Info(
MSGSOURCE,
" ++ recognized aliases: 'nocrack' (crack veto), 'sym' (duplicates for eta<0), 'barrel', 'endcap'");
173 Info(
MSGSOURCE,
" ++ for other SFs, IdKey can be replaced by RecoKey/IsoKey/TriggerKey");
174 Info(
MSGSOURCE,
" ++ CorrectionFileNameList can also be used instead of keys");
175 Info(
MSGSOURCE,
" ++ optional arguments are other configurable properties of the AsgElectronEfficiencyCorrectionTool.");
176 Info(
MSGSOURCE,
" ++ e.g. EgEfficiencyCorr_dumpNPs Year=2015 IdKey=Tight CorrelationModel=SIMPLIFIED UncorrEtaBinsUser=0,1.37,2.47");
182 const std::set<std::string> string_properties{
183 "MapFilePath",
"RecoKey",
"IdKey",
"IsoKey",
"TriggerKey",
185 const std::set<std::string> int_properties{
"ForceDataType"};
186 const std::set<std::string> vector_properties{
187 "UncorrEtaBinsUser",
"UncorrEtBinsUser"};
196 std::vector<int8_t> eta_flags(
eta_edges.size()-1, 0);
197 std::vector<int8_t> pt_flags(
pt_edges.size()-1, 0);
201 const std::size_t
pos{
key.find(
'=')};
202 if (
pos == std::string::npos)
help();
206 if (
key ==
"CorrectionFileNameList") {
207 std::vector<std::string>
files{
val};
209 }
else if (
key ==
"Year") {
211 }
else if (string_properties.count(
key)) {
213 }
else if (int_properties.count(
key)) {
215 }
else if (vector_properties.count(
key)) {
216 std::vector<float>
bins;
219 }
else if (
key ==
"AnalysisEta") {
222 }
else if (
key ==
"AnalysisPt") {
234 "When Analysis* arguments are provided, "
243 for (std::size_t
i{0};
i<eta_flags.size(); ++
i) {
244 if (eta_flags[
i] != 2)
continue;
247 const auto j =
static_cast<std::size_t
>(
248 std::upper_bound(eeb, eee, -
z) - eeb - 1);
249 if (
i == j)
continue;
251 eta_flags[
i] = eta_flags[j];
255 auto efb{eta_flags.begin()}, efe{eta_flags.end()};
259 auto pfb{pt_flags.begin()}, pfe{pt_flags.end()};
265 for (std::size_t
i{0};
i<eta_flags.size(); ++
i) {
266 if (eta_flags[
i] < 1)
continue;
267 for (std::size_t j{0}; j<pt_flags.size(); ++j) {
268 if (pt_flags[j] < 1)
continue;
◆ parseProgramOptions()
void Config::parseProgramOptions |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 91 of file TriggerMenuRW.cxx.
93 std::string currentParameter(
"");
94 std::string listofUnknownParameters =
"";
98 std::string currentWord(
argv[
i]);
99 bool isParam = currentWord[0]==
'-';
102 int firstChar = currentWord.find_first_not_of(
'-');
103 string paramName = currentWord.substr(firstChar);
107 listofUnknownParameters +=
" " + currentWord;
112 currentParameter =
"";
114 if(paramName ==
"h" || paramName ==
"help" ) {
help =
true;
continue; }
115 if(paramName ==
"d" || paramName ==
"detail" ) {
detail =
true;
continue; }
116 if(paramName ==
"w" || paramName ==
"write" ) {
write =
true; }
118 if(paramName ==
"c" || paramName ==
"ctp" ) {
doCtp =
true; }
119 currentParameter = paramName;
126 if(currentParameter ==
"file" || currentParameter ==
"f") {
130 if(currentParameter ==
"smk") {
131 smk = stoul(currentWord);
134 if(currentParameter ==
"l1psk") {
135 l1psk = stoul(currentWord);
138 if(currentParameter ==
"hltpsk") {
139 hltpsk = stoul(currentWord);
142 if(currentParameter ==
"bgsk") {
143 bgsk = stoul(currentWord);
146 if(currentParameter ==
"db") {
152 if(currentParameter ==
"write" || currentParameter ==
"w" || currentParameter ==
"Write" || currentParameter ==
"W") {
161 error.push_back(
"No input specified! Please provide either one of the following: input file(s), smk, l1psk, hltpsk, or bgsk");
164 if ( listofUnknownParameters.size() > 0 ) {
165 error.push_back(
string(
"Unknown parameter(s):") + listofUnknownParameters);
◆ setDebug()
◆ setEfficiency() [1/2]
Config& Config::setEfficiency |
( |
const std::string & |
leg, |
|
|
double |
eff |
|
) |
| |
|
inline |
◆ setEfficiency() [2/2]
Config& Config::setEfficiency |
( |
const std::string & |
leg, |
|
|
std::function< double(float)> && |
eff |
|
) |
| |
|
inline |
◆ setEventSelection()
◆ setExpectedEfficiency()
Config& Config::setExpectedEfficiency |
( |
double |
eff, |
|
|
double |
tolerance |
|
) |
| |
|
inline |
◆ setLeptonPDF()
Config& Config::setLeptonPDF |
( |
unsigned |
nmin, |
|
|
unsigned |
nmax, |
|
|
std::initializer_list< float > |
ptvalues |
|
) |
| |
|
inline |
◆ setTriggers()
◆ setUnavailable()
Config& Config::setUnavailable |
( |
const std::string & |
leg | ) |
|
|
inline |
◆ updateFlavours()
void Config::updateFlavours |
( |
const std::string & |
leg | ) |
|
|
inlineprivate |
◆ usage()
Definition at line 64 of file TriggerMenuRW.cxx.
66 cout <<
"The program needs to be run with the following specifications:\n\n";
67 cout <<
"TriggerMenuRW <options>\n";
69 cout <<
"[Input options]\n";
70 cout <<
" -f|--file file1 [file2 [file3 ...]] ... one or multiple json files\n";
71 cout <<
" --smk smk ... smk \n";
72 cout <<
" --l1psk l1psk ... the L1 prescale key \n";
73 cout <<
" --hltpsk hltpsk ... the HLT prescale key \n";
74 cout <<
" --bgsk bgsk ... the bunchgroup key \n";
75 cout <<
" --db dbalias ... dbalias (default " <<
dbalias <<
") \n";
76 cout <<
" -c|--ctp ... if provided together with the SMK and DB then will read only CTP files from the DB and not the rest of the menu\n";
77 cout <<
"[Output options]\n";
78 cout <<
" -w|--write [base] ... to write out json files, e.g. L1menu[_<base>].json. base is optional.\n";
79 cout <<
" -W|--Write [base] ... to write out json files from the internal structure (only for L1Menu), e.g. L1menu[_<base>].json. base is optional.\n";
80 cout <<
"[Other options]\n";
81 cout <<
" -h|--help ... this help\n";
82 cout <<
" -d|--detail ... prints detailed job options\n";
85 cout <<
" --file L1menu.json HLTMenu.json ... read L1Menu.json and HLTMenu.json and show some basic statistics\n";
86 cout <<
" --db TRIGGERDB_RUN3 --smk 3205 ... read the L1 menu, HLT menu, HLT job options, and HLT monitoring groups for SMK 3205\n";
87 cout <<
" --db TRIGGERDB_RUN3 --smk 3205 -w ... read the information and write DB content directly as json files\n";
◆ analysis_mode
bool Config::analysis_mode {false} |
◆ base
std::string Config::base { "" } |
◆ bgsk
unsigned int Config::bgsk { 0 } |
◆ dbalias
std::string Config::dbalias { "TRIGGERDB_RUN3" } |
◆ debug
bool Config::debug = false |
◆ detail
bool Config::detail { false } |
◆ doCtp
bool Config::doCtp { false } |
◆ domains
std::vector<Domain> Config::domains {} |
◆ efficiencies
std::map<std::string, std::function<double(float)> > Config::efficiencies |
◆ error
◆ eventSelection
◆ expectedEfficiency
double Config::expectedEfficiency = -1. |
◆ expectedEfficiencyTolerance
double Config::expectedEfficiencyTolerance = 1e-6 |
◆ generateElectrons
bool Config::generateElectrons = false |
◆ generateMuons
bool Config::generateMuons = false |
◆ generatePhotons
bool Config::generatePhotons = false |
◆ help
bool Config::help { false } |
◆ hltpsk
unsigned int Config::hltpsk { 0 } |
◆ inputFiles
std::vector<std::string> Config::inputFiles {} |
◆ knownParameters
std::vector<std::string> Config::knownParameters |
Initial value:{
"file", "f", "smk", "l1psk", "hltpsk", "bgsk", "db", "write", "w",
"Write", "W", "help", "h", "detail", "d", "ctp", "c"
}
Definition at line 29 of file TriggerMenuRW.cxx.
◆ l1psk
unsigned int Config::l1psk { 0 } |
◆ leptonPtValues
std::vector<float> Config::leptonPtValues |
◆ maxLeptons
unsigned Config::maxLeptons = 5 |
◆ minLeptons
unsigned Config::minLeptons = 1 |
◆ run_number
int Config::run_number {0} |
◆ smk
unsigned int Config::smk { 0 } |
◆ systematics
◆ testName
std::string Config::testName |
◆ tool
Initial value:{
"AsgElectronEfficiencyCorrectionTool/tool"}
Definition at line 48 of file dumpNPs.cxx.
◆ triggers
std::string Config::triggers = "" |
◆ unavailable
std::string Config::unavailable |
◆ write
bool Config::write { false } |
◆ writeFromDataStructure
bool Config::writeFromDataStructure { false } |
The documentation for this struct was generated from the following files: