Rivet analyses referenceMARKI_1975_I100733Measurement of $R$ and the hadronic cross section for energies between 2.4 and 6.9 GeVExperiment: MARKI (Spear) Inspire ID: 100733 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of $R$ and the hadronic cross section for energies between 2.4 and 6.9 GeV. The charged hadron spectum at 3, 4.8 and 7.4 GeV is also measured. The muonic cross sections is also outputted to the yoda file so that ratio $R$ can be recalcuated if runs are combined. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: MARKI_1975_I100733.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4
5namespace Rivet {
6
7
8 /// @brief R measurement
9 class MARKI_1975_I100733 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(MARKI_1975_I100733);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21
22 declare(FinalState(), "FS");
23 // Book histograms
24 for(unsigned int ix=0;ix<2;++ix) {
25 if(ix==0) {
26 book(_c_hadrons[ix], 1+ix,1,1);
27 }
28 else {
29 book(_c_hadrons[ix], "/TMP/sigma_hadrons_"+toString(ix), refData<YODA::BinnedEstimate<string>>(1+ix,1,1));
30 book(_c_muons, "/TMP/sigma_muons_" +toString(ix), refData<YODA::BinnedEstimate<string>>(1+ix,1,1));
31 }
32 for (const string& en : _c_hadrons[ix].binning().edges<0>()) {
33 const size_t idx = en.find("-");
34 if(idx!=std::string::npos) {
35 const double emin = std::stod(en.substr(0,idx));
36 const double emax = std::stod(en.substr(idx+1,string::npos));
37 if(inRange(sqrtS()/GeV, emin, emax)) {
38 _ecms[ix] = en;
39 break;
40 }
41 }
42 else {
43 const double end = std::stod(en)*GeV;
44 if (isCompatibleWithSqrtS(end)) {
45 _ecms[ix] = en;
46 break;
47 }
48 }
49 }
50 }
51 if (isCompatibleWithSqrtS(3*GeV)) {
52 book(_h_charged, 3, 1, 1);
53 }
54 else if (isCompatibleWithSqrtS(4.8*GeV)) {
55 book(_h_charged, 3, 1, 2);
56 }
57 else if (isCompatibleWithSqrtS(7.4*GeV)) {
58 book(_h_charged, 3, 1, 3);
59 }
60 if(_ecms[0].empty() &&_ecms[1].empty())
61 MSG_ERROR("Beam energy incompatible with analysis.");
62 }
63
64
65 /// Perform the per-event analysis
66 void analyze(const Event& event) {
67 const FinalState& fs = apply<FinalState>(event, "FS");
68
69 map<long,int> nCount;
70 int ntotal(0);
71 for (const Particle& p : fs.particles()) {
72 nCount[p.pid()] += 1;
73 ++ntotal;
74 }
75 if (nCount[-13]==1 and nCount[13]==1 && ntotal==2+nCount[22]) {
76 _c_muons->fill(_ecms[1]); // mu+mu- + photons
77 }
78 // everything else
79 else {
80 for(unsigned int ix=0;ix<2;++ix) _c_hadrons[ix]->fill(_ecms[ix]);
81 if(_h_charged) {
82 if(_edges.empty()) _edges = _h_charged->xEdges();
83 for (const Particle& p : fs.particles()) {
84 if(PID::isCharged(p.pid())) {
85 double x = 2.*p.p3().mod()/sqrtS();
86 const size_t idx = _axis.index(x);
87 if(idx && idx <=_edges.size())
88 _h_charged->fill(_edges[idx-1]);
89 }
90 }
91 }
92 }
93 }
94
95
96 /// Normalise histograms etc., after the run
97 void finalize() {
98 if (_h_charged) {
99 scale(_h_charged, crossSection()/ sumOfWeights() /microbarn*sqr(sqrtS()));
100 for(auto & b : _h_charged->bins()) {
101 const size_t idx = b.index();
102 b.scaleW(1./_axis.width(idx));
103 }
104 }
105 const double fact = crossSection()/ sumOfWeights() /nanobarn;
106 scale(_c_hadrons[0], fact);
107 BinnedEstimatePtr<string> mult;
108 book(mult,2,1,1);
109 divide(_c_hadrons[1],_c_muons,mult);
110 }
111
112 /// @}
113
114
115 /// @name Histograms
116 /// @{
117 BinnedHistoPtr<string> _c_hadrons[2], _c_muons;
118 string _ecms[2];
119 BinnedHistoPtr<string> _h_charged;
120 vector<string> _edges;
121 YODA::Axis<double> _axis{0.,0.10,0.12,0.14,0.16,0.18,0.20,0.22,0.24,0.26,0.28,0.30,
122 0.32,0.34,0.36,0.38,0.40,0.44,0.48,0.52,0.56,0.64,0.72,0.80,0.88};
123 /// @}
124
125
126 };
127
128
129 RIVET_DECLARE_PLUGIN(MARKI_1975_I100733);
130
131
132}
|