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>
45 , m_outputfilename { _outputfilename }
61 std::cout <<
"RhoFluct::Init - Outoput to " <<
m_outputfilename << std::endl;
67 m_T =
new TTree(
"T",
"RhoFluct Tree");
114 std::cout <<
" Input Selections:" << std::endl;
125 GlobalVertexMap *mapVtx = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
129 CentralityInfo* cent_node = findNode::getClass<CentralityInfo>(topNode,
"CentralityInfo");
138 const double ghost_max_rap = 1.1;
139 const double ghost_R = 0.01;
140 const double max_jet_rap = 1.1;
146 const int TOW_PRINT_INT = 8000;
150 std::vector<fastjet::PseudoJet> calo_pseudojets;
152 if (
Verbosity()>TOW_PRINT_INT) std::cout <<
" Input Tower Set("<<n_inputs++<<
"): ";
155 std::vector<Jet *>
particles = inp->get_input(topNode);
156 for (
unsigned int i = 0;
i < particles.size(); ++
i)
158 auto& part = particles[
i];
159 float this_e = part->get_e();
160 if (this_e == 0.)
continue;
161 float this_px = particles[
i]->get_px();
162 float this_py = particles[
i]->get_py();
163 float this_pz = particles[
i]->get_pz();
167 float e_ratio = 0.001 / this_e;
168 this_e = this_e * e_ratio;
169 this_px = this_px * e_ratio;
170 this_py = this_py * e_ratio;
171 this_pz = this_pz * e_ratio;
173 fastjet::PseudoJet pseudojet(this_px, this_py, this_pz, this_e);
175 calo_pseudojets .push_back(pseudojet);
177 sum_pt += pseudojet.perp();
181 if (
Verbosity()>TOW_PRINT_INT) std::cout <<
" sumpt(" << sum_pt <<
") from ntowers("<<
n_towers <<
")" << std::endl;
182 for (
auto &
p : particles)
delete p;
185 auto embjet = fastjet::PseudoJet();
187 calo_pseudojets.push_back(embjet);
190 fastjet::Selector not_pure_ghost = !fastjet::SelectorIsPureGhost();
192 fastjet::Selector selection = jetrap && not_pure_ghost;
193 fastjet::AreaDefinition area_def(
194 fastjet::active_area_explicit_ghosts, fastjet::GhostedAreaSpec(ghost_max_rap, 1, ghost_R));
202 fastjet::JetMedianBackgroundEstimator bge_rm2 {selector_rm2, jet_def_bkgd, area_def};
203 bge_rm2.set_particles(calo_pseudojets);
205 m_rho = bge_rm2.rho();
213 fastjet::ClusterSequenceArea clustSeq(calo_pseudojets, jet_def_antikt, area_def);
214 std::vector<fastjet::PseudoJet> jets
215 =
sorted_by_pt( selection( clustSeq.inclusive_jets(5.) ));
220 std::cout <<
" --- rhoA jets [set("<<
outevent<<
")]" << std::endl;
221 for (
auto jet : jets) {
222 if (jet.perp()-
m_rho*jet.area() > 5.) {
223 auto phi = jet.phi();
224 while (
phi > M_PI)
phi -= 2*M_PI;
225 std::cout << Form(
"k[%i] pt:phi:eta[%5.2f:%5.2f:%5.2f]", fixmek++, (jet.perp()-
m_rho*jet.area()),
phi, jet.eta()) << std::endl;
231 if (jets.size() == 0) {
232 std::cout <<
" no jets reconstructed; something is very wrong" << std::endl;
241 auto& lead_jet = jets[0];
249 while (dphi>M_PI) dphi = TMath::Abs(dphi-2*M_PI);
250 float dR = TMath::Sq(dphi)+TMath::Sq(lead_jet.eta()-
m_1TeV_eta);
263 std::vector<fastjet::PseudoJet> sub1_pseudojets;
265 if (
Verbosity()>TOW_PRINT_INT) std::cout <<
" Input Tower Set("<<n_inputs++<<
"): ";
268 std::vector<Jet *> particles = inp->get_input(topNode);
269 for (
unsigned int i = 0;
i < particles.size(); ++
i)
271 auto& part = particles[
i];
272 float this_e = part->get_e();
273 if (this_e == 0.)
continue;
274 float this_px = particles[
i]->get_px();
275 float this_py = particles[
i]->get_py();
276 float this_pz = particles[
i]->get_pz();
280 float e_ratio = 0.001 / this_e;
281 this_e = this_e * e_ratio;
282 this_px = this_px * e_ratio;
283 this_py = this_py * e_ratio;
284 this_pz = this_pz * e_ratio;
286 fastjet::PseudoJet pseudojet(this_px, this_py, this_pz, this_e);
288 sub1_pseudojets .push_back(pseudojet);
290 sum_pt += pseudojet.perp();
294 if (
Verbosity()>TOW_PRINT_INT) std::cout <<
" sumpt(" << sum_pt <<
") from ntowers("<<
n_towers <<
")" << std::endl;
295 for (
auto &
p : particles)
delete p;
298 sub1_pseudojets.push_back(embjet);
300 fastjet::ClusterSequenceArea clustSeq_sub1(sub1_pseudojets, jet_def_antikt, area_def);
301 std::vector<fastjet::PseudoJet> jets_sub1
302 =
sorted_by_pt( selection( clustSeq_sub1.inclusive_jets(5.) ));
305 if (jets_sub1.size() == 0) {
306 std::cout <<
" no jets_sub1 reconstructed; something is very wrong" << std::endl;
313 auto& lead_jet = jets_sub1[0];
318 float dphi = TMath::Abs(lead_jet.phi_std() -
m_1TeV_phi);
319 while (dphi>M_PI) dphi = TMath::Abs(dphi-2*M_PI);
320 float dR = TMath::Sq(dphi)+TMath::Sq(lead_jet.eta()-
m_1TeV_eta);