31#include "fastjet/CDFJetCluPlugin.hh"
32#include "fastjet/ClusterSequence.hh"
37#include "JetCluAlgorithm.hh"
38#include "PhysicsTower.hh"
41FASTJET_BEGIN_NAMESPACE
46thread_safety_helpers::FirstTimeTrue CDFJetCluPlugin::_first_time;
48string CDFJetCluPlugin::description ()
const {
51 desc <<
"CDF JetClu jet algorithm with "
52 <<
"seed_threshold = " << seed_threshold () <<
", "
53 <<
"cone_radius = " << cone_radius () <<
", "
54 <<
"adjacency_cut = " << adjacency_cut () <<
", "
55 <<
"max_iterations = " << max_iterations () <<
", "
56 <<
"iratch = " << iratch () <<
", "
57 <<
"overlap_threshold = " << overlap_threshold () ;
68 vector<PhysicsTower> towers;
69 towers.reserve(clust_seq.
jets().size());
74 for (
unsigned i = 0; i < clust_seq.
jets().size(); i++) {
77 LorentzVector fourvect(particle.px(), particle.py(),
78 particle.pz(), particle.E());
79 PhysicsTower tower(fourvect);
82 towers.push_back(tower);
86 JetCluAlgorithm j(seed_threshold(), cone_radius(), adjacency_cut(),
87 max_iterations(), iratch(), overlap_threshold());
90 std::vector<Cluster> jets;
107 for(
int iCDFjets = jets.size()-1; iCDFjets >= 0; iCDFjets--) {
109 const vector<PhysicsTower> & tower_list = jets[iCDFjets].towerList;
110 int ntow = int(tower_list.size());
117 vector<int> jc_indices(ntow);
118 vector<double> fj_indices(ntow);
119 for (
int itow = 0; itow < ntow; itow++) {
120 jc_indices[itow] = itow;
121 fj_indices[itow] = tower_list[itow].fjindex;
123 sort_indices(jc_indices, fj_indices);
125 int jet_k = tower_list[jc_indices[0]].fjindex;
127 for (
int itow = 1; itow < ntow; itow++) {
128 if (tower_list[jc_indices[itow]].Et() > 1e-50) {
133 jet_j = tower_list[jc_indices[itow]].fjindex;
136 assert (jet_j >= 0 && jet_j <
int(towers.size()));
148 double d_iB = clust_seq.
jets()[jet_k].perp2();
170void CDFJetCluPlugin::_print_banner(ostream *ostr)
const{
171 if (! _first_time())
return;
176 (*ostr) <<
"#-------------------------------------------------------------------------" << endl;
177 (*ostr) <<
"# You are running the CDF JetClu plugin for FastJet " << endl;
178 (*ostr) <<
"# This is based on an implementation provided by Joey Huston. " << endl;
179 (*ostr) <<
"# If you use this plugin, please cite " << endl;
180 (*ostr) <<
"# F. Abe et al. [CDF Collaboration], Phys. Rev. D 45 (1992) 1448. " << endl;
181 (*ostr) <<
"# in addition to the usual FastJet reference. " << endl;
182 (*ostr) <<
"#-------------------------------------------------------------------------" << endl;
void plugin_record_iB_recombination(int jet_i, double diB)
record the fact that there has been a recombination between jets()[jet_i] and the beam,...
const std::vector< PseudoJet > & jets() const
allow the user to access the internally stored _jets() array, which contains both the initial particl...
static std::ostream * fastjet_banner_stream()
returns a pointer to the stream to be used to print banners (cout by default).
void plugin_record_ij_recombination(int jet_i, int jet_j, double dij, int &newjet_k)
record the fact that there has been a recombination between jets()[jet_i] and jets()[jet_k],...
Class to contain pseudojets, including minimal information of use to jet-clustering routines.