13 #include "fastjet/PseudoJet.hh"
14 #include "fastjet/ClusterSequence.hh"
15 #include "fastjet/ClusterSequenceActiveArea.hh"
17 #include "fastjet/ClusterSequence.hh"
18 #include "fastjet/ClusterSequenceActiveArea.hh"
19 #include "fastjet/ClusterSequenceArea.hh"
35 delete mJetDefinition;
49 string JetFinder=
"kt_algorithm";;
51 string Strategy=
"Best";
105 cout <<
"[FastJetWrapper] `njets` and `dcut` set!=-1! - running inclusive Mode"<<endl;
113 cout <<
"*******************************************"<<endl;
114 cout <<
"* Configuration of FastJet "<<endl;
118 cout <<
"* Mode : inclusive"<<endl;
122 cout <<
"* [WARNING] Mode : inclusive - dcut and njets set!"<<endl;
126 cout <<
"* Mode : exclusive"<<endl;
130 cout <<
"* Mode : exclusive"<<endl;
135 cout <<
"* JetFinder: "<<JetFinder<<endl;
136 cout <<
"* Strategy : "<<Strategy<<endl;
137 cout <<
"*******************************************"<<endl;
142 if (!fOutput)
return;
146 std::vector<fastjet::PseudoJet> fjInputs;
147 fjInputs.reserve (fInput.size());
149 for (
unsigned i = 0;
i < fInput.size(); ++
i) {
151 fjInputs.push_back (fastjet::PseudoJet (c->
px(),c->
py(),c->
pz(),c->
energy()));
152 fjInputs.back().set_user_index(
i);
160 fastjet::ClusterSequenceActiveArea* clusterSequenceWithArea = 0;
161 fastjet::ClusterSequenceArea* clusterSequence = 0;
170 std::vector<fastjet::PseudoJet>
jets = clusterSequence->inclusive_jets (
thePtMin_);
173 double median_Pt_Per_Area = clusterSequenceWithArea ? clusterSequenceWithArea->pt_per_unit_area() : 0.;
176 for (std::vector<fastjet::PseudoJet>::const_iterator
jet=jets.begin();
jet!=jets.end();++
jet) {
182 double jetArea=clusterSequence->area(*
jet);
185 if (clusterSequenceWithArea) {
186 fastjet::PseudoJet pu_p4 = median_Pt_Per_Area * clusterSequenceWithArea->area_4vector(*
jet);
188 if (pu_p4.perp2() >=
jet->perp2() || pu_p4.E() >=
jet->E()) {
189 px = py = pz = E = 0.;
200 std::vector<fastjet::PseudoJet> fastjet_constituents = clusterSequence->constituents(*
jet);
202 jetConstituents.reserve (fastjet_constituents.size());
203 for (std::vector<fastjet::PseudoJet>::const_iterator itConst=fastjet_constituents.begin();
204 itConst!=fastjet_constituents.end();itConst++){
205 jetConstituents.push_back(fInput[(*itConst).user_index()]);
208 fOutput->push_back(
ProtoJet(p4,jetConstituents));
209 fOutput->back().setJetArea (jetArea);
210 fOutput->back().setPileup (pu);
213 if (clusterSequenceWithArea)
delete clusterSequenceWithArea;
214 else delete clusterSequence;
int theActive_Area_Repeats_
virtual double energy() const =0
energy
std::vector< ProtoJet > OutputCollection
void run(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
std::vector< InputItem > InputCollection
virtual double pz() const =0
z coordinate of momentum vector
Transient Jet class used by the reconstruction algorithms.
fastjet::GhostedAreaSpec * mActiveArea
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual double py() const =0
y coordinate of momentum vector
virtual double px() const =0
x coordinate of momentum vector
fastjet::JetDefinition * mJetDefinition