/
CharmJetModule.cc
67 lines (42 loc) · 1.44 KB
/
CharmJetModule.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "CharmJetModule.h"
#include "TClonesArray.h"
#include "classes/DelphesClasses.h"
#include "AnalysisFunctions.cc"
#include <iostream>
CharmJetModule::CharmJetModule(ExRootTreeReader* data)
: Module(data)
{
}
CharmJetModule::~CharmJetModule()
{
}
bool CharmJetModule::execute(std::map<std::string, std::any>* DataStore)
{
auto data = getData();
// If event contains at least 1 jet
std::vector<Jet*> all_jets;
for (int ijet = 0; ijet < getJets()->GetEntries(); ijet++)
{
// Take first jet
Jet *jet = (Jet*) getJets()->At(ijet);
all_jets.push_back(jet);
}
std::vector<Jet*> fiducial_jets = SelectorFcn<Jet>(all_jets, [](Jet* j){ return (TMath::Abs(j->Eta) < 3.0 && j->PT > 5.0); });
std::vector<Jet*> charmJets = SelectorFcn<Jet>(fiducial_jets, [](Jet* j){ return (j->Flavor == 4); });
(*DataStore)["CharmJets"] = charmJets;
// for (int igjet = 0; igjet < getGenJets()->GetEntries(); igjet++)
// {
// Jet *tru_jet = (Jet*) getGenJets()->At(igjet);
// // if (jet->P4().DeltaR(tru_jet->P4()) < 0.5 &) {
// // }
// }
// auto jet_constituents = jet->Constituents;
// for (int iconst = 0; iconst < jet_constituents.GetEntries(); iconst++) {
// auto constituent = jet_constituents.At(iconst);
// if(constituent == 0) continue;
// if (constituent->IsA() == Track::Class()) {
// auto track = static_cast<Track*>(constituent);
// }
// }
return true;
}