Rivet analyses referenceMC_REENTRANTExperiment: () Status: UNVALIDATED No authors listed No references listed Beams: * * Beam energies: ANY
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 att pp pseudorepidity distributions at
10 /// two collision energies. It usess the possibility to read in a
11 /// pre-exixsting yoda file, and if histograms for both energies are
12 /// filled when finalize() is called, a ratio plot is produced.
13 class MC_REENTRANT : public Analysis {
14 public:
15
16 /// Constructor
17 RIVET_DEFAULT_ANALYSIS_CTOR(MC_REENTRANT);
18
19
20 /// @name Analysis methods
21 /// @{
22
23 /// Book histograms and initialise projections before the run
24 void init() {
25
26 // Projections
27 const FinalState fs(Cuts::abseta < 5 && Cuts::pT > 500*MeV);
28 declare(fs, "FS");
29 declare(ChargedFinalState(fs), "CFS");
30
31 // Histograms. Booked for both 900 GeV and 7 TeV and their ratio.
32 book(_histEta70, "Eta70", 50, -5, 5);
33 book(_histEta09, "Eta09", 50, -5, 5);
34 book(_histEtaR , "EtaR", 50, -5, 5);
35
36 if (isCompatibleWithSqrtS(900.)) fill09 = true;
37 else if (isCompatibleWithSqrtS(7000.)) fill70 = true;
38 }
39
40
41 /// Perform the per-event analysis
42 void analyze(const Event& event) {
43 const FinalState& cfs = apply<FinalState>(event, "CFS");
44 for (const Particle& p : cfs.particles()) {
45 if (fill09) _histEta09->fill(p.eta());
46 else if (fill70) _histEta70->fill(p.eta());
47 }
48 }
49
50
51 /// Finalize
52 void finalize() {
53 if ( fill70 ) scale(_histEta70, 1.0/sumOfWeights());
54 if ( fill09 ) scale(_histEta09, 1.0/sumOfWeights());
55 if (_histEta70->numEntries() > 0 && _histEta09->numEntries() > 0) {
56 divide(_histEta70, _histEta09, _histEtaR);
57 }
58 }
59
60 /// @}
61
62
63 private:
64
65 /// @name Histograms
66 /// @{
67 Histo1DPtr _histEta09, _histEta70;
68 Estimate1DPtr _histEtaR;
69 /// @}
70
71 bool fill09 = false, fill70 = false;
72
73 };
74
75
76 RIVET_DECLARE_PLUGIN(MC_REENTRANT);
77
78}
|