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: (1.0, 1.0); (1.0, 1.0); (1.1, 1.1); (1.1, 1.1); (1.1, 1.1); (1.1, 1.1); (1.1, 1.1); (1.1, 1.1); (1.2, 1.2); (1.2, 1.2); (1.2, 1.2); (1.2, 1.2); (1.3, 1.3); (1.3, 1.3); (1.4, 1.4); (1.5, 1.5); (1.5, 1.5); (1.5, 1.5); (1.5, 1.5); (1.5, 1.5); (1.5, 1.5); (1.5, 1.5) GeV 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. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. 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, 1, 1, 1);
27 for (const string& en : _nPhiEta.binning().edges<0>()) {
28 const double end = std::stod(en)*GeV;
29 if (isCompatibleWithSqrtS(end)) {
30 _ecms = en;
31 break;
32 }
33 }
34 if(_ecms.empty()) MSG_ERROR("Beam energy incompatible with analysis.");
35
36 }
37
38 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
39 for (const Particle &child : p.children()) {
40 if(child.children().empty()) {
41 nRes[child.pid()]-=1;
42 --ncount;
43 }
44 else
45 findChildren(child,nRes,ncount);
46 }
47 }
48
49
50 /// Perform the per-event analysis
51 void analyze(const Event& event) {
52 const FinalState& fs = apply<FinalState>(event, "FS");
53
54 map<long,int> nCount;
55 int ntotal(0);
56 for (const Particle& p : fs.particles()) {
57 nCount[p.pid()] += 1;
58 ++ntotal;
59 }
60 const FinalState& ufs = apply<FinalState>(event, "UFS");
61
62 // loop over eta mesons
63 for (const Particle& p : ufs.particles(Cuts::pid==221)) {
64 if(p.children().empty()) continue;
65 map<long,int> nRes = nCount;
66 int ncount = ntotal;
67 findChildren(p,nRes,ncount);
68 // loop over phi mesons
69 for (const Particle& p2 : ufs.particles(Cuts::pid==333)) {
70 if(p2.parents()[0].isSame(p)) continue;
71 map<long,int> nResB = nRes;
72 int ncountB = ncount;
73 findChildren(p2,nResB,ncountB);
74 if(ncountB!=0) continue;
75 bool matched = true;
76 for(auto const & val : nResB) {
77 if(val.second!=0) {
78 matched = false;
79 break;
80 }
81 }
82 if(matched) _nPhiEta->fill(_ecms);
83 }
84 }
85 }
86
87
88 /// Normalise histograms etc., after the run
89 void finalize() {
90 scale(_nPhiEta, crossSection()/ sumOfWeights()/picobarn);
91 }
92
93 ///@}
94
95
96 /// @name Histograms
97 ///@{
98 BinnedHistoPtr<string> _nPhiEta;
99 string _ecms;
100 ///@}
101
102
103 };
104
105
106 RIVET_DECLARE_PLUGIN(BESIII_2021_I1857930);
107
108}
|