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: ANY 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. 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 book(_num[0] , "TMP/etapipi");
25 book(_num[1] , "TMP/etarho" );
26 }
27
28 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
29 for(const Particle &child : p.children()) {
30 if(child.children().empty()) {
31 --nRes[child.pid()];
32 --ncount;
33 }
34 else
35 findChildren(child,nRes,ncount);
36 }
37 }
38
39 /// Perform the per-event analysis
40 void analyze(const Event& event) {
41 const FinalState& fs = apply<FinalState>(event, "FS");
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 const FinalState& ufs = apply<FinalState>(event, "UFS");
49 // loop over eta mesons
50 for (const Particle& p : ufs.particles(Cuts::pid==221)) {
51 map<long,int> nRes = nCount;
52 int ncount = ntotal;
53 findChildren(p,nRes,ncount);
54 bool matched = true;
55 for(auto const & val : nRes) {
56 if(abs(val.first)==211) {
57 if(val.second !=1) {
58 matched = false;
59 break;
60 }
61 }
62 else if(val.second!=0) {
63 matched = false;
64 break;
65 }
66 }
67 if(!matched) continue;
68 _num[0]->fill();
69 for (const Particle& p2 : ufs.particles(Cuts::pid==113)) {
70 map<long,int> nResB = nRes;
71 int ncountB = ncount;
72 findChildren(p2,nResB,ncountB);
73 if(ncountB!=0) continue;
74 bool matched = true;
75 for(auto const & val : nResB) {
76 if(val.second!=0) {
77 matched = false;
78 break;
79 }
80 }
81 if(matched) _num[1]->fill();
82 }
83 }
84 }
85
86
87 /// Normalise histograms etc., after the run
88 void finalize() {
89 double fact = crossSection()/ sumOfWeights() /picobarn;
90 for(unsigned int ix=0;ix<2;++ix) {
91 double sigma = _num[ix]->val()*fact;
92 double error = _num[ix]->err()*fact;
93 Scatter2D temphisto(refData(ix+1, 1, 1));
94 Scatter2DPtr mult;
95 book(mult, ix+1, 1, 1);
96 for (size_t b = 0; b < temphisto.numPoints(); b++) {
97 const double x = temphisto.point(b).x();
98 pair<double,double> ex = temphisto.point(b).xErrs();
99 pair<double,double> ex2 = ex;
100 if(ex2.first ==0.) ex2. first=0.0001;
101 if(ex2.second==0.) ex2.second=0.0001;
102 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
103 mult->addPoint(x, sigma, ex, make_pair(error,error));
104 }
105 else {
106 mult->addPoint(x, 0., ex, make_pair(0.,.0));
107 }
108 }
109 }
110 }
111
112 /// @}
113
114
115 /// @name Histograms
116 /// @{
117 CounterPtr _num[2];
118 /// @}
119
120
121 };
122
123
124 RIVET_DECLARE_PLUGIN(BESIII_2022_I2039027);
125
126}
|