00001 // -*- C++ -*- 00002 #ifndef RIVET_IdentifiedFinalState_HH 00003 #define RIVET_IdentifiedFinalState_HH 00004 00005 #include "Rivet/Tools/Logging.hh" 00006 #include "Rivet/Rivet.hh" 00007 #include "Rivet/Particle.hh" 00008 #include "Rivet/Event.hh" 00009 #include "Rivet/Projection.hh" 00010 #include "Rivet/Projections/FinalState.hh" 00011 00012 namespace Rivet { 00013 00014 00015 /// Produce a final state which only contains specified particle IDs. 00016 class IdentifiedFinalState : public FinalState { 00017 public: 00018 00019 /// @name Constructors 00020 //@{ 00021 00022 /// Constructor with specific FinalState. 00023 IdentifiedFinalState(const FinalState& fsp); 00024 00025 /// Constructor with a single eta range argument. 00026 IdentifiedFinalState(double etamin=-MAXRAPIDITY, 00027 double etamax=MAXRAPIDITY, 00028 double ptMin=0.0*GeV); 00029 00030 /// Constructor which allows to specify multiple eta ranges 00031 /// and the min \f$ p_T \f$. 00032 IdentifiedFinalState(const vector<pair<double, double> >& etaRanges, 00033 double ptMin=0.0*GeV); 00034 00035 /// Clone on the heap. 00036 virtual const Projection* clone() const { 00037 return new IdentifiedFinalState(*this); 00038 } 00039 //@} 00040 00041 00042 public: 00043 00044 /// Get the list of particle IDs to accept. 00045 const set<PdgId>& acceptedIds() const { 00046 return _pids; 00047 } 00048 00049 /// Add an accepted particle ID. 00050 IdentifiedFinalState& acceptId(PdgId pid) { 00051 _pids.insert(pid); 00052 return *this; 00053 } 00054 00055 /// Add a set of accepted particle IDs. 00056 IdentifiedFinalState& acceptIds(const vector<PdgId>& pids) { 00057 foreach (const PdgId pid, pids) { 00058 _pids.insert(pid); 00059 } 00060 return *this; 00061 } 00062 00063 /// Add an accepted particle ID and its antiparticle. 00064 IdentifiedFinalState& acceptIdPair(PdgId pid) { 00065 _pids.insert(pid); 00066 _pids.insert(-pid); 00067 return *this; 00068 } 00069 00070 /// Add a set of accepted particle IDs and their antiparticles. 00071 IdentifiedFinalState& acceptIdPairs(const vector<PdgId>& pids) { 00072 foreach (const PdgId pid, pids) { 00073 _pids.insert(pid); 00074 _pids.insert(-pid); 00075 } 00076 return *this; 00077 } 00078 00079 /// Accept all neutrinos (convenience method). 00080 IdentifiedFinalState& acceptNeutrinos() { 00081 acceptIdPair(NU_E); 00082 acceptIdPair(NU_MU); 00083 acceptIdPair(NU_TAU); 00084 return *this; 00085 } 00086 00087 /// Accept all charged leptons (convenience method). 00088 IdentifiedFinalState& acceptChLeptons() { 00089 acceptIdPair(ELECTRON); 00090 acceptIdPair(MUON); 00091 acceptIdPair(TAU); 00092 return *this; 00093 } 00094 00095 /// Reset the list of particle IDs to accept. 00096 void reset() { 00097 _pids.clear(); 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 }; 00116 00117 00118 } 00119 00120 00121 #endif