00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "fastjet/D0RunIBaseConePlugin.hh"
00032 #include "fastjet/D0RunIpre96ConePlugin.hh"
00033 #include "fastjet/D0RunIConePlugin.hh"
00034 #include "fastjet/ClusterSequence.hh"
00035 #include "fastjet/Error.hh"
00036 #include <sstream>
00037
00038
00039 #include <list>
00040 #include "ConeClusterAlgo.hpp"
00041 #include "HepEntityIpre96.h"
00042 #include "HepEntityI.h"
00043
00044 FASTJET_BEGIN_NAMESPACE
00045
00046 using namespace std;
00047 using namespace d0runi;
00048
00049
00050
00051
00052
00053
00054
00055 const double D0RunIBaseConePlugin::_DEFAULT_SPLifr = 0.5;
00056 const double D0RunIBaseConePlugin::_DEFAULT_TWOrad = 0.;
00057 const bool D0RunIBaseConePlugin::_DEFAULT_D0_Angle = false;
00058 const bool D0RunIBaseConePlugin::_DEFAULT_Increase_Delta_R = true;
00059 const bool D0RunIBaseConePlugin::_DEFAULT_Kill_Far_Clusters = true;
00060 const bool D0RunIBaseConePlugin::_DEFAULT_Jet_Et_Min_On_Iter = true;
00061 const double D0RunIBaseConePlugin::_DEFAULT_Far_Ratio = 0.5;
00062 const double D0RunIBaseConePlugin::_DEFAULT_Eitem_Negdrop = -1.0;
00063 const double D0RunIBaseConePlugin::_DEFAULT_Et_Min_Ratio = 0.5;
00064 const double D0RunIBaseConePlugin::_DEFAULT_Thresh_Diff_Et = 0.01;
00065
00066
00067
00068
00069 template<typename HepEntityType>
00070 void D0RunIBaseConePlugin::run_clustering_worker(ClusterSequence & clust_seq) const{
00071
00072 vector<HepEntityType> entities(clust_seq.jets().size());
00073 list<const HepEntityType * > ensemble;
00074 for (unsigned i = 0; i < clust_seq.jets().size(); i++) {
00075 entities[i].Fill(clust_seq.jets()[i].E(),
00076 clust_seq.jets()[i].px(),
00077 clust_seq.jets()[i].py(),
00078 clust_seq.jets()[i].pz(),
00079 i);
00080
00081 if (abs(entities[i].pz() ) < entities[i].E() ) {
00082 ensemble.push_back(& (entities[i]));
00083 }
00084 }
00085
00086
00087 ConeClusterAlgo<HepEntityType>
00088 RunIconeAlgo(CONErad(),
00089 JETmne(),
00090 TWOrad(),
00091 SPLifr(),
00092 D0_Angle(),
00093 Increase_Delta_R(),
00094 Kill_Far_Clusters(),
00095 Jet_Et_Min_On_Iter(),
00096 Far_Ratio(),
00097 Eitem_Negdrop(),
00098 Et_Min_Ratio(),
00099 Thresh_Diff_Et());
00100
00101
00102
00103 float Zvertex = 0.;
00104 list<HepEntityType> jets;
00105 RunIconeAlgo.makeClusters(jets, ensemble, Zvertex);
00106
00107
00108
00109 for(int i = RunIconeAlgo.TempColl.size()-1; i >= 0; i--) {
00110
00111 std::list<const HepEntityType*> tlist = RunIconeAlgo.TempColl[i].LItems();
00112 typename std::list<const HepEntityType*>::iterator tk;
00113
00114
00115 tk = tlist.begin();
00116 int jet_k = (*tk)->index;
00117
00118
00119
00120
00121 HepEntityType jet_current_momentum = *(*tk);
00122
00123
00124 tk++;
00125 for (; tk != tlist.end(); tk++) {
00126 int jet_i = jet_k;
00127 int jet_j = (*tk)->index;
00128
00129 double dij = 0.0;
00130
00131
00132
00133 jet_current_momentum.Add(**tk);
00134 PseudoJet new_mom(jet_current_momentum.px(), jet_current_momentum.py(),
00135 jet_current_momentum.pz(), jet_current_momentum.E());
00136
00137 clust_seq.plugin_record_ij_recombination(jet_i, jet_j, dij, new_mom, jet_k);
00138 }
00139
00140
00141 double d_iB = clust_seq.jets()[jet_k].perp2();
00142 clust_seq.plugin_record_iB_recombination(jet_k, d_iB);
00143 }
00144 }
00145
00146
00147
00148
00149
00150
00151
00152
00153 string D0RunIpre96ConePlugin::description () const {
00154 ostringstream desc;
00155
00156 desc << "D0 Run I (pre 96) cone jet algorithm, with ";
00157 desc << "cone_radius = " << CONErad () << ", "
00158 << "min_jet_Et = " << JETmne () << ", "
00159 << "split_fraction = " << SPLifr ();
00160
00161 return desc.str();
00162 }
00163
00164 void D0RunIpre96ConePlugin::run_clustering(ClusterSequence & clust_seq) const {
00165 run_clustering_worker<HepEntityIpre96>(clust_seq);
00166 }
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 string D0RunIConePlugin::description () const {
00177 ostringstream desc;
00178
00179 desc << "D0 Run I cone jet algorithm, with ";
00180 desc << "cone_radius = " << CONErad () << ", "
00181 << "min_jet_Et = " << JETmne () << ", "
00182 << "split_fraction = " << SPLifr ();
00183
00184 return desc.str();
00185 }
00186
00187 void D0RunIConePlugin::run_clustering(ClusterSequence & clust_seq) const {
00188 run_clustering_worker<HepEntityI>(clust_seq);
00189 }
00190
00191
00192
00193
00194
00195 FASTJET_END_NAMESPACE