Rivet analyses referenceBESIII_2020_I1784442Cross Section for $e^+e^-\to\eta J/\psi$ for energies between 3.81 and 4.60 GeVExperiment: BESIII (BEPC) Inspire ID: 1784442 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (1.9, 1.9); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (2.0, 2.0); (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.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.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.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.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.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3) GeV Run details:
Cross section for $e^+e^-\to\eta J/\psi$ for energies between 3.81 and 4.60 GeV measured by the BESIII collaboration. Source code: BESIII_2020_I1784442.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- -> eta J/psi
10 class BESIII_2020_I1784442 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2020_I1784442);
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 for (unsigned int ix=0; ix<2; ++ix) {
25 book(_sigmaJPsi[ix], 1+ix, 1, 1);
26 for(const string& en : _sigmaJPsi[ix].binning().edges<0>()) {
27 const double end = std::stod(en)*GeV;
28 if (isCompatibleWithSqrtS(end)) {
29 _ecms[ix] = en;
30 break;
31 }
32 }
33 }
34 if (_ecms[0].empty() && _ecms[1].empty()) {
35 MSG_ERROR("Beam energy incompatible with analysis.");
36 }
37 }
38
39 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
40 for (const Particle &child : p.children()) {
41 if (child.children().empty()) {
42 --nRes[child.pid()];
43 --ncount;
44 }
45 else {
46 findChildren(child,nRes,ncount);
47 }
48 }
49 }
50
51 /// Perform the per-event analysis
52 void analyze(const Event& event) {
53 const FinalState& fs = apply<FinalState>(event, "FS");
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 for (const Particle& p : ufs.particles(Cuts::pid==PID::JPSI)) {
62 if (p.children().empty()) continue;
63 // find the J/psi
64 map<long,int> nRes = nCount;
65 int ncount = ntotal;
66 findChildren(p,nRes,ncount);
67 bool matched=false;
68 for (const Particle& p2 : ufs.particles(Cuts::pid==PID::ETA)) {
69 if(p2.children().empty()) continue;
70 bool JpsiParent=false;
71 Particle parent=p2;
72 while (!parent.parents().empty()) {
73 parent=parent.parents()[0];
74 if (parent.pid()==PID::JPSI) {
75 JpsiParent=true;
76 break;
77 }
78 }
79 if (JpsiParent) continue;
80 map<long,int> nRes2 = nRes;
81 int ncount2 = ncount;
82 findChildren(p2,nRes2,ncount2);
83 if (ncount2!=0) continue;
84 matched = true;
85 for (const auto& val : nRes2) {
86 if (val.second!=0) {
87 matched = false;
88 break;
89 }
90 }
91 if (matched) {
92 for (unsigned int ix=0; ix<2; ++ix)
93 if (!_ecms[ix].empty()) {
94 _sigmaJPsi[ix]->fill(_ecms[ix]);
95 break;
96 }
97 }
98 }
99 if (matched) break;
100 }
101 }
102
103
104 /// Normalise histograms etc., after the run
105 void finalize() {
106 scale(_sigmaJPsi, crossSection()/ sumOfWeights() /picobarn);
107 }
108
109 /// @}
110
111
112 /// @name Histograms
113 /// @{
114 BinnedHistoPtr<string> _sigmaJPsi[2];
115 string _ecms[2];
116 /// @}
117
118
119 };
120
121
122 RIVET_DECLARE_PLUGIN(BESIII_2020_I1784442);
123
124}
|