Rivet analyses referenceBESIII_2024_I2776394Cross section for $e^+e^-\to\omega\eta^\prime$ for $\sqrt{s}$ between 2 and 3.08 GeVExperiment: BESIII (BEPC) Inspire ID: 2776394 Status: VALIDATED NOHEPDATA Authors:
Beam energies: ANY Run details:
Cross section for $e^+e^-\to\omega\eta^\prime$ for $\sqrt{s}$ between 2 and 3.08 GeV Source code: BESIII_2024_I2776394.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 Add a short analysis description here
10 class BESIII_2024_I2776394 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2024_I2776394);
15
16
17 /// @name Analysis methods
18 /// @{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22 // Initialise and register projections
23 declare(FinalState(), "FS");
24 declare(UnstableParticles(), "UFS");
25 book(_h, 1, 1, 1);
26 for (const string& en : _h.binning().edges<0>()) {
27 const double end = std::stod(en)*GeV;
28 if (isCompatibleWithSqrtS(end)) {
29 _ecms = en;
30 break;
31 }
32 }
33 }
34
35 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
36 for( const Particle &child : p.children()) {
37 if(child.children().empty()) {
38 --nRes[child.pid()];
39 --ncount;
40 }
41 else
42 findChildren(child,nRes,ncount);
43 }
44 }
45
46 /// Perform the per-event analysis
47 void analyze(const Event& event) {
48 const FinalState& fs = apply<FinalState>(event, "FS");
49
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 UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
57 for (const Particle& p : ufs.particles(Cuts::pid==223)) {
58 if(p.children().empty()) continue;
59 map<long,int> nRes = nCount;
60 int ncount = ntotal;
61 findChildren(p,nRes,ncount);
62 // check for eta
63 for (const Particle& p2 : ufs.particles(Cuts::pid==331)) {
64 map<long,int> nResB = nRes;
65 int ncountB = ncount;
66 findChildren(p2,nResB,ncountB);
67 if(ncountB!=0) continue;
68 bool matched = true;
69 for(auto const & val : nResB) {
70 if(val.second!=0) {
71 matched = false;
72 break;
73 }
74 }
75 if(matched) {
76 _h->fill(_ecms);
77 break;
78 }
79 }
80 }
81 }
82
83
84 /// Normalise histograms etc., after the run
85 void finalize() {
86 scale(_h,crossSection()/picobarn/sumOfWeights());
87 }
88
89 /// @}
90
91
92 /// @name Histograms
93 /// @{
94 BinnedHistoPtr<string> _h;
95 string _ecms;
96 /// @}
97
98
99 };
100
101
102 RIVET_DECLARE_PLUGIN(BESIII_2024_I2776394);
103
104}
|