34#include "ConeClusterAlgo.hpp"
35#include "HepEntityIpre96.h"
36#include "HepEntityI.h"
38#include "fastjet/D0RunIBaseConePlugin.hh"
39#include "fastjet/D0RunIpre96ConePlugin.hh"
40#include "fastjet/D0RunIConePlugin.hh"
41#include "fastjet/ClusterSequence.hh"
42#include "fastjet/Error.hh"
45FASTJET_BEGIN_NAMESPACE
48using namespace d0runi;
56const double D0RunIBaseConePlugin::_DEFAULT_SPLifr = 0.5;
57const double D0RunIBaseConePlugin::_DEFAULT_TWOrad = 0.;
58const bool D0RunIBaseConePlugin::_DEFAULT_D0_Angle =
false;
59const bool D0RunIBaseConePlugin::_DEFAULT_Increase_Delta_R =
true;
60const bool D0RunIBaseConePlugin::_DEFAULT_Kill_Far_Clusters =
true;
61const bool D0RunIBaseConePlugin::_DEFAULT_Jet_Et_Min_On_Iter =
true;
62const double D0RunIBaseConePlugin::_DEFAULT_Far_Ratio = 0.5;
63const double D0RunIBaseConePlugin::_DEFAULT_Eitem_Negdrop = -1.0;
64const double D0RunIBaseConePlugin::_DEFAULT_Et_Min_Ratio = 0.5;
65const double D0RunIBaseConePlugin::_DEFAULT_Thresh_Diff_Et = 0.01;
70template<
typename HepEntityType>
71void D0RunIBaseConePlugin::run_clustering_worker(ClusterSequence & clust_seq)
const{
73 vector<HepEntityType> entities(clust_seq.jets().size());
74 list<const HepEntityType * > ensemble;
75 for (
unsigned i = 0; i < clust_seq.jets().size(); i++) {
76 entities[i].Fill(clust_seq.jets()[i].E(),
77 clust_seq.jets()[i].px(),
78 clust_seq.jets()[i].py(),
79 clust_seq.jets()[i].pz(),
82 if (abs(entities[i].pz() ) < entities[i].E() ) {
83 ensemble.push_back(& (entities[i]));
88 ConeClusterAlgo<HepEntityType>
89 RunIconeAlgo(CONErad(),
105 list<HepEntityType> jets;
106 RunIconeAlgo.makeClusters(jets, ensemble, Zvertex);
110 for(
int i = RunIconeAlgo.TempColl.size()-1; i >= 0; i--) {
112 std::list<const HepEntityType*> tlist = RunIconeAlgo.TempColl[i].LItems();
113 typename std::list<const HepEntityType*>::iterator tk;
117 int jet_k = (*tk)->index;
122 HepEntityType jet_current_momentum = *(*tk);
126 for (; tk != tlist.end(); tk++) {
128 int jet_j = (*tk)->index;
134 jet_current_momentum.Add(**tk);
135 PseudoJet new_mom(jet_current_momentum.px(), jet_current_momentum.py(),
136 jet_current_momentum.pz(), jet_current_momentum.E());
138 clust_seq.plugin_record_ij_recombination(jet_i, jet_j, dij, new_mom, jet_k);
142 double d_iB = clust_seq.jets()[jet_k].perp2();
143 clust_seq.plugin_record_iB_recombination(jet_k, d_iB);
154thread_safety_helpers::FirstTimeTrue D0RunIpre96ConePlugin::_first_time;
156string D0RunIpre96ConePlugin::description ()
const {
159 desc <<
"D0 Run I (pre 96) cone jet algorithm, with ";
160 desc <<
"cone_radius = " << CONErad () <<
", "
161 <<
"min_jet_Et = " << JETmne () <<
", "
162 <<
"split_fraction = " << SPLifr ();
171 run_clustering_worker<HepEntityIpre96>(clust_seq);
175void D0RunIpre96ConePlugin::_print_banner(ostream *ostr)
const{
176 if (! _first_time())
return;
181 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
182 (*ostr) <<
"# You are running the D0 Run I (pre96) Cone plugin for FastJet " << endl;
183 (*ostr) <<
"# Original code by the D0 collaboration, provided by Lars Sonnenschein; " << endl;
184 (*ostr) <<
"# interface by FastJet authors " << endl;
185 (*ostr) <<
"# If you use this plugin, please cite " << endl;
186 (*ostr) <<
"# B. Abbott et al. [D0 Collaboration], FERMILAB-PUB-97-242-E. " << endl;
187 (*ostr) <<
"# in addition to the usual FastJet reference. " << endl;
188 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
201thread_safety_helpers::FirstTimeTrue D0RunIConePlugin::_first_time;
203string D0RunIConePlugin::description ()
const {
206 desc <<
"D0 Run I cone jet algorithm, with ";
207 desc <<
"cone_radius = " << CONErad () <<
", "
208 <<
"min_jet_Et = " << JETmne () <<
", "
209 <<
"split_fraction = " << SPLifr ();
218 run_clustering_worker<HepEntityI>(clust_seq);
222void D0RunIConePlugin::_print_banner(ostream *ostr)
const{
223 if (! _first_time())
return;
228 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
229 (*ostr) <<
"# You are running the D0 Run I Cone plugin for FastJet " << endl;
230 (*ostr) <<
"# Original code provided by Lars Sonnenschein; interface by FastJet authors" << endl;
231 (*ostr) <<
"# If you use this plugin, please cite " << endl;
232 (*ostr) <<
"# B. Abbott et al. [D0 Collaboration], FERMILAB-PUB-97-242-E. " << endl;
233 (*ostr) <<
"# in addition to the usual FastJet reference. " << endl;
234 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
static std::ostream * fastjet_banner_stream()
returns a pointer to the stream to be used to print banners (cout by default).