32 #include "ConeClusterAlgo.hpp" 33 #include "HepEntityIpre96.h" 34 #include "HepEntityI.h" 36 #include "fastjet/D0RunIBaseConePlugin.hh" 37 #include "fastjet/D0RunIpre96ConePlugin.hh" 38 #include "fastjet/D0RunIConePlugin.hh" 39 #include "fastjet/ClusterSequence.hh" 40 #include "fastjet/Error.hh" 43 FASTJET_BEGIN_NAMESPACE
46 using namespace d0runi;
54 const double D0RunIBaseConePlugin::_DEFAULT_SPLifr = 0.5;
55 const double D0RunIBaseConePlugin::_DEFAULT_TWOrad = 0.;
56 const bool D0RunIBaseConePlugin::_DEFAULT_D0_Angle =
false;
57 const bool D0RunIBaseConePlugin::_DEFAULT_Increase_Delta_R =
true;
58 const bool D0RunIBaseConePlugin::_DEFAULT_Kill_Far_Clusters =
true;
59 const bool D0RunIBaseConePlugin::_DEFAULT_Jet_Et_Min_On_Iter =
true;
60 const double D0RunIBaseConePlugin::_DEFAULT_Far_Ratio = 0.5;
61 const double D0RunIBaseConePlugin::_DEFAULT_Eitem_Negdrop = -1.0;
62 const double D0RunIBaseConePlugin::_DEFAULT_Et_Min_Ratio = 0.5;
63 const double D0RunIBaseConePlugin::_DEFAULT_Thresh_Diff_Et = 0.01;
68 template<
typename HepEntityType>
69 void D0RunIBaseConePlugin::run_clustering_worker(ClusterSequence & clust_seq)
const{
71 vector<HepEntityType> entities(clust_seq.jets().size());
72 list<const HepEntityType * > ensemble;
73 for (
unsigned i = 0; i < clust_seq.jets().size(); i++) {
74 entities[i].Fill(clust_seq.jets()[i].E(),
75 clust_seq.jets()[i].px(),
76 clust_seq.jets()[i].py(),
77 clust_seq.jets()[i].pz(),
80 if (abs(entities[i].pz() ) < entities[i].E() ) {
81 ensemble.push_back(& (entities[i]));
86 ConeClusterAlgo<HepEntityType>
87 RunIconeAlgo(CONErad(),
103 list<HepEntityType> jets;
104 RunIconeAlgo.makeClusters(jets, ensemble, Zvertex);
108 for(
int i = RunIconeAlgo.TempColl.size()-1; i >= 0; i--) {
110 std::list<const HepEntityType*> tlist = RunIconeAlgo.TempColl[i].LItems();
111 typename std::list<const HepEntityType*>::iterator tk;
115 int jet_k = (*tk)->index;
120 HepEntityType jet_current_momentum = *(*tk);
124 for (; tk != tlist.end(); tk++) {
126 int jet_j = (*tk)->index;
132 jet_current_momentum.Add(**tk);
133 PseudoJet new_mom(jet_current_momentum.px(), jet_current_momentum.py(),
134 jet_current_momentum.pz(), jet_current_momentum.E());
136 clust_seq.plugin_record_ij_recombination(jet_i, jet_j, dij, new_mom, jet_k);
140 double d_iB = clust_seq.jets()[jet_k].perp2();
141 clust_seq.plugin_record_iB_recombination(jet_k, d_iB);
152 bool D0RunIpre96ConePlugin::_first_time=
true;
154 string D0RunIpre96ConePlugin::description ()
const {
157 desc <<
"D0 Run I (pre 96) cone jet algorithm, with ";
158 desc <<
"cone_radius = " << CONErad () <<
", " 159 <<
"min_jet_Et = " << JETmne () <<
", " 160 <<
"split_fraction = " << SPLifr ();
165 void D0RunIpre96ConePlugin::run_clustering(ClusterSequence & clust_seq)
const {
167 _print_banner(clust_seq.fastjet_banner_stream());
169 run_clustering_worker<HepEntityIpre96>(clust_seq);
173 void D0RunIpre96ConePlugin::_print_banner(ostream *ostr)
const{
174 if (! _first_time)
return;
180 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
181 (*ostr) <<
"# You are running the D0 Run I (pre96) Cone plugin for FastJet " << endl;
182 (*ostr) <<
"# Original code by the D0 collaboration, provided by Lars Sonnenschein; " << endl;
183 (*ostr) <<
"# interface by FastJet authors " << endl;
184 (*ostr) <<
"# If you use this plugin, please cite " << endl;
185 (*ostr) <<
"# B. Abbott et al. [D0 Collaboration], FERMILAB-PUB-97-242-E. " << endl;
186 (*ostr) <<
"# in addition to the usual FastJet reference. " << endl;
187 (*ostr) <<
"#--------------------------------------------------------------------------" << endl;
200 bool D0RunIConePlugin::_first_time=
true;
202 string D0RunIConePlugin::description ()
const {
205 desc <<
"D0 Run I cone jet algorithm, with ";
206 desc <<
"cone_radius = " << CONErad () <<
", " 207 <<
"min_jet_Et = " << JETmne () <<
", " 208 <<
"split_fraction = " << SPLifr ();
213 void D0RunIConePlugin::run_clustering(ClusterSequence & clust_seq)
const {
215 _print_banner(clust_seq.fastjet_banner_stream());
217 run_clustering_worker<HepEntityI>(clust_seq);
221 void D0RunIConePlugin::_print_banner(ostream *ostr)
const{
222 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;
242 FASTJET_END_NAMESPACE