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