herwig is hosted by Hepforge, IPPP Durham
Herwig++  2.7.0
JetFinder.h
00001 // -*- C++ -*-
00002 
00003 // (C) 2007-2009 Simon Plaetzer -- sp@particle.uni-karlsruhe.de
00004 
00005 #ifndef Analysis2_JetFinder_H
00006 #define Analysis2_JetFinder_H
00007 //
00008 // This is the declaration of the JetFinder class.
00009 //
00010 
00011 #include "ThePEG/Interface/Interfaced.h"
00012 #include "JetFinder.fh"
00013 
00014 #include "ThePEG/EventRecord/Event.h"
00015 #include "ThePEG/Vectors/Lorentz5Vector.h"
00016 
00017 namespace Analysis2 {
00018 
00019 using namespace ThePEG;
00020 
00031 class JetFinder: public Interfaced {
00032 
00033 public:
00034 
00040   inline JetFinder();
00041 
00045   virtual ~JetFinder();
00047 
00048 public:
00049 
00052 
00056   inline Energy dCut () const;
00057 
00061   inline double yCut () const;
00062 
00066   inline double R () const;
00067 
00069 
00070 public:
00071 
00077   virtual inline void use (const vector<Lorentz5Momentum>&, bool inclusive = false);
00078 
00082   inline const vector<Lorentz5Momentum>& lastEvent () const;
00083 
00087   inline const vector<Lorentz5Momentum>& jets () const;
00088 
00089 public:
00090 
00093 
00097   virtual void findJets () = 0;
00098 
00102   virtual void findJetsN (unsigned int nJets) = 0;
00103 
00107   virtual void findJetsD () = 0;
00108 
00112   virtual void findJetsY (double y = -1.) = 0;
00113 
00117   inline unsigned int getNJets () const;
00118 
00122   virtual Energy getDMerge (unsigned int nJets) const = 0;
00123 
00127   virtual double getYMerge (unsigned int nJets) const = 0;
00128 
00130 
00131 public:
00132 
00135 
00139   virtual inline void sortEnergy ();
00140 
00144   virtual inline void sortEt ();
00145 
00149   virtual inline void sortPt ();
00150 
00154   virtual inline void sortY ();
00155 
00159   virtual inline void sortEta ();
00160 
00162 
00163 protected:
00164 
00167 
00171   struct GreaterInEnergy {
00175     inline bool operator () (const Lorentz5Momentum& a, const Lorentz5Momentum& b) {
00176       return a.e() > b.e();
00177     }
00178   };
00179 
00183   struct GreaterInEt {
00187     inline bool operator () (const Lorentz5Momentum& a, const Lorentz5Momentum& b) {
00188       return a.et() > b.et();
00189     }
00190   };
00191 
00195   struct GreaterInPt {
00199     inline bool operator () (const Lorentz5Momentum& a, const Lorentz5Momentum& b) {
00200       return a.perp() > b.perp();
00201     }
00202   };
00203 
00207   struct GreaterInY {
00211     inline bool operator () (const Lorentz5Momentum& a, const Lorentz5Momentum& b) {
00212       return a.rapidity() > b.rapidity();
00213     }
00214   };
00215 
00219   struct GreaterInEta {
00223     inline bool operator () (const Lorentz5Momentum& a, const Lorentz5Momentum& b) {
00224       return a.eta() > b.eta();
00225     }
00226   };
00227 
00229 
00230 protected:
00231 
00235   inline void jets (const vector<Lorentz5Momentum>&);
00236 
00237 public:
00238 
00245   void persistentOutput(PersistentOStream & os) const;
00246 
00252   void persistentInput(PersistentIStream & is, int version);
00254 
00261   static void Init();
00262 
00263 
00264 // If needed, insert declarations of virtual function defined in the
00265 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
00266 
00267 
00268 private:
00269 
00273   Energy _dCut;
00274 
00278   double _yCut;
00279 
00283   double _R;
00284 
00288   vector<Lorentz5Momentum> _lastEvent;
00289 
00293   vector<Lorentz5Momentum> _jets;
00294 
00299   static AbstractClassDescription<JetFinder> initJetFinder;
00300 
00305   JetFinder & operator=(const JetFinder &);
00306 
00307 };
00308 
00309 }
00310 
00311 #include "ThePEG/Utilities/ClassTraits.h"
00312 
00313 namespace ThePEG {
00314 
00319 template <>
00320 struct BaseClassTrait<Analysis2::JetFinder,1> {
00322   typedef Interfaced NthBase;
00323 };
00324 
00327 template <>
00328 struct ClassTraits<Analysis2::JetFinder>
00329   : public ClassTraitsBase<Analysis2::JetFinder> {
00331   static string className() { return "Analysis2::JetFinder"; }
00339   static string library() { return "Analysis2.so"; }
00340 };
00341 
00344 }
00345 
00346 #include "JetFinder.icc"
00347 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
00348 // #include "JetFinder.tcc"
00349 #endif
00350 
00351 #endif /* Analysis2_JetFinder_H */