Rivet analyses referenceMC_PARTONICTOPSPlot partonic top properties (requires tops in event record)Experiment: () Status: VALIDATED Authors:
Beams: * * Beam energies: ANY Run details:
Just looks for final, i.e. post-QCD and weakly decaying, top quarks in the event record and plots their multiplicities, transverse momentum spectra, and rapidity distribution, both inclusively and classified by decay mode. Source code: MC_PARTONICTOPS.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/PartonicTops.hh"
4
5namespace Rivet {
6
7
8 /// Find and plot partonic top properties (requires tops in event record)
9 class MC_PARTONICTOPS : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(MC_PARTONICTOPS);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21
22 // Initialise and register projections
23 declare(PartonicTops(TopDecay::ALL), "AllTops");
24 declare(PartonicTops(TopDecay::ALL, PromptEMuFromTau::YES, InclHadronicTau::NO,
25 Cuts::OPEN, WhichTop::FIRST), "AllTopsFirst");
26 declare(PartonicTops(TopDecay::E_MU), "LeptonicTops");
27 declare(PartonicTops(TopDecay::HADRONIC), "HadronicTops");
28
29 // Book histograms
30 book(_h_tall_n, "t_all_n", linspace(5, -0.5, 4.5));
31 book(_h_tall_pt, "t_all_pT", logspace(50, 1, 500));
32 book(_h_tall_y, "t_all_y", linspace(50, -5, 5));
33
34 book(_h_tall_n_first, "t_all_n_firsttop", linspace(5, -0.5, 4.5));
35 book(_h_tall_pt_first, "t_all_pT_firsttop", logspace(50, 1, 500));
36 book(_h_tall_y_first, "t_all_y_firsttop", linspace(50, -5, 5));
37
38 book(_h_tall_pt_dfirstlast, "t_all_pT_dfirstlast", linspace(100, -100, 100));
39 book(_p_tall_pt_dfirstlast, "t_all_pT_dfirstlast_prof", logspace(50, 1, 500));
40
41 book(_h_tlep_n, "t_lep_n", linspace(5, -0.5, 4.5));
42 book(_h_tlep_pt, "t_lep_pT", logspace(50, 1, 500));
43 book(_h_tlep_y, "t_lep_y", linspace(50, -5, 5));
44
45 book(_h_thad_n, "t_had_n", linspace(5, -0.5, 4.5));
46 book(_h_thad_pt, "t_had_pT", logspace(50, 1, 500));
47 book(_h_thad_y, "t_had_y", linspace(50, -5, 5));
48
49 }
50
51
52 /// Perform the per-event analysis
53 void analyze(const Event& event) {
54
55 // Last tops (standard)
56 const Particles& alltops = apply<PartonicTops>(event, "AllTops").particlesByPt();
57 _h_tall_n->fill(alltops.size());
58 for (const Particle& t : alltops) {
59 _h_tall_pt->fill(t.pT()/GeV);
60 _h_tall_y->fill(t.rap());
61 }
62
63 // First tops
64 const Particles& alltops_first = apply<PartonicTops>(event, "AllTopsFirst").particlesByPt();
65 _h_tall_n_first->fill(alltops_first.size());
66 for (const Particle& t : alltops_first) {
67 _h_tall_pt_first->fill(t.pT()/GeV);
68 _h_tall_y_first->fill(t.rap());
69 }
70
71 // Match first and last tops
72 for (const Particle& tf : alltops_first) {
73 for (const Particle& tl : alltops) {
74 //if (deltaR(tf, tl) > 1) continue;
75 if (tf.pid() != tl.pid()) continue;
76 const double dpt = tl.pT() - tf.pT(); //< defined as change due to PS
77 _h_tall_pt_dfirstlast->fill(dpt/GeV);
78 _p_tall_pt_dfirstlast->fill(tf.pT()/GeV, fabs(dpt)/GeV);
79 }
80 }
81
82 // Leptonic (last) tops
83 const Particles& leptops = apply<PartonicTops>(event, "LeptonicTops").particlesByPt();
84 _h_tlep_n->fill(leptops.size());
85 for (const Particle& t : leptops) {
86 _h_tlep_pt->fill(t.pT()/GeV);
87 _h_tlep_y->fill(t.rap());
88 }
89
90 // Hadronic (last) tops
91 const Particles& hadtops = apply<PartonicTops>(event, "HadronicTops").particlesByPt();
92 _h_thad_n->fill(hadtops.size());
93 for (const Particle& t : hadtops) {
94 _h_thad_pt->fill(t.pT()/GeV);
95 _h_thad_y->fill(t.rap());
96 }
97
98 }
99
100
101 /// Normalise histograms etc., after the run
102 void finalize() {
103 normalize(_h_tall_n); normalize(_h_tall_n_first); normalize(_h_tlep_n); normalize(_h_thad_n);
104 normalize(_h_tall_pt); normalize(_h_tall_pt_first); normalize(_h_tlep_pt); normalize(_h_thad_pt);
105 normalize(_h_tall_y); normalize(_h_tall_y_first); normalize(_h_tlep_y); normalize(_h_thad_y);
106 normalize(_h_tall_pt_dfirstlast);
107 }
108
109 /// @}
110
111
112 /// @name Histograms
113 /// @{
114 Histo1DPtr _h_tall_n, _h_tall_n_first, _h_tlep_n, _h_thad_n;
115 Histo1DPtr _h_tall_pt, _h_tall_pt_first, _h_tlep_pt, _h_thad_pt;
116 Histo1DPtr _h_tall_y, _h_tall_y_first, _h_tlep_y, _h_thad_y;
117 Histo1DPtr _h_tall_pt_dfirstlast;
118 Profile1DPtr _p_tall_pt_dfirstlast;
119 /// @}
120
121
122 };
123
124
125 RIVET_DECLARE_PLUGIN(MC_PARTONICTOPS);
126
127}
|