Rivet analyses referenceBESIII_2023_I2685727Cross section for $e^+e^-\to\phi+K^+K^-$ and $K^0_SK^0_S$ at energies between 3.773 and 4.7008 GeVExperiment: BESIII (BEPC) Inspire ID: 2685727 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (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.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.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.4, 2.4) GeV Run details:
Cross section for $e^+e^-\to\phi+K^+K^-$ and $K^0_SK^0_S$ at energies between 3.773 and 4.7008 GeV. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: BESIII_2023_I2685727.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 K+K-/KS0 KS0
10 class BESIII_2023_I2685727 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2023_I2685727);
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(_nPhi[ix], 1, 1, 1+ix);
26 for (const string& en : _nPhi[0].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())
34 MSG_ERROR("Beam energy incompatible with analysis.");
35 }
36
37 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
38 for (const Particle &child : p.children()) {
39 if (child.children().empty()) {
40 --nRes[child.pid()];
41 --ncount;
42 }
43 else {
44 findChildren(child,nRes,ncount);
45 }
46 }
47 }
48
49 /// Perform the per-event analysis
50 void analyze(const Event& event) {
51 const FinalState& fs = apply<FinalState>(event, "FS");
52 map<long,int> nCount;
53 int ntotal(0);
54 for (const Particle& p : fs.particles()) {
55 nCount[p.pid()] += 1;
56 ++ntotal;
57 }
58 const FinalState& ufs = apply<FinalState>(event, "UFS");
59 // find the phis
60 for (const Particle& p : ufs.particles(Cuts::pid==333)) {
61 if (p.children().empty()) continue;
62 map<long,int> nRes = nCount;
63 int ncount = ntotal;
64 findChildren(p,nRes,ncount);
65 // phi KK
66 if (ncount!=2) continue;
67 bool matched = false;
68 for (unsigned int imode=0; imode<2; ++imode) {
69 matched = true;
70 for (const auto& val : nRes) {
71 if (abs(val.first)==310 && imode==1) {
72 if (val.second !=2) {
73 matched = false;
74 break;
75 }
76 }
77 else if (abs(val.first)==321 && imode==0) {
78 if (val.second !=1) {
79 matched = false;
80 break;
81 }
82 }
83 else if (val.second!=0) {
84 matched = false;
85 break;
86 }
87 }
88 if (matched) {
89 _nPhi[imode]->fill(_ecms);
90 break;
91 }
92 }
93 if (matched) break;
94 }
95 }
96
97
98 /// Normalise histograms etc., after the run
99 void finalize() {
100 scale(_nPhi, crossSection()/ sumOfWeights() /picobarn);
101 }
102
103 /// @}
104
105
106 /// @name Histograms
107 /// @{
108 BinnedHistoPtr<string> _nPhi[2];
109 string _ecms;
110 /// @}
111
112
113 };
114
115
116 RIVET_DECLARE_PLUGIN(BESIII_2023_I2685727);
117
118}
|