Rivet analyses referenceBESII_2009_I814778Measurement of $R$ for energies between 2.6 and 3.65 GeVExperiment: BESII (BEPC) Inspire ID: 814778 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of $R$ in $e^+e^-$ collisions by BESII for energies between 2.6 and 3.65 GeV. The individual hadronic and muonic cross sections are also outputted to the yoda file so that ratio $R$ can be recalculated if runs are combined. Source code: BESII_2009_I814778.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4
5namespace Rivet {
6
7
8 /// @brief Add a short analysis description here
9 class BESII_2009_I814778 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(BESII_2009_I814778);
14
15
16 /// @name Analysis methods
17 //@{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 // Initialise and register projections
22 declare(FinalState(), "FS");
23 // Book histograms
24 book(_c_hadrons, "/TMP/sigma_hadrons");
25 book(_c_muons, "/TMP/sigma_muons");
26 }
27
28
29 /// Perform the per-event analysis
30 void analyze(const Event& event) {
31 const FinalState& fs = apply<FinalState>(event, "FS");
32
33 map<long,int> nCount;
34 int ntotal(0);
35 for (const Particle& p : fs.particles()) {
36 nCount[p.pid()] += 1;
37 ++ntotal;
38 }
39 // mu+mu- + photons
40 if(nCount[-13]==1 and nCount[13]==1 &&
41 ntotal==2+nCount[22])
42 _c_muons->fill();
43 // everything else
44 else
45 _c_hadrons->fill();
46 }
47
48
49 /// Normalise histograms etc., after the run
50 void finalize() {
51 Scatter1D R = *_c_hadrons/ *_c_muons;
52 double rval = R.point(0).x();
53 pair<double,double> rerr = R.point(0).xErrs();
54 double fact = crossSection()/ sumOfWeights() /nanobarn;
55 double sig_h = _c_hadrons->val()*fact;
56 double err_h = _c_hadrons->err()*fact;
57 double sig_m = _c_muons ->val()*fact;
58 double err_m = _c_muons ->err()*fact;
59 Scatter2D temphisto(refData(1, 1, 1));
60 Scatter2DPtr hadrons;
61 book(hadrons, "sigma_hadrons");
62 Scatter2DPtr muons;
63 book(muons, "sigma_muons" );
64 Scatter2DPtr mult;
65 book(mult, 1, 1, 1);
66 for (size_t b = 0; b < temphisto.numPoints(); b++) {
67 const double x = temphisto.point(b).x();
68 pair<double,double> ex = temphisto.point(b).xErrs();
69 pair<double,double> ex2 = ex;
70 if(ex2.first ==0.) ex2. first=0.0001;
71 if(ex2.second==0.) ex2.second=0.0001;
72 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
73 mult ->addPoint(x, rval, ex, rerr);
74 hadrons->addPoint(x, sig_h, ex, make_pair(err_h,err_h));
75 muons ->addPoint(x, sig_m, ex, make_pair(err_m,err_m));
76 }
77 else {
78 mult ->addPoint(x, 0., ex, make_pair(0.,.0));
79 hadrons->addPoint(x, 0., ex, make_pair(0.,.0));
80 muons ->addPoint(x, 0., ex, make_pair(0.,.0));
81 }
82 }
83 }
84
85 //@}
86
87
88 /// @name Histograms
89 //@{
90 CounterPtr _c_hadrons, _c_muons;
91 //@}
92
93
94 };
95
96
97 // The hook for the plugin system
98 RIVET_DECLARE_PLUGIN(BESII_2009_I814778);
99
100
101}
|