File indexing completed on 2025-10-30 08:54:10
0001 
0002 #ifndef RIVET_LeadingParticlesFinalState_HH
0003 #define RIVET_LeadingParticlesFinalState_HH
0004 
0005 #include "Rivet/Event.hh"
0006 #include "Rivet/Projection.hh"
0007 #include "Rivet/Projections/FinalState.hh"
0008 
0009 namespace Rivet {
0010 
0011 
0012   
0013   class LeadingParticlesFinalState : public FinalState {
0014   public:
0015 
0016     
0017     LeadingParticlesFinalState(const FinalState& fsp)
0018       :  FinalState(), _leading_only(false)
0019     {
0020       setName("LeadingParticlesFinalState");
0021       declare(fsp, "FS");
0022     }
0023 
0024     
0025     RIVET_DEFAULT_PROJ_CLONE(LeadingParticlesFinalState);
0026 
0027     
0028     using Projection::operator =;
0029 
0030 
0031     
0032     LeadingParticlesFinalState& addParticleId(PdgId id) {
0033       _ids.insert(id);
0034       return *this;
0035     }
0036 
0037     
0038     LeadingParticlesFinalState& addParticleIds(vector<PdgId> ids) {
0039       for (PdgId id : ids) _ids.insert(id);
0040       return *this;
0041     }
0042 
0043     
0044     LeadingParticlesFinalState& addParticleIdPair(PdgId id) {
0045       _ids.insert(id);
0046       _ids.insert(-id);
0047       return *this;
0048     }
0049 
0050     
0051     
0052     
0053     void setLeadingOnly(bool leadingonly) {
0054       _leading_only = leadingonly;
0055     }
0056 
0057     
0058     
0059 
0060     
0061     
0062 
0063 
0064     
0065     void project(const Event& e);
0066 
0067     
0068     CmpState compare(const Projection& p) const;
0069 
0070 
0071   protected:
0072 
0073     
0074     std::set<long> _ids;
0075     bool _leading_only;
0076 
0077   };
0078 
0079 
0080 }
0081 
0082 #endif