Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KtJets.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_KtJets_HH
00003 #define RIVET_KtJets_HH
00004 
00005 #include "Rivet/Projection.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "KtJet/KtJet.h"
00008 #include "KtJet/KtEvent.h"
00009 
00010 
00011 namespace Rivet {
00012   
00013   /// Project out jets based on configurable kT algorithm.
00014   class KtJets : public Projection {
00015     
00016   public:
00017     
00018     /// @name Standard constructors and destructors.
00019     //@{
00020     /// Default constructor. Must specify a FinalState projection which is
00021     //  assumed to live throughout the run.
00022     inline KtJets(FinalState& fsp)
00023       : _pktev(0), _type(4), _angle(2), _recom(1), 
00024         _rparameter(1.0),   _fsproj(&fsp) 
00025     { 
00026       addProjection(fsp);
00027     }
00028 
00029     /// Argument constructor. Allows the to be run with different parameters.
00030     /// Must specify a FinalState projection which is assumed to live throughout the run. 
00031     inline KtJets(FinalState& fsp, int type, int angle, int recom, double rparameter)
00032       : _pktev(0), _type(type), _angle(angle), _recom(recom),
00033         _rparameter(rparameter), _fsproj(&fsp)
00034     { 
00035       addProjection(fsp);
00036     }
00037     
00038     /// Destructor.
00039     inline virtual ~KtJets() { 
00040       if (_pktev) delete _pktev; 
00041     }
00042     //@}
00043 
00044   public:
00045     /// Return the name of the projection
00046     inline string getName() const {
00047       return "KtJets";
00048     }
00049     
00050   protected:   
00051 
00052     /// Perform the projection on the Event.
00053     void project(const Event& e);
00054 
00055     /// Compare projections.
00056     int compare(const Projection& p) const;  
00057 
00058   public:
00059     
00060     /// @name Access the projected NJets.
00061     //@ {
00062     inline int getNJets() const { return _pktev->getNJets(); }
00063     inline int getNConstituents() const { return _pktev->getNConstituents(); }
00064     inline vector<KtJet::KtLorentzVector> copyConstituents() const { return _pktev->copyConstituents(); }
00065     inline double getETot() const { return _pktev->getETot(); } // had trouble building with Ktfloat, used double instead
00066     inline int getType() const { return _pktev->getType(); }
00067     inline int getAngle() const { return _pktev->getAngle(); }
00068     inline int getRecom() const { return _pktev->getRecom(); }
00069     inline bool isInclusive() const { return _pktev->isInclusive(); }
00070 
00071     inline vector<KtJet::KtLorentzVector> getJets() const { return _pktev->getJets(); }
00072     inline vector<KtJet::KtLorentzVector> getJetsE() const { return _pktev->getJetsE(); }
00073     inline vector<KtJet::KtLorentzVector> getJetsEt() const { return _pktev->getJetsEt(); }
00074     inline vector<KtJet::KtLorentzVector> getJetsPt() const { return _pktev->getJetsPt(); }
00075     inline vector<KtJet::KtLorentzVector> getJetsRapidity() const { return _pktev->getJetsRapidity(); }
00076     inline vector<KtJet::KtLorentzVector> getJetsEta() const { return _pktev->getJetsEta(); }
00077     //@}
00078 
00079     /// Get the subjet splitting variables for the given jet.
00080     vector<double> getYSubJet(const KtJet::KtLorentzVector& jet) const; 
00081 
00082   private:
00083     
00084     /// Internal KtEvent, rebuilt every time an event is projected, but not otherwise.
00085     KtJet::KtEvent* _pktev;
00086 
00087     int _type, _angle, _recom;
00088     double _rparameter;  // had trouble building with Ktfloat, used double instead
00089 
00090     /// The FinalState projection used by this projection.
00091     FinalState* _fsproj;
00092 
00093     /// Map of vectors of y scales. This is mutable so we can use caching/lazy evaluation.
00094     mutable map<int, vector<double> > _yscales;
00095     
00096   };
00097 
00098 }
00099 
00100 #endif