Rivet analyses referenceBESIII_2012_I1126960Cross Section for $e^+e^-\to\eta J/\psi$ for $\sqrt{s}=4.009$ GeVExperiment: BESIII (BEPC) Inspire ID: 1126960 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (2.0, 2.0) GeV Run details:
Cross section for $e^+e^-\to\eta J/\psi$ for $\sqrt{s}=4.009$ GeV measured by the BESIII collaboration. Source code: BESIII_2012_I1126960.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_2012_I1126960 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2012_I1126960);
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(_h,1,1,1);
25 }
26
27 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
28 for (const Particle &child : p.children()) {
29 if (child.children().empty()) {
30 --nRes[child.pid()];
31 --ncount;
32 }
33 else {
34 findChildren(child,nRes,ncount);
35 }
36 }
37 }
38
39 /// Perform the per-event analysis
40 void analyze(const Event& event) {
41 const FinalState& fs = apply<FinalState>(event, "FS");
42 map<long,int> nCount;
43 int ntotal(0);
44 for (const Particle& p : fs.particles()) {
45 nCount[p.pid()] += 1;
46 ++ntotal;
47 }
48 const FinalState& ufs = apply<FinalState>(event, "UFS");
49 for (const Particle& p : ufs.particles(Cuts::pid==PID::JPSI)) {
50 if (p.children().empty()) continue;
51 // find the J/psi
52 map<long,int> nRes = nCount;
53 int ncount = ntotal;
54 findChildren(p,nRes,ncount);
55 bool matched=false;
56 for (const Particle& p2 : ufs.particles(Cuts::pid==PID::ETA)) {
57 if (p2.children().empty()) continue;
58 bool JpsiParent=false;
59 Particle parent=p2;
60 while (!parent.parents().empty()) {
61 parent=parent.parents()[0];
62 if (parent.pid()==PID::JPSI) {
63 JpsiParent=true;
64 break;
65 }
66 }
67 if (JpsiParent) continue;
68 map<long,int> nRes2 = nRes;
69 int ncount2 = ncount;
70 findChildren(p2,nRes2,ncount2);
71 if (ncount2!=0) continue;
72 matched = true;
73 for (const auto& val : nRes2) {
74 if (val.second!=0) {
75 matched = false;
76 break;
77 }
78 }
79 if (matched) {
80 _h->fill(4.009);
81 break;
82 }
83 }
84 if (matched) break;
85 }
86 }
87
88
89 /// Normalise histograms etc., after the run
90 void finalize() {
91 scale(_h,crossSection()/ sumOfWeights() /picobarn);
92 }
93
94 /// @}
95
96
97 /// @name Histograms
98 /// @{
99 Histo1DPtr _h;
100 /// @}
101
102
103 };
104
105
106 RIVET_DECLARE_PLUGIN(BESIII_2012_I1126960);
107
108}
|