Rivet analyses referenceBESII_2009_I814778Measurement of for energies between 2.6 and 3.65 GeVExperiment: BESII (BEPC) Inspire ID: 814778 Status: VALIDATED Authors:
Beam energies: (1.3, 1.3); (1.5, 1.5); (1.8, 1.8) GeV Run details:
Measurement of in 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 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 Measurement of $R$ for energies between 2.6 and 3.65 GeV
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", refData<YODA::BinnedEstimate<string>>(1,1,1));
25 book(_c_muons, "/TMP/sigma_muons" , refData<YODA::BinnedEstimate<string>>(1,1,1));
26 for (const string& en : _c_hadrons.binning().edges<0>()) {
27 double end = std::stod(en)*GeV;
28 if(isCompatibleWithSqrtS(end)) {
29 _ecms = en;
30 break;
31 }
32 }
33 if(_ecms.empty()) MSG_ERROR("Beam energy incompatible with analysis.");
34 }
35
36
37 /// Perform the per-event analysis
38 void analyze(const Event& event) {
39 const FinalState& fs = apply<FinalState>(event, "FS");
40
41 map<long,int> nCount;
42 int ntotal(0);
43 for (const Particle& p : fs.particles()) {
44 nCount[p.pid()] += 1;
45 ++ntotal;
46 }
47 // mu+mu- + photons
48 if(nCount[-13]==1 and nCount[13]==1 &&
49 ntotal==2+nCount[22])
50 _c_muons->fill(_ecms);
51 // everything else
52 else
53 _c_hadrons->fill(_ecms);
54 }
55
56
57 /// Normalise histograms etc., after the run
58 void finalize() {
59 BinnedEstimatePtr<string> mult;
60 book(mult, 1, 1, 1);
61 divide(_c_hadrons,_c_muons,mult);
62 }
63
64 /// @}
65
66
67 /// @name Histograms
68 /// @{
69 BinnedHistoPtr<string> _c_hadrons, _c_muons;
70 string _ecms;
71 /// @}
72
73
74 };
75
76
77 RIVET_DECLARE_PLUGIN(BESII_2009_I814778);
78
79
80}
|