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]);
93 sort( centralJets.begin(), centralJets.end(), compEt );
96 vector<math::XYZTLorentzVector> p4_hardJets;
100 vector<vector<int> > indices( centralJets.size() );
103 vector<fastjet::PseudoJet>::iterator jetIt = centralJets.begin(),
104 centralJetsEnd = centralJets.end();
107 for ( ; jetIt != centralJetsEnd; ++jetIt ) {
110 fastjet::PseudoJet localJet = *jetIt;
116 if (
verbose_ )
cout<<
"local jet pt = "<<localJet.perp()<<endl;
119 double ptHard =
ptFracBins_[sumEtBinId]*localJet.perp();
120 vector<fastjet::PseudoJet> leftoversAll;
123 if (
verbose_ )
cout <<
"Doing decomposition 1" << endl;
124 fastjet::PseudoJet ja, jb;
125 vector<fastjet::PseudoJet> leftovers1;
126 bool hardBreak1 =
decomposeJet(localJet,*fjClusterSeq,cell_particles,ptHard,nCellMin,deltarcut,ja,jb,leftovers1);
127 leftoversAll.insert(leftoversAll.end(),leftovers1.begin(),leftovers1.end());
132 if (
verbose_ )
cout <<
"Doing decomposition 2. ja->jaa+jab?" << endl;
133 fastjet::PseudoJet jaa, jab;
134 vector<fastjet::PseudoJet> leftovers2a;
135 bool hardBreak2a =
false;
136 if (hardBreak1) hardBreak2a =
decomposeJet(ja,*fjClusterSeq,cell_particles,ptHard,nCellMin,deltarcut,jaa,jab,leftovers2a);
137 leftoversAll.insert(leftoversAll.end(),leftovers2a.begin(),leftovers2a.end());
139 if (
verbose_ )
cout <<
"Doing decomposition 2. ja->jba+jbb?" << endl;
140 fastjet::PseudoJet jba, jbb;
141 vector<fastjet::PseudoJet> leftovers2b;
142 bool hardBreak2b =
false;
143 if (hardBreak1) hardBreak2b =
decomposeJet(jb,*fjClusterSeq,cell_particles,ptHard,nCellMin,deltarcut,jba,jbb,leftovers2b);
144 leftoversAll.insert(leftoversAll.end(),leftovers2b.begin(),leftovers2b.end());
151 if (
verbose_ )
cout <<
"Done with decomposition" << endl;
153 if (
verbose_ )
cout<<
"hardBreak1 = "<<hardBreak1<<endl;
154 if (
verbose_ )
cout<<
"hardBreak2a = "<<hardBreak2a<<endl;
155 if (
verbose_ )
cout<<
"hardBreak2b = "<<hardBreak2b<<endl;
157 fastjet::PseudoJet hardA = blankJet, hardB = blankJet, hardC = blankJet, hardD = blankJet;
163 if(
verbose_)
cout<<
"Hardbreak failed. Save subjet1=localJet"<<endl;
165 if (hardBreak1 && !hardBreak2a && !hardBreak2b) {
170 if(
verbose_)
cout<<
"First decomposition succeeded, both second decompositions failed. Save subjet1=ja subjet2=jb"<<endl;
172 if (hardBreak1 && hardBreak2a && !hardBreak2b) {
177 if(
verbose_)
cout<<
"First decomposition succeeded, ja split succesfully, jb did not split. Save subjet1=jaa subjet2=jab subjet3=jb"<<endl;
179 if (hardBreak1 && !hardBreak2a && hardBreak2b) {
184 if(
verbose_)
cout<<
"First decomposition succeeded, jb split succesfully, ja did not split. Save subjet1=jba subjet2=jbb subjet3=ja"<<endl;
186 if (hardBreak1 && hardBreak2a && hardBreak2b) {
191 if(
verbose_)
cout<<
"First decomposition and both secondary decompositions succeeded. Save subjet1=jaa subjet2=jab subjet3=jba subjet4=jbb"<<endl;
195 fastjet::PseudoJet subjet1 = blankJet;
196 fastjet::PseudoJet subjet2 = blankJet;
197 fastjet::PseudoJet subjet3 = blankJet;
198 fastjet::PseudoJet subjet4 = blankJet;
199 subjet1 = hardA; subjet2 = hardB; subjet3 = hardC; subjet4 = hardD;
202 vector<fastjet::PseudoJet> hardSubjets;
205 std::cout <<
"HardA : user_index = " << hardA.user_index() <<
", (Pt,Y,Phi,M) = ("
206 << hardA.pt() <<
", " << hardA.rapidity() <<
", "
207 << hardA.phi() <<
", " << hardA.m() <<
")" << std::endl;
209 std::cout <<
"HardB : user_index = " << hardB.user_index() <<
", (Pt,Y,Phi,M) = ("
210 << hardB.pt() <<
", " << hardB.rapidity() <<
", "
211 << hardB.phi() <<
", " << hardB.m() <<
")" << std::endl;
213 std::cout <<
"HardC : user_index = " << hardC.user_index() <<
", (Pt,Y,Phi,M) = ("
214 << hardC.pt() <<
", " << hardC.rapidity() <<
", "
215 << hardC.phi() <<
", " << hardC.m() <<
")" << std::endl;
217 std::cout <<
"HardD : user_index = " << hardD.user_index() <<
", (Pt,Y,Phi,M) = ("
218 << hardD.pt() <<
", " << hardD.rapidity() <<
", "
219 << hardD.phi() <<
", " << hardD.m() <<
")" << std::endl;
226 if ( subjet1.pt() > 0.0001 )
227 hardSubjets.push_back(subjet1);
228 if ( subjet2.pt() > 0.0001 )
229 hardSubjets.push_back(subjet2);
230 if ( subjet3.pt() > 0.0001 )
231 hardSubjets.push_back(subjet3);
232 if ( subjet4.pt() > 0.0001 )
233 hardSubjets.push_back(subjet4);
234 sort(hardSubjets.begin(), hardSubjets.end(), compEt );
237 fastjet::PseudoJet candidate =
join(hardSubjets);
239 candidate.reset_momentum( jetIt->px(), jetIt->py(), jetIt->pz(), jetIt->e() );
242 std::cout <<
"Final top-jet candidate: (Pt,Y,Phi,M) = ("
243 << candidate.pt() <<
", " << candidate.rapidity() <<
", "
244 << candidate.phi() <<
", " << candidate.m() <<
")" << std::endl;
245 std::vector<fastjet::PseudoJet>
pieces = candidate.pieces();
246 std::cout <<
"Number of pieces = " << pieces.size() << std::endl;
247 for ( std::vector<fastjet::PseudoJet>::const_iterator ibegin = pieces.begin(), iend = pieces.end(), i = ibegin;
249 std::cout <<
" Piece : " << i - ibegin <<
", (Pt,Y,Phi,M) = ("
250 << i->pt() <<
", " << i->rapidity() <<
", "
251 << i->phi() <<
", " << i->m() <<
")" << std::endl;
255 hardjetsOutput.push_back( candidate );
std::vector< double > sumEtBins_
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_