Rivet analyses referenceBESIII_2022_I2165175Cross section for $e^+e^-\to\phi\eta^\prime$ between 3.508 and 4.6 GeVExperiment: BESIII (BEPC) Inspire ID: 2165175 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (1.8, 1.8); (1.8, 1.8); (1.9, 1.9); (1.9, 1.9); (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.2, 2.2); (2.2, 2.2); (2.3, 2.3) GeV Run details:
Cross section for $e^+e^-\to\phi\eta^\prime$ between 3.508 and 4.6 GeV. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: BESIII_2022_I2165175.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_2022_I2165175 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2022_I2165175);
15
16
17 /// @name Analysis methods
18 /// @{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22 // projections
23 declare(FinalState(), "FS");
24 declare(UnstableParticles(Cuts::pid==331 or Cuts::pid==333), "UFS");
25 book(_sigma,1,1,1);
26 for (const string& en : _sigma.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
48 /// Perform the per-event analysis
49 void analyze(const Event& event) {
50 const FinalState& fs = apply<FinalState>(event, "FS");
51 map<long,int> nCount;
52 int ntotal(0);
53 for (const Particle& p: fs.particles()) {
54 nCount[p.pid()] += 1;
55 ++ntotal;
56 }
57 const FinalState& ufs = apply<FinalState>(event, "UFS");
58 // loop over any phi mesons
59 for(const Particle& phi : ufs.particles(Cuts::pid==333)) {
60 bool matched = false;
61 if(phi.children().empty()) continue;
62 map<long,int> nRes = nCount;
63 int ncount = ntotal;
64 findChildren(phi,nRes,ncount);
65 for(const Particle & chi : ufs.particles(Cuts::pid==331)) {
66 if(chi.children().empty()) continue;
67 map<long,int> nRes2 = nRes;
68 int ncount2 = ncount;
69 findChildren(chi,nRes2,ncount2);
70 matched = true;
71 for(auto const & val : nRes2) {
72 if(val.second!=0) {
73 matched = false;
74 break;
75 }
76 }
77 if (!matched) continue;
78 _sigma->fill(_ecms);
79 break;
80 }
81 if(matched) break;
82 }
83 }
84
85
86 /// Normalise histograms etc., after the run
87 void finalize() {
88 scale(_sigma,crossSection()/ sumOfWeights() /picobarn);
89 }
90
91 /// @}
92
93
94 /// @name Histograms
95 /// @{
96 BinnedHistoPtr<string> _sigma;
97 string _ecms;
98 /// @}
99
100
101 };
102
103
104 RIVET_DECLARE_PLUGIN(BESIII_2022_I2165175);
105
106}
|