Rivet analyses referenceBESIII_2022_I2513076$\pi^0$ and $K^0_S$ momentum distributions for energies between 2.23 and 3.67 GeVExperiment: BESIII (BEPC) Inspire ID: 2513076 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (1.1, 1.1); (1.2, 1.2); (1.4, 1.4); (1.5, 1.5); (1.7, 1.7); (1.8, 1.8) GeV Run details:
$\pi^0$ and $K^0_S$ momentum distributions for energies between 2.23 and 3.67 GeV. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: BESIII_2022_I2513076.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief pi0/K0 spectra
9 class BESIII_2022_I2513076 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2022_I2513076);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 // projection
22 declare(UnstableParticles(Cuts::pid==PID::PI0 || Cuts::pid==PID::K0S), "UFS");
23 // find beam energy
24 unsigned int iloc(0);
25 if (isCompatibleWithSqrtS(2.2324, 1E-3))
26 iloc = 1;
27 else if (isCompatibleWithSqrtS(2.4 , 1E-3))
28 iloc = 2;
29 else if (isCompatibleWithSqrtS(2.8 , 1E-3))
30 iloc = 3;
31 else if (isCompatibleWithSqrtS(3.05 , 1E-3))
32 iloc = 4;
33 else if (isCompatibleWithSqrtS(3.4 , 1E-3))
34 iloc = 5;
35 else if (isCompatibleWithSqrtS(3.671 , 1E-3))
36 iloc = 6;
37 else
38 MSG_ERROR("Beam energy not supported!");
39 // book histos
40 for (unsigned int ix=0; ix<2; ++ix) {
41 book(_h[ix],1+ix,1,iloc);
42 }
43 }
44
45
46 /// Perform the per-event analysis
47 void analyze(const Event& event) {
48 for (const Particle& p : apply<UnstableParticles>(event, "UFS").particles()) {
49 const double pp = p.p3().mod();
50 if (p.pid()==PID::PI0) _h[0]->fill(pp);
51 else _h[1]->fill(pp);
52 }
53 }
54
55
56 /// Normalise histograms etc., after the run
57 void finalize() {
58 scale(_h, 1./sumOfWeights());
59 }
60
61 /// @}
62
63
64 /// @name Histograms
65 /// @{
66 Histo1DPtr _h[2];
67 /// @}
68
69
70 };
71
72
73 RIVET_DECLARE_PLUGIN(BESIII_2022_I2513076);
74
75}
|