Rivet analyses referenceMC_JETTAGSMonte Carlo validation analysis for ideal heavy flavour tagging observablesExperiment: () Status: VALIDATED Authors:
Beams: * * Beam energies: ANY Run details:
Plots to study theoretical tagging of heavy flavour hadrons in jets. Source code: MC_JETTAGS.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4#include "Rivet/Projections/FastJets.hh"
5
6namespace Rivet {
7
8
9
10 /// @brief MC validation analysis for jet events
11 class MC_JETTAGS : public Analysis {
12 public:
13
14 MC_JETTAGS()
15 : Analysis("MC_JETTAGS")
16 { }
17
18
19 void init() {
20 FinalState fs;
21 declare(FastJets(fs, JetAlg::ANTIKT, 0.4), "Jets04");
22 declare(FastJets(fs, JetAlg::ANTIKT, 0.6), "Jets06");
23
24 book(_h_numBTagsPerJet[0] ,"numBTagsPer04Jet", 5, -0.5, 4.5);
25 book(_h_numBTagsPerJet[1] ,"numBTagsPer06Jet", 5, -0.5, 4.5);
26 book(_h_numCTagsPerJet[0] ,"numCTagsPer04Jet", 5, -0.5, 4.5);
27 book(_h_numCTagsPerJet[1] ,"numCTagsPer06Jet", 5, -0.5, 4.5);
28 book(_h_numTauTagsPerJet[0] ,"numTauTagsPer04Jet", 5, -0.5, 4.5);
29 book(_h_numTauTagsPerJet[1] ,"numTauTagsPer06Jet", 5, -0.5, 4.5);
30 }
31
32
33 void analyze(const Event& event) {
34
35 const Jets jets04 = apply<FastJets>(event, "Jets04").jetsByPt(Cuts::pT > 20*GeV);
36 const Jets jets06 = apply<FastJets>(event, "Jets06").jetsByPt(Cuts::pT > 20*GeV);
37
38 for (const Jet& j : jets04) {
39 _h_numBTagsPerJet[0]->fill(j.bTags().size());
40 _h_numCTagsPerJet[0]->fill(j.cTags().size());
41 _h_numTauTagsPerJet[0]->fill(j.tauTags().size());
42 }
43 for (const Jet& j : jets06) {
44 _h_numBTagsPerJet[1]->fill(j.bTags().size());
45 _h_numCTagsPerJet[1]->fill(j.cTags().size());
46 _h_numTauTagsPerJet[1]->fill(j.tauTags().size());
47 }
48 }
49
50
51 void finalize() {
52 for (size_t i = 0; i < 2; ++i) {
53 normalize(_h_numBTagsPerJet[i]);
54 normalize(_h_numCTagsPerJet[i]);
55 normalize(_h_numTauTagsPerJet[i]);
56 }
57 }
58
59
60 private:
61
62 Histo1DPtr _h_numBTagsPerJet[2], _h_numCTagsPerJet[2], _h_numTauTagsPerJet[2];
63
64 };
65
66
67 RIVET_DECLARE_PLUGIN(MC_JETTAGS);
68
69}
|