File indexing completed on 2025-12-13 10:26:13
0001
0002 #ifndef RIVET_VetoedFinalState_HH
0003 #define RIVET_VetoedFinalState_HH
0004
0005 #include "Rivet/Projections/FinalState.hh"
0006
0007 namespace Rivet {
0008
0009
0010
0011 class VetoedFinalState : public FinalState {
0012 public:
0013
0014
0015
0016
0017
0018 VetoedFinalState(const FinalState& fsp, const vector<Cut>& cuts)
0019 : FinalState(), _vetoCuts(cuts)
0020 {
0021 setName("VetoedFinalState");
0022 declare(fsp, "FS");
0023 }
0024
0025
0026 VetoedFinalState(const FinalState& fsp, const Cut& cut)
0027 : VetoedFinalState(fsp, vector<Cut>{cut})
0028 { }
0029
0030
0031 VetoedFinalState(const vector<Cut>& cuts)
0032 : VetoedFinalState(FinalState(), cuts)
0033 { }
0034
0035
0036 VetoedFinalState(const Cut& cut)
0037 : VetoedFinalState(FinalState(), vector<Cut>{cut})
0038 { }
0039
0040
0041 VetoedFinalState(const FinalState& fsp, const vector<PdgId>& vetopids)
0042 : VetoedFinalState(fsp, {})
0043 {
0044 _vetoCuts.reserve(vetopids.size());
0045 for (PdgId pid : vetopids) addVeto(pid);
0046 }
0047
0048
0049 VetoedFinalState(const FinalState& fsp, PdgId vetopid)
0050 : VetoedFinalState(fsp, vector<Cut>{Cuts::pid == vetopid})
0051 { }
0052
0053
0054 VetoedFinalState(const vector<PdgId>& vetopids)
0055 : VetoedFinalState(FinalState(), {})
0056 {
0057 _vetoCuts.reserve(vetopids.size());
0058 for (PdgId pid : vetopids) addVeto(pid);
0059 }
0060
0061
0062 VetoedFinalState(PdgId vetopid)
0063 : VetoedFinalState(FinalState(), vector<Cut>{Cuts::pid == vetopid})
0064 { }
0065
0066
0067 VetoedFinalState(const FinalState& fsp)
0068 : VetoedFinalState(fsp, vector<Cut>())
0069 { }
0070
0071
0072 VetoedFinalState()
0073 : VetoedFinalState(FinalState(), vector<Cut>())
0074 { }
0075
0076
0077
0078 RIVET_DEFAULT_PROJ_CLONE(VetoedFinalState);
0079
0080
0081
0082
0083 using Projection::operator =;
0084
0085
0086
0087 const vector<Cut>& vetoDetails() const {
0088 return _vetoCuts;
0089 }
0090
0091
0092
0093
0094 VetoedFinalState& addVeto(const Cut& cut) {
0095 _vetoCuts.push_back(cut);
0096 return *this;
0097 }
0098
0099
0100 VetoedFinalState& addVeto(PdgId pid, const Cut& cut=Cuts::OPEN) {
0101 _vetoCuts.push_back(Cuts::pid == pid && cut);
0102 return *this;
0103 }
0104
0105
0106 VetoedFinalState& addVetoPair(PdgId pid, const Cut& cut=Cuts::OPEN) {
0107 _vetoCuts.push_back(Cuts::abspid == pid && cut);
0108 return *this;
0109 }
0110
0111
0112
0113
0114
0115 VetoedFinalState& addVetoDetail(PdgId pid, double ptmin, double ptmax=std::numeric_limits<double>::max()) {
0116 return addVeto(pid, Cuts::ptIn(ptmin, ptmax));
0117 }
0118
0119
0120
0121
0122
0123
0124 VetoedFinalState& addVetoPairDetail(PdgId pid, double ptmin, double ptmax=std::numeric_limits<double>::max()) {
0125 return addVetoPair(pid, Cuts::ptIn(ptmin, ptmax));
0126 }
0127
0128
0129
0130 VetoedFinalState& addVetoId(PdgId pid) {
0131 return addVeto(pid);
0132 }
0133
0134
0135
0136
0137
0138
0139 VetoedFinalState& addVetoPairId(PdgId pid) {
0140 return addVetoPair(pid);
0141 }
0142
0143
0144
0145
0146 VetoedFinalState& setVetoDetails(const vector<Cut>& cuts) {
0147 _vetoCuts = cuts;
0148 return *this;
0149 }
0150
0151
0152
0153
0154 VetoedFinalState& vetoNeutrinos() {
0155 addVetoPairId(PID::NU_E);
0156 addVetoPairId(PID::NU_MU);
0157 addVetoPairId(PID::NU_TAU);
0158 return *this;
0159 }
0160
0161
0162
0163
0164
0165 VetoedFinalState& addCompositeMassVeto(double mass, double width, int nProducts=2) {
0166 const double halfWidth = 0.5*width;
0167 pair<double,double> massRange(mass-halfWidth, mass+halfWidth);
0168 _compositeVetoes.insert(make_pair(nProducts, massRange));
0169 _nCompositeDecays.insert(nProducts);
0170 return *this;
0171 }
0172
0173
0174
0175
0176
0177 VetoedFinalState& addDecayProductsVeto(PdgId pid) {
0178 _parentVetoes.insert(pid);
0179 return *this;
0180 }
0181
0182
0183 VetoedFinalState& vetoFinalState(const ParticleFinder& fs) {
0184 const string name = "FS_" + to_str(_vetofsnames.size());
0185 declare(fs, name);
0186 _vetofsnames.insert(name);
0187 return *this;
0188 }
0189
0190
0191
0192 VetoedFinalState& addVetoOnThisFinalState(const ParticleFinder& fs) {
0193 return vetoFinalState(fs);
0194 }
0195
0196
0197
0198 VetoedFinalState& reset() {
0199 _vetoCuts.clear();
0200 return *this;
0201 }
0202
0203
0204
0205 void project(const Event& e);
0206
0207
0208 CmpState compare(const Projection& p) const;
0209
0210
0211 protected:
0212
0213
0214 vector<Cut> _vetoCuts;
0215
0216
0217
0218 multimap<PdgId, pair<double,double> > _compositeVetoes;
0219 set<int> _nCompositeDecays;
0220
0221
0222 set<PdgId> _parentVetoes;
0223
0224
0225 set<string> _vetofsnames;
0226
0227 };
0228
0229
0230 }
0231
0232
0233 #endif