Rivet analyses referenceMC_CORRELATORS_EXAMPLEExample analysis for correlators frameworkExperiment: None () Status: UNVALIDATED No authors listed No references listed Beams: * * Beam energies: ANY Run details:
Example analysis for how to implement a flow analysis using the correlators framework. Source code: MC_CORRELATORS_EXAMPLE.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/ChargedFinalState.hh"
4#include "Rivet/Projections/PrimaryParticles.hh"
5#include "Rivet/Tools/Correlators.hh"
6
7
8namespace Rivet {
9
10
11 class MC_CORRELATORS_EXAMPLE : public CumulantAnalysis {
12 public:
13
14 /// @name Constructors etc.
15 /// @{
16
17 /// Constructor
18 MC_CORRELATORS_EXAMPLE()
19 : CumulantAnalysis("MC_CORRELATORS_EXAMPLE")
20 { }
21 /// @}
22
23
24 /// @name Analysis methods
25 /// @{
26 /// Book histograms and initialise projections before the run
27 void init() {
28
29 ChargedFinalState cfs(Cuts::abseta < 1.0);
30 declare(cfs, "CFS");
31 ChargedFinalState pp(Cuts::abseta < 2.0);
32 declare(pp, "PP");
33 book(h_c22, "c22",120,0,120);
34 book(h_c23, "c23",120,0,120);
35 book(h_v22pT, "v22pT",10,0,10);
36 ec22 = bookECorrelator<2,2>("ec22",*h_c22);
37 ec23 = bookECorrelator<3,2>("ec32",*h_c22);
38 ec22pT = bookECorrelator<2,2>("ec22pT",*h_v22pT);
39 pair<int, int> max = getMaxValues();
40 // Declare correlator projections.
41 declare(Correlators(pp, max.first, max.second, *h_v22pT),"CRS");
42 }
43
44 /// Perform the per-event analysis
45 void analyze(const Event& event) {
46 const Correlators& c = apply<Correlators>(event,"CRS");
47 ec22->fill(apply<ChargedFinalState>(event,"CFS").particles().size(), c);
48 ec23->fill(apply<ChargedFinalState>(event,"CFS").particles().size(), c);
49 ec22pT->fill(c);
50 }
51
52 /// Normalise histograms etc., after the run
53 void finalize() {
54 cnTwoInt(h_c22,ec22);
55 cnTwoInt(h_c23,ec23);
56 vnTwoDiff(h_v22pT,ec22pT);
57
58 }
59
60 /// @}
61
62
63 private:
64
65 /// @name Histograms
66 /// @{
67 Scatter2DPtr h_c22;
68 Scatter2DPtr h_v22pT;
69 ECorrPtr ec22;
70 ECorrPtr ec22pT;
71 Scatter2DPtr h_c23;
72 ECorrPtr ec23;
73 /// @}
74
75 };
76
77
78
79 RIVET_DECLARE_PLUGIN(MC_CORRELATORS_EXAMPLE);
80
81}
|