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 Scatter2D temphisto(refData(6, 1, 1));
43 Scatter2DPtr mult;
44 book(mult, 6, 1, 1);
45 for (size_t b = 0; b < temphisto.numPoints(); b++) {
46 const double x = temphisto.point(b).x();
47 pair<double,double> ex = temphisto.point(b).xErrs();
48 pair<double,double> ex2 = ex;
49 if(ex2.first ==0.) ex2. first=0.0001;
50 if(ex2.second==0.) ex2.second=0.0001;
51 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
52 mult->addPoint(x, sigma, ex, make_pair(error,error));
53 }
54 else {
55 mult->addPoint(x, 0., ex, make_pair(0.,.0));
56 }
57 }
58 }
59
60 //@}
61
62
63 /// @name Histograms
64 //@{
65 CounterPtr _nHadrons;
66 //@}
67
68
69 };
70
71
72 // The hook for the plugin system
73 RIVET_DECLARE_PLUGIN(MARKI_1982_I169326);
74
75
76}
|