Rivet analyses referenceBESIII_2016_I1457597Cross section for $e^+e^-\to J/\psi \eta^\prime$ at energies between 4.189 and 4.6 GeVExperiment: BESIII (BEPC) Inspire ID: 1457597 Status: VALIDATED Authors:
Beam energies: (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.3, 2.3); (2.3, 2.3); (2.3, 2.3) GeV Run details:
Measurement of the cross section for $e^+e^-\to J/\psi \eta^\prime$ at energies between 4.189 and 4.6 GeV. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: BESIII_2016_I1457597.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 Cross section for $e^+e^-\to J/\psi \eta^\prime$ at energies between 4.189 and 4.6 GeV
10 class BESIII_2016_I1457597 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2016_I1457597);
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 book(_nJPsi, 1, 1, 7);
25 for (const string& en : _nJPsi.binning().edges<0>()) {
26 const double end = std::stod(en)*GeV;
27 if (isCompatibleWithSqrtS(end)) {
28 _ecms = en;
29 break;
30 }
31 }
32 if (_ecms.empty())
33 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 /// Perform the per-event analysis
48 void analyze(const Event& event) {
49 const FinalState& fs = apply<FinalState>(event, "FS");
50 map<long,int> nCount;
51 int ntotal(0);
52 for (const Particle& p : fs.particles()) {
53 nCount[p.pid()] += 1;
54 ++ntotal;
55 }
56 const FinalState& ufs = apply<FinalState>(event, "UFS");
57 for (const Particle& p1 : ufs.particles()) {
58 bool matched=false;
59 if(p1.children().empty()) continue;
60 // find the j/psi
61 if(p1.pid()!=443) continue;
62 map<long,int> nRes = nCount;
63 int ncount = ntotal;
64 findChildren(p1,nRes,ncount);
65
66 for (const Particle& p2 : ufs.particles()) {
67 if(p2.children().empty()) continue;
68 // find the j/psi
69 if(p2.pid()!=331) continue;
70 map<long,int> nRes2 = nRes;
71 int ncount2 = ncount;
72 findChildren(p2,nRes2,ncount2);
73 if(ncount2!=0) continue;
74 matched=true;
75 for(auto const & val : nRes2) {
76 if(val.second!=0) {
77 matched = false;
78 break;
79 }
80 }
81 if(matched) {
82 _nJPsi->fill(_ecms);
83 break;
84 }
85 }
86 if(matched) break;
87 }
88 }
89
90 /// Normalise histograms etc., after the run
91 void finalize() {
92 scale(_nJPsi, crossSection()/ sumOfWeights() /picobarn);
93 }
94
95 /// @}
96
97
98 /// @name Histograms
99 /// @{
100 BinnedHistoPtr<string> _nJPsi;
101 string _ecms;
102 /// @}
103
104
105 };
106
107
108 RIVET_DECLARE_PLUGIN(BESIII_2016_I1457597);
109
110
111}
|