rivet is hosted by Hepforge, IPPP Durham
TauFinder.hh
Go to the documentation of this file.
00001 
00002 #ifndef RIVET_TauFinder_HH
00003 #define RIVET_TauFinder_HH
00004 
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/UnstableFinalState.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011 
00012   /// @brief Convenience finder of unstable taus
00013   /// @todo Inherit directly from ParticleFinder, not FinalState
00014   class TauFinder : public FinalState {
00015   public:
00016 
00017     enum DecayType { ANY=0, LEPTONIC=1, HADRONIC };
00018     
00019     static bool isHadronic(const Particle& tau) {
00020       assert(tau.abspid() == PID::TAU);
00021       return any(tau.stableDescendants(), isHadron);
00022     }
00023     
00024     static bool isLeptonic(const Particle& tau) {
00025       return !isHadronic(tau);
00026     }
00027 
00028 
00029     TauFinder(DecayType decaytype, const Cut& cut=Cuts::open()) {
00030       setName("TauFinder");
00031       //_theParticles.clear();
00032       _dectype=decaytype;
00033       //cout << "Init tf with "<< _dectype << endl;
00034       addProjection(UnstableFinalState(cut), "UFS");
00035     }
00036 
00037 
00038     /// Clone on the heap.
00039     virtual const Projection* clone() const {
00040       return new TauFinder(*this);
00041     }
00042 
00043 
00044     const Particles& taus() const { return _theParticles; }
00045 
00046 
00047   protected:
00048 
00049     /// Apply the projection on the supplied event.
00050     void project(const Event& e);
00051 
00052     /// Compare with other projections.
00053     virtual int compare(const Projection& p) const;
00054 
00055 
00056   private:
00057 
00058     /// The decaytype enum
00059     DecayType _dectype;
00060   
00061   };
00062 
00063 
00064 }
00065 
00066 
00067 #endif