Rivet API documentation

Rivet 4.1.3
SimpleAnalysis.hh
1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/DirectFinalState.hh"
4#include "Rivet/Projections/FastJets.hh"
5#include "Rivet/Projections/FinalState.hh"
6#include "Rivet/Projections/LeptonFinder.hh"
7#include "Rivet/Projections/MissingMomentum.hh"
8#include "Rivet/Projections/Smearing.hh"
9#include "Rivet/Projections/TauFinder.hh"
10#include "Rivet/Tools/Cutflow.hh"
11
12namespace Rivet {
13
14
16 class SimpleAnalysis : public Analysis {
17 public:
18
20 enum class IDClass { LOOSE, MEDIUM, TIGHT };
21
23 SimpleAnalysis(const std::string& name)
24 : Analysis(name) { }
25
27 virtual ~SimpleAnalysis() { }
28
29
32
37 void postInit() {
38
39 // Electron projections
40 FinalState es(_acut && _ecut && Cuts::abspid == PID::ELECTRON);
41 LeptonFinder es_direct(_acut && _ecut && Cuts::abspid == PID::ELECTRON, 0.1);
42 for (const auto& classkv : _idclasses()) {
43 const IDClass& idc = classkv.first;
44 const string pre = "Electrons";
45 const string aname = _pckey(true, idc, pre);
46 if (!hasProjection(aname)) {
47 declare(SmearedParticles(es, _effs_electron[idc], _smear_electron), aname);
48 }
49 const string pname = _pckey(false, idc, pre);
50 if (!hasProjection(pname)) {
51 declare(SmearedParticles(es_direct, _effs_electron[idc], _smear_electron), pname);
52 }
53 }
54
55 // Muon projections
56 FinalState ms(_acut && _mcut && Cuts::abspid == PID::MUON);
57 LeptonFinder ms_direct(_acut && _mcut && Cuts::abspid == PID::MUON, 0.1);
58 for (const auto& classkv : _idclasses()) {
59 const IDClass& idc = classkv.first;
60 const string pre = "Muons";
61 const string aname = _pckey(true, idc, pre);
62 if (!hasProjection(aname)) {
63 declare(SmearedParticles(ms, _effs_muon[idc], _smear_muon), aname);
64 }
65 const string pname = _pckey(false, idc, pre);
66 if (!hasProjection(pname)) {
67 declare(SmearedParticles(ms_direct, _effs_muon[idc], _smear_muon), pname);
68 }
69 }
70
71 // Photon projections
72 FinalState ys(_acut && _phocut && Cuts::abspid == PID::PHOTON);
73 DirectFinalState ys_direct(_acut && _phocut && Cuts::abspid == PID::PHOTON);
74 for (const auto& classkv : _idclasses()) {
75 const IDClass& idc = classkv.first;
76 const string pre = "Photons";
77 const string aname = _pckey(true, idc, pre);
78 if (!hasProjection(aname)) {
79 declare(SmearedParticles(ys, _effs_photon[idc], _smear_photon), aname);
80 }
81 const string pname = _pckey(false, idc, pre);
82 if (!hasProjection(pname)) {
83 declare(SmearedParticles(ys_direct, _effs_photon[idc], _smear_photon), pname);
84 }
85 }
86
87 // Tau projections
88 TauFinder ts(TauDecay::HADRONIC, LeptonOrigin::ANY, _acut && _tcut);
89 TauFinder ts_direct(TauDecay::HADRONIC, LeptonOrigin::NODECAY, _acut && _tcut);
90 for (const auto& classkv : _idclasses()) {
91 const IDClass& idc = classkv.first;
92 const string pre = "Taus";
93 const string aname = _pckey(true, idc, pre);
94 if (!hasProjection(aname)) {
95 declare(SmearedParticles(ts, _effs_tau[idc], _smear_tau), aname);
96 }
97 const string pname = _pckey(false, idc, pre);
98 if (!hasProjection(pname)) {
99 declare(SmearedParticles(ts_direct, _effs_tau[idc], _smear_tau), pname);
100 }
101 }
102
103 // Track projection
104 const FinalState trkfs(_acut && _trkcut && Cuts::abscharge > 0);
105 if (!hasProjection("Tracks")) {
106 declare(SmearedParticles(trkfs, _eff_trk, _smear_trk), "Tracks");
107 }
108
109 // Jet projections
110 const FinalState allfs(_acut);
111 declare(allfs, "AllParticles");
112 for (const auto& jditem : _jdefs) {
113 const JetScheme& jd = jditem.second;
115 FastJets jetfs(allfs, jd.alg, jd.R, jd.muons, jd.invis);
117 if (!hasProjection("Jets" + jditem.first)) {
118 declare(SmearedJets(jetfs, _smears_jet[jditem.first], _effs_btag[jditem.first]),
119 "Jets" + jditem.first);
120 }
121 }
122
123 // Missing momentum projection
124 if (!hasProjection("MET")) {
125 declare(SmearedMET(MissingMomentum(allfs), _smearps_met, _smear_met), "MET");
126 }
127 }
128
129
131 void preAnalyze(const Event& event) {
132 _electrons.clear();
133 _muons.clear();
134 _taus.clear();
135 _photons.clear();
136 _jets.clear();
137 _bjets.clear();
138 }
139
141
142
145
148
152 IDClass idc = IDClass::MEDIUM) {
153 _effs_electron[idc] = eff;
154 _smear_electron = smear;
155 }
156
157 void setMuonReco(const ParticleEffFn& eff,
159 IDClass idc = IDClass::MEDIUM) {
160 _effs_muon[idc] = eff;
161 _smear_muon = smear;
162 }
163
166 IDClass idc = IDClass::MEDIUM) {
167 _effs_photon[idc] = eff;
168 _smear_photon = smear;
169 }
170
171 void setTauReco(const ParticleEffFn& eff,
173 IDClass idc = IDClass::MEDIUM) {
174 _effs_tau[idc] = eff;
175 _smear_tau = smear;
176 }
177
179 _eff_trk = eff;
180 _smear_trk = smear;
181 }
182
183 void setJetReco(const JetSmearFn& smear,
184 const JetEffFn& btageff,
185 const std::string& jetname = "DEFAULT") {
186 _smears_jet[jetname] = smear;
187 _effs_btag[jetname] = btageff;
188 }
189
190 void setMETReco(const METSmearParamsFn& smearps) {
191 _smearps_met = smearps;
192 }
193
194 void setMETReco(const METSmearParamsFn& smearps, const METSmearFn& smear) {
195 _smearps_met = smearps;
196 _smear_met = smear;
197 }
198
200
201
206 void setAccCut(const Cut& cut) {
207 _acut = cut;
208 }
209 void setElectronCut(const Cut& cut) {
210 _ecut = cut;
211 }
212 void setMuonCut(const Cut& cut) {
213 _mcut = cut;
214 }
215 void setPhotonCut(const Cut& cut) {
216 _phocut = cut;
217 }
218 void setTauCut(const Cut& cut) {
219 _tcut = cut;
220 }
221 void setTrkCut(const Cut& cut) {
222 _trkcut = cut;
223 }
224 void setJetDef(const JetScheme& jdef, const std::string& jetname = "DEFAULT") {
225 _jdefs[jetname] = jdef;
226 }
227 void setJetCut(const Cut& cut, const std::string& jetname = "DEFAULT") {
228 _jcuts[jetname] = cut;
229 }
231
233
234
237
239 const Particles& electrons(IDClass eclass = IDClass::MEDIUM, bool include_indirect = false) const {
240 const std::string kpc = _pckey(include_indirect, eclass);
241 if (_electrons.find(kpc) == _electrons.end()) { //< if not cached
242 _electrons[kpc] = apply<ParticleFinder>(currentEvent(), "Electrons" + kpc).particlesByPt();
243 }
244 return _electrons.at(kpc);
245 }
246
247 Particles electrons(const Cut& cut,
248 IDClass eclass = IDClass::MEDIUM,
249 bool include_indirect = false) const {
250 return select(electrons(eclass, include_indirect), cut);
251 }
252
253
255 const Particles& muons(IDClass muclass = IDClass::MEDIUM, bool include_indirect = false) const {
256 const std::string kpc = _pckey(include_indirect, muclass);
257 if (_muons.find(kpc) == _muons.end()) { //< if not cached
258 _muons[kpc] = apply<ParticleFinder>(currentEvent(), "Muons" + kpc).particlesByPt();
259 }
260 return _muons.at(kpc);
261 }
262
263 Particles muons(const Cut& cut, IDClass muclass = IDClass::MEDIUM, bool include_indirect = false) const {
264 return select(muons(muclass, include_indirect), cut);
265 }
266
267
269 const Particles& photons(IDClass phoclass = IDClass::MEDIUM,
270 bool include_indirect = false,
271 double dRiso = 0.4,
272 double isofrac = 0.1) const {
273 const std::string kpc = _pckey(include_indirect, phoclass);
274 if (_photons.find(kpc) == _photons.end()) { //< if not cached
275 Particles ystmp = apply<ParticleFinder>(currentEvent(), "Photons" + kpc).particlesByPt();
276 const Particles& clusters = apply<ParticleFinder>(currentEvent(), "AllParticles").particles();
277 _photons[kpc].reserve(ystmp.size());
278 for (const Particle& y : ystmp) {
279 double sumpt = 0;
280 for (const Particle& cl : select(clusters, deltaRLess(y, dRiso))) {
281 if (deltaR(cl, y) == 0.01) continue; //< irresolvably close
282 sumpt += cl.pT();
283 }
284 if (sumpt / y.pT() < isofrac) _photons[kpc].push_back(y);
285 }
286 }
287 return _photons.at(kpc);
288 }
289
290 Particles photons(const Cut& cut,
291 IDClass phoclass = IDClass::MEDIUM,
292 bool include_indirect = false) const {
293 return select(photons(phoclass, include_indirect), cut);
294 }
295
296
298 const Particles& taus(IDClass tauclass = IDClass::MEDIUM, bool include_indirect = false) const {
299 const std::string kpc = _pckey(include_indirect, tauclass);
300 if (_taus.find(kpc) == _taus.end()) { //< if not cached
301 _taus[kpc] = apply<ParticleFinder>(currentEvent(), "Taus" + kpc).particlesByPt();
302 }
303 return _taus.at(kpc);
304 }
305
306 Particles taus(const Cut& cut, IDClass tauclass = IDClass::MEDIUM, bool include_indirect = false) const {
307 return select(taus(tauclass, include_indirect), cut);
308 }
309
310
315 const Particles tracks() const {
316 return apply<ParticleFinder>(currentEvent(), "Tracks").particlesByPt();
317 }
318
322 Particles tracks(const Cut& cut) const {
323 return apply<ParticleFinder>(currentEvent(), "Tracks").particlesByPt(cut);
324 }
325
326
328 const std::vector<std::string> jetnames() const {
329 std::vector<std::string> rtn;
330 rtn.reserve(_jets.size());
331 for (const auto& kv : _jets) rtn.push_back(kv.first);
332 return rtn;
333 }
334
336 const Jets& jets(const std::string& jetname = "DEFAULT") const {
337 if (_jets.find(jetname) == _jets.end()) { //< not cached
339 _jets[jetname] = apply<JetFinder>(currentEvent(), "Jets" + jetname).jetsByPt(_jcuts.at(jetname));
340 }
341 return _jets.at(jetname);
342 }
343
344 Jets jets(const Cut& cut, const std::string& jetname = "DEFAULT") const {
345 return select(jets(jetname), cut);
346 }
347
348
350 const Jets& bjets(const std::string& jetname = "DEFAULT") const {
351 if (_bjets.find(jetname) == _bjets.end()) { //< not cached
352 _bjets[jetname] = select(jets(jetname), hasBTag(_bcut, _bdeltaR));
353 }
354 return _bjets.at(jetname);
355 }
356
357 Jets bjets(const Cut& cut, const std::string& jetname = "DEFAULT") const {
358 return select(bjets(jetname), cut);
359 }
360
361
363 Vector3 vmet() const {
364 return apply<METFinder>(currentEvent(), "MET").vectorMissingPt();
365 }
366
368 double met() const {
369 return vmet().mod();
370 }
371
373 double set() const {
374 return apply<METFinder>(currentEvent(), "MET").scalarEt();
375 }
376
378 double metSignf() const {
379 return apply<SmearedMET>(currentEvent(), "MET").missingEtSignf();
380 }
381
383
384
387
405 void doSimpleOverlapRemoval(IDClass eclass = IDClass::MEDIUM,
406 IDClass muclass = IDClass::MEDIUM,
407 IDClass phoclass = IDClass::MEDIUM, //IDClass tauclass=IDClass::MEDIUM,
408 bool include_indirect = false,
409 const std::string& jetname = "DEFAULT") {
410 // Get non-const handles for filtering (and ensure objects exist)
411 Jets& myjets = const_cast<Jets&>(jets(jetname));
412 Jets& mybjets = const_cast<Jets&>(bjets(jetname));
413 Particles& myes = const_cast<Particles&>(electrons(eclass, include_indirect));
414 Particles& myms = const_cast<Particles&>(muons(muclass, include_indirect));
415 //Particles& myts = const_cast<Particles&>(taus(tauclass, include_indirect));
416 Particles& myys = const_cast<Particles&>(photons(phoclass, include_indirect));
417 // Remove all jets within dR < 0.2 of a dressed lepton
418 idiscardIfAnyDeltaRLess(myjets, myes, 0.2);
419 idiscardIfAnyDeltaRLess(myjets, myms, 0.2);
420 idiscardIfAnyDeltaRLess(mybjets, myes, 0.2);
421 idiscardIfAnyDeltaRLess(mybjets, myms, 0.2);
422 // Remove all isolated photons within dR < 0.2 of a dressed electron
424 idiscardIfAnyDeltaRLess(myys, myes, 0.2);
425 // Remove dressed leptons within the radius of a remaining jet
426 idiscardIfAnyDeltaRLess(myes, myjets, _jdefs.at(jetname).R);
427 idiscardIfAnyDeltaRLess(myms, myjets, _jdefs.at(jetname).R);
429 }
430
431
433 // void doJetRecluster(/* jet collection names (in and out), recluster-alg enum and dR */) {
434 // /// @todo ...
435 // }
436
438
439
442
444 template <typename T>
445 void scaleToIntLumi(T& ao, double intlumi) {
446 scale(ao, intlumi * crossSection() / sumOfWeights());
447 }
448
450
451
454
456 const ParticleFinder& electronsProj(IDClass eclass = IDClass::MEDIUM, bool include_indirect = false) {
457 return getProjection<ParticleFinder>(_pckey(include_indirect, eclass, "Electrons"));
458 }
459
460 const ParticleFinder& muonsProj(IDClass muclass = IDClass::MEDIUM, bool include_indirect = false) {
461 return getProjection<ParticleFinder>(_pckey(include_indirect, muclass, "Muons"));
462 }
463
464 const ParticleFinder& tausProj(IDClass tauclass = IDClass::MEDIUM, bool include_indirect = false) {
465 return getProjection<ParticleFinder>(_pckey(include_indirect, tauclass, "Taus"));
466 }
467
468 const ParticleFinder& photonsProj(IDClass phoclass = IDClass::MEDIUM, bool include_indirect = false) {
469 return getProjection<ParticleFinder>(_pckey(include_indirect, phoclass, "Photons"));
470 }
471
473 return getProjection<ParticleFinder>("Tracks");
474 }
475
476 const JetFinder& jetsProj(const std::string& jetname = "DEFAULT") {
477 return getProjection<JetFinder>("Jets_" + jetname);
478 }
479
481 return getProjection<METFinder>("MET");
482 }
483
485
486
487 private:
488
491 std::map<IDClass, ParticleEffFn> _effs_electron{{IDClass::LOOSE, PARTICLE_EFF_ONE},
492 {IDClass::MEDIUM, PARTICLE_EFF_ONE},
493 {IDClass::TIGHT, PARTICLE_EFF_ONE}};
494 std::map<IDClass, ParticleEffFn> _effs_muon{{IDClass::LOOSE, PARTICLE_EFF_ONE},
495 {IDClass::MEDIUM, PARTICLE_EFF_ONE},
496 {IDClass::TIGHT, PARTICLE_EFF_ONE}};
497 std::map<IDClass, ParticleEffFn> _effs_photon{{IDClass::LOOSE, PARTICLE_EFF_ONE},
498 {IDClass::MEDIUM, PARTICLE_EFF_ONE},
499 {IDClass::TIGHT, PARTICLE_EFF_ONE}};
500 std::map<IDClass, ParticleEffFn> _effs_tau{{IDClass::LOOSE, PARTICLE_EFF_ONE},
501 {IDClass::MEDIUM, PARTICLE_EFF_ONE},
502 {IDClass::TIGHT, PARTICLE_EFF_ONE}};
504 _smear_photon{PARTICLE_SMEAR_IDENTITY}, _smear_tau{PARTICLE_SMEAR_IDENTITY};
507 std::map<std::string, JetSmearFn> _smears_jet{{"DEFAULT", JET_SMEAR_IDENTITY}};
508 std::map<std::string, JetEffFn> _effs_btag{{"DEFAULT", JET_BTAG_IDENTITY}};
510 METSmearFn _smear_met{MET_SMEAR_IDENTITY};
512
515 Cut _acut = Cuts::abseta < 5.0; //< base acceptance, applied to all
516 Cut _ecut = Cuts::pT > 10 * GeV;
517 Cut _mcut = Cuts::pT > 10 * GeV;
518 Cut _tcut = Cuts::pT > 10 * GeV;
519 Cut _trkcut = Cuts::abseta < 2.5;
520 Cut _phocut = Cuts::pT > 10 * GeV;
521 std::map<std::string, Cut> _jcuts = {{"DEFAULT", Cuts::pT > 20 * GeV&& Cuts::abseta < 5.0}};
522 std::map<std::string, JetScheme> _jdefs = {{"DEFAULT", JetScheme(JetAlg::ANTIKT, 0.4)}};
524
525
530 Cut _bcut = Cuts::pT > 5 * GeV&& Cuts::abseta < 2.5;
531 double _bdeltaR = 0.3;
533
534
539
540 // Internal typedefs
541 // using ParticlesMap = std::map<std::string, Particles>;
542 // using JetsMap = std::map<std::string, Jets>;
543
545 mutable std::map<std::string, Particles> _electrons, _muons, _taus, _photons;
546
548 mutable std::map<std::string, Jets> _jets, _bjets;
549
551
552
554 //
556 const std::map<IDClass, std::string>& _idclasses() const {
557 // static const std::vector<IDClass> _idclasses{ {IDClass::LOOSE, IDClass::MEDIUM, IDClass::TIGHT} };
558 static const auto* map = new std::map<IDClass, std::string>{{IDClass::LOOSE, "Loose"},
559 {IDClass::MEDIUM, "Medium"},
560 {IDClass::TIGHT, "Tight"}};
561 return *map;
562 }
563 const std::string& _idclassname(const IDClass& idc) const {
564 return _idclasses().at(idc);
565 }
566
568 std::string _pckey(bool include_indirect, IDClass idc, const std::string& prefix = "") const {
569 return prefix + (include_indirect ? "All" : "Direct") + _idclassname(idc);
570 }
571 };
572
573
574}
575
576
580#define RIVET_DEFAULT_SIMPLEANALYSIS_CTOR(clsname) clsname() : SimpleAnalysis(# clsname) {}
581
582
587#define setDetSmearing(DET, BTAG) do { \
588 setElectronReco(ELECTRON_EFF_ ## DET ## _LOOSE, ELECTRON_SMEAR_ ## DET, IDClass::LOOSE) ; \
589 setElectronReco(ELECTRON_EFF_ ## DET ## _MEDIUM, ELECTRON_SMEAR_ ## DET, IDClass::MEDIUM) ; \
590 setElectronReco(ELECTRON_EFF_ ## DET ## _TIGHT, ELECTRON_SMEAR_ ## DET, IDClass::TIGHT) ; \
591 setMuonReco(MUON_EFF_ ## DET ## _LOOSE, MUON_SMEAR_ ## DET, IDClass::LOOSE) ; \
592 setMuonReco(MUON_EFF_ ## DET ## _MEDIUM, MUON_SMEAR_ ## DET, IDClass::MEDIUM) ; \
593 setMuonReco(MUON_EFF_ ## DET ## _TIGHT, MUON_SMEAR_ ## DET, IDClass::TIGHT) ; \
594 setPhotonReco(PHOTON_EFF_ ## DET ## _LOOSE, ELECTRON_SMEAR_ ## DET, IDClass::LOOSE) ; \
595 setPhotonReco(PHOTON_EFF_ ## DET ## _MEDIUM, ELECTRON_SMEAR_ ## DET, IDClass::MEDIUM) ; \
596 setPhotonReco(PHOTON_EFF_ ## DET ## _TIGHT, ELECTRON_SMEAR_ ## DET, IDClass::TIGHT) ; \
597 setTauReco(TAU_EFF_ ## DET ## _LOOSE, TAU_SMEAR_ ## DET, IDClass::LOOSE) ; \
598 setTauReco(TAU_EFF_ ## DET ## _MEDIUM, TAU_SMEAR_ ## DET, IDClass::MEDIUM) ; \
599 setTauReco(TAU_EFF_ ## DET ## _TIGHT, TAU_SMEAR_ ## DET, IDClass::TIGHT) ; \
600 setTrkReco(TRK_EFF_ ## DET, TRK_SMEAR_ ## DET) ; \
601 for (const std::string& jname : jetnames()) \
602 setJetReco(JET_SMEAR_ ## DET, JET_BTAG_ ## DET ## _ ## BTAG, jname) ; \
603 setMETReco(MET_SMEARPARAMS_ ## DET, MET_SMEAR_ ## DET) ; \
604 } while (0)
double crossSection() const
Get the process cross-section in pb. Throws if this hasn't been set.
const Event & currentEvent() const
Access the current event.
Definition Analysis.hh:433
void scale(MultiplexPtr< Multiplexer< T > > &ao, CounterAdapter factor)
Multiplicatively scale the given AnalysisObject, ao, by factor factor.
Definition Analysis.hh:1381
double sumOfWeights() const
Alias.
Definition Analysis.hh:475
Analysis(const std::string &name)
Constructor.
virtual std::string name() const
Get the name of the analysis.
Definition Analysis.hh:165
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Find jets using jet algorithms via the FastJet package.
Definition FastJets.hh:30
Project out all final-state particles in an event. Probably the most important projection in Rivet!
Definition FinalState.hh:12
Abstract base class for projections which can return a set of Jets.
Definition JetFinder.hh:42
Specialised vector of Jet objects.
Definition Jet.hh:21
Reconstruct leptons, generally including "dressing" with clustered photons.
Definition LeptonFinder.hh:29
Interface for projections that find missing transverse energy/momentum.
Definition METFinder.hh:11
Calculate missing , etc. as complements to the total visible momentum.
Definition MissingMomentum.hh:22
Base class for projections which return subsets of an event's particles.
Definition ParticleFinder.hh:11
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:50
Specialised vector of Particle objects.
Definition Particle.hh:21
const PROJ & getProjection(const std::string &name) const
Definition ProjectionApplier.hh:72
std::enable_if_t< std::is_base_of< Projection, PROJ >::value, const PROJ & > apply(const Event &evt, const Projection &proj) const
Apply the supplied projection on event evt.
Definition ProjectionApplier.hh:124
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version).
Definition ProjectionApplier.hh:205
bool hasProjection(const std::string &name) const
Does this applier have a projection registered under the name name?
Definition ProjectionApplier.hh:55
Particles electrons(const Cut &cut, IDClass eclass=IDClass::MEDIUM, bool include_indirect=false) const
Get the pT-ordered set of reconstructed direct electrons, with extra cuts.
Definition SimpleAnalysis.hh:247
const ParticleFinder & tracksProj()
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:472
const ParticleFinder & electronsProj(IDClass eclass=IDClass::MEDIUM, bool include_indirect=false)
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:456
void doSimpleOverlapRemoval(IDClass eclass=IDClass::MEDIUM, IDClass muclass=IDClass::MEDIUM, IDClass phoclass=IDClass::MEDIUM, bool include_indirect=false, const std::string &jetname="DEFAULT")
Perform a simple, in-place overlap removal between all physics objects.
Definition SimpleAnalysis.hh:405
const Jets & bjets(const std::string &jetname="DEFAULT") const
Get a pT-ordered named set of reconstructed b-tagged jets.
Definition SimpleAnalysis.hh:350
const Particles & photons(IDClass phoclass=IDClass::MEDIUM, bool include_indirect=false, double dRiso=0.4, double isofrac=0.1) const
Get the pT-ordered set of reconstructed direct and isolated photons.
Definition SimpleAnalysis.hh:269
Vector3 vmet() const
Get the MET vector.
Definition SimpleAnalysis.hh:363
void setTauReco(const ParticleEffFn &eff, const ParticleSmearFn &smear=PARTICLE_SMEAR_IDENTITY, IDClass idc=IDClass::MEDIUM)
Set the tau reco functions for a given ID class.
Definition SimpleAnalysis.hh:171
void setPhotonReco(const ParticleEffFn &eff, const ParticleSmearFn &smear=PARTICLE_SMEAR_IDENTITY, IDClass idc=IDClass::MEDIUM)
Set the photon reco functions for a given ID class.
Definition SimpleAnalysis.hh:164
const Jets & jets(const std::string &jetname="DEFAULT") const
Get a pT-ordered named set of reconstructed jets.
Definition SimpleAnalysis.hh:336
Particles muons(const Cut &cut, IDClass muclass=IDClass::MEDIUM, bool include_indirect=false) const
Get the pT-ordered set of reconstructed muons, with extra cuts.
Definition SimpleAnalysis.hh:263
double metSignf() const
Get the MET significance.
Definition SimpleAnalysis.hh:378
Jets bjets(const Cut &cut, const std::string &jetname="DEFAULT") const
Get a pT-ordered named set of reconstructed b-tagged jets, with extra cuts.
Definition SimpleAnalysis.hh:357
const ParticleFinder & muonsProj(IDClass muclass=IDClass::MEDIUM, bool include_indirect=false)
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:460
void scaleToIntLumi(T &ao, double intlumi)
Helper function to elide the xsec/sumW scalefactor.
Definition SimpleAnalysis.hh:445
const std::vector< std::string > jetnames() const
Get the set of jet-collection names (also usable for b-jets).
Definition SimpleAnalysis.hh:328
const JetFinder & jetsProj(const std::string &jetname="DEFAULT")
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:476
Jets jets(const Cut &cut, const std::string &jetname="DEFAULT") const
Get a pT-ordered named set of reconstructed jets, with extra cuts.
Definition SimpleAnalysis.hh:344
const METFinder & metProj()
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:480
double set() const
Get the SET scalar.
Definition SimpleAnalysis.hh:373
void setTrkReco(const ParticleEffFn &eff, const ParticleSmearFn &smear=PARTICLE_SMEAR_IDENTITY)
Set the track reco functions for a given jet name.
Definition SimpleAnalysis.hh:178
const ParticleFinder & photonsProj(IDClass phoclass=IDClass::MEDIUM, bool include_indirect=false)
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:468
const Particles & electrons(IDClass eclass=IDClass::MEDIUM, bool include_indirect=false) const
Get the pT-ordered set of reconstructed direct electrons.
Definition SimpleAnalysis.hh:239
IDClass
Physics-object ID classes.
Definition SimpleAnalysis.hh:20
void setElectronReco(const ParticleEffFn &eff, const ParticleSmearFn &smear=PARTICLE_SMEAR_IDENTITY, IDClass idc=IDClass::MEDIUM)
Set the electron reco functions for a given ID class.
Definition SimpleAnalysis.hh:150
void preAnalyze(const Event &event)
Reset per-event members, before the user analyze().
Definition SimpleAnalysis.hh:131
Particles tracks(const Cut &cut) const
Definition SimpleAnalysis.hh:322
virtual ~SimpleAnalysis()
Destructor to support subclassing.
Definition SimpleAnalysis.hh:27
void setJetReco(const JetSmearFn &smear, const JetEffFn &btageff, const std::string &jetname="DEFAULT")
Set the jet reco functions for a given jet name.
Definition SimpleAnalysis.hh:183
const Particles & taus(IDClass tauclass=IDClass::MEDIUM, bool include_indirect=false) const
Get the pT-ordered set of reconstructed direct (hadronic) taus.
Definition SimpleAnalysis.hh:298
void setMETReco(const METSmearParamsFn &smearps, const METSmearFn &smear)
Set the MET reco functions.
Definition SimpleAnalysis.hh:194
Particles taus(const Cut &cut, IDClass tauclass=IDClass::MEDIUM, bool include_indirect=false) const
Get the pT-ordered set of reconstructed direct (hadronic) taus, with extra cuts.
Definition SimpleAnalysis.hh:306
Particles photons(const Cut &cut, IDClass phoclass=IDClass::MEDIUM, bool include_indirect=false) const
Get the pT-ordered set of reconstructed direct and isolated photons, with extra cuts.
Definition SimpleAnalysis.hh:290
const ParticleFinder & tausProj(IDClass tauclass=IDClass::MEDIUM, bool include_indirect=false)
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:464
const Particles tracks() const
Definition SimpleAnalysis.hh:315
void postInit()
Definition SimpleAnalysis.hh:37
SimpleAnalysis(const std::string &name)
Constructor, passing arg to base class and supporting subclassing.
Definition SimpleAnalysis.hh:23
const Particles & muons(IDClass muclass=IDClass::MEDIUM, bool include_indirect=false) const
Get the pT-ordered set of reconstructed muons.
Definition SimpleAnalysis.hh:255
void setMuonReco(const ParticleEffFn &eff, const ParticleSmearFn &smear=PARTICLE_SMEAR_IDENTITY, IDClass idc=IDClass::MEDIUM)
Set the muon reco functions for a given ID class.
Definition SimpleAnalysis.hh:157
void setMETReco(const METSmearParamsFn &smearps)
Set the MET reco-params function.
Definition SimpleAnalysis.hh:190
double met() const
Get the MET scalar.
Definition SimpleAnalysis.hh:368
Wrapper projection for smearing Jets with detector resolutions and efficiencies.
Definition SmearedJets.hh:19
Wrapper projection for smearing missing (transverse) energy/momentum with detector resolutions.
Definition SmearedMET.hh:15
Wrapper projection for smearing Jets with detector resolutions and efficiencies.
Definition SmearedParticles.hh:14
Convenience finder of unstable taus.
Definition TauFinder.hh:19
Three-dimensional specialisation of Vector.
Definition Vector3.hh:39
double mod() const
Calculate the modulus of a vector. .
Definition VectorN.hh:99
Jets select(const Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Definition JetUtils.hh:183
Vector3 MET_SMEAR_IDENTITY(const Vector3 &met, double)
Identity MET smearing just returns the input.
Definition MomentumSmearingFunctions.hh:206
METSmearParams MET_SMEARPARAMS_IDENTITY(const Vector3 &met, double)
Identity resolution is 0 (perfect delta function, no offset).
Definition MomentumSmearingFunctions.hh:201
function< Vector3(const Vector3 &, double)> METSmearFn
Definition MomentumSmearingFunctions.hh:168
function< METSmearParams(const Vector3 &, double)> METSmearParamsFn
Definition MomentumSmearingFunctions.hh:163
double PARTICLE_EFF_ONE(const Particle &)
Take a Particle and return 1.
Definition ParticleSmearingFunctions.hh:39
function< Particle(const Particle &)> ParticleSmearFn
Typedef for Particle smearing functions/functors.
Definition ParticleSmearingFunctions.hh:19
Particle PARTICLE_SMEAR_IDENTITY(const Particle &p)
Take a Particle and return it unmodified.
Definition ParticleSmearingFunctions.hh:67
double JET_BTAG_IDENTITY(const Jet &j)
Alias for JET_BTAG_PERFECT.
Definition JetSmearingFunctions.hh:78
function< double(const Particle &)> ParticleEffFn
Typedef for Particle efficiency functions/functors.
Definition ParticleSmearingFunctions.hh:22
Jet JET_SMEAR_IDENTITY(const Jet &j)
Definition JetSmearingFunctions.hh:128
function< Jet(const Jet &)> JetSmearFn
Typedef for Jet smearing functions/functors.
Definition JetSmearingFunctions.hh:20
function< double(const Jet &)> JetEffFn
Typedef for Jet efficiency functions/functors.
Definition JetSmearingFunctions.hh:23
Definition LHCbCommon.hh:9
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition MathUtils.hh:754
PromptFinalState DirectFinalState
Alias with a more correct name.
Definition DirectFinalState.hh:10
Convenience container of params for simple jet definitions.
Definition JetFinder.hh:22
JetAlg alg
Params.
Definition JetFinder.hh:34