Find the ProtoJets from the collection of input Candidates.
24 if (
verbose_ )
cout <<
"Welcome to CATopSubJetAlgorithm::run" << endl;
31 for (
unsigned i = 0;
i < cell_particles.size(); ++
i) {
32 sumEt += cell_particles[
i].perp();
40 if (
verbose_ )
cout <<
"Using sumEt = " << sumEt <<
", bin = " << sumEtBinId << endl;
43 if ( sumEtBinId < 0 ) {
48 fastjet::PseudoJet blankJetA(0,0,0,0);
49 blankJetA.set_user_index(-1);
50 const fastjet::PseudoJet blankJet = blankJetA;
64 if (
verbose_ )
cout <<
"About to do jet clustering in CA" << endl;
78 if (
verbose_ )
cout <<
"Getting inclusive jets" << endl;
80 vector<fastjet::PseudoJet> inclusiveJets = fjClusterSeq->inclusive_jets(
ptMin_);
84 vector<fastjet::PseudoJet> centralJets;
85 for (
unsigned int i = 0;
i < inclusiveJets.size();
i++) {
88 centralJets.push_back(inclusiveJets[
i]);
95 vector<math::XYZTLorentzVector> p4_hardJets;
99 vector<vector<int> > indices( centralJets.size() );
102 vector<fastjet::PseudoJet>::iterator jetIt = centralJets.begin(),
103 centralJetsEnd = centralJets.end();
106 for ( ; jetIt != centralJetsEnd; ++jetIt ) {
109 fastjet::PseudoJet localJet = *jetIt;
115 if (
verbose_ )
cout<<
"local jet pt = "<<localJet.perp()<<endl;
118 double ptHard =
ptFracBins_[sumEtBinId]*localJet.perp();
119 vector<fastjet::PseudoJet> leftoversAll;
122 if (
verbose_ )
cout <<
"Doing decomposition 1" << endl;
123 fastjet::PseudoJet ja, jb;
124 vector<fastjet::PseudoJet> leftovers1;
125 bool hardBreak1 =
decomposeJet(localJet,*fjClusterSeq,cell_particles,ptHard,nCellMin,deltarcut,ja,jb,leftovers1);
126 leftoversAll.insert(leftoversAll.end(),leftovers1.begin(),leftovers1.end());
131 if (
verbose_ )
cout <<
"Doing decomposition 2. ja->jaa+jab?" << endl;
132 fastjet::PseudoJet jaa, jab;
133 vector<fastjet::PseudoJet> leftovers2a;
134 bool hardBreak2a =
false;
135 if (hardBreak1) hardBreak2a =
decomposeJet(ja,*fjClusterSeq,cell_particles,ptHard,nCellMin,deltarcut,jaa,jab,leftovers2a);
136 leftoversAll.insert(leftoversAll.end(),leftovers2a.begin(),leftovers2a.end());
138 if (
verbose_ )
cout <<
"Doing decomposition 2. ja->jba+jbb?" << endl;
139 fastjet::PseudoJet jba, jbb;
140 vector<fastjet::PseudoJet> leftovers2b;
141 bool hardBreak2b =
false;
142 if (hardBreak1) hardBreak2b =
decomposeJet(jb,*fjClusterSeq,cell_particles,ptHard,nCellMin,deltarcut,jba,jbb,leftovers2b);
143 leftoversAll.insert(leftoversAll.end(),leftovers2b.begin(),leftovers2b.end());
150 if (
verbose_ )
cout <<
"Done with decomposition" << endl;
152 if (
verbose_ )
cout<<
"hardBreak1 = "<<hardBreak1<<endl;
153 if (
verbose_ )
cout<<
"hardBreak2a = "<<hardBreak2a<<endl;
154 if (
verbose_ )
cout<<
"hardBreak2b = "<<hardBreak2b<<endl;
156 fastjet::PseudoJet hardA = blankJet, hardB = blankJet, hardC = blankJet, hardD = blankJet;
162 if(
verbose_)
cout<<
"Hardbreak failed. Save subjet1=localJet"<<endl;
164 if (hardBreak1 && !hardBreak2a && !hardBreak2b) {
169 if(
verbose_)
cout<<
"First decomposition succeeded, both second decompositions failed. Save subjet1=ja subjet2=jb"<<endl;
171 if (hardBreak1 && hardBreak2a && !hardBreak2b) {
176 if(
verbose_)
cout<<
"First decomposition succeeded, ja split succesfully, jb did not split. Save subjet1=jaa subjet2=jab subjet3=jb"<<endl;
178 if (hardBreak1 && !hardBreak2a && hardBreak2b) {
183 if(
verbose_)
cout<<
"First decomposition succeeded, jb split succesfully, ja did not split. Save subjet1=jba subjet2=jbb subjet3=ja"<<endl;
185 if (hardBreak1 && hardBreak2a && hardBreak2b) {
190 if(
verbose_)
cout<<
"First decomposition and both secondary decompositions succeeded. Save subjet1=jaa subjet2=jab subjet3=jba subjet4=jbb"<<endl;
194 fastjet::PseudoJet subjet1 = blankJet;
195 fastjet::PseudoJet subjet2 = blankJet;
196 fastjet::PseudoJet subjet3 = blankJet;
197 fastjet::PseudoJet subjet4 = blankJet;
198 subjet1 = hardA; subjet2 = hardB; subjet3 = hardC; subjet4 = hardD;
201 vector<fastjet::PseudoJet> hardSubjets;
204 std::cout <<
"HardA : user_index = " << hardA.user_index() <<
", (Pt,Y,Phi,M) = (" 205 << hardA.pt() <<
", " << hardA.rapidity() <<
", " 206 << hardA.phi() <<
", " << hardA.m() <<
")" << std::endl;
208 std::cout <<
"HardB : user_index = " << hardB.user_index() <<
", (Pt,Y,Phi,M) = (" 209 << hardB.pt() <<
", " << hardB.rapidity() <<
", " 210 << hardB.phi() <<
", " << hardB.m() <<
")" << std::endl;
212 std::cout <<
"HardC : user_index = " << hardC.user_index() <<
", (Pt,Y,Phi,M) = (" 213 << hardC.pt() <<
", " << hardC.rapidity() <<
", " 214 << hardC.phi() <<
", " << hardC.m() <<
")" << std::endl;
216 std::cout <<
"HardD : user_index = " << hardD.user_index() <<
", (Pt,Y,Phi,M) = (" 217 << hardD.pt() <<
", " << hardD.rapidity() <<
", " 218 << hardD.phi() <<
", " << hardD.m() <<
")" << std::endl;
225 if ( subjet1.pt() > 0.0001 )
226 hardSubjets.push_back(subjet1);
227 if ( subjet2.pt() > 0.0001 )
228 hardSubjets.push_back(subjet2);
229 if ( subjet3.pt() > 0.0001 )
230 hardSubjets.push_back(subjet3);
231 if ( subjet4.pt() > 0.0001 )
232 hardSubjets.push_back(subjet4);
236 fastjet::PseudoJet candidate =
join(hardSubjets);
238 candidate.reset_momentum( jetIt->px(), jetIt->py(), jetIt->pz(), jetIt->e() );
241 std::cout <<
"Final top-jet candidate: (Pt,Y,Phi,M) = (" 242 << candidate.pt() <<
", " << candidate.rapidity() <<
", " 243 << candidate.phi() <<
", " << candidate.m() <<
")" << std::endl;
244 std::vector<fastjet::PseudoJet>
pieces = candidate.pieces();
245 std::cout <<
"Number of pieces = " << pieces.size() << std::endl;
246 for ( std::vector<fastjet::PseudoJet>::const_iterator ibegin = pieces.begin(), iend = pieces.end(), i = ibegin;
248 std::cout <<
" Piece : " << i - ibegin <<
", (Pt,Y,Phi,M) = (" 249 << i->pt() <<
", " << i->rapidity() <<
", " 250 << i->phi() <<
", " << i->m() <<
")" << std::endl;
254 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_