Rivet analyses referenceSND_2016_I1484677Cross section for $e^+e^-\to K^+K^-$ between 1.05 and 2 GeVExperiment: SND (VEPP-2M) Inspire ID: 1484677 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the cross section for $e^+e^-\to K^+K^-$ at energies between 1.05 and 2 GeV Source code: SND_2016_I1484677.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4
5namespace Rivet {
6
7
8 /// @brief e+ e- > K+K-
9 class SND_2016_I1484677 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(SND_2016_I1484677);
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(FinalState(), "FS");
24
25 // Book histograms
26 for(unsigned int ix=0;ix<2;++ix) {
27 book(_nkaon[ix], 1+ix, 1, 1);
28 for (const string& en : _nkaon[ix].binning().edges<0>()) {
29 const double end = std::stod(en)*GeV;
30 if (isCompatibleWithSqrtS(end)) {
31 _ecms[ix] = en;
32 break;
33 }
34 }
35 }
36 if (_ecms[0].empty() && _ecms[1].empty())
37 MSG_ERROR("Beam energy incompatible with analysis.");
38 }
39
40
41 /// Perform the per-event analysis
42 void analyze(const Event& event) {
43 const FinalState& fs = apply<FinalState>(event, "FS");
44 if(fs.particles().size()!=2) vetoEvent;
45 for (const Particle& p : fs.particles()) {
46 if(abs(p.pid())!=PID::KPLUS) vetoEvent;
47 }
48 for(unsigned int ix=0;ix<2;++ix) _nkaon[ix]->fill(_ecms[ix]);
49 }
50
51
52 /// Normalise histograms etc., after the run
53 void finalize() {
54 scale(_nkaon, crossSection()/ sumOfWeights() /nanobarn);
55 }
56
57 /// @}
58
59
60 /// @name Histograms
61 /// @{
62 BinnedHistoPtr<string> _nkaon[2];
63 string _ecms[2];
64 /// @}
65
66
67 };
68
69
70 RIVET_DECLARE_PLUGIN(SND_2016_I1484677);
71
72
73}
|