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"
45 FASTJET_BEGIN_NAMESPACE
48 using namespace d0runi;
56 const double D0RunIBaseConePlugin::_DEFAULT_SPLifr = 0.5;
57 const double D0RunIBaseConePlugin::_DEFAULT_TWOrad = 0.;
58 const bool D0RunIBaseConePlugin::_DEFAULT_D0_Angle =
false;
59 const bool D0RunIBaseConePlugin::_DEFAULT_Increase_Delta_R =
true;
60 const bool D0RunIBaseConePlugin::_DEFAULT_Kill_Far_Clusters =
true;
61 const bool D0RunIBaseConePlugin::_DEFAULT_Jet_Et_Min_On_Iter =
true;
62 const double D0RunIBaseConePlugin::_DEFAULT_Far_Ratio = 0.5;
63 const double D0RunIBaseConePlugin::_DEFAULT_Eitem_Negdrop = -1.0;
64 const double D0RunIBaseConePlugin::_DEFAULT_Et_Min_Ratio = 0.5;
65 const double D0RunIBaseConePlugin::_DEFAULT_Thresh_Diff_Et = 0.01;
70 template<
typename HepEntityType>
71 void 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);
154 bool D0RunIpre96ConePlugin::_first_time=
true;
156 string 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);
175 void D0RunIpre96ConePlugin::_print_banner(ostream *ostr)
const{
176 if (! _first_time)
return;
182 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
183 (*ostr) <<
"# You are running the D0 Run I (pre96) Cone plugin for FastJet " << endl;
184 (*ostr) <<
"# Original code by the D0 collaboration, provided by Lars Sonnenschein; " << endl;
185 (*ostr) <<
"# interface by FastJet authors " << endl;
186 (*ostr) <<
"# If you use this plugin, please cite " << endl;
187 (*ostr) <<
"# B. Abbott et al. [D0 Collaboration], FERMILAB-PUB-97-242-E. " << endl;
188 (*ostr) <<
"# in addition to the usual FastJet reference. " << endl;
189 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
202 bool D0RunIConePlugin::_first_time=
true;
204 string D0RunIConePlugin::description ()
const {
207 desc <<
"D0 Run I cone jet algorithm, with ";
208 desc <<
"cone_radius = " << CONErad () <<
", "
209 <<
"min_jet_Et = " << JETmne () <<
", "
210 <<
"split_fraction = " << SPLifr ();
219 run_clustering_worker<HepEntityI>(clust_seq);
223 void D0RunIConePlugin::_print_banner(ostream *ostr)
const{
224 if (! _first_time)
return;
230 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
231 (*ostr) <<
"# You are running the D0 Run I Cone plugin for FastJet " << endl;
232 (*ostr) <<
"# Original code provided by Lars Sonnenschein; interface by FastJet authors" << endl;
233 (*ostr) <<
"# If you use this plugin, please cite " << endl;
234 (*ostr) <<
"# B. Abbott et al. [D0 Collaboration], FERMILAB-PUB-97-242-E. " << endl;
235 (*ostr) <<
"# in addition to the usual FastJet reference. " << endl;
236 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
244 FASTJET_END_NAMESPACE
static std::ostream * fastjet_banner_stream()
returns a pointer to the stream to be used to print banners (cout by default).