rivet is hosted by Hepforge, IPPP Durham
Rivet 4.1.0
SimpleAnalysis.hh
1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4#include "Rivet/Projections/FastJets.hh"
5#include "Rivet/Projections/LeptonFinder.hh"
6#include "Rivet/Projections/TauFinder.hh"
7#include "Rivet/Projections/MissingMomentum.hh"
8#include "Rivet/Projections/DirectFinalState.hh"
9#include "Rivet/Projections/Smearing.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 { }
26
29 { }
30
31
34
39 void postInit() {
40
41 // Electron projections
42 FinalState es(_acut && _ecut && Cuts::abspid == PID::ELECTRON);
43 LeptonFinder es_prompt(_acut && _ecut && Cuts::abspid == PID::ELECTRON, 0.1);
44 for (const auto& classkv : _idclasses()) {
45 const IDClass& idc = classkv.first;
46 const string p = "Electrons";
47 const string aname = _pckey(true, idc, p);
48 if (!hasProjection(aname))
49 declare(SmearedParticles(es, _effs_electron[idc], _smear_electron), aname);
50 const string pname = _pckey(false, idc, p);
51 if (!hasProjection(pname))
52 declare(SmearedParticles(es_prompt, _effs_electron[idc], _smear_electron), pname);
53 }
54
55 // Muon projections
56 FinalState ms(_acut && _mcut && Cuts::abspid == PID::MUON);
57 LeptonFinder ms_prompt(_acut && _mcut && Cuts::abspid == PID::MUON, 0.1);
58 for (const auto& classkv : _idclasses()) {
59 const IDClass& idc = classkv.first;
60 const string p = "Muons";
61 const string aname = _pckey(true, idc, p);
62 if (!hasProjection(aname))
63 declare(SmearedParticles(ms, _effs_muon[idc], _smear_muon), aname);
64 const string pname = _pckey(false, idc, p);
65 if (!hasProjection(pname))
66 declare(SmearedParticles(ms_prompt, _effs_muon[idc], _smear_muon), pname);
67 }
68
69 // Photon projections
70 FinalState ys(_acut && _phocut && Cuts::abspid == PID::PHOTON);
71 DirectFinalState ys_prompt(_acut && _phocut && Cuts::abspid == PID::PHOTON);
72 for (const auto& classkv : _idclasses()) {
73 const IDClass& idc = classkv.first;
74 const string p = "Photons";
75 const string aname = _pckey(true, idc, p);
76 if (!hasProjection(aname))
77 declare(SmearedParticles(ys, _effs_photon[idc], _smear_photon), aname);
78 const string pname = _pckey(false, idc, p);
79 if (!hasProjection(pname))
80 declare(SmearedParticles(ys_prompt, _effs_photon[idc], _smear_photon), pname);
81 }
82
83 // Tau projections
84 TauFinder ts(TauDecay::HADRONIC, LeptonOrigin::ANY, _acut && _tcut);
85 TauFinder ts_prompt(TauDecay::HADRONIC, LeptonOrigin::NODECAY, _acut && _tcut);
86 for (const auto& classkv : _idclasses()) {
87 const IDClass& idc = classkv.first;
88 const string p = "Taus";
89 const string aname = _pckey(true, idc, p);
90 if (!hasProjection(aname))
91 declare(SmearedParticles(ts, _effs_tau[idc], _smear_tau), aname);
92 const string pname = _pckey(false, idc, p);
93 if (!hasProjection(pname))
94 declare(SmearedParticles(ts_prompt, _effs_tau[idc], _smear_tau), pname);
95 }
96
97 // Track projection
98 const FinalState trkfs(_acut && _trkcut && Cuts::abscharge > 0);
99 if (!hasProjection("Tracks"))
100 declare(SmearedParticles(trkfs, _eff_trk, _smear_trk), "Tracks");
101
102 // Jet projections
103 const FinalState allfs(_acut);
104 declare(allfs, "AllParticles");
105 for (const auto& jditem : _jdefs) {
106 const JetScheme& jd = jditem.second;
108 FastJets jetfs(allfs, jd.alg, jd.R, jd.muons, jd.invis);
110 if (!hasProjection("Jets"+jditem.first))
111 declare(SmearedJets(jetfs, _smears_jet[jditem.first], _effs_btag[jditem.first]), "Jets"+jditem.first);
112 }
113
114 // Missing momentum projection
115 if (!hasProjection("MET"))
116 declare(SmearedMET(MissingMomentum(allfs), _smearps_met, _smear_met), "MET");
117 }
118
119
121 void preAnalyze(const Event& event) {
122 _electrons.clear();
123 _muons.clear();
124 _taus.clear();
125 _photons.clear();
126 _jets.clear();
127 _bjets.clear();
128 }
129
131
132
133
136
139
141 void setElectronReco(const ParticleEffFn& eff, const ParticleSmearFn& smear=PARTICLE_SMEAR_IDENTITY, IDClass idc=IDClass::MEDIUM) {
142 _effs_electron[idc] = eff;
143 _smear_electron = smear;
144 }
146 void setMuonReco(const ParticleEffFn& eff, const ParticleSmearFn& smear=PARTICLE_SMEAR_IDENTITY, IDClass idc=IDClass::MEDIUM) {
147 _effs_muon[idc] = eff;
148 _smear_muon = smear;
149 }
151 void setPhotonReco(const ParticleEffFn& eff, const ParticleSmearFn& smear=PARTICLE_SMEAR_IDENTITY, IDClass idc=IDClass::MEDIUM) {
152 _effs_photon[idc] = eff;
153 _smear_photon = smear;
154 }
156 void setTauReco(const ParticleEffFn& eff, const ParticleSmearFn& smear=PARTICLE_SMEAR_IDENTITY, IDClass idc=IDClass::MEDIUM) {
157 _effs_tau[idc] = eff;
158 _smear_tau = smear;
159 }
162 _eff_trk = eff;
163 _smear_trk = smear;
164 }
166 void setJetReco(const JetSmearFn& smear, const JetEffFn& btageff, const std::string& jetname="DEFAULT") {
167 _smears_jet[jetname] = smear;
168 _effs_btag[jetname] = btageff;
169 }
171 void setMETReco(const METSmearParamsFn& smearps) {
172 _smearps_met = smearps;
173 }
175 void setMETReco(const METSmearParamsFn& smearps, const METSmearFn& smear) {
176 _smearps_met = smearps;
177 _smear_met = smear;
178 }
179
181
182
187 void setAccCut(const Cut& cut) { _acut = cut; }
188 void setElectronCut(const Cut& cut) { _ecut = cut; }
189 void setMuonCut(const Cut& cut) { _mcut = cut; }
190 void setPhotonCut(const Cut& cut) { _phocut = cut; }
191 void setTauCut(const Cut& cut) { _tcut = cut; }
192 void setTrkCut(const Cut& cut) { _trkcut = cut; }
193 void setJetDef(const JetScheme& jdef, const std::string& jetname="DEFAULT") { _jdefs[jetname] = jdef; }
194 void setJetCut(const Cut& cut, const std::string& jetname="DEFAULT") { _jcuts[jetname] = cut; }
196
198
199
200
203
205 const Particles& electrons(IDClass eclass=IDClass::MEDIUM, bool include_nonprompt=false) const {
206 const std::string kpc = _pckey(include_nonprompt, eclass);
207 if (_electrons.find(kpc) == _electrons.end()) { //< if not cached
208 _electrons[kpc] = apply<ParticleFinder>(currentEvent(), "Electrons"+kpc).particlesByPt();
209 }
210 return _electrons.at(kpc);
211 }
213 Particles electrons(const Cut& cut, IDClass eclass=IDClass::MEDIUM, bool include_nonprompt=false) const {
214 return select(electrons(eclass, include_nonprompt), cut);
215 }
216
217
219 const Particles& muons(IDClass muclass=IDClass::MEDIUM, bool include_nonprompt=false) const {
220 const std::string kpc = _pckey(include_nonprompt, muclass);
221 if (_muons.find(kpc) == _muons.end()) { //< if not cached
222 _muons[kpc] = apply<ParticleFinder>(currentEvent(), "Muons"+kpc).particlesByPt();
223 }
224 return _muons.at(kpc);
225 }
227 Particles muons(const Cut& cut, IDClass muclass=IDClass::MEDIUM, bool include_nonprompt=false) const {
228 return select(muons(muclass, include_nonprompt), cut);
229 }
230
231
233 const Particles& photons(IDClass phoclass=IDClass::MEDIUM, bool include_nonprompt=false, double dRiso=0.4, double isofrac=0.1) const {
234 const std::string kpc = _pckey(include_nonprompt, phoclass);
235 if (_photons.find(kpc) == _photons.end()) { //< if not cached
236 Particles ystmp = apply<ParticleFinder>(currentEvent(), "Photons"+kpc).particlesByPt();
237 const Particles& clusters = apply<ParticleFinder>(currentEvent(), "AllParticles").particles();
238 _photons[kpc].reserve(ystmp.size());
239 for (const Particle& y : ystmp) {
240 double sumpt = 0;
241 for (const Particle& cl : select(clusters, deltaRLess(y, dRiso))) {
242 if (deltaR(cl, y) == 0.01) continue; //< irresolvably close
243 sumpt += cl.pT();
244 }
245 if (sumpt/y.pT() < isofrac) _photons[kpc].push_back(y);
246 }
247 }
248 return _photons.at(kpc);
249 }
251 Particles photons(const Cut& cut, IDClass phoclass=IDClass::MEDIUM, bool include_nonprompt=false) const {
252 return select(photons(phoclass, include_nonprompt), cut);
253 }
254
255
257 const Particles& taus(IDClass tauclass=IDClass::MEDIUM, bool include_nonprompt=false) const {
258 const std::string kpc = _pckey(include_nonprompt, tauclass);
259 if (_taus.find(kpc) == _taus.end()) { //< if not cached
260 _taus[kpc] = apply<ParticleFinder>(currentEvent(), "Taus"+kpc).particlesByPt();
261 }
262 return _taus.at(kpc);
263 }
265 Particles taus(const Cut& cut, IDClass tauclass=IDClass::MEDIUM, bool include_nonprompt=false) const {
266 return select(taus(tauclass, include_nonprompt), cut);
267 }
268
269
274 const Particles tracks() const {
275 return apply<ParticleFinder>(currentEvent(), "Tracks").particlesByPt();
276 }
281 Particles tracks(const Cut& cut) const {
282 return apply<ParticleFinder>(currentEvent(), "Tracks").particlesByPt(cut);
283 }
284
285
287 const std::vector<std::string> jetnames() const {
288 std::vector<std::string> rtn;
289 rtn.reserve(_jets.size());
290 for (const auto& kv : _jets) rtn.push_back(kv.first);
291 return rtn;
292 }
293
295 const Jets& jets(const std::string& jetname="DEFAULT") const {
296 if (_jets.find(jetname) == _jets.end()) { //< not cached
298 _jets[jetname] = apply<JetFinder>(currentEvent(), "Jets"+jetname).jetsByPt(_jcuts.at(jetname));
299 }
300 return _jets.at(jetname);
301 }
303 Jets jets(const Cut& cut, const std::string& jetname="DEFAULT") const {
304 return select(jets(jetname), cut);
305 }
306
307
309 const Jets& bjets(const std::string& jetname="DEFAULT") const {
310 if (_bjets.find(jetname) == _bjets.end()) { //< not cached
311 _bjets[jetname] = select(jets(jetname), hasBTag(_bcut, _bdeltaR));
312 }
313 return _bjets.at(jetname);
314 }
316 Jets bjets(const Cut& cut, const std::string& jetname="DEFAULT") const {
317 return select(bjets(jetname), cut);
318 }
319
320
322 Vector3 vmet() const {
323 return apply<METFinder>(currentEvent(), "MET").vectorMissingPt();
324 }
325
327 double met() const {
328 return vmet().mod();
329 }
330
332 double set() const {
333 return apply<METFinder>(currentEvent(), "MET").scalarEt();
334 }
335
337 double metSignf() const {
338 return apply<SmearedMET>(currentEvent(), "MET").missingEtSignf();
339 }
340
342
343
346
364 void doSimpleOverlapRemoval(IDClass eclass=IDClass::MEDIUM, IDClass muclass=IDClass::MEDIUM,
365 IDClass phoclass=IDClass::MEDIUM, //IDClass tauclass=IDClass::MEDIUM,
366 bool include_nonprompt=false, const std::string& jetname="DEFAULT") {
367 // Get non-const handles for filtering (and ensure objects exist)
368 Jets& myjets = const_cast<Jets&>(jets(jetname));
369 Jets& mybjets = const_cast<Jets&>(bjets(jetname));
370 Particles& myes = const_cast<Particles&>(electrons(eclass, include_nonprompt));
371 Particles& myms = const_cast<Particles&>(muons(muclass, include_nonprompt));
372 //Particles& myts = const_cast<Particles&>(taus(tauclass, include_nonprompt));
373 Particles& myys = const_cast<Particles&>(photons(phoclass, include_nonprompt));
374 // Remove all jets within dR < 0.2 of a dressed lepton
375 idiscardIfAnyDeltaRLess(myjets, myes, 0.2);
376 idiscardIfAnyDeltaRLess(myjets, myms, 0.2);
377 idiscardIfAnyDeltaRLess(mybjets, myes, 0.2);
378 idiscardIfAnyDeltaRLess(mybjets, myms, 0.2);
379 // Remove all isolated photons within dR < 0.2 of a dressed electron
381 idiscardIfAnyDeltaRLess(myys, myes, 0.2);
382 // Remove dressed leptons within the radius of a remaining jet
383 idiscardIfAnyDeltaRLess(myes, myjets, _jdefs.at(jetname).R);
384 idiscardIfAnyDeltaRLess(myms, myjets, _jdefs.at(jetname).R);
386 }
387
388
390 // void doJetRecluster(/* jet collection names (in and out), recluster-alg enum and dR */) {
391 // /// @todo ...
392 // }
393
395
396
399
401 template<typename T>
402 void scaleToIntLumi(T& ao, double intlumi) {
403 scale(ao, intlumi*crossSection()/sumOfWeights());
404 }
405
407
408
411
413 const ParticleFinder& electronsProj(IDClass eclass=IDClass::MEDIUM, bool include_nonprompt=false) {
414 return getProjection<ParticleFinder>(_pckey(include_nonprompt, eclass, "Electrons"));
415 }
417 const ParticleFinder& muonsProj(IDClass muclass=IDClass::MEDIUM, bool include_nonprompt=false) {
418 return getProjection<ParticleFinder>(_pckey(include_nonprompt, muclass, "Muons"));
419 }
421 const ParticleFinder& tausProj(IDClass tauclass=IDClass::MEDIUM, bool include_nonprompt=false) {
422 return getProjection<ParticleFinder>(_pckey(include_nonprompt, tauclass, "Taus"));
423 }
425 const ParticleFinder& photonsProj(IDClass phoclass=IDClass::MEDIUM, bool include_nonprompt=false) {
426 return getProjection<ParticleFinder>(_pckey(include_nonprompt, phoclass, "Photons"));
427 }
430 return getProjection<ParticleFinder>("Tracks");
431 }
433 const JetFinder& jetsProj(const std::string& jetname="DEFAULT") {
434 return getProjection<JetFinder>("Jets_"+jetname);
435 }
437 const METFinder& metProj() { return getProjection<METFinder>("MET"); }
438
440
441
442 private:
443
446 std::map<IDClass, ParticleEffFn> _effs_electron{ { IDClass::LOOSE, PARTICLE_EFF_ONE }, { IDClass::MEDIUM, PARTICLE_EFF_ONE }, { IDClass::TIGHT, PARTICLE_EFF_ONE } };
447 std::map<IDClass, ParticleEffFn> _effs_muon{ { IDClass::LOOSE, PARTICLE_EFF_ONE }, { IDClass::MEDIUM, PARTICLE_EFF_ONE }, { IDClass::TIGHT, PARTICLE_EFF_ONE } };
448 std::map<IDClass, ParticleEffFn> _effs_photon{ { IDClass::LOOSE, PARTICLE_EFF_ONE }, { IDClass::MEDIUM, PARTICLE_EFF_ONE }, { IDClass::TIGHT, PARTICLE_EFF_ONE } };
449 std::map<IDClass, ParticleEffFn> _effs_tau{ { IDClass::LOOSE, PARTICLE_EFF_ONE }, { IDClass::MEDIUM, PARTICLE_EFF_ONE }, { IDClass::TIGHT, PARTICLE_EFF_ONE } };
453 std::map<std::string, JetSmearFn> _smears_jet{ { "DEFAULT", JET_SMEAR_IDENTITY } };
454 std::map<std::string, JetEffFn> _effs_btag{ { "DEFAULT", JET_BTAG_IDENTITY } };
456 METSmearFn _smear_met{MET_SMEAR_IDENTITY};
458
461 Cut _acut = Cuts::abseta < 5.0; //< base acceptance, applied to all
462 Cut _ecut = Cuts::pT > 10*GeV;
463 Cut _mcut = Cuts::pT > 10*GeV;
464 Cut _tcut = Cuts::pT > 10*GeV;
465 Cut _trkcut = Cuts::abseta < 2.5;
466 Cut _phocut = Cuts::pT > 10*GeV;
467 std::map<std::string, Cut> _jcuts = {{ "DEFAULT", Cuts::pT > 20*GeV && Cuts::abseta < 5.0 }};
468 std::map<std::string, JetScheme> _jdefs = {{ "DEFAULT", JetScheme(JetAlg::ANTIKT, 0.4) }};
470
471
476 Cut _bcut = Cuts::pT > 5*GeV && Cuts::abseta < 2.5;
477 double _bdeltaR = 0.3;
479
480
485
486 // Internal typedefs
487 // using ParticlesMap = std::map<std::string, Particles>;
488 // using JetsMap = std::map<std::string, Jets>;
489
491 mutable std::map<std::string, Particles> _electrons, _muons, _taus, _photons;
492
494 mutable std::map<std::string, Jets> _jets, _bjets;
495
497
498
500 //
502 const std::map<IDClass, std::string>& _idclasses() const {
503 // static const std::vector<IDClass> _idclasses{ {IDClass::LOOSE, IDClass::MEDIUM, IDClass::TIGHT} };
504 static const auto* map = new std::map<IDClass, std::string>{
505 {IDClass::LOOSE, "Loose"}, {IDClass::MEDIUM, "Medium"}, {IDClass::TIGHT, "Tight"} };
506 return *map;
507 }
508 const std::string& _idclassname(const IDClass& idc) const {
509 return _idclasses().at(idc);
510 }
511
513 std::string _pckey(bool include_nonprompt, IDClass idc, const std::string& prefix="") const {
514 return prefix + (include_nonprompt ? "All" : "Prompt") + _idclassname(idc);
515 }
516
517 };
518
519
520}
521
522
526#define RIVET_DEFAULT_SIMPLEANALYSIS_CTOR(clsname) clsname() : SimpleAnalysis(# clsname) {}
527
528
533#define setDetSmearing(DET, BTAG) do { \
534 setElectronReco(ELECTRON_EFF_ ## DET ## _LOOSE, ELECTRON_SMEAR_ ## DET, IDClass::LOOSE) ; \
535 setElectronReco(ELECTRON_EFF_ ## DET ## _MEDIUM, ELECTRON_SMEAR_ ## DET, IDClass::MEDIUM) ; \
536 setElectronReco(ELECTRON_EFF_ ## DET ## _TIGHT, ELECTRON_SMEAR_ ## DET, IDClass::TIGHT) ; \
537 setMuonReco(MUON_EFF_ ## DET ## _LOOSE, MUON_SMEAR_ ## DET, IDClass::LOOSE) ; \
538 setMuonReco(MUON_EFF_ ## DET ## _MEDIUM, MUON_SMEAR_ ## DET, IDClass::MEDIUM) ; \
539 setMuonReco(MUON_EFF_ ## DET ## _TIGHT, MUON_SMEAR_ ## DET, IDClass::TIGHT) ; \
540 setPhotonReco(PHOTON_EFF_ ## DET ## _LOOSE, ELECTRON_SMEAR_ ## DET, IDClass::LOOSE) ; \
541 setPhotonReco(PHOTON_EFF_ ## DET ## _MEDIUM, ELECTRON_SMEAR_ ## DET, IDClass::MEDIUM) ; \
542 setPhotonReco(PHOTON_EFF_ ## DET ## _TIGHT, ELECTRON_SMEAR_ ## DET, IDClass::TIGHT) ; \
543 setTauReco(TAU_EFF_ ## DET ## _LOOSE, TAU_SMEAR_ ## DET, IDClass::LOOSE) ; \
544 setTauReco(TAU_EFF_ ## DET ## _MEDIUM, TAU_SMEAR_ ## DET, IDClass::MEDIUM) ; \
545 setTauReco(TAU_EFF_ ## DET ## _TIGHT, TAU_SMEAR_ ## DET, IDClass::TIGHT) ; \
546 setTrkReco(TRK_EFF_ ## DET, TRK_SMEAR_ ## DET) ; \
547 for (const std::string& jname : jetnames()) \
548 setJetReco(JET_SMEAR_ ## DET, JET_BTAG_ ## DET ## _ ## BTAG, jname) ; \
549 setMETReco(MET_SMEARPARAMS_ ## DET, MET_SMEAR_ ## DET) ; \
550 } while (0)
This is the base class of all analysis classes in Rivet.
Definition Analysis.hh:70
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:425
void scale(MultiplexPtr< Multiplexer< T > > &ao, CounterAdapter factor)
Multiplicatively scale the given AnalysisObject, ao, by factor factor.
Definition Analysis.hh:1271
double sumOfWeights() const
Alias.
Definition Analysis.hh:460
virtual std::string name() const
Get the name of the analysis.
Definition Analysis.hh:164
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:41
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:45
Specialised vector of Particle objects.
Definition Particle.hh:21
const PROJ & declare(const PROJ &proj, const std::string &name) const
Register a contained projection (user-facing version)
Definition ProjectionApplier.hh:184
bool hasProjection(const std::string &name) const
Does this applier have a projection registered under the name name?
Definition ProjectionApplier.hh:55
Find final state particles directly connected to the hard process.
Definition PromptFinalState.hh:25
Simplified analysis API with predefined physics objects.
Definition SimpleAnalysis.hh:16
Particles photons(const Cut &cut, IDClass phoclass=IDClass::MEDIUM, bool include_nonprompt=false) const
Get the pT-ordered set of reconstructed prompt and isolated photons, with extra cuts.
Definition SimpleAnalysis.hh:251
const Particles & taus(IDClass tauclass=IDClass::MEDIUM, bool include_nonprompt=false) const
Get the pT-ordered set of reconstructed prompt (hadronic) taus.
Definition SimpleAnalysis.hh:257
const ParticleFinder & tracksProj()
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:429
const Jets & bjets(const std::string &jetname="DEFAULT") const
Get a pT-ordered named set of reconstructed b-tagged jets.
Definition SimpleAnalysis.hh:309
const ParticleFinder & electronsProj(IDClass eclass=IDClass::MEDIUM, bool include_nonprompt=false)
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:413
Vector3 vmet() const
Get the MET vector.
Definition SimpleAnalysis.hh:322
const Particles & photons(IDClass phoclass=IDClass::MEDIUM, bool include_nonprompt=false, double dRiso=0.4, double isofrac=0.1) const
Get the pT-ordered set of reconstructed prompt and isolated photons.
Definition SimpleAnalysis.hh:233
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:156
Particles electrons(const Cut &cut, IDClass eclass=IDClass::MEDIUM, bool include_nonprompt=false) const
Get the pT-ordered set of reconstructed prompt electrons, with extra cuts.
Definition SimpleAnalysis.hh:213
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:151
const Jets & jets(const std::string &jetname="DEFAULT") const
Get a pT-ordered named set of reconstructed jets.
Definition SimpleAnalysis.hh:295
const ParticleFinder & muonsProj(IDClass muclass=IDClass::MEDIUM, bool include_nonprompt=false)
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:417
double metSignf() const
Get the MET significance.
Definition SimpleAnalysis.hh:337
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:316
const ParticleFinder & photonsProj(IDClass phoclass=IDClass::MEDIUM, bool include_nonprompt=false)
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:425
const Particles & electrons(IDClass eclass=IDClass::MEDIUM, bool include_nonprompt=false) const
Get the pT-ordered set of reconstructed prompt electrons.
Definition SimpleAnalysis.hh:205
void scaleToIntLumi(T &ao, double intlumi)
Helper function to elide the xsec/sumW scalefactor.
Definition SimpleAnalysis.hh:402
const std::vector< std::string > jetnames() const
Get the set of jet-collection names (also usable for b-jets)
Definition SimpleAnalysis.hh:287
const JetFinder & jetsProj(const std::string &jetname="DEFAULT")
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:433
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:303
const METFinder & metProj()
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:437
const ParticleFinder & tausProj(IDClass tauclass=IDClass::MEDIUM, bool include_nonprompt=false)
Direct access to the underlying projection.
Definition SimpleAnalysis.hh:421
double set() const
Get the SET scalar.
Definition SimpleAnalysis.hh:332
void setTrkReco(const ParticleEffFn &eff, const ParticleSmearFn &smear=PARTICLE_SMEAR_IDENTITY)
Set the track reco functions for a given jet name.
Definition SimpleAnalysis.hh:161
IDClass
Physics-object ID classes.
Definition SimpleAnalysis.hh:20
Particles taus(const Cut &cut, IDClass tauclass=IDClass::MEDIUM, bool include_nonprompt=false) const
Get the pT-ordered set of reconstructed prompt (hadronic) taus, with extra cuts.
Definition SimpleAnalysis.hh:265
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:141
void preAnalyze(const Event &event)
Reset per-event members, before the user analyze()
Definition SimpleAnalysis.hh:121
Particles tracks(const Cut &cut) const
Definition SimpleAnalysis.hh:281
virtual ~SimpleAnalysis()
Destructor to support subclassing.
Definition SimpleAnalysis.hh:28
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:166
const Particles & muons(IDClass muclass=IDClass::MEDIUM, bool include_nonprompt=false) const
Get the pT-ordered set of reconstructed muons.
Definition SimpleAnalysis.hh:219
void doSimpleOverlapRemoval(IDClass eclass=IDClass::MEDIUM, IDClass muclass=IDClass::MEDIUM, IDClass phoclass=IDClass::MEDIUM, bool include_nonprompt=false, const std::string &jetname="DEFAULT")
Perform a simple, in-place overlap removal between all physics objects.
Definition SimpleAnalysis.hh:364
void setMETReco(const METSmearParamsFn &smearps, const METSmearFn &smear)
Set the MET reco functions.
Definition SimpleAnalysis.hh:175
Particles muons(const Cut &cut, IDClass muclass=IDClass::MEDIUM, bool include_nonprompt=false) const
Get the pT-ordered set of reconstructed muons, with extra cuts.
Definition SimpleAnalysis.hh:227
const Particles tracks() const
Definition SimpleAnalysis.hh:274
void postInit()
Definition SimpleAnalysis.hh:39
SimpleAnalysis(const std::string &name)
Constructor, passing arg to base class and supporting subclassing.
Definition SimpleAnalysis.hh:23
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:146
void setMETReco(const METSmearParamsFn &smearps)
Set the MET reco-params function.
Definition SimpleAnalysis.hh:171
double met() const
Get the MET scalar.
Definition SimpleAnalysis.hh:327
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:25
Three-dimensional specialisation of Vector.
Definition Vector3.hh:40
double mod() const
Calculate the modulus of a vector. .
Definition VectorN.hh:95
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:157
Vector3 MET_SMEAR_IDENTITY(const Vector3 &met, double)
Identity MET smearing just returns the input.
Definition MomentumSmearingFunctions.hh:177
METSmearParams MET_SMEARPARAMS_IDENTITY(const Vector3 &met, double)
Identity resolution is 0 (perfect delta function, no offset)
Definition MomentumSmearingFunctions.hh:172
function< Vector3(const Vector3 &, double)> METSmearFn
Definition MomentumSmearingFunctions.hh:139
function< METSmearParams(const Vector3 &, double)> METSmearParamsFn
Definition MomentumSmearingFunctions.hh:134
double PARTICLE_EFF_ONE(const Particle &)
Take a Particle and return 1.
Definition ParticleSmearingFunctions.hh:33
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:50
double JET_BTAG_IDENTITY(const Jet &j)
Alias for JET_BTAG_PERFECT.
Definition JetSmearingFunctions.hh:58
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:95
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 MC_CENT_PPB_Projections.hh:10
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition MathUtils.hh:697
(with respect to another 4-momentum, vec) less-than functor
Definition ParticleBaseUtils.hh:205
B-tagging functor, with a tag selection cut as the stored state.
Definition JetUtils.hh:101
Convenience container of params for simple jet definitions.
Definition JetFinder.hh:22
JetAlg alg
Params.
Definition JetFinder.hh:33