TIMBER  beta
Tree Interface for Making Binned Events with RDataFrame
JER_weight.h
1 #ifndef _TIMBER_JER_WEIGHT
2 #define _TIMBER_JER_WEIGHT
3 #include <string>
4 #include <ROOT/RVec.hxx>
5 #include "JetSmearer.h"
6 
7 using namespace ROOT::VecOps;
11 class JER_weight {
12  private:
13  JetSmearer _smearer;
14  public:
21  JER_weight(std::string jerTag, std::string jetType);
22  ~JER_weight(){};
36  template <class Tjet, class TgenJet>
37  RVec< RVec<float> > eval(std::vector<Tjet> jets, std::vector<TgenJet> genJets, float fixedGridRhoFastjetAll){
38  RVec< RVec<float> > out (jets.size());
39  for (size_t ijet = 0; ijet < jets.size(); ijet++) {
40  out[ijet] = (RVec<float>)_smearer.GetSmearValsPt(hardware::TLvector(jets[ijet]), hardware::TLvector(genJets), fixedGridRhoFastjetAll);
41  }
42  return out;
43  }
44 };
45 #endif
C++ class to handle the JER weight calculations.
Definition: JER_weight.h:11
RVec< RVec< float > > eval(std::vector< Tjet > jets, std::vector< TgenJet > genJets, float fixedGridRhoFastjetAll)
Evaluation calculates the factor necessary for each jet in the provided vector of jets* in order to s...
Definition: JER_weight.h:37
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:49
std::vector< float > GetSmearValsPt(LorentzV jet, RVec< LorentzV > genJets, float fixedGridRhoFastjetAll)
Smear jet pT to account for measured difference in JER between data and simulation. The function computes the nominal smeared jet pT simultaneously with the JER up and down shifts, in order to use the same random number to smear all three (for consistency reasons).
Definition: JetSmearer.cc:51