rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

MC_PARTONICTOPS

Plot partonic top properties (requires tops in event record)
Experiment: ()
Status: VALIDATED
Authors:
  • Andy Buckley
No references listed
Beams: * *
Beam energies: ANY
Run details:
  • Any events containing partonic tops

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(PartonicTops::DecayMode::ALL), "AllTops");
 24      declare(PartonicTops(PartonicTops::DecayMode::ALL, true, false, Cuts::OPEN, PartonicTops::WhichTop::FIRST), "AllTopsFirst"); ///< @todo API ick!
 25      declare(PartonicTops(PartonicTops::DecayMode::E_MU), "LeptonicTops");
 26      declare(PartonicTops(PartonicTops::DecayMode::HADRONIC), "HadronicTops");
 27
 28      // Book histograms
 29      book(_h_tall_n, "t_all_n", linspace(5, -0.5, 4.5));
 30      book(_h_tall_pt, "t_all_pT", logspace(50, 1, 500));
 31      book(_h_tall_y, "t_all_y", linspace(50, -5, 5));
 32
 33      book(_h_tall_n_first, "t_all_n_firsttop", linspace(5, -0.5, 4.5));
 34      book(_h_tall_pt_first, "t_all_pT_firsttop", logspace(50, 1, 500));
 35      book(_h_tall_y_first, "t_all_y_firsttop", linspace(50, -5, 5));
 36
 37      book(_h_tall_pt_dfirstlast, "t_all_pT_dfirstlast", linspace(100, -100, 100));
 38      book(_p_tall_pt_dfirstlast, "t_all_pT_dfirstlast_prof", logspace(50, 1, 500));
 39
 40      book(_h_tlep_n, "t_lep_n", linspace(5, -0.5, 4.5));
 41      book(_h_tlep_pt, "t_lep_pT", logspace(50, 1, 500));
 42      book(_h_tlep_y, "t_lep_y", linspace(50, -5, 5));
 43
 44      book(_h_thad_n, "t_had_n", linspace(5, -0.5, 4.5));
 45      book(_h_thad_pt, "t_had_pT", logspace(50, 1, 500));
 46      book(_h_thad_y, "t_had_y", linspace(50, -5, 5));
 47
 48    }
 49
 50
 51    /// Perform the per-event analysis
 52    void analyze(const Event& event) {
 53
 54      // Last tops (standard)
 55      const Particles& alltops = apply<PartonicTops>(event, "AllTops").particlesByPt();
 56      _h_tall_n->fill(alltops.size());
 57      for (const Particle& t : alltops) {
 58        _h_tall_pt->fill(t.pT()/GeV);
 59        _h_tall_y->fill(t.rap());
 60      }
 61
 62      // First tops
 63      const Particles& alltops_first = apply<PartonicTops>(event, "AllTopsFirst").particlesByPt();
 64      _h_tall_n_first->fill(alltops_first.size());
 65      for (const Particle& t : alltops_first) {
 66        _h_tall_pt_first->fill(t.pT()/GeV);
 67        _h_tall_y_first->fill(t.rap());
 68      }
 69
 70      // Match first and last tops
 71      for (const Particle& tf : alltops_first) {
 72        for (const Particle& tl : alltops) {
 73          //if (deltaR(tf, tl) > 1) continue;
 74          if (tf.pid() != tl.pid()) continue;
 75          const double dpt = tl.pT() - tf.pT(); //< defined as change due to PS
 76          _h_tall_pt_dfirstlast->fill(dpt/GeV);
 77          _p_tall_pt_dfirstlast->fill(tf.pT()/GeV, fabs(dpt)/GeV);
 78        }
 79      }
 80
 81      // Leptonic (last) tops
 82      const Particles& leptops = apply<PartonicTops>(event, "LeptonicTops").particlesByPt();
 83      _h_tlep_n->fill(leptops.size());
 84      for (const Particle& t : leptops) {
 85        _h_tlep_pt->fill(t.pT()/GeV);
 86        _h_tlep_y->fill(t.rap());
 87      }
 88
 89      // Hadronic (last) tops
 90      const Particles& hadtops = apply<PartonicTops>(event, "HadronicTops").particlesByPt();
 91      _h_thad_n->fill(hadtops.size());
 92      for (const Particle& t : hadtops) {
 93        _h_thad_pt->fill(t.pT()/GeV);
 94        _h_thad_y->fill(t.rap());
 95      }
 96
 97    }
 98
 99
100    /// Normalise histograms etc., after the run
101    void finalize() {
102      normalize(_h_tall_n); normalize(_h_tall_n_first); normalize(_h_tlep_n); normalize(_h_thad_n);
103      normalize(_h_tall_pt); normalize(_h_tall_pt_first); normalize(_h_tlep_pt); normalize(_h_thad_pt);
104      normalize(_h_tall_y); normalize(_h_tall_y_first); normalize(_h_tlep_y); normalize(_h_thad_y);
105      normalize(_h_tall_pt_dfirstlast);
106    }
107
108    //@}
109
110
111    /// @name Histograms
112    //@{
113    Histo1DPtr _h_tall_n, _h_tall_n_first, _h_tlep_n, _h_thad_n;
114    Histo1DPtr _h_tall_pt, _h_tall_pt_first, _h_tlep_pt, _h_thad_pt;
115    Histo1DPtr _h_tall_y, _h_tall_y_first, _h_tlep_y, _h_thad_y;
116    Histo1DPtr _h_tall_pt_dfirstlast;
117    Profile1DPtr _p_tall_pt_dfirstlast;
118    //@}
119
120
121  };
122
123
124  RIVET_DECLARE_PLUGIN(MC_PARTONICTOPS);
125
126}