Rivet analyses referenceBESIII_2021_I1866051Cross section for $e^+e^-\to$ $K_S^0K_L^0$between2.00 and 3.08 GeVExperiment: BESIII (BEPC) Inspire ID: 1866051 Status: VALIDATED Authors:
Beam energies: (1.0, 1.0); (1.0, 1.0); (1.1, 1.1); (1.1, 1.1); (1.1, 1.1); (1.1, 1.1); (1.1, 1.1); (1.1, 1.1); (1.2, 1.2); (1.2, 1.2); (1.2, 1.2); (1.3, 1.3); (1.3, 1.3); (1.4, 1.4); (1.5, 1.5) GeV Run details:
Measurement of the cross section for $e^+e^-\to$ $K_S^0K_L^0$ for energies between 2.00 and 3.08 GeV. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: BESIII_2021_I1866051.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4
5namespace Rivet {
6
7
8 /// @brief e+e- > K0K0
9 class BESIII_2021_I1866051 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2021_I1866051);
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 book(_nKSKL, 1, 1, 1);
27 for (const string& en : _nKSKL.binning().edges<0>()) {
28 const double end = std::stod(en)*GeV;
29 if (isCompatibleWithSqrtS(end)) {
30 _ecms = en;
31 break;
32 }
33 }
34 if(_ecms.empty()) MSG_ERROR("Beam energy incompatible with analysis.");
35 }
36
37
38 /// Perform the per-event analysis
39 void analyze(const Event& event) {
40 const FinalState& fs = apply<FinalState>(event, "FS");
41
42 map<long,int> nCount;
43 int ntotal(0);
44 for (const Particle& p : fs.particles()) {
45 nCount[p.pid()] += 1;
46 ++ntotal;
47 }
48
49 if(ntotal==2 && nCount[130]==1 && nCount[310]==1)
50 _nKSKL->fill(_ecms);
51 }
52
53
54 /// Normalise histograms etc., after the run
55 void finalize() {
56 scale(_nKSKL, crossSection()/ sumOfWeights() /picobarn);
57 }
58
59 ///@}
60
61
62 /// @name Histograms
63 ///@{
64 BinnedHistoPtr<string> _nKSKL;
65 string _ecms;
66 ///@}
67
68
69 };
70
71
72 RIVET_DECLARE_PLUGIN(BESIII_2021_I1866051);
73
74}
|