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 fill70 = fill09 = false;
36 }
37
38
39 /// Perform the per-event analysis
40 void analyze(const Event& event) {
41 if (isCompatibleWithSqrtS(900*GeV))
42 fill09 = true;
43 else if (isCompatibleWithSqrtS(7000*GeV))
44 fill70 = true;
45
46 const FinalState& cfs = apply<FinalState>(event, "CFS");
47 for (const Particle& p : cfs.particles()) {
48 if (isCompatibleWithSqrtS(900*GeV))
49 _histEta09->fill(p.eta());
50 else if (isCompatibleWithSqrtS(7000*GeV))
51 _histEta70->fill(p.eta());
52 }
53 }
54
55
56 /// Finalize
57 void finalize() {
58 if ( fill70 ) scale(_histEta70, 1.0/sumOfWeights());
59 if ( fill09 ) scale(_histEta09, 1.0/sumOfWeights());
60 if ( _histEta70->numEntries() > 0 && _histEta09->numEntries() > 0 )
61 divide(_histEta70, _histEta09, _histEtaR);
62 }
63
64 /// @}
65
66
67 private:
68
69 /// @name Histograms
70 /// @{
71 Histo1DPtr _histEta09, _histEta70;
72 Estimate1DPtr _histEtaR;
73 /// @}
74
75 bool fill09, fill70;
76
77 };
78
79
80 RIVET_DECLARE_PLUGIN(MC_REENTRANT);
81
82}
|