Rivet  1.8.3
VetoedFinalState.hh
1 // -*- C++ -*-
2 #ifndef RIVET_VetoedFinalState_HH
3 #define RIVET_VetoedFinalState_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 
16  class VetoedFinalState : public FinalState {
17 
18  public:
19 
21  typedef pair<double, double> BinaryCut;
22 
24  typedef map<long, BinaryCut> VetoDetails;
25 
27  typedef multimap<int, BinaryCut> CompositeVeto;
28 
29 
31 
34  setName("VetoedFinalState");
35  addProjection(FinalState(), "FS");
36  }
37 
40  {
41  setName("VetoedFinalState");
42  addProjection(fsp, "FS");
43  }
44 
47  VetoedFinalState(const VetoDetails& vetocodes)
48  : _vetoCodes(vetocodes)
49  {
50  setName("VetoedFinalState");
51  addProjection(FinalState(), "FS");
52  }
53 
57  VetoedFinalState(const FinalState& fsp, const VetoDetails& vetocodes)
58  : _vetoCodes(vetocodes)
59  {
60  setName("VetoedFinalState");
61  addProjection(fsp, "FS");
62  }
63 
64 
66  virtual const Projection* clone() const {
67  return new VetoedFinalState(*this);
68  }
70 
71 
72  public:
73 
75  const VetoDetails& vetoDetails() const {
76  return _vetoCodes;
77  }
78 
81  VetoedFinalState& addVetoDetail(const long id, const double ptmin, const double ptmax) {
82  BinaryCut ptrange(ptmin, ptmax);
83  _vetoCodes.insert(make_pair(id, ptrange));
84  return *this;
85  }
86 
89  VetoedFinalState& addVetoPairDetail(const long id, const double ptmin, const double ptmax) {
90  addVetoDetail(id, ptmin, ptmax);
91  addVetoDetail(-id, ptmin, ptmax);
92  return *this;
93  }
94 
97  VetoedFinalState& addVetoPairId(const long id) {
98  addVetoId(id);
99  addVetoId(-id);
100  return *this;
101  }
102 
104  VetoedFinalState& addVetoId(const long id) {
105  BinaryCut ptrange(0.0, numeric_limits<double>::max());
106  _vetoCodes.insert(make_pair(id, ptrange));
107  return *this;
108  }
109 
112  addVetoPairId(NU_E);
113  addVetoPairId(NU_MU);
114  addVetoPairId(NU_TAU);
115  return *this;
116  }
117 
121  VetoedFinalState& addCompositeMassVeto(const double &mass, const double &width, int nProducts=2){
122  double halfWidth = 0.5*width;
123  BinaryCut massRange(mass - halfWidth, mass + halfWidth);
124  _compositeVetoes.insert(make_pair(nProducts, massRange));
125  _nCompositeDecays.insert(nProducts);
126  return *this;
127  }
128 
133  _parentVetoes.insert(id);
134  return *this;
135  }
136 
139  _vetoCodes = ids;
140  return *this;
141  }
142 
145  _vetoCodes.clear();
146  return *this;
147  }
148 
149 
152  stringstream st_name;
153  st_name << "FS_" << _vetofsnames.size();
154  string name = st_name.str();
155  addProjection(fs, name);
156  _vetofsnames.insert(name);
157  return *this;
158  }
159 
160 
161  protected:
162 
164  void project(const Event& e);
165 
167  int compare(const Projection& p) const;
168 
169 
170  private:
171 
173  VetoDetails _vetoCodes;
174 
176  CompositeVeto _compositeVetoes;
177  set<int> _nCompositeDecays;
178 
179  typedef set<long> ParentVetos;
180 
182  ParentVetos _parentVetoes;
183 
185  set<string> _vetofsnames;
186 
187  };
188 
189 
190 }
191 
192 
193 #endif
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:120
const VetoDetails & vetoDetails() const
Get the list of particle IDs and ranges to veto.
Definition: VetoedFinalState.hh:75
pair< double, double > BinaryCut
Typedef for a pair of back-to-back cuts.
Definition: VetoedFinalState.hh:21
VetoedFinalState & addDecayProductsVeto(const long id)
Definition: VetoedFinalState.hh:132
virtual std::string name() const
Get the name of the projection.
Definition: Projection.hh:101
virtual size_t size() const
Access the projected final-state particles.
Definition: FinalState.hh:89
VetoedFinalState & vetoNeutrinos()
Veto all neutrinos (convenience method)
Definition: VetoedFinalState.hh:111
VetoedFinalState(const VetoDetails &vetocodes)
Definition: VetoedFinalState.hh:47
virtual const Projection * clone() const
Clone on the heap.
Definition: VetoedFinalState.hh:66
VetoedFinalState & addVetoDetail(const long id, const double ptmin, const double ptmax)
Definition: VetoedFinalState.hh:81
FS modifier to exclude classes of particles from the final state.
Definition: VetoedFinalState.hh:16
Definition: Event.hh:22
void project(const Event &e)
Apply the projection on the supplied event.
Definition: VetoedFinalState.cc:23
VetoedFinalState & addVetoPairId(const long id)
Definition: VetoedFinalState.hh:97
VetoedFinalState()
Default constructor.
Definition: VetoedFinalState.hh:33
VetoedFinalState & addVetoOnThisFinalState(const FinalState &fs)
Veto particles from a supplied final state.
Definition: VetoedFinalState.hh:151
VetoedFinalState(const FinalState &fsp)
Constructor with specific FinalState.
Definition: VetoedFinalState.hh:39
VetoedFinalState & reset()
Clear the list of particle IDs and ranges to veto.
Definition: VetoedFinalState.hh:144
VetoedFinalState & addCompositeMassVeto(const double &mass, const double &width, int nProducts=2)
Definition: VetoedFinalState.hh:121
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Definition: ProjectionApplier.hh:113
VetoedFinalState & addVetoId(const long id)
Add a particle ID to veto (all range will be vetoed).
Definition: VetoedFinalState.hh:104
FinalState(double mineta=-MAXRAPIDITY, double maxeta=MAXRAPIDITY, double minpt=0.0 *GeV)
Definition: FinalState.cc:9
VetoedFinalState & setVetoDetails(const VetoDetails &ids)
Set the list of particle IDs and ranges to veto.
Definition: VetoedFinalState.hh:138
VetoedFinalState(const FinalState &fsp, const VetoDetails &vetocodes)
Definition: VetoedFinalState.hh:57
double mass(const FourMomentum &v)
Get the mass (the Lorentz self-invariant) of a momentum 4-vector.
Definition: Vector4.hh:539
Base class for all Rivet projections.
Definition: Projection.hh:28
multimap< int, BinaryCut > CompositeVeto
Typedef for a veto on a composite particle mass.
Definition: VetoedFinalState.hh:27
VetoedFinalState & addVetoPairDetail(const long id, const double ptmin, const double ptmax)
Definition: VetoedFinalState.hh:89
map< long, BinaryCut > VetoDetails
Typedef for a vetoing entry.
Definition: VetoedFinalState.hh:24
int compare(const Projection &p) const
Compare projections.
Definition: VetoedFinalState.cc:11