160{
161 using namespace asg::msgUserCode;
162
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");
177 std::abort();
178 };
179
180 if (argc < 2)
help();
181
182 const std::set<std::string> string_properties{
183 "MapFilePath", "RecoKey", "IdKey", "IsoKey", "TriggerKey",
184 "CorrelationModel"};
185 const std::set<std::string> int_properties{"ForceDataType"};
186 const std::set<std::string> vector_properties{
187 "UncorrEtaBinsUser", "UncorrEtBinsUser"};
188
189
194
196 std::vector<int8_t> eta_flags(
eta_edges.size()-1, 0);
197 std::vector<int8_t> pt_flags(
pt_edges.size()-1, 0);
198
199 for (
int i=1;
i<
argc; ++
i) {
201 const std::size_t
pos{
key.find(
'=')};
202 if (pos == std::string::npos)
help();
203 std::string
val(
key.substr(pos + 1));
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") {
225 } else {
228 }
229 }
230
234 "When Analysis* arguments are provided, "
235 "Year is ignored.");
236 }
240 }
241
242
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];
252 }
253
254
255 auto efb{eta_flags.begin()}, efe{eta_flags.end()};
256 if (!std::count(efb, efe, 1)) {
257 std::replace(efb, efe, 0, 1);
258 }
259 auto pfb{pt_flags.begin()}, pfe{pt_flags.end()};
260 if (!std::count(pfb, pfe, 1)) {
261 std::fill(pfb, pfe, 1);
262 }
263
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;
272 });
273 }
274 }
275 return true;
276}
static const std::vector< std::string > bins
int get_run_number(const int year)
std::vector< float > pt_edges
std::vector< float > eta_edges
bool parse_csv_list(std::string val, Args &... args)
std::vector< std::string > files
file names and file pointers
Error
The different types of error that can be flagged in the L1TopoRDO.
std::vector< Domain > domains
asg::AnaToolHandle< IAsgElectronEfficiencyCorrectionTool > tool