rivet is hosted by Hepforge, IPPP Durham
IdentifiedFinalState.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_IdentifiedFinalState_HH
00003 #define RIVET_IdentifiedFinalState_HH
00004 
00005 #include "Rivet/Projections/FinalState.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief Produce a final state which only contains specified particle IDs.
00011   class IdentifiedFinalState : public FinalState {
00012   public:
00013 
00014     /// @name Constructors
00015     //@{
00016 
00017     /// Constructor with specific FinalState.
00018     IdentifiedFinalState(const FinalState& fsp);
00019 
00020     /// Constructor with a single eta range argument.
00021     IdentifiedFinalState(double etamin=-MAXDOUBLE,
00022                          double etamax=MAXDOUBLE,
00023                          double ptMin=0.0*GeV);
00024 
00025     // /// Constructor which allows to specify multiple eta ranges
00026     // /// and the min \f$ p_T \f$.
00027     // IdentifiedFinalState(const vector<pair<double, double> >& etaRanges,
00028     //                      double ptMin=0.0*GeV);
00029 
00030     /// Clone on the heap.
00031     virtual const Projection* clone() const {
00032       return new IdentifiedFinalState(*this);
00033     }
00034     //@}
00035 
00036 
00037   public:
00038 
00039     /// Get the list of particle IDs to accept.
00040     const set<PdgId>& acceptedIds() const {
00041       return _pids;
00042     }
00043 
00044     /// Add an accepted particle ID.
00045     IdentifiedFinalState& acceptId(PdgId pid) {
00046       _pids.insert(pid);
00047       return *this;
00048     }
00049 
00050     /// Add a set of accepted particle IDs.
00051     IdentifiedFinalState& acceptIds(const vector<PdgId>& pids) {
00052       foreach (const PdgId pid, pids) {
00053         _pids.insert(pid);
00054       }
00055       return *this;
00056     }
00057 
00058     /// Add an accepted particle ID and its antiparticle.
00059     IdentifiedFinalState& acceptIdPair(PdgId pid) {
00060       _pids.insert(pid);
00061       _pids.insert(-pid);
00062       return *this;
00063     }
00064 
00065     /// Add a set of accepted particle IDs and their antiparticles.
00066     IdentifiedFinalState& acceptIdPairs(const vector<PdgId>& pids) {
00067       foreach (const PdgId pid, pids) {
00068         _pids.insert(pid);
00069         _pids.insert(-pid);
00070       }
00071       return *this;
00072     }
00073 
00074     /// Accept all neutrinos (convenience method).
00075     IdentifiedFinalState& acceptNeutrinos() {
00076       acceptIdPair(PID::NU_E);
00077       acceptIdPair(PID::NU_MU);
00078       acceptIdPair(PID::NU_TAU);
00079       return *this;
00080     }
00081 
00082     /// Accept all charged leptons (convenience method).
00083     IdentifiedFinalState& acceptChLeptons() {
00084       acceptIdPair(PID::ELECTRON);
00085       acceptIdPair(PID::MUON);
00086       acceptIdPair(PID::TAU);
00087       return *this;
00088     }
00089 
00090     /// Reset the list of particle IDs to accept.
00091     void reset() {
00092       _pids.clear();
00093     }
00094 
00095     // The remaining particles
00096     virtual const Particles& remainingParticles() const {
00097       return _remainingParticles;
00098     }
00099 
00100 
00101   protected:
00102 
00103     /// Apply the projection on the supplied event.
00104     void project(const Event& e);
00105 
00106     /// Compare projections.
00107     int compare(const Projection& p) const;
00108 
00109 
00110   private:
00111 
00112     /// The final-state particles.
00113     set<PdgId> _pids;
00114 
00115     // A vector of all other particles in the final state
00116     Particles _remainingParticles;
00117 
00118   };
00119 
00120 
00121 }
00122 
00123 
00124 #endif