Rivet analyses referenceMARKI_1975_I100592Cross section and charged particle multiplicity for energies between 2.6 and 5 GeVExperiment: MARKI (SPEAR) Inspire ID: 100592 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Cross section and harged particle multiplicity for energies between 2.6 and 5 GeV Source code: MARKI_1975_I100592.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_1975_I100592 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(MARKI_1975_I100592);
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 book(_nEvent, "TMP/event");
28
29 }
30
31
32 /// Perform the per-event analysis
33 void analyze(const Event& event) {
34 const ChargedFinalState& fs = apply<ChargedFinalState>(event, "FS");
35 _nEvent->fill();
36 _nHadrons->fill(fs.particles().size());
37 }
38
39 /// Normalise histograms etc., after the run
40 void finalize() {
41 for(unsigned int ix=1;ix<3;++ix) {
42 double sigma,error;
43 if(ix==1) {
44 sigma = _nEvent->val()*crossSection()/ sumOfWeights() /nanobarn;
45 error = _nEvent->err()*crossSection()/ sumOfWeights() /nanobarn;
46 }
47 else {
48 sigma = _nHadrons->val()/sumOfWeights();
49 error = _nHadrons->err()/sumOfWeights();
50 }
51 Scatter2D temphisto(refData(ix, 1, 1));
52 Scatter2DPtr mult;
53 book(mult, ix, 1, 1);
54 for (size_t b = 0; b < temphisto.numPoints(); b++) {
55 const double x = temphisto.point(b).x();
56 pair<double,double> ex = temphisto.point(b).xErrs();
57 pair<double,double> ex2 = ex;
58 if(ex2.first ==0.) ex2. first=0.0001;
59 if(ex2.second==0.) ex2.second=0.0001;
60 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
61 mult->addPoint(x, sigma, ex, make_pair(error,error));
62 }
63 else {
64 mult->addPoint(x, 0., ex, make_pair(0.,.0));
65 }
66 }
67 }
68 }
69
70 //@}
71
72
73 /// @name Histograms
74 //@{
75 CounterPtr _nHadrons,_nEvent;
76 //@}
77
78
79 };
80
81
82 // The hook for the plugin system
83 RIVET_DECLARE_PLUGIN(MARKI_1975_I100592);
84
85
86}
|