19 fastjet::PseudoJet
jet;
21 std::vector<float> lund_all_lnR;
22 std::vector<float> lund_all_lnkT;
23 std::vector<float> lund_all_z;
24 std::vector<float> lund_all_kt;
25 std::vector<float> lund_all_deltaR;
26 std::vector<int> lund_all_idp1;
27 std::vector<int> lund_all_idp2;
29 std::vector<std::vector<LundVariablesTool::Declustering>> v_LundValues;
30 auto & constit_links = injet->constituentLinks();
31 std::vector<fastjet::PseudoJet> v_pj_constituents;
33 v_pj_constituents.clear();
35 for(
size_t ij = 0; ij < injet->numConstituents(); ij++) {
38 TLorentzVector tlv_const;
39 tlv_const.SetPtEtaPhiE(constit->
pt() / 1.e3, constit->
eta(), constit->
phi(), constit->
e() / 1.e3);
41 v_pj_constituents.push_back(fastjet::PseudoJet(tlv_const.Px(), tlv_const.Py(), tlv_const.Pz(), tlv_const.E()));
50 std::vector<double> v_jj_pt;
51 std::vector<double> v_j1_pt;
52 std::vector<double> v_j2_pt;
53 std::vector<double> v_jj_kt;
56 for (
const auto & declust : v_LundValues.at(0)){
57 v_jj_pt.push_back( declust.jj.pt() );
58 v_j1_pt.push_back( declust.j1.pt() );
59 v_j2_pt.push_back( declust.j2.pt() );
60 v_jj_kt.push_back( declust.kt );
63 for (
int id=0;
id < int(v_jj_pt.size());
id++) {
68 auto itp1 =
find(v_jj_pt.begin(), v_jj_pt.end(), v_j1_pt.at(
id));
69 auto itp2 =
find(v_jj_pt.begin(), v_jj_pt.end(), v_j2_pt.at(
id));
71 if (itp1 != v_jj_pt.end()) {
72 idp1 = itp1 - v_jj_pt.begin();
77 if (itp2 != v_jj_pt.end()) {
78 idp2 = itp2 - v_jj_pt.begin();
80 v_LundValues.at(0).at(
id).idp1 = idp1;
81 v_LundValues.at(0).at(
id).idp2 = idp2;
85 for (
const auto&
split : v_LundValues[0]) {
88 lund_all_lnR.push_back(std::log(1.0 /
split.delta_R));
89 lund_all_lnkT.push_back(std::log(
split.kt));
90 lund_all_z.push_back(
split.z);
91 lund_all_kt.push_back(
split.kt);
92 lund_all_deltaR.push_back(
split.delta_R);
93 lund_all_idp1.push_back(
split.idp1);
94 lund_all_idp2.push_back(
split.idp2);
100 const std::string prefix =
m_prefix;
114 decLnR(*injet) = std::move(lund_all_lnR);
115 decLnKT(*injet) = std::move(lund_all_lnkT);
116 decZ(*injet) = std::move(lund_all_z);
117 decKt(*injet) = std::move(lund_all_kt);
118 decDR(*injet) = std::move(lund_all_deltaR);
119 decIDP1(*injet) = std::move(lund_all_idp1);
120 decIDP2(*injet) = std::move(lund_all_idp2);
121 decNSplits(*injet) = n_splits;
124 return StatusCode::SUCCESS;
129 fastjet::JetDefinition jd(fastjet::cambridge_algorithm, 1.0);
130 std::vector<LundVariablesTool::Declustering>
result;
131 fastjet::ClusterSequence cs(v_jcs, jd);
132 std::vector<fastjet::PseudoJet> v_pj = sorted_by_pt(cs.inclusive_jets());
134 fastjet::PseudoJet j = v_pj.at(0);
136 std::queue< fastjet::PseudoJet > jetStack;
139 while ( jetStack.size() > 0 ) {
140 fastjet::PseudoJet thisJ, pJLeft, pJRight;
141 thisJ = jetStack.front();
144 bool thisJHasParents = thisJ.has_parents(pJLeft, pJRight);
146 if (!thisJHasParents){
150 if (pJLeft.pt2() < pJRight.pt2()) {
151 fastjet::PseudoJet jTemp;
157 jetStack.push(pJLeft);
158 jetStack.push(pJRight);
164 declust.
j2 = pJRight;
167 declust.
pt = thisJ.pt();
168 declust.
m = thisJ.m();
171 declust.
pt1 = pJLeft.pt();
172 declust.
pt2 = pJRight.pt();
173 declust.
eta = pJRight.eta();
174 declust.
E = pJRight.E();
175 declust.
delta_R = pJLeft.delta_R(pJRight);
176 declust.
z = declust.
pt2 / (declust.
pt1 + declust.
pt2);
177 declust.
kt = pJRight.pt() * declust.
delta_R;
179 declust.
varphi = std::atan2(pJLeft.rap() - pJRight.rap(), pJLeft.delta_phi_to(pJRight));
180 result.push_back(std::move(declust));