Rivet analyses referenceBESIII_2021_I1845443Cross section for $e^+e^-\to p \bar{p} \eta$ and $p \bar{p} \omega$ at energies between 3.773 and 4.600 GeVExperiment: BESIII (BEPC) Inspire ID: 1845443 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Cross section for $e^+e^-\to p \bar{p} \eta$ and $p \bar{p} \omega$ at energies between 3.773 and 4.600 GeV measured by the BESIII collaboration. Source code: BESIII_2021_I1845443.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- -> p pbar eta/omega
10 class BESIII_2021_I1845443 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2021_I1845443);
15
16
17 /// @name Analysis methods
18 ///@{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22 // Initialise and register projections
23 declare(FinalState(), "FS");
24 declare(UnstableParticles(), "UFS");
25 book(_nEta, "/TMP/nEta" );
26 book(_nOmega, "/TMP/nOmega" );
27 }
28
29 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
30 for (const Particle &child : p.children()) {
31 if(child.children().empty()) {
32 nRes[child.pid()]-=1;
33 --ncount;
34 }
35 else
36 findChildren(child,nRes,ncount);
37 }
38 }
39
40 /// Perform the per-event analysis
41 void analyze(const Event& event) {
42 const FinalState& fs = apply<FinalState>(event, "FS");
43 // total hadronic and muonic cross sections
44 map<long,int> nCount;
45 int ntotal(0);
46 for (const Particle& p : fs.particles()) {
47 nCount[p.pid()] += 1;
48 ++ntotal;
49 }
50 // find the eta/omega
51 const FinalState& ufs = apply<UnstableParticles>(event, "UFS");
52 for(const Particle& p : ufs.particles(Cuts::pid==PID::ETA or Cuts::pid==PID::OMEGA)) {
53 map<long,int> nRes = nCount;
54 int ncount = ntotal;
55 findChildren(p,nRes,ncount);
56 bool matched=true;
57 for(auto const & val : nRes) {
58 if(abs(val.first)==PID::PROTON) {
59 if(val.second!=1) {
60 matched = false;
61 break;
62 }
63 }
64 else if(val.second!=0) {
65 matched = false;
66 break;
67 }
68 }
69 if(matched) {
70 if(p.pid()==PID::ETA)
71 _nEta->fill();
72 else
73 _nOmega->fill();
74 break;
75 }
76 }
77 }
78
79
80 /// Normalise histograms etc., after the run
81 void finalize() {
82 for(unsigned int ix=1;ix<3;++ix) {
83 double sigma,error;
84 if(ix==1) {
85 sigma = _nEta->val();
86 error = _nEta->err();
87 }
88 else {
89 sigma = _nOmega->val();
90 error = _nOmega->err();
91 }
92 sigma *= crossSection()/ sumOfWeights() /picobarn;
93 error *= crossSection()/ sumOfWeights() /picobarn;
94 Scatter2D temphisto(refData(ix, 1, 1));
95 Scatter2DPtr mult;
96 book(mult, ix, 1, 1);
97 for (size_t b = 0; b < temphisto.numPoints(); b++) {
98 const double x = temphisto.point(b).x();
99 pair<double,double> ex = temphisto.point(b).xErrs();
100 pair<double,double> ex2 = ex;
101 if(ex2.first ==0.) ex2. first=0.0001;
102 if(ex2.second==0.) ex2.second=0.0001;
103 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
104 mult->addPoint(x, sigma, ex, make_pair(error,error));
105 }
106 else {
107 mult->addPoint(x, 0., ex, make_pair(0.,.0));
108 }
109 }
110 }
111 }
112
113 ///@}
114
115
116 /// @name Histograms
117 ///@{
118 CounterPtr _nEta,_nOmega;
119 ///@}
120
121
122 };
123
124
125 RIVET_DECLARE_PLUGIN(BESIII_2021_I1845443);
126
127}
|