fastjet 2.4.5
many_algs_example.cc
Go to the documentation of this file.
00001 //STARTHEADER
00002 // $Id: many_algs_example.cc 1514 2009-04-16 12:43:19Z soyez $
00003 //
00004 // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam
00005 //
00006 //----------------------------------------------------------------------
00007 // This file is part of FastJet.
00008 //
00009 //  FastJet is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU General Public License as published by
00011 //  the Free Software Foundation; either version 2 of the License, or
00012 //  (at your option) any later version.
00013 //
00014 //  The algorithms that underlie FastJet have required considerable
00015 //  development and are described in hep-ph/0512210. If you use
00016 //  FastJet as part of work towards a scientific publication, please
00017 //  include a citation to the FastJet paper.
00018 //
00019 //  FastJet is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with FastJet; if not, write to the Free Software
00026 //  Foundation, Inc.:
00027 //      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //----------------------------------------------------------------------
00029 //ENDHEADER
00030 
00031 //----------------------------------------------------------------------
00032 // example program to illustrate the use of multiple jet-definitions,
00033 // some of which are plugin based.
00034 //
00035 // Compile it with: make many_algs_example
00036 // run it with    : ./many_algs_example < data/single-event.dat
00037 //----------------------------------------------------------------------
00038 
00039 #include "fastjet/config.h"
00040 #include "run_jet_finder.hh"
00041 
00042 // get info on how fastjet was configured
00043 #include "fastjet/config.h"
00044 
00045 #ifdef ENABLE_PLUGIN_SISCONE
00046 #  include "fastjet/SISConePlugin.hh"
00047 #endif
00048 #ifdef ENABLE_PLUGIN_CDFCONES
00049 #  include "fastjet/CDFMidPointPlugin.hh"
00050 #  include "fastjet/CDFJetCluPlugin.hh"
00051 #endif
00052 #ifdef ENABLE_PLUGIN_PXCONE
00053 #  include "fastjet/PxConePlugin.hh"
00054 #endif
00055 #ifdef ENABLE_PLUGIN_D0RUNIICONE
00056 #  include "fastjet/D0RunIIConePlugin.hh"
00057 #endif
00058 #ifdef ENABLE_PLUGIN_TRACKJET
00059 #include "fastjet/TrackJetPlugin.hh"
00060 #endif
00061 #ifdef ENABLE_PLUGIN_ATLASCONE
00062 #include "fastjet/ATLASConePlugin.hh"
00063 #endif
00064 #ifdef ENABLE_PLUGIN_EECAMBRIDGE
00065 #include "fastjet/EECambridgePlugin.hh"
00066 #endif
00067 #ifdef ENABLE_PLUGIN_JADE
00068 #include "fastjet/JadePlugin.hh"
00069 #endif
00070 #ifdef ENABLE_PLUGIN_CMSITERATIVECONE
00071 #include "fastjet/CMSIterativeConePlugin.hh"
00072 #endif
00073 // end of the plugin list (don't modify this line)
00074 
00075 #include<vector>
00076 #include<iostream>
00077 #include "fastjet/PseudoJet.hh"
00078 
00079 using namespace std;
00080 
00081 int main(int argc, char** argv) {
00082 
00083   // read input particles
00084   vector<fastjet::PseudoJet> input_particles;
00085   read_input_particles(cin, input_particles);
00086   
00087   // we will have four jet definitions, and the first two will be
00088   // plugins
00089   vector<fastjet::JetDefinition> jet_defs;
00090   vector<fastjet::JetDefinition::Plugin *> plugins;
00091 
00092   // common parameters
00093   double jet_radius = 0.7;
00094   //double jet_radius = 1.0;
00095   double overlap_threshold = 0.5;
00096 
00097   // set up a pxcone jet definition (if wanted -- requires f77, and you
00098   // should compile the pxcone plugin (not there by default))
00099 #ifdef ENABLE_PLUGIN_PXCONE
00100   double min_jet_energy = 5.0;
00101   bool   E_scheme_jets = false;
00102   plugins.push_back( new fastjet::PxConePlugin (jet_radius, min_jet_energy, 
00103                                         overlap_threshold, E_scheme_jets));
00104   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00105 #endif // ENABLE_PLUGIN_PXCONE
00106 
00107 
00108 
00109   // set up a CDF midpoint jet definition
00110 #ifdef ENABLE_PLUGIN_CDFCONES
00111   double seed_threshold = 1.0;
00112   double cone_area_fraction = 1.0;
00113   int    max_pair_size = 2;
00114   int    max_iterations = 100;
00115   plugins.push_back(new fastjet::CDFMidPointPlugin(seed_threshold, jet_radius, 
00116                                           cone_area_fraction, max_pair_size,
00117                                           max_iterations, overlap_threshold));
00118   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00119 #endif
00120 
00121   // set up a siscone jet definition
00122 #ifdef ENABLE_PLUGIN_SISCONE
00123   int npass = 0;               // do infinite number of passes
00124   double protojet_ptmin = 0.0; // use all protojets
00125   plugins.push_back(new fastjet::SISConePlugin (jet_radius, overlap_threshold, 
00126                                                 npass, protojet_ptmin));
00127   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00128 #endif
00129 
00130   // set up a d0runiicone jet definition
00131 #ifdef ENABLE_PLUGIN_D0RUNIICONE
00132   double min_jet_Et = 6.0; // earlier D0 analyses used 8 GeV
00133   plugins.push_back(new fastjet::D0RunIIConePlugin (jet_radius, min_jet_Et, 
00134                                               overlap_threshold));
00135   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00136 #endif // ENABLE_PLUGIN_D0RUNIICONE
00137 
00138   // set up a trackjet
00139 #ifdef ENABLE_PLUGIN_TRACKJET
00140   plugins.push_back(new fastjet::TrackJetPlugin(jet_radius));
00141   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00142 #endif // ENABLE_PLUGIN_TRACKJET
00143   // set up a atlascone
00144 #ifdef ENABLE_PLUGIN_ATLASCONE
00145   plugins.push_back(new fastjet::ATLASConePlugin(jet_radius));
00146   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00147 #endif // ENABLE_PLUGIN_ATLASCONE
00148   // set up a eecambridge
00149 #ifdef ENABLE_PLUGIN_EECAMBRIDGE
00150   double ycut = 0.08;
00151   plugins.push_back(new fastjet::EECambridgePlugin(ycut));
00152   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00153 #endif // ENABLE_PLUGIN_EECAMBRIDGE
00154   // set up a jade
00155 #ifdef ENABLE_PLUGIN_JADE
00156   plugins.push_back(new fastjet::JadePlugin());
00157   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00158 #endif // ENABLE_PLUGIN_JADE
00159   // set up a cmsiterativecone
00160 #ifdef ENABLE_PLUGIN_CMSITERATIVECONE
00161   double cms_seed_threshold = 1.0;
00162   plugins.push_back(new fastjet::CMSIterativeConePlugin(jet_radius, cms_seed_threshold));
00163   jet_defs.push_back(fastjet::JetDefinition(plugins.back()));
00164 #endif // ENABLE_PLUGIN_CMSITERATIVECONE
00165   // end of the plugins instantiation (don't modify this line)
00166 
00167   // set up kt and cam/aachen definitions
00168   jet_defs.push_back(fastjet::JetDefinition(fastjet::kt_algorithm, jet_radius));
00169   jet_defs.push_back(fastjet::JetDefinition(fastjet::cambridge_algorithm, 
00170                                             jet_radius));
00171   jet_defs.push_back(fastjet::JetDefinition(fastjet::antikt_algorithm, 
00172                                             jet_radius));
00173 
00174   // call the example jet-finding routine with each of jet definitions
00175   for (vector<fastjet::JetDefinition>::const_iterator jd_it = jet_defs.begin();
00176        jd_it != jet_defs.end(); jd_it++) {
00177     run_jet_finder(input_particles, *jd_it);
00178   }
00179 
00180   // clean up plugin memory.
00181   for (vector<fastjet::JetDefinition>::const_iterator jd_it = jet_defs.begin();
00182        jd_it != jet_defs.end(); jd_it++) {
00183     if (jd_it->plugin() != NULL) delete jd_it->plugin();
00184   }
00185 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines