D0ILConeJets.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_D0ILConeJets_HH
00003 #define RIVET_D0ILConeJets_HH
00004 
00005 #include "Rivet/Rivet.hh"
00006 #include "Rivet/Projection.hh"
00007 #include "Rivet/Projections/FinalState.hh"
00008 #include "Rivet/Projections/VetoedFinalState.hh"
00009 
00010 #include "Rivet/RivetCLHEP.hh"
00011 #include "Rivet/Tools/D0RunIIcone/HepEntity.h"
00012 #include "Rivet/Tools/D0RunIIcone/energycluster/ILConeAlgorithm.hpp"
00013 
00014 
00015 namespace Rivet {
00016   
00017   /// @brief Find jets according to the D0 "improved legacy" cone algorithm.
00018   ///
00019   /// The jet algorithm is described in:
00020   ///
00021   /// D0 Note Number: 003750, Date: 4/20/00,
00022   /// Title: Run II Jet Physics,
00023   /// Proceedings of the jet physics group of the Run II QCD Workshop
00024   /// Author(s): Gerald C. Blazey, Jay R. Dittmann, Stephen D. Ellis, 
00025   /// V. Daniel Elvira, K. Frame, S. Grinstein, Robert Hirosky, R.Peigaia, 
00026   /// H. Schellman, R. Snihur,V. Sorin, Dieter Zeppenfeld.
00027   ///
00028   /// The actual implementation differs in details: mid points are only 
00029   /// considered between 4-vectors above threshold and the midpoint is 
00030   /// determined \f$ p_T \f$-weighted.
00031   ///
00032   /// The cone radius has to be specified according to the analysis
00033   /// D0 JCCA: _cone_radius=0.7, D0 JCCB: _cone_radius=0.5    
00034   class D0ILConeJets : public Projection {
00035 
00036   public:
00037     
00038     /// @name Constructors and destructors.
00039     //@{
00040 
00041     /// @brief Default constructor. 
00042     ///
00043     /// The algorithm parameters are supposed to be set as used by D0 in RunII -
00044     /// this constructor will initialise the correct parameter values.
00045     /// Must specify a FinalState projection which is assumed to live throughout the run.    
00046     inline D0ILConeJets(FinalState& fsp)
00047       : _fsproj(&fsp), _cone_radius(0.7), _min_jet_Et(0.0), 
00048         _split_ratio(0.5), _far_ratio(0.5), 
00049         _et_min_ratio(0.5), _kill_duplicate(true), 
00050         _duplicate_dR(0.005), _duplicate_dPT(0.01), 
00051         _search_factor(1.0), 
00052         _pT_min_leading_protojet(0.0), 
00053         _pT_min_second_protojet(0.0), 
00054         _merge_max(1000), _pT_min_nomerge(0.0), 
00055         _algo(_cone_radius, _min_jet_Et, _split_ratio,
00056               _far_ratio, _et_min_ratio, _kill_duplicate, _duplicate_dR, 
00057               _duplicate_dPT, _search_factor, _pT_min_leading_protojet, 
00058               _pT_min_second_protojet, _merge_max, _pT_min_nomerge)
00059     { 
00060       addProjection(*_fsproj);
00061     }
00062 
00063         
00064     /// @brief Alternative constructor.
00065     ///
00066     /// Added so that same projection can be ran but with different parameters.
00067     /// Must specify a FinalState projection which is assumed to live throughout the run. 
00068     inline D0ILConeJets(FinalState& fsp, float r, float etMin, float split,
00069             float farRatio, float etMinRatio, bool killDuplicate,
00070             float duplicateDR, float duplicateDPT, float searchFactor,
00071             float pTMinLeadingProtojet, float pTMinSecondProtojet,
00072             int mergeMax, float pTMinNomerge)
00073       : _fsproj(&fsp), _cone_radius(r), _min_jet_Et(etMin), 
00074         _split_ratio(split), _far_ratio(farRatio), 
00075         _et_min_ratio(etMinRatio), _kill_duplicate(killDuplicate),
00076         _duplicate_dR(duplicateDR), _duplicate_dPT(duplicateDPT), 
00077         _search_factor(searchFactor),
00078         _pT_min_leading_protojet(pTMinLeadingProtojet), 
00079         _pT_min_second_protojet(pTMinSecondProtojet), 
00080         _merge_max(mergeMax), _pT_min_nomerge(pTMinNomerge),
00081         _algo(_cone_radius, _min_jet_Et, _split_ratio,
00082               _far_ratio, _et_min_ratio, _kill_duplicate, _duplicate_dR, 
00083               _duplicate_dPT, _search_factor, _pT_min_leading_protojet, 
00084               _pT_min_second_protojet, _merge_max, _pT_min_nomerge)
00085     {  
00086       addProjection(*_fsproj);
00087     }
00088     
00089 
00090     /// Destructor.
00091     virtual ~D0ILConeJets() {};
00092 
00093     //@}
00094 
00095   public:
00096     /// Return the name of the projection
00097     inline string getName() const {
00098       return "D0ILConeJets";
00099     }
00100 
00101   protected:   
00102 
00103     /// Perform the projection on the Event.
00104     void project(const Event& e);
00105 
00106     /// This function defines a unique ordering between different 
00107     /// Projection objects of the same class. Should only be called from 
00108     /// operator<(const Projection&).
00109     int compare(const Projection& p) const;  
00110 
00111   public:
00112     
00113     /// Get the number of jets.
00114     inline int getNJets() const { return _jets.size(); }
00115   
00116     /// Get a reference to the jets collection.
00117     inline list<HepEntity>& getJets() { return _jets; }
00118     /// Get a reference to the jets collection (const version).
00119     inline const list<HepEntity>& getJets() const { return _jets; }
00120 
00121     /// Get a reference to the lorentzvecjets collection.
00122     inline const list<LorentzVector>& getLorentzJets() const {
00123       return _lorentzvecjets; 
00124     }
00125 
00126 
00127     /// Clear the jets list.
00128     inline D0ILConeJets& clearJets() { 
00129       _jets.clear(); 
00130       return *this; 
00131     }
00132 
00133 
00134 
00135   private:
00136     /// The collection of jets.
00137     list<HepEntity> _jets;
00138 
00139     //Collection of jets converted to tlist of LorentzVector's
00140     list<LorentzVector> _lorentzvecjets;
00141 
00142     /// List of the event particles
00143     list<HepEntity> _particlelist;
00144     /// List of the event particles (as pointers)
00145     list<const HepEntity*> _particlepointerlist;
00146 
00147     /// The FinalState projection used by this projection.
00148     FinalState* _fsproj;
00149 
00150 
00151     /// @name Cone algorithm parameters
00152     //@{
00153     /// Cone radius
00154     const float _cone_radius;
00155     /// Jet \f$ E_T \f$ threshold
00156     const float _min_jet_Et;
00157     /// Split/merge fraction
00158     const float _split_ratio;
00159     //@}
00160 
00161 
00162     /// @name More algorithm parameters
00163     //@{
00164     /// The original author Laurent Duflot might be able to explain these.
00165     const float _far_ratio;
00166     const float _et_min_ratio;
00167     const bool _kill_duplicate;
00168     const float _duplicate_dR; 
00169     const float _duplicate_dPT; 
00170     const float _search_factor; 
00171     const float _pT_min_leading_protojet; 
00172     const float _pT_min_second_protojet;
00173     const int _merge_max; 
00174     const float _pT_min_nomerge;
00175     //@}
00176 
00177     /// The jet algorithm function itself
00178     ILConeAlgorithm<HepEntity> _algo;
00179 
00180   };
00181 
00182 }
00183 
00184 #endif