rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

MC_GENERIC

Generic MC testing analysis -- DEPRECATED, use MC_FSPARTICLES
Experiment: ()
Status: VALIDATED
Authors:
  • Ian Bruce
  • Andy Buckley
No references listed
Beams: * *
Beam energies: ANY
Run details:
  • Any!

Generic analysis of typical event distributions such as $\eta$, $y$, $pT$, $\phi$\dots

Source code: MC_GENERIC.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3#include "Rivet/Projections/FinalState.hh"
  4#include "Rivet/Projections/ChargedFinalState.hh"
  5
  6namespace Rivet {
  7
  8
  9  /// Generic analysis looking at various distributions of final state particles
 10  ///
 11  /// @deprecated Replaced by the better-named MC_FSPARTICLES
 12  class MC_GENERIC : public Analysis {
 13  public:
 14
 15    /// Constructor
 16    RIVET_DEFAULT_ANALYSIS_CTOR(MC_GENERIC);
 17
 18
 19    /// @name Analysis methods
 20    //@{
 21
 22    /// Book histograms and initialise projections before the run
 23    void init() {
 24
 25      // Projections
 26      const FinalState fs(Cuts::abseta < 5 && Cuts::pT > 500*MeV);
 27      declare(fs, "FS");
 28      declare(ChargedFinalState(fs), "CFS");
 29
 30      // Histograms
 31      /// @todo Choose E/pT ranged based on input energies... can't do anything about kin. cuts, though
 32      book(_histMult   ,"Mult", 100, -0.5, 199.5);
 33      book(_histMultCh ,"MultCh", 100, -0.5, 199.5);
 34
 35      book(_histPt   ,"Pt", 300, 0, 30);
 36      book(_histPtCh ,"PtCh", 300, 0, 30);
 37
 38      book(_histE   ,"E", 100, 0, 200);
 39      book(_histECh ,"ECh", 100, 0, 200);
 40
 41      book(_histEtaSumEt ,"EtaSumEt", 25, 0, 5);
 42
 43      book(_histEta    ,"Eta", 50, -5, 5);
 44      book(_histEtaCh  ,"EtaCh", 50, -5, 5);
 45      _tmphistEtaPlus = Histo1D(25, 0, 5);
 46      _tmphistEtaMinus = Histo1D(25, 0, 5);
 47      _tmphistEtaChPlus = Histo1D(25, 0, 5);
 48      _tmphistEtaChMinus = Histo1D(25, 0, 5);
 49
 50      book(_histRapidity    ,"Rapidity", 50, -5, 5);
 51      book(_histRapidityCh  ,"RapidityCh", 50, -5, 5);
 52      _tmphistRapPlus = Histo1D(25, 0, 5);
 53      _tmphistRapMinus = Histo1D(25, 0, 5);
 54      _tmphistRapChPlus = Histo1D(25, 0, 5);
 55      _tmphistRapChMinus = Histo1D(25, 0, 5);
 56
 57      book(_histPhi    ,"Phi", 50, 0, TWOPI);
 58      book(_histPhiCh  ,"PhiCh", 50, 0, TWOPI);
 59
 60      book(_histEtaPMRatio, "EtaPMRatio");
 61      book(_histEtaChPMRatio, "EtaChPMRatio");
 62      book(_histRapidityPMRatio, "RapidityPMRatio");
 63      book(_histRapidityChPMRatio, "RapidityChPMRatio");
 64    }
 65
 66
 67    /// Perform the per-event analysis
 68    void analyze(const Event& event) {
 69
 70      // Charged + neutral final state
 71      const FinalState& fs = apply<FinalState>(event, "FS");
 72      MSG_DEBUG("Total multiplicity = " << fs.size());
 73      _histMult->fill(fs.size());
 74      for (const Particle& p : fs.particles()) {
 75        _histEta->fill(p.eta());
 76        _histEtaSumEt->fill(p.abseta(), p.Et());
 77        (p.eta() > 0 ? _tmphistEtaPlus : _tmphistEtaMinus).fill(p.abseta());
 78        //
 79        _histRapidity->fill(p.rap());
 80        (p.rap() > 0 ? _tmphistRapPlus : _tmphistRapMinus).fill(p.absrap());
 81        //
 82        _histPt->fill(p.pT()/GeV);
 83        _histE->fill(p.E()/GeV);
 84        _histPhi->fill(p.phi());
 85      }
 86
 87      // Same for the charged FS particles only
 88      const FinalState& cfs = apply<FinalState>(event, "CFS");
 89      MSG_DEBUG("Total charged multiplicity = " << cfs.size());
 90      _histMultCh->fill(cfs.size());
 91      for (const Particle& p : cfs.particles()) {
 92        _histEtaCh->fill(p.eta());
 93        (p.eta() > 0 ? _tmphistEtaChPlus : _tmphistEtaChMinus).fill(p.abseta());
 94        //
 95        _histRapidityCh->fill(p.rap());
 96        (p.rap() > 0 ? _tmphistRapChPlus : _tmphistRapChMinus).fill(p.absrap());
 97        //
 98        _histPtCh->fill(p.pT()/GeV);
 99        _histECh->fill(p.E()/GeV);
100        _histPhiCh->fill(p.phi());
101      }
102
103    }
104
105
106    /// Finalize
107    void finalize() {
108      normalize(_histMult); normalize(_histEta); normalize(_histRapidity); 
109      normalize(_histPt); normalize(_histE); normalize(_histPhi);
110      normalize(_histMultCh); normalize(_histEtaCh); normalize(_histRapidityCh); 
111      normalize(_histPtCh); normalize(_histECh); normalize(_histPhiCh);
112      divide(_tmphistEtaPlus, _tmphistEtaMinus, _histEtaPMRatio);
113      divide(_tmphistEtaChPlus, _tmphistEtaChMinus, _histEtaChPMRatio);
114      divide(_tmphistRapPlus, _tmphistRapMinus, _histRapidityPMRatio);
115      divide(_tmphistRapChPlus, _tmphistRapChMinus, _histRapidityChPMRatio);
116    }
117
118    //@}
119
120
121  private:
122
123    /// @name Histograms
124    //@{
125    Histo1DPtr _histMult, _histEta, _histRapidity, _histPt, _histE, _histPhi;
126    Histo1DPtr _histMultCh,  _histEtaCh, _histRapidityCh, _histPtCh, _histECh, _histPhiCh;
127    Profile1DPtr _histEtaSumEt;
128    Scatter2DPtr _histEtaPMRatio, _histEtaChPMRatio, _histRapidityPMRatio, _histRapidityChPMRatio;
129    //@}
130
131    /// @name Temporary histos used to calculate +/- rapidity ratio plots
132    //@{
133    Histo1D _tmphistEtaPlus, _tmphistEtaMinus, _tmphistEtaChPlus, _tmphistEtaChMinus;
134    Histo1D _tmphistRapPlus, _tmphistRapMinus, _tmphistRapChPlus, _tmphistRapChMinus;
135    //@}
136
137  };
138
139
140  // The hook for the plugin system
141  RIVET_DECLARE_PLUGIN(MC_GENERIC);
142
143}