Rivet: /Users/chrisg/software/rivet/include/Rivet/Projections/VetoedFinalState.hh Source File

| Rivet 3.1.9

VetoedFinalState.hh
1// -*- C++ -*-
2#ifndef RIVET_VetoedFinalState_HH
3#define RIVET_VetoedFinalState_HH
4
5#include "Rivet/Projections/FinalState.hh"
6
7namespace Rivet {
8
9
11 class VetoedFinalState : public FinalState {
12 public:
13
15
16
18 VetoedFinalState(const FinalState& fsp, const vector<Cut>& cuts)
19 : FinalState(), _vetoCuts(cuts)
20 {
21 setName("VetoedFinalState");
22 declare(fsp, "FS");
23 }
24
26 VetoedFinalState(const FinalState& fsp, const Cut& cut)
27 : VetoedFinalState(fsp, vector<Cut>{cut})
28 { }
29
31 VetoedFinalState(const vector<Cut>& cuts)
32 : VetoedFinalState(FinalState(), cuts)
33 { }
34
36 VetoedFinalState(const Cut& cut)
37 : VetoedFinalState(FinalState(), vector<Cut>{cut})
38 { }
39
41 VetoedFinalState(const FinalState& fsp, const vector<PdgId>& vetopids)
42 : VetoedFinalState(fsp, {})
43 {
44 _vetoCuts.reserve(vetopids.size());
45 for (PdgId pid : vetopids) addVeto(pid);
46 }
47
49 VetoedFinalState(const FinalState& fsp, PdgId vetopid)
50 : VetoedFinalState(fsp, vector<Cut>{Cuts::pid == vetopid})
51 { }
52
54 VetoedFinalState(const vector<PdgId>& vetopids)
55 : VetoedFinalState(FinalState(), {})
56 {
57 _vetoCuts.reserve(vetopids.size());
58 for (PdgId pid : vetopids) addVeto(pid);
59 }
60
62 VetoedFinalState(PdgId vetopid)
63 : VetoedFinalState(FinalState(), vector<Cut>{Cuts::pid == vetopid})
64 { }
65
67 VetoedFinalState(const FinalState& fsp)
68 : VetoedFinalState(fsp, vector<Cut>())
69 { }
70
72 VetoedFinalState()
73 : VetoedFinalState(FinalState(), vector<Cut>())
74 { }
75
78 //DEPRECATED("Prefer constructors using Cut arguments")
79 VetoedFinalState(const map<PdgId,pair<double,double>>& vetocodes)
80 : VetoedFinalState(FinalState(), {})
81 {
82 for (const auto& it : vetocodes) {
83 addVeto(it.first, Cuts::pT > it.second.first && Cuts::pT < it.second.second);
84 }
85 }
86
87
89 DEFAULT_RIVET_PROJ_CLONE(VetoedFinalState);
90
92
94 using Projection::operator =;
95
96
98 const vector<Cut>& vetoDetails() const {
99 return _vetoCuts;
100 }
101 //using vetos = vetoDetails;
102
103
105 VetoedFinalState& addVeto(const Cut& cut) {
106 _vetoCuts.push_back(cut);
107 return *this;
108 }
109
111 VetoedFinalState& addVeto(PdgId pid, const Cut& cut=Cuts::OPEN) {
112 _vetoCuts.push_back(Cuts::pid == pid && cut);
113 return *this;
114 }
115
117 VetoedFinalState& addVetoPair(PdgId pid, const Cut& cut=Cuts::OPEN) {
118 _vetoCuts.push_back(Cuts::abspid == pid && cut);
119 return *this;
120 }
121
122
126 VetoedFinalState& addVetoDetail(PdgId pid, double ptmin, double ptmax=std::numeric_limits<double>::max()) {
127 return addVeto(pid, Cuts::ptIn(ptmin, ptmax));
128 }
129 //const auto addVeto = addVetoDetail;
130
135 VetoedFinalState& addVetoPairDetail(PdgId pid, double ptmin, double ptmax=std::numeric_limits<double>::max()) {
136 return addVetoPair(pid, Cuts::ptIn(ptmin, ptmax));
137 }
138 //using addVetoPair = addVetoPairDetail;
139
141 VetoedFinalState& addVetoId(PdgId pid) {
142 return addVeto(pid);
143 }
144 //using addVeto = addVetoId;
145
150 VetoedFinalState& addVetoPairId(PdgId pid) {
151 return addVetoPair(pid);
152 }
153 //using addVetoPair = addVetoPairId;
154
155
157 VetoedFinalState& setVetoDetails(const vector<Cut>& cuts) {
158 _vetoCuts = cuts;
159 return *this;
160 }
161 //const auto setVetos = setVetoDetails;
162
163
165 VetoedFinalState& vetoNeutrinos() {
166 addVetoPairId(PID::NU_E);
167 addVetoPairId(PID::NU_MU);
168 addVetoPairId(PID::NU_TAU);
169 return *this;
170 }
171
172
176 VetoedFinalState& addCompositeMassVeto(double mass, double width, int nProducts=2) {
177 const double halfWidth = 0.5*width;
178 pair<double,double> massRange(mass-halfWidth, mass+halfWidth);
179 _compositeVetoes.insert(make_pair(nProducts, massRange));
180 _nCompositeDecays.insert(nProducts);
181 return *this;
182 }
183
184
188 VetoedFinalState& addDecayProductsVeto(PdgId pid) {
189 _parentVetoes.insert(pid);
190 return *this;
191 }
192
194 VetoedFinalState& addVetoOnThisFinalState(const ParticleFinder& fs) {
195 const string name = "FS_" + to_str(_vetofsnames.size());
196 declare(fs, name);
197 _vetofsnames.insert(name);
198 return *this;
199 }
200
201
203 VetoedFinalState& reset() {
204 _vetoCuts.clear();
205 return *this;
206 }
207
208
210 void project(const Event& e);
211
213 CmpState compare(const Projection& p) const;
214
215
216 protected:
217
219 vector<Cut> _vetoCuts;
220
223 multimap<PdgId, pair<double,double> > _compositeVetoes;
224 set<int> _nCompositeDecays;
225
227 set<PdgId> _parentVetoes;
228
230 set<string> _vetofsnames;
231
232 };
233
234
235}
236
237
238#endif
Rivet::Event
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Rivet::FinalState
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition FinalState.hh:12
Rivet::ParticleFinder
Base class for projections which return subsets of an event's particles.
Definition ParticleFinder.hh:11
Rivet::ProjectionApplier::declare
const PROJ & declare(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:170
Rivet::Projection
Base class for all Rivet projections.
Definition Projection.hh:29
Rivet::Projection::setName
void setName(const std::string &name)
Used by derived classes to set their name.
Definition Projection.hh:142
Rivet::Projection::name
virtual std::string name() const
Get the name of the projection.
Definition Projection.hh:56
Rivet::VetoedFinalState
FS modifier to exclude classes of particles from the final state.
Definition VetoedFinalState.hh:11
Rivet::VetoedFinalState::vetoDetails
const vector< Cut > & vetoDetails() const
Get the list of particle IDs and ranges to veto.
Definition VetoedFinalState.hh:98
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const Cut &cut)
Constructor with a default FinalState and a single cut to veto.
Definition VetoedFinalState.hh:36
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const FinalState &fsp, const Cut &cut)
Constructor with a specific FinalState and a single cut to veto.
Definition VetoedFinalState.hh:26
Rivet::VetoedFinalState::addVetoPairId
VetoedFinalState & addVetoPairId(PdgId pid)
Add a particle/antiparticle pair to veto.
Definition VetoedFinalState.hh:150
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const FinalState &fsp, const vector< Cut > &cuts)
Constructor with a specific FinalState and a cuts list to veto.
Definition VetoedFinalState.hh:18
Rivet::VetoedFinalState::addVetoPair
VetoedFinalState & addVetoPair(PdgId pid, const Cut &cut=Cuts::OPEN)
Add a particle/antiparticle selection to be vetoed from the final state.
Definition VetoedFinalState.hh:117
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const map< PdgId, pair< double, double > > &vetocodes)
Definition VetoedFinalState.hh:79
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const vector< PdgId > &vetopids)
Constructor with a default FinalState and a PID list to veto.
Definition VetoedFinalState.hh:54
Rivet::VetoedFinalState::reset
VetoedFinalState & reset()
Clear the list of particle IDs and ranges to veto.
Definition VetoedFinalState.hh:203
Rivet::VetoedFinalState::addVetoPairDetail
VetoedFinalState & addVetoPairDetail(PdgId pid, double ptmin, double ptmax=std::numeric_limits< double >::max())
Add a particle/antiparticle pair to veto in a given range.
Definition VetoedFinalState.hh:135
Rivet::VetoedFinalState::setVetoDetails
VetoedFinalState & setVetoDetails(const vector< Cut > &cuts)
Set the list of particle selections to veto.
Definition VetoedFinalState.hh:157
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const FinalState &fsp)
Constructor with specific FinalState but no cuts.
Definition VetoedFinalState.hh:67
Rivet::VetoedFinalState::vetoNeutrinos
VetoedFinalState & vetoNeutrinos()
Veto all neutrinos (convenience method)
Definition VetoedFinalState.hh:165
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState()
Default constructor with default FinalState and no cuts.
Definition VetoedFinalState.hh:72
Rivet::VetoedFinalState::addCompositeMassVeto
VetoedFinalState & addCompositeMassVeto(double mass, double width, int nProducts=2)
Definition VetoedFinalState.hh:176
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(PdgId vetopid)
Constructor with a default FinalState and a PID to veto.
Definition VetoedFinalState.hh:62
Rivet::VetoedFinalState::addDecayProductsVeto
VetoedFinalState & addDecayProductsVeto(PdgId pid)
Definition VetoedFinalState.hh:188
Rivet::VetoedFinalState::addVetoOnThisFinalState
VetoedFinalState & addVetoOnThisFinalState(const ParticleFinder &fs)
Veto particles from a supplied final state.
Definition VetoedFinalState.hh:194
Rivet::VetoedFinalState::project
void project(const Event &e)
Apply the projection on the supplied event.
Rivet::VetoedFinalState::addVetoDetail
VetoedFinalState & addVetoDetail(PdgId pid, double ptmin, double ptmax=std::numeric_limits< double >::max())
Add a particle ID and range to veto.
Definition VetoedFinalState.hh:126
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const FinalState &fsp, const vector< PdgId > &vetopids)
Constructor with a specific FinalState and a PID list to veto.
Definition VetoedFinalState.hh:41
Rivet::VetoedFinalState::compare
CmpState compare(const Projection &p) const
Compare projections.
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const FinalState &fsp, PdgId vetopid)
Constructor with a specific FinalState and a PID to veto.
Definition VetoedFinalState.hh:49
Rivet::VetoedFinalState::DEFAULT_RIVET_PROJ_CLONE
DEFAULT_RIVET_PROJ_CLONE(VetoedFinalState)
Clone on the heap.
Rivet::VetoedFinalState::addVeto
VetoedFinalState & addVeto(const Cut &cut)
Add a particle selection to be vetoed from the final state.
Definition VetoedFinalState.hh:105
Rivet::VetoedFinalState::addVeto
VetoedFinalState & addVeto(PdgId pid, const Cut &cut=Cuts::OPEN)
Add a particle selection to be vetoed from the final state.
Definition VetoedFinalState.hh:111
Rivet::VetoedFinalState::addVetoId
VetoedFinalState & addVetoId(PdgId pid)
Add a particle ID to veto (all range will be vetoed)
Definition VetoedFinalState.hh:141
Rivet::VetoedFinalState::VetoedFinalState
VetoedFinalState(const vector< Cut > &cuts)
Constructor with a default FinalState and a cuts list to veto.
Definition VetoedFinalState.hh:31
Rivet::Kin::mass
double mass(const ParticleBase &p)
Unbound function access to mass.
Definition ParticleBaseUtils.hh:705
Rivet::Kin::p
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
Rivet::pid
int pid(const Particle &p)
Unbound function access to PID code.
Definition ParticleUtils.hh:23
Rivet::to_str
string to_str(const T &x)
Convert any object to a string.
Definition Utils.hh:66
Rivet
Definition MC_Cent_pPb.hh:10