1 #ifndef _TIMBER_TOPTAG_SF 2 #define _TIMBER_TOPTAG_SF 7 #include <Math/Vector4Dfwd.h> 8 #include <Math/GenVector/LorentzVector.h> 9 #include <Math/GenVector/PtEtaPhiM4D.h> 10 #include "GenMatching.h" 11 using LVector = ROOT::Math::PtEtaPhiMVector;
19 std::string workpoint_name;
21 std::map<int, std::map<std::string, TH1F*>> _hists;
32 TopTag_SF(
int year,
int workpoint,
bool NoMassCut=
false);
45 int NMerged(LVector top_vect, RVec<Particle*> Ws,
57 RVec<double>
eval(LVector top_vect, std::vector<T> GenParts){
60 RVec<Particle*> Ws, quarks;
63 for (
size_t i = 0; i < GenParts.size(); i++) {
65 this_pdgId = this_particle->
pdgId;
66 if (abs(this_pdgId) == 24) {
67 Ws.push_back(this_particle);
68 }
else if (abs(this_pdgId) >= 1 && abs(this_pdgId) <= 5) {
69 quarks.push_back(this_particle);
72 int nMergedProngs =
NMerged(top_vect, Ws, quarks, GPT);
73 std::vector<double> sfs(3);
74 if (nMergedProngs > 0){
75 if (top_vect.Pt() > 5000) {
76 sfs = {_hists[nMergedProngs][
"nom"]->GetBinContent(_hists[nMergedProngs][
"nom"]->GetNbinsX()),
77 _hists[nMergedProngs][
"up"]->GetBinContent(_hists[nMergedProngs][
"up"]->GetNbinsX()),
78 _hists[nMergedProngs][
"down"]->GetBinContent(_hists[nMergedProngs][
"down"]->GetNbinsX())
81 sfs = {_hists[nMergedProngs][
"nom"]->GetBinContent(_hists[nMergedProngs][
"nom"]->FindFixBin(top_vect.Pt())),
82 _hists[nMergedProngs][
"up"]->GetBinContent(_hists[nMergedProngs][
"up"]->FindFixBin(top_vect.Pt())),
83 _hists[nMergedProngs][
"down"]->GetBinContent(_hists[nMergedProngs][
"down"]->FindFixBin(top_vect.Pt()))
int NMerged(LVector top_vect, RVec< Particle *> Ws, RVec< Particle *> quarks, GenParticleTree GPT)
Finds the number of merged generator particles in the reconstructed jet.
Definition: TopTag_SF.cc:25
Particle * AddParticle(Particle particle)
Add particle to tree.
Definition: GenMatching.cc:73
C++ class. Stores identifying features of a particle in the GenPart collection.
Definition: GenMatching.h:38
C++ class. Constructs tree by adding particles. Establish relationships between particles (parent...
Definition: GenMatching.h:123
int pdgId
Definition: GenMatching.h:47
RVec< double > eval(LVector top_vect, std::vector< T > GenParts)
Evaluation function based on the reconstructed top jet pt and the matched generator particles (GenPar...
Definition: TopTag_SF.h:57
TopTag_SF(int year, int workpoint, bool NoMassCut=false)
Construct a new TopTag_SF object.
Definition: TopTag_SF.cc:3
C++ class to access scale factors associated with tau32+subjet btag(+mass) based top tagging...
Definition: TopTag_SF.h:17