Rivet  1.8.3
IdentifiedFinalState.hh
1 // -*- C++ -*-
2 #ifndef RIVET_IdentifiedFinalState_HH
3 #define RIVET_IdentifiedFinalState_HH
4 
5 #include "Rivet/Tools/Logging.hh"
6 #include "Rivet/Rivet.hh"
7 #include "Rivet/Particle.hh"
8 #include "Rivet/Event.hh"
9 #include "Rivet/Projection.hh"
10 #include "Rivet/Projections/FinalState.hh"
11 
12 namespace Rivet {
13 
14 
17  public:
18 
20 
21 
23  IdentifiedFinalState(const FinalState& fsp);
24 
26  IdentifiedFinalState(double etamin=-MAXRAPIDITY,
27  double etamax=MAXRAPIDITY,
28  double ptMin=0.0*GeV);
29 
32  IdentifiedFinalState(const vector<pair<double, double> >& etaRanges,
33  double ptMin=0.0*GeV);
34 
36  virtual const Projection* clone() const {
37  return new IdentifiedFinalState(*this);
38  }
40 
41 
42  public:
43 
45  const set<PdgId>& acceptedIds() const {
46  return _pids;
47  }
48 
51  _pids.insert(pid);
52  return *this;
53  }
54 
56  IdentifiedFinalState& acceptIds(const vector<PdgId>& pids) {
57  foreach (const PdgId pid, pids) {
58  _pids.insert(pid);
59  }
60  return *this;
61  }
62 
65  _pids.insert(pid);
66  _pids.insert(-pid);
67  return *this;
68  }
69 
71  IdentifiedFinalState& acceptIdPairs(const vector<PdgId>& pids) {
72  foreach (const PdgId pid, pids) {
73  _pids.insert(pid);
74  _pids.insert(-pid);
75  }
76  return *this;
77  }
78 
81  acceptIdPair(NU_E);
82  acceptIdPair(NU_MU);
83  acceptIdPair(NU_TAU);
84  return *this;
85  }
86 
89  acceptIdPair(ELECTRON);
90  acceptIdPair(MUON);
91  acceptIdPair(TAU);
92  return *this;
93  }
94 
96  void reset() {
97  _pids.clear();
98  }
99 
100 
101  protected:
102 
104  void project(const Event& e);
105 
107  int compare(const Projection& p) const;
108 
109 
110  private:
111 
113  set<PdgId> _pids;
114 
115  };
116 
117 
118 }
119 
120 
121 #endif
IdentifiedFinalState & acceptChLeptons()
Accept all charged leptons (convenience method).
Definition: IdentifiedFinalState.hh:88
Definition: MC_JetAnalysis.hh:9
IdentifiedFinalState & acceptIds(const vector< PdgId > &pids)
Add a set of accepted particle IDs.
Definition: IdentifiedFinalState.hh:56
IdentifiedFinalState & acceptId(PdgId pid)
Add an accepted particle ID.
Definition: IdentifiedFinalState.hh:50
Produce a final state which only contains specified particle IDs.
Definition: IdentifiedFinalState.hh:16
int compare(const Projection &p) const
Compare projections.
Definition: IdentifiedFinalState.cc:34
virtual const Projection * clone() const
Clone on the heap.
Definition: IdentifiedFinalState.hh:36
Definition: Event.hh:22
void project(const Event &e)
Apply the projection on the supplied event.
Definition: IdentifiedFinalState.cc:45
IdentifiedFinalState & acceptIdPair(PdgId pid)
Add an accepted particle ID and its antiparticle.
Definition: IdentifiedFinalState.hh:64
IdentifiedFinalState & acceptIdPairs(const vector< PdgId > &pids)
Add a set of accepted particle IDs and their antiparticles.
Definition: IdentifiedFinalState.hh:71
void reset()
Reset the list of particle IDs to accept.
Definition: IdentifiedFinalState.hh:96
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
IdentifiedFinalState & acceptNeutrinos()
Accept all neutrinos (convenience method).
Definition: IdentifiedFinalState.hh:80
static const double MAXRAPIDITY
A sensible default maximum value of rapidity for Rivet analyses to use.
Definition: Rivet.hh:24
const set< PdgId > & acceptedIds() const
Get the list of particle IDs to accept.
Definition: IdentifiedFinalState.hh:45
Base class for all Rivet projections.
Definition: Projection.hh:28
virtual double ptMin() const
Minimum- requirement.
Definition: FinalState.hh:97
IdentifiedFinalState(const FinalState &fsp)
Constructor with specific FinalState.
Definition: IdentifiedFinalState.cc:11