TIMBER  beta
Tree Interface for Making Binned Events with RDataFrame
JMR_weight.h
1 #ifndef _TIMBER_JMR_WEIGHT
2 #define _TIMBER_JMR_WEIGHT
3 #include <string>
4 #include <ROOT/RVec.hxx>
5 #include <TF1.h>
6 #include "JetSmearer.h"
7 
8 using namespace ROOT::VecOps;
16 class JMR_weight {
17  private:
18  std::map< int, std::vector<float> > _jmrTable {
19  {2016, {1.00, 1.2, 0.8 } },
20  {2017, {1.09, 1.14, 1.04} },
21  {2018, {1.09, 1.14, 1.04} }
22  };
23  JetSmearer _smearer;
24 
25  public:
31  JMR_weight(int year);
32  ~JMR_weight(){};
50  template <class Tjet, class TgenJet>
51  RVec<RVec<float>> eval(std::vector<Tjet> jets, std::vector<TgenJet> genJets){
52  RVec<RVec<float>> out (jets.size());
53 
54  for (size_t ijet = 0; ijet < jets.size(); ijet++) {
55  RVec<LorentzV> genJetsV = hardware::TLvector(genJets);
56  out[ijet] = (RVec<float>)_smearer.GetSmearValsM(hardware::TLvector(jets[ijet]), hardware::TLvector(genJets));
57  }
58  return out;
59  }
60 };
61 #endif
C++ class to directly handle JMR weights in the case of tau21 jet substructure. The values used (nomi...
Definition: JMR_weight.h:16
RVec< RVec< float > > eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets)
Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to s...
Definition: JMR_weight.h:51
std::vector< float > GetSmearValsM(LorentzV jet, RVec< LorentzV > genJets)
Smear jet mass to account for measured difference in JMR between data and simulation. The function computes the nominal smeared jet mass simultaneously with the JMR up and down shifts, in order to use the same random number to smear all three (for consistency reasons).
Definition: JetSmearer.cc:93
C++ class to handle the smearing of jet pt and mass using the JER and JMR inputs, respectively...
Definition: JetSmearer.h:62
ROOT::Math::PtEtaPhiMVector TLvector(float pt, float eta, float phi, float m)
Create a ROOT::Math::PtEtaPhiMVector.
Definition: common.cc:78