rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

MC_CORRELATORS_EXAMPLE

Example analysis for correlators framework
Experiment: None ()
Status: UNVALIDATED
No authors listed No references listed
Beams: * *
Beam energies: ANY
Run details:
  • any

Example analysis for how to implement a flow analysis using the correlators framework.

Source code: MC_CORRELATORS_EXAMPLE.cc
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// -*- C++ -*-
#include "Rivet/Analysis.hh"
#include "Rivet/Projections/ChargedFinalState.hh"
#include "Rivet/Projections/PrimaryParticles.hh"
#include "Rivet/Tools/Correlators.hh"


namespace Rivet {


  class MC_CORRELATORS_EXAMPLE : public CumulantAnalysis {
  public:

    /// @name Constructors etc.
    //@{

    /// Constructor
    MC_CORRELATORS_EXAMPLE()
      : CumulantAnalysis("MC_CORRELATORS_EXAMPLE")
    {   }
    //@}


    /// @name Analysis methods
    //@{
    /// Book histograms and initialise projections before the run
    void init() {

      ChargedFinalState cfs(Cuts::abseta < 1.0);
      declare(cfs, "CFS");
      ChargedFinalState pp(Cuts::abseta < 2.0);
      declare(pp, "PP");
      book(h_c22, "c22",120,0,120);
      book(h_c23, "c23",120,0,120);
      book(h_v22pT, "v22pT",10,0,10);
      ec22 = bookECorrelator<2,2>("ec22",*h_c22);
      ec23 = bookECorrelator<3,2>("ec32",*h_c22);
      ec22pT = bookECorrelator<2,2>("ec22pT",*h_v22pT);
      pair<int, int> max = getMaxValues();
      // Declare correlator projections.
      declare(Correlators(pp, max.first, max.second, *h_v22pT),"CRS");
    }

    /// Perform the per-event analysis
    void analyze(const Event& event) {
      const Correlators& c = apply<Correlators>(event,"CRS");
      ec22->fill(apply<ChargedFinalState>(event,"CFS").particles().size(), c);
      ec23->fill(apply<ChargedFinalState>(event,"CFS").particles().size(), c);
      ec22pT->fill(c);
    }

    /// Normalise histograms etc., after the run
    void finalize() {
      cnTwoInt(h_c22,ec22);
      cnTwoInt(h_c23,ec23);
      vnTwoDiff(h_v22pT,ec22pT);

    }

    //@}


  private:

    /// @name Histograms
    //@{
    Scatter2DPtr h_c22;
    Scatter2DPtr h_v22pT;
    ECorrPtr ec22;
    ECorrPtr ec22pT;
    Scatter2DPtr h_c23;
    ECorrPtr ec23;
    //@}

  };



  // The hook for the plugin system
  RIVET_DECLARE_PLUGIN(MC_CORRELATORS_EXAMPLE);

}