Rivet analyses referenceMARKI_1982_I169326Charged particle multiplicity for energies between 2.6 and 7.8 GeVExperiment: MARKI (SPEAR) Inspire ID: 169326 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Charged particle multiplicity for energies between 2.6 and 7.8 GeV Source code: MARKI_1982_I169326.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/ChargedFinalState.hh"
4
5namespace Rivet {
6
7
8 /// @brief Add a short analysis description here
9 class MARKI_1982_I169326 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(MARKI_1982_I169326);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21
22 // Initialise and register projections
23 declare(ChargedFinalState(), "FS");
24
25 // Book histograms
26 book(_nHadrons, "TMP/hadrons");
27
28 }
29
30
31 /// Perform the per-event analysis
32 void analyze(const Event& event) {
33 const ChargedFinalState& fs = apply<ChargedFinalState>(event, "FS");
34 _nHadrons->fill(fs.particles().size());
35 }
36
37
38 /// Normalise histograms etc., after the run
39 void finalize() {
40 double sigma = _nHadrons->val()/sumOfWeights();
41 double error = _nHadrons->err()/sumOfWeights();
42 Estimate1DPtr mult;
43 book(mult, 6, 1, 1);
44 for (auto& b : mult->bins()) {
45 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
46 b.set(sigma, error);
47 }
48 }
49 }
50
51 /// @}
52
53
54 /// @name Histograms
55 /// @{
56 CounterPtr _nHadrons;
57 /// @}
58
59
60 };
61
62
63 RIVET_DECLARE_PLUGIN(MARKI_1982_I169326);
64
65
66}
|