|
4 | 4 |
|
5 | 5 | #include "correction.h" |
6 | 6 |
|
7 | | -static constexpr double PT_EPS = 1e-4; |
8 | | -static constexpr double ISO_EPS = 1e-6; |
9 | | - |
10 | | -static double safe_log10(double x, double eps) { |
11 | | - return std::log10(std::max(x, eps)); |
12 | | -} |
13 | | - |
14 | | -int main(int argc, char** argv) { |
15 | | - if (argc != 2) { |
| 7 | +int main(int argc, char **argv) |
| 8 | +{ |
| 9 | + if (argc != 2) |
| 10 | + { |
16 | 11 | std::cerr << "Usage: " << argv[0] << " lwtnn_correction.json\n"; |
17 | 12 | return 1; |
18 | 13 | } |
19 | 14 |
|
20 | 15 | const std::string json_path = argv[1]; |
21 | 16 | auto correction_set = correction::CorrectionSet::from_file(json_path); |
22 | | - auto correction = correction_set->at("electron_sf"); |
| 17 | + auto correction = correction_set->at("electron_fastsim_sf"); |
23 | 18 |
|
24 | 19 | // Mock "GEN-matched" electron values (replace with real NanoAOD lookup later) |
25 | | - const double gen_pt = 15.0; |
| 20 | + const double gen_pt = 15.0; |
26 | 21 | const double gen_eta = 0.4; |
27 | 22 | const double gen_phi = 2.1; |
28 | 23 | const double gen_iso = 1e-3; |
29 | 24 |
|
30 | | - const double pt_log10 = safe_log10(gen_pt, PT_EPS); |
31 | | - const double iso_log10 = safe_log10(gen_iso, ISO_EPS); |
32 | | - |
33 | | - double sf = correction->evaluate({pt_log10, gen_eta, gen_phi, iso_log10}); |
| 25 | + double sf = correction->evaluate({gen_pt, gen_eta, gen_phi, gen_iso}); |
34 | 26 |
|
35 | 27 | std::cout << std::setprecision(17); |
36 | 28 | std::cout << "sf_fullOverFast " << sf << "\n"; |
|
0 commit comments