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 a FinalState and optional list of PDG ID codes.
00018     IdentifiedFinalState(const FinalState& fsp, const vector<PdgId>& pids=vector<PdgId>());
00019 
00020     /// Constructor with a list of PDG ID codes and a FinalState
00021     /// @deprecated Use the version with FinalState as 1st arg
00022     IdentifiedFinalState(const vector<PdgId>& pids, const FinalState& fsp);
00023 
00024     /// Constructor with a FinalState and a single of PDG ID code.
00025     IdentifiedFinalState(const FinalState& fsp, PdgId pid);
00026 
00027     /// Constructor with a single PDG ID code and a FinalState.
00028     /// @deprecated Use the version with FinalState as 1st arg
00029     IdentifiedFinalState(PdgId pid, const FinalState& fsp);
00030 
00031 
00032     /// Construction using optional Cuts object and optional list of PDG ID codes
00033     IdentifiedFinalState(const Cut& c=Cuts::open(), const vector<PdgId>& pids=vector<PdgId>());
00034 
00035     /// Construction using list of PDG ID codes and an optional Cuts object
00036     IdentifiedFinalState(const vector<PdgId>& pids, const Cut& c=Cuts::open());
00037 
00038     /// Construction using Cuts object and a single PDG ID code
00039     IdentifiedFinalState(const Cut& c, PdgId pid);
00040 
00041     /// Construction using a single PDG ID code and an optional Cuts object
00042     IdentifiedFinalState(PdgId pid, const Cut& c=Cuts::open());
00043 
00044 
00045     /// Constructor with eta range and pT_min arguments and optional list of PDG ID codes.
00046     /// @deprecated Use the versions with Cut or FinalState arguments
00047     DEPRECATED("Use the versions with Cut or FinalState arguments.")
00048     IdentifiedFinalState(double etamin, double etamax, double ptMin=0.0*GeV);
00049 
00050 
00051     /// Clone on the heap.
00052     DEFAULT_RIVET_PROJ_CLONE(IdentifiedFinalState);
00053 
00054     //@}
00055 
00056 
00057     /// Get the list of particle IDs to accept.
00058     const set<PdgId>& acceptedIds() const {
00059       return _pids;
00060     }
00061 
00062     /// Add an accepted particle ID.
00063     IdentifiedFinalState& acceptId(PdgId pid) {
00064       _pids.insert(pid);
00065       return *this;
00066     }
00067 
00068     /// Add a set of accepted particle IDs.
00069     IdentifiedFinalState& acceptIds(const vector<PdgId>& pids) {
00070       foreach (const PdgId pid, pids) {
00071         _pids.insert(pid);
00072       }
00073       return *this;
00074     }
00075 
00076     /// Add an accepted particle ID and its antiparticle.
00077     IdentifiedFinalState& acceptIdPair(PdgId pid) {
00078       _pids.insert(pid);
00079       _pids.insert(-pid);
00080       return *this;
00081     }
00082 
00083     /// Add a set of accepted particle IDs and their antiparticles.
00084     IdentifiedFinalState& acceptIdPairs(const vector<PdgId>& pids) {
00085       foreach (const PdgId pid, pids) {
00086         _pids.insert(pid);
00087         _pids.insert(-pid);
00088       }
00089       return *this;
00090     }
00091 
00092     /// Accept all neutrinos (convenience method).
00093     IdentifiedFinalState& acceptNeutrinos() {
00094       acceptIdPair(PID::NU_E);
00095       acceptIdPair(PID::NU_MU);
00096       acceptIdPair(PID::NU_TAU);
00097       return *this;
00098     }
00099 
00100     /// Accept all charged leptons (convenience method).
00101     IdentifiedFinalState& acceptChLeptons() {
00102       acceptIdPair(PID::ELECTRON);
00103       acceptIdPair(PID::MUON);
00104       acceptIdPair(PID::TAU);
00105       return *this;
00106     }
00107 
00108     /// Reset the list of particle IDs to accept.
00109     void reset() {
00110       _pids.clear();
00111     }
00112 
00113     // The remaining particles
00114     virtual const Particles& remainingParticles() const {
00115       return _remainingParticles;
00116     }
00117 
00118 
00119   protected:
00120 
00121     /// Apply the projection on the supplied event.
00122     void project(const Event& e);
00123 
00124     /// Compare projections.
00125     int compare(const Projection& p) const;
00126 
00127 
00128   private:
00129 
00130     /// The final-state particles.
00131     set<PdgId> _pids;
00132 
00133     // A vector of all other particles in the final state
00134     Particles _remainingParticles;
00135 
00136   };
00137 
00138 
00139 }
00140 
00141 
00142 #endif