2 #include "fastjet/AreaDefinition.hh"
3 #include "fastjet/ClusterSequenceArea.hh"
4 #include "fastjet/Selector.hh"
5 #include "fastjet/tools/BackgroundEstimatorBase.hh"
6 #include "fastjet/tools/JetMedianBackgroundEstimator.hh"
21 #include <fastjet/ClusterSequence.hh>
22 #include <fastjet/JetDefinition.hh>
23 #include <fastjet/PseudoJet.hh>
43 ( std::vector<std::string> jetnames
44 , std::vector<std::pair<std::string,std::string>> matchlist
45 , std::vector<std::pair<Jet::SRC,std::string>> src
46 ,
const float min_jet_pt
47 ,
const float min_tow_pt
50 , m_jet_names { jetnames }
54 , m_min_tow_pt { min_tow_pt }
76 CentralityInfo* cent_node = findNode::getClass<CentralityInfo>(topNode,
"CentralityInfo");
77 float cent = cent_node->
get_centile(CentralityInfo::PROP::epd_NS);
80 std::cout << std::endl <<
" NEW EVENT " <<
nevnt++ <<
" cent("<<cent<<
")" <<std::endl;
85 std::cout << std::endl <<
" --- JetMap named " <<
name <<
" --- " << std::endl;
86 JetMap* jetmap = findNode::getClass<JetMap>(topNode,
name);
87 if (jetmap ==
nullptr )
89 std::cout <<
" -> is NULL (not present) on the node tree." << std::endl;
92 auto jets = jetmap->
vec();
94 std::cout << Form(
" -> Has %i jets; printing up to %i jets w/pT>%5.2f", ((
int)jets.size()),
nmax_jetprint,
m_min_jet_pt) << std::endl;
96 for (
auto jet : jets) {
99 std::cout << Form(
"k[%i] pt:phi:eta[%5.2f:%5.2f:%5.2f]",
i++, jet->get_pt(), jet->get_phi(), jet->get_eta()) << std::endl;
104 JetMap* jetmapA = findNode::getClass<JetMap>(topNode, match.first);
105 if (jetmapA ==
nullptr )
107 std::cout <<
" Can't jet map " << match.first << std::endl;
110 auto jetsA = jetmapA->
vec();
113 JetMap* jetmapB = findNode::getClass<JetMap>(topNode, match.second);
114 if (jetmapB ==
nullptr )
116 std::cout <<
" Can't find jet map " << match.second << std::endl;
119 auto jetsB = jetmapB->
vec();
122 std::cout << std::endl <<
" >>> Matching (up to " <<
m_pt_min_match <<
"GeV) " << match.first <<
" with " << match.second << std::endl;
124 std::vector<bool> B_is_matched (jetsB.size(),
false);
125 for (
auto A : jetsA) {
127 bool found_A =
false;
128 for (
unsigned int iB = 0; iB<jetsB.size(); ++iB) {
129 if (B_is_matched[iB])
continue;
131 float dphi = fabs(
A->get_phi()-B->get_phi());
132 while (dphi>M_PI) dphi = fabs(dphi - 2*M_PI);
133 const float deta =
A->get_eta() - B->get_eta();
134 const float R2_comp = deta*deta + dphi*
dphi;
136 std::cout << Form(
"Matched pT->pT; phi->phi; eta->eta [ %6.2f->%6.2f, %6.2f->%6.2f, %6.2f->%6.2f ]",
137 A->get_pt(), B->get_pt(),
A->get_phi(), B->get_phi(),
A->get_eta(), B->get_eta()) << std::endl;
139 B_is_matched[iB] =
true;
144 std::cout << Form(
"NoMatch pT->??; phi->???? eta->????[ %6.2f->%6s, %6.2f->%6s, %6.2f->%6s ]",
145 A->get_pt(),
"nf",
A->get_phi(),
"nf",
A->get_eta(),
"nf") << std::endl;
150 for (
auto src :
m_SRC) {
151 std::cout << std::endl <<
" --- Printing Tower Input: " << src.second << std::endl;
153 auto tows = tow_inp->get_input(topNode);
155 std::cout << Form(
" -> Has %i towers; printing all w/pT>%5.2f", ((
int)tows.size()),
m_min_tow_pt) << std::endl;
157 for (
auto tow : tows) {
159 std::cout << Form(
"k[%i] pt:phi:eta[%5.2f:%5.2f:%5.2f]",
i++, tow->get_pt(), tow->get_phi(), tow->get_eta()) << std::endl;
161 for (
auto tow : tows)
delete tow;