rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
IdentifiedFinalState.hh
1 // -*- C++ -*-
2 #ifndef RIVET_IdentifiedFinalState_HH
3 #define RIVET_IdentifiedFinalState_HH
4 
5 #include "Rivet/Projections/FinalState.hh"
6 
7 namespace Rivet {
8 
9 
12  public:
13 
15 
16 
18  IdentifiedFinalState(const FinalState& fsp, const vector<PdgId>& pids=vector<PdgId>());
19 
22  DEPRECATED("Use the version with FinalState as 1st arg")
23  IdentifiedFinalState(const vector<PdgId>& pids, const FinalState& fsp);
24 
26  IdentifiedFinalState(const FinalState& fsp, PdgId pid);
27 
30  DEPRECATED("Use the version with FinalState as 1st arg")
31  IdentifiedFinalState(PdgId pid, const FinalState& fsp);
32 
33 
35  IdentifiedFinalState(const Cut& c=Cuts::open(), const vector<PdgId>& pids=vector<PdgId>());
36 
38  IdentifiedFinalState(const vector<PdgId>& pids, const Cut& c=Cuts::open());
39 
41  IdentifiedFinalState(const Cut& c, PdgId pid);
42 
44  IdentifiedFinalState(PdgId pid, const Cut& c=Cuts::open());
45 
46 
49 
51 
52 
54  const set<PdgId>& acceptedIds() const {
55  return _pids;
56  }
57 
60  _pids.insert(pid);
61  return *this;
62  }
63 
65  IdentifiedFinalState& acceptIds(const vector<PdgId>& pids) {
66  for (const PdgId pid : pids) _pids.insert(pid);
67  return *this;
68  }
69 
72  _pids.insert(pid);
73  _pids.insert(-pid);
74  return *this;
75  }
76 
78  IdentifiedFinalState& acceptIdPairs(const vector<PdgId>& pids) {
79  for (const PdgId pid : pids) {
80  _pids.insert(pid);
81  _pids.insert(-pid);
82  }
83  return *this;
84  }
85 
88  acceptIdPair(PID::NU_E);
89  acceptIdPair(PID::NU_MU);
90  acceptIdPair(PID::NU_TAU);
91  return *this;
92  }
93 
96  acceptIdPair(PID::ELECTRON);
97  acceptIdPair(PID::MUON);
98  acceptIdPair(PID::TAU);
99  return *this;
100  }
101 
103  void reset() {
104  _pids.clear();
105  }
106 
107  // The remaining particles
108  virtual const Particles& remainingParticles() const {
109  return _remainingParticles;
110  }
111 
112 
114  void project(const Event& e);
115 
117  int compare(const Projection& p) const;
118 
119 
120  private:
121 
123  set<PdgId> _pids;
124 
125  // A vector of all other particles in the final state
126  Particles _remainingParticles;
127 
128  };
129 
130 
131 }
132 
133 
134 #endif
IdentifiedFinalState & acceptChLeptons()
Accept all charged leptons (convenience method).
Definition: IdentifiedFinalState.hh:95
Definition: ALICE_2010_I880049.cc:13
IdentifiedFinalState & acceptIds(const vector< PdgId > &pids)
Add a set of accepted particle IDs.
Definition: IdentifiedFinalState.hh:65
IdentifiedFinalState & acceptId(PdgId pid)
Add an accepted particle ID.
Definition: IdentifiedFinalState.hh:59
PdgIdPair pids(const ParticlePair &pp)
Definition: ParticleUtils.hh:735
Produce a final state which only contains specified particle IDs.
Definition: IdentifiedFinalState.hh:11
int pid(const Particle &p)
Unbound function access to PID code.
Definition: ParticleUtils.hh:20
const set< PdgId > & acceptedIds() const
Get the list of particle IDs to accept.
Definition: IdentifiedFinalState.hh:54
DEFAULT_RIVET_PROJ_CLONE(IdentifiedFinalState)
Clone on the heap.
Definition: Event.hh:22
void project(const Event &e)
Apply the projection on the supplied event.
Definition: IdentifiedFinalState.cc:69
IdentifiedFinalState & acceptIdPair(PdgId pid)
Add an accepted particle ID and its antiparticle.
Definition: IdentifiedFinalState.hh:71
IdentifiedFinalState & acceptIdPairs(const vector< PdgId > &pids)
Add a set of accepted particle IDs and their antiparticles.
Definition: IdentifiedFinalState.hh:78
const Cut & open()
Fully open cut singleton, accepts everything.
Definition: Cuts.cc:81
int compare(const Projection &p) const
Compare projections.
Definition: IdentifiedFinalState.cc:58
void reset()
Reset the list of particle IDs to accept.
Definition: IdentifiedFinalState.hh:103
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:12
IdentifiedFinalState(const FinalState &fsp, const vector< PdgId > &pids=vector< PdgId >())
Constructor with a FinalState and optional list of PDG ID codes.
Definition: IdentifiedFinalState.cc:7
IdentifiedFinalState & acceptNeutrinos()
Accept all neutrinos (convenience method).
Definition: IdentifiedFinalState.hh:87
Base class for all Rivet projections.
Definition: Projection.hh:29