Find the ProtoJets from the collection of input Candidates.
22 cout <<
"Welcome to CATopSubJetAlgorithm::run" << endl;
29 for (
unsigned i = 0;
i < cell_particles.size(); ++
i) {
30 sumEt += cell_particles[
i].perp();
40 cout <<
"Using sumEt = " << sumEt <<
", bin = " << sumEtBinId << endl;
48 fastjet::PseudoJet blankJetA(0, 0, 0, 0);
49 blankJetA.set_user_index(-1);
50 const fastjet::PseudoJet blankJet = blankJetA;
59 cout <<
"No Adjacency" << endl;
61 cout <<
"using deltar adjacency" << endl;
63 cout <<
"using modified adjacency" << endl;
65 cout <<
"using calorimeter nearest neighbor based adjacency" << endl;
67 cout <<
"Using deltarcut = " << deltarcut << endl;
69 cout <<
"Using nCellMin = " << nCellMin << endl;
72 cout <<
"About to do jet clustering in CA" << endl;
87 cout <<
"Getting inclusive jets" << endl;
89 vector<fastjet::PseudoJet> inclusiveJets = fjClusterSeq->inclusive_jets(
ptMin_);
92 cout <<
"Getting central jets" << endl;
94 vector<fastjet::PseudoJet> centralJets;
95 for (
unsigned int i = 0;
i < inclusiveJets.size();
i++) {
97 centralJets.push_back(inclusiveJets[
i]);
104 vector<math::XYZTLorentzVector> p4_hardJets;
108 vector<vector<int> >
indices(centralJets.size());
111 vector<fastjet::PseudoJet>::iterator jetIt = centralJets.begin(), centralJetsEnd = centralJets.end();
113 cout <<
"Loop over jets" << endl;
115 for (; jetIt != centralJetsEnd; ++jetIt) {
117 cout <<
"\nJet " << i << endl;
119 fastjet::PseudoJet localJet = *jetIt;
126 cout <<
"local jet pt = " << localJet.perp() << endl;
130 double ptHard =
ptFracBins_[sumEtBinId] * localJet.perp();
131 vector<fastjet::PseudoJet> leftoversAll;
135 cout <<
"Doing decomposition 1" << endl;
136 fastjet::PseudoJet ja, jb;
137 vector<fastjet::PseudoJet> leftovers1;
139 decomposeJet(localJet, *fjClusterSeq, cell_particles, ptHard, nCellMin, deltarcut, ja, jb, leftovers1);
140 leftoversAll.insert(leftoversAll.end(), leftovers1.begin(), leftovers1.end());
146 cout <<
"Doing decomposition 2. ja->jaa+jab?" << endl;
147 fastjet::PseudoJet jaa, jab;
148 vector<fastjet::PseudoJet> leftovers2a;
149 bool hardBreak2a =
false;
151 hardBreak2a =
decomposeJet(ja, *fjClusterSeq, cell_particles, ptHard, nCellMin, deltarcut, jaa, jab, leftovers2a);
152 leftoversAll.insert(leftoversAll.end(), leftovers2a.begin(), leftovers2a.end());
155 cout <<
"Doing decomposition 2. ja->jba+jbb?" << endl;
156 fastjet::PseudoJet jba, jbb;
157 vector<fastjet::PseudoJet> leftovers2b;
158 bool hardBreak2b =
false;
160 hardBreak2b =
decomposeJet(jb, *fjClusterSeq, cell_particles, ptHard, nCellMin, deltarcut, jba, jbb, leftovers2b);
161 leftoversAll.insert(leftoversAll.end(), leftovers2b.begin(), leftovers2b.end());
169 cout <<
"Done with decomposition" << endl;
172 cout <<
"hardBreak1 = " << hardBreak1 << endl;
174 cout <<
"hardBreak2a = " << hardBreak2a << endl;
176 cout <<
"hardBreak2b = " << hardBreak2b << endl;
178 fastjet::PseudoJet hardA = blankJet, hardB = blankJet, hardC = blankJet, hardD = blankJet;
185 cout <<
"Hardbreak failed. Save subjet1=localJet" << endl;
187 if (hardBreak1 && !hardBreak2a && !hardBreak2b) {
193 cout <<
"First decomposition succeeded, both second decompositions failed. Save subjet1=ja subjet2=jb" << endl;
195 if (hardBreak1 && hardBreak2a && !hardBreak2b) {
201 cout <<
"First decomposition succeeded, ja split succesfully, jb did not split. Save subjet1=jaa subjet2=jab " 205 if (hardBreak1 && !hardBreak2a && hardBreak2b) {
211 cout <<
"First decomposition succeeded, jb split succesfully, ja did not split. Save subjet1=jba subjet2=jbb " 215 if (hardBreak1 && hardBreak2a && hardBreak2b) {
221 cout <<
"First decomposition and both secondary decompositions succeeded. Save subjet1=jaa subjet2=jab " 222 "subjet3=jba subjet4=jbb" 227 fastjet::PseudoJet subjet1 = blankJet;
228 fastjet::PseudoJet subjet2 = blankJet;
229 fastjet::PseudoJet subjet3 = blankJet;
230 fastjet::PseudoJet subjet4 = blankJet;
237 vector<fastjet::PseudoJet> hardSubjets;
240 std::cout <<
"HardA : user_index = " << hardA.user_index() <<
", (Pt,Y,Phi,M) = (" << hardA.pt() <<
", " 241 << hardA.rapidity() <<
", " << hardA.phi() <<
", " << hardA.m() <<
")" << std::endl;
243 std::cout <<
"HardB : user_index = " << hardB.user_index() <<
", (Pt,Y,Phi,M) = (" << hardB.pt() <<
", " 244 << hardB.rapidity() <<
", " << hardB.phi() <<
", " << hardB.m() <<
")" << std::endl;
246 std::cout <<
"HardC : user_index = " << hardC.user_index() <<
", (Pt,Y,Phi,M) = (" << hardC.pt() <<
", " 247 << hardC.rapidity() <<
", " << hardC.phi() <<
", " << hardC.m() <<
")" << std::endl;
249 std::cout <<
"HardD : user_index = " << hardD.user_index() <<
", (Pt,Y,Phi,M) = (" << hardD.pt() <<
", " 250 << hardD.rapidity() <<
", " << hardD.phi() <<
", " << hardD.m() <<
")" << std::endl;
257 if (subjet1.pt() > 0.0001)
258 hardSubjets.push_back(subjet1);
259 if (subjet2.pt() > 0.0001)
260 hardSubjets.push_back(subjet2);
261 if (subjet3.pt() > 0.0001)
262 hardSubjets.push_back(subjet3);
263 if (subjet4.pt() > 0.0001)
264 hardSubjets.push_back(subjet4);
268 fastjet::PseudoJet candidate =
join(hardSubjets);
270 candidate.reset_momentum(jetIt->px(), jetIt->py(), jetIt->pz(), jetIt->e());
273 std::cout <<
"Final top-jet candidate: (Pt,Y,Phi,M) = (" << candidate.pt() <<
", " << candidate.rapidity() <<
", " 274 << candidate.phi() <<
", " << candidate.m() <<
")" << std::endl;
275 std::vector<fastjet::PseudoJet>
pieces = candidate.pieces();
276 std::cout <<
"Number of pieces = " << pieces.size() << std::endl;
277 for (std::vector<fastjet::PseudoJet>::const_iterator ibegin = pieces.begin(), iend = pieces.end(), i = ibegin;
280 std::cout <<
" Piece : " << i - ibegin <<
", (Pt,Y,Phi,M) = (" << i->pt() <<
", " << i->rapidity() <<
", " 281 << i->phi() <<
", " << i->m() <<
")" << std::endl;
285 hardjetsOutput.push_back(candidate);
std::vector< double > sumEtBins_
bool greaterByEtPseudoJet(fastjet::PseudoJet const &j1, fastjet::PseudoJet const &j2)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool decomposeJet(const fastjet::PseudoJet &theJet, const fastjet::ClusterSequence &theClusterSequence, const std::vector< fastjet::PseudoJet > &cell_particles, double ptHard, double nCellMin, double deltarcut, fastjet::PseudoJet &ja, fastjet::PseudoJet &jb, std::vector< fastjet::PseudoJet > &leftovers) const
std::vector< double > ptFracBins_
std::vector< double > deltarBins_
static std::string join(char **cmd)
T perp() const
Magnitude of transverse component.
std::vector< double > nCellBins_