rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

MC_DIS_Check

A simple analysis using the DISKinematics projection.
Experiment: (HERA)
Status: UNVALIDATED
Authors:
  • Hannes Jung
  • Leif Lönnblad
No references listed
Beams: p+ e-, p+ e+
Beam energies: ANY
    No run details listed

A simple analysis to illustrate how to use the DISKinematics projection together with different options, and to histogram the obtained x, y and Q2 variables.

Source code: MC_DIS_Check.cc
 1// -*- C++ -*-
 2#include "Rivet/Analysis.hh"
 3#include "Rivet/Projections/FinalState.hh"
 4#include "Rivet/Projections/FastJets.hh"
 5#include "Rivet/Projections/DISKinematics.hh"
 6
 7namespace Rivet {
 8
 9
10  /// @brief A simple analysis to illustrate how to use the
11  /// DISKinematics projection together with different options.
12  class MC_DIS_Check : public Analysis {
13  public:
14
15    /// Constructor
16    RIVET_DEFAULT_ANALYSIS_CTOR(MC_DIS_Check);
17
18
19    /// @name Analysis methods
20    //@{
21
22    /// Book histograms and initialise projections before the run
23    void init() {
24
25      // Initialise and register projections. Note that the definition
26      // of the scattered lepton can be influenced by sepcifying
27      // options as declared in the .info file.
28      DISLepton lepton(options());
29      declare(lepton, "Lepton");
30      declare(DISKinematics(lepton), "Kinematics");
31
32      // Book histograms
33	
34      book(_hist_Q2, "Q2",logspace(100,0.1, 1000.0));
35      book(_hist_y, "y",100,0.,1.);
36      book(_hist_x, "xBj",logspace(100,0.00001, 1.0));
37
38    }
39
40
41    /// Perform the per-event analysis
42    void analyze(const Event& event) {
43      // Get the DIS kinematics
44      const DISKinematics& dk = apply<DISKinematics>(event, "Kinematics");
45      if ( dk.failed() ) return;
46      double x  = dk.x();
47      double y  = dk.y();
48      double Q2 = dk.Q2();
49      // Weight of the event
50      _hist_Q2->fill(Q2);
51      _hist_y->fill(y);
52      _hist_x->fill(x);
53
54      /// @todo Do the event by event analysis here
55
56    }
57
58
59    /// Normalise histograms etc., after the run
60    void finalize() {
61
62      normalize(_hist_Q2); // normalize to unity
63      normalize(_hist_y); // normalize to unity
64
65    }
66
67    //@}
68
69
70    /// The histograms.
71    Histo1DPtr _hist_Q2, _hist_y, _hist_x;
72
73
74  };
75
76
77  // The hook for the plugin system
78  RIVET_DECLARE_PLUGIN(MC_DIS_Check);
79
80
81}