Rivet analyses referenceBESIII_2022_I2039027Cross section for $e^+e^-\to\pi^+\pi^-\eta$ between 3.872 and 4.7 GeVExperiment: BESIII (BEPC) Inspire ID: 2039027 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (1.9, 1.9); (2.0, 2.0); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.4, 2.4) GeV Run details:
Measurement of the cross section for $e^+e^-\to\pi^+\pi^-\eta$ between 3.872 and 4.7 GeV by the BESIII collaboration. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: BESIII_2022_I2039027.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4#include "Rivet/Projections/UnstableParticles.hh"
5
6namespace Rivet {
7
8
9 /// @brief e+e- -> pi+pi-eta
10 class BESIII_2022_I2039027 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2022_I2039027);
15
16
17 /// @name Analysis methods
18 /// @{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22 declare(FinalState(), "FS");
23 declare(UnstableParticles(), "UFS");
24 for(unsigned int ix=0;ix<2;++ix)
25 book(_num[ix] , 1+ix, 1, 1);
26 for (const string& en : _num[0].binning().edges<0>()) {
27 const 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 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
37 for(const Particle &child : p.children()) {
38 if(child.children().empty()) {
39 --nRes[child.pid()];
40 --ncount;
41 }
42 else
43 findChildren(child,nRes,ncount);
44 }
45 }
46
47 /// Perform the per-event analysis
48 void analyze(const Event& event) {
49 const FinalState& fs = apply<FinalState>(event, "FS");
50 map<long,int> nCount;
51 int ntotal(0);
52 for (const Particle& p : fs.particles()) {
53 nCount[p.pid()] += 1;
54 ++ntotal;
55 }
56 const FinalState& ufs = apply<FinalState>(event, "UFS");
57 // loop over eta mesons
58 for (const Particle& p : ufs.particles(Cuts::pid==221)) {
59 map<long,int> nRes = nCount;
60 int ncount = ntotal;
61 findChildren(p,nRes,ncount);
62 bool matched = true;
63 for(auto const & val : nRes) {
64 if(abs(val.first)==211) {
65 if(val.second !=1) {
66 matched = false;
67 break;
68 }
69 }
70 else if(val.second!=0) {
71 matched = false;
72 break;
73 }
74 }
75 if(!matched) continue;
76 _num[0]->fill(_ecms);
77 for (const Particle& p2 : ufs.particles(Cuts::pid==113)) {
78 map<long,int> nResB = nRes;
79 int ncountB = ncount;
80 findChildren(p2,nResB,ncountB);
81 if(ncountB!=0) continue;
82 bool matched = true;
83 for(auto const & val : nResB) {
84 if(val.second!=0) {
85 matched = false;
86 break;
87 }
88 }
89 if(matched) _num[1]->fill(_ecms);
90 }
91 }
92 }
93
94
95 /// Normalise histograms etc., after the run
96 void finalize() {
97 double fact = crossSection()/ sumOfWeights() /picobarn;
98 for(unsigned int ix=0;ix<2;++ix)
99 scale(_num[ix],fact);
100 }
101
102 /// @}
103
104
105 /// @name Histograms
106 /// @{
107 BinnedHistoPtr<string> _num[2];
108 string _ecms;
109 /// @}
110
111
112 };
113
114
115 RIVET_DECLARE_PLUGIN(BESIII_2022_I2039027);
116
117}
|