DAS  3.0
Das Analysis System
common.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include <optional>
5 #include <regex>
6 #include <string>
7 #include <sstream>
8 
13 
14 #include <darwin.h>
15 
16 namespace DAS::JetEnergy {
17 
18 inline static const std::vector<double> pt_JERC_edges = {15, 17, 20, 23, 27, 30, 35, 40, 45, 57, 72, 90, 120, 150, 200, 300, 400, 550, 750, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000, 9500};
19 inline static const int nPtJERCbins = pt_JERC_edges.size()-1;
20 
23 inline static const std::vector<double> abseta_edges = { 0.000, 0.261, 0.522, 0.783, 1.044, 1.305, 1.566, 1.740, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.853, 2.964, 3.139, 3.489, 3.839, 5.191 };
24 inline static const int nAbsEtaBins = abseta_edges.size()-1;
25 inline static const std::vector<TString> absetaBins = MakeTitle(abseta_edges, "|#eta|", false, true, [](double v) { return Form("%.3f", v);});
26 
27 inline static const std::map<int,std::vector<double>> rho_edges = {
28  { 2016, {0, 6.69, 12.39, 18.09, 23.79, 29.49, 35.19, 40.9, 999} }, // EOY16
29  { 2017, {0, 7.47, 13.49, 19.52, 25.54, 31.57, 37.59, 999} }, // UL17
30  { 2018, {0, 7.35, 13.26, 19.17, 25.08, 30.99, 36.9, 999} }, // UL18
31 
32  { 2024, {0.0, 8.23, 14.49, 20.75, 27.01, 33.27, 39.53, 45.79, 52.05, 999} }, // Winter24 (copy of Summer23)
33 };
34 
35 inline int GetNRhoBins (int year) { return rho_edges.at(year).size()-1; }
36 inline std::vector<TString> rhoBins (int year)
37 {
38  return MakeTitle(rho_edges.at(year), "#rho", false, false,
39  [](double v) { return Form("%.2f", v); });
40 }
41 
44 inline static const std::vector<double> eta_unc_edges = MakeBinning({-5.4, 5.4}, 0.2, BinningOptions::step);
45 inline static const int nEtaUncBins = eta_unc_edges.size()-1;
46 
47 inline static const std::vector<std::string> JES_variations {"AbsoluteStat", "AbsoluteScale", "AbsoluteMPFBias", "Fragmentation", "SinglePionECAL", "SinglePionHCAL", "FlavorQCD", "RelativeJEREC1", "RelativeJEREC2", "RelativeJERHF", "RelativePtBB", "RelativePtEC1", "RelativePtEC2", "RelativePtHF", "RelativeBal", "RelativeSample", "RelativeFSR", "RelativeStatFSR", "RelativeStatEC", "RelativeStatHF", "PileUpDataMC", "PileUpPtRef", "PileUpPtBB", "PileUpPtEC1", "PileUpPtEC2", "PileUpPtHF"};
48 
49 } // end of DAS::JetEnergy namespace
DAS::JetEnergy::rho_edges
static const std::map< int, std::vector< double > > rho_edges
Definition: common.h:27
DAS::JetEnergy::rhoBins
std::vector< TString > rhoBins(int year)
Definition: common.h:36
DAS::JetEnergy::eta_unc_edges
static const std::vector< double > eta_unc_edges
binning for JES uncertainties (taken from JES files)
Definition: common.h:44
Ntupliser_cfg.year
int year
Definition: Ntupliser_cfg.py:67
DAS::MakeTitle
std::vector< TString > MakeTitle(const std::vector< double > &edges, const char *v, bool lowEdge, bool highEdge, std::function< const char *(double)> format)
Make a vector of properly formated titles from bin edges.
Definition: binnings.h:13
DAS::JetEnergy::pt_JERC_edges
static const std::vector< double > pt_JERC_edges
Definition: common.h:18
DAS::step
@ step
linear with param as step for binning
Definition: toolbox.h:26
Event.h
Jet.h
DAS::JetEnergy::absetaBins
static const std::vector< TString > absetaBins
Definition: common.h:25
DAS::JetEnergy::JES_variations
static const std::vector< std::string > JES_variations
Definition: common.h:47
binnings.h
DAS::JetEnergy::GetNRhoBins
int GetNRhoBins(int year)
Definition: common.h:35
DAS::JetEnergy::nEtaUncBins
static const int nEtaUncBins
Definition: common.h:45
DAS::JetEnergy::abseta_edges
static const std::vector< double > abseta_edges
JERC binning (taken from JERCProtoLab repo, /macros/common_info/common_binning.hpp)
Definition: common.h:23
toolbox.h
DAS::MakeBinning
std::vector< T > MakeBinning(std::pair< T, T > range, double param, int opt=BinningOptions::default_def)
Define a regular binning.
Definition: toolbox.h:33
DAS::JetEnergy::nPtJERCbins
static const int nPtJERCbins
Definition: common.h:19
DAS::JetEnergy
Definition: applyJERsmearing.cc:42
DAS::JetEnergy::nAbsEtaBins
static const int nAbsEtaBins
Definition: common.h:24