CDFMidPointPlugin.cc
Go to the documentation of this file.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/CDFMidPointPlugin.hh"
00032 #include "fastjet/ClusterSequence.hh"
00033 #include "fastjet/Error.hh"
00034 #include <sstream>
00035
00036
00037 #include "MidPointAlgorithm.hh"
00038 #include "PhysicsTower.hh"
00039 #include "Cluster.hh"
00040
00041 FASTJET_BEGIN_NAMESPACE
00042
00043 using namespace std;
00044 using namespace cdf;
00045
00046 string CDFMidPointPlugin::description () const {
00047 ostringstream desc;
00048
00049 string sm_scale_string = "split-merge uses ";
00050 switch(_sm_scale) {
00051 case SM_pt:
00052 sm_scale_string += "pt";
00053 break;
00054 case SM_Et:
00055 sm_scale_string += "Et";
00056 break;
00057 case SM_mt:
00058 sm_scale_string += "mt";
00059 break;
00060 case SM_pttilde:
00061 sm_scale_string += "pttilde (scalar sum of pts)";
00062 break;
00063 default:
00064 ostringstream err;
00065 err << "Unrecognized split-merge scale choice = " << _sm_scale;
00066 throw Error(err.str());
00067 }
00068
00069
00070 if (cone_area_fraction() == 1) {
00071 desc << "CDF MidPoint jet algorithm, with " ;
00072 } else {
00073 desc << "CDF MidPoint+Searchcone jet algorithm, with ";
00074 }
00075 desc << "seed_threshold = " << seed_threshold () << ", "
00076 << "cone_radius = " << cone_radius () << ", "
00077 << "cone_area_fraction = " << cone_area_fraction () << ", "
00078 << "max_pair_size = " << max_pair_size () << ", "
00079 << "max_iterations = " << max_iterations () << ", "
00080 << "overlap_threshold = " << overlap_threshold () << ", "
00081 << sm_scale_string ;
00082
00083 return desc.str();
00084 }
00085
00086
00087 void CDFMidPointPlugin::run_clustering(ClusterSequence & clust_seq) const {
00088
00089
00090 vector<PhysicsTower> towers;
00091 towers.reserve(clust_seq.jets().size());
00092 for (unsigned i = 0; i < clust_seq.jets().size(); i++) {
00093 LorentzVector fourvect(clust_seq.jets()[i].px(),
00094 clust_seq.jets()[i].py(),
00095 clust_seq.jets()[i].pz(),
00096 clust_seq.jets()[i].E());
00097 PhysicsTower tower(fourvect);
00098
00099
00100 tower.calTower.iEta = i;
00101 towers.push_back(tower);
00102 }
00103
00104
00105 MidPointAlgorithm m(_seed_threshold,_cone_radius,_cone_area_fraction,
00106 _max_pair_size,_max_iterations,_overlap_threshold,
00107 MidPointAlgorithm::SplitMergeScale(_sm_scale));
00108
00109
00110 std::vector<Cluster> jets;
00111 m.run(towers,jets);
00112
00113
00114
00115
00116
00117 for(vector<Cluster>::const_iterator jetIter = jets.begin();
00118 jetIter != jets.end(); jetIter++) {
00119 const vector<PhysicsTower> & tower_list = jetIter->towerList;
00120 int jet_k = tower_list[0].calTower.iEta;
00121
00122 int ntow = int(jetIter->towerList.size());
00123 for (int itow = 1; itow < ntow; itow++) {
00124 int jet_i = jet_k;
00125
00126 int jet_j = tower_list[itow].calTower.iEta;
00127
00128 double dij = 0.0;
00129 clust_seq.plugin_record_ij_recombination(jet_i, jet_j, dij, jet_k);
00130 }
00131
00132
00133 double d_iB = clust_seq.jets()[jet_k].perp2();
00134 clust_seq.plugin_record_iB_recombination(jet_k, d_iB);
00135 }
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 }
00152
00153 FASTJET_END_NAMESPACE