Rivet analyses referenceBESIII_2018_I1653121Cross section for $e^+e^-\to K^+K^-J/\psi$ and $K^0_SK^0_SJ/\psi$ for energies between 4.2 and 4.6 GeVExperiment: BESIII (BEPC) Inspire ID: 1653121 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:
Cross section for $e^+e^-\to K^+K^-J/\psi$ and $K^0_SK^0_SJ/\psi$ for energies between 4.2 and 4.6 GeV measured by the BESIII collaboration. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: BESIII_2018_I1653121.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- > KK J/Psi
10 class BESIII_2018_I1653121 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2018_I1653121);
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(Cuts::pid==443), "UFS");
24 book(_nKp, 1, 1, 1);
25 book(_nK0, 1, 1, 2);
26 for (const string& en : _nKp.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()) 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& p : ufs.particles()) {
58 if(p.children().empty()) continue;
59 map<long,int> nRes = nCount;
60 int ncount = ntotal;
61 findChildren(p,nRes,ncount);
62 // J/psi KK
63 if(ncount!=2) continue;
64 bool matched = true;
65 for(auto const & val : nRes) {
66 if(abs(val.first)==321 || abs(val.first)==310) {
67 continue;
68 }
69 else if(val.second!=0) {
70 matched = false;
71 break;
72 }
73 }
74 if(matched) {
75 if(nRes[321]==1 && nRes[-321]==1) {
76 _nKp->fill(_ecms);
77 break;
78 }
79 else if(nRes[310]==2) {
80 _nK0->fill(_ecms);
81 break;
82 }
83 }
84 }
85 }
86
87 /// Normalise histograms etc., after the run
88 void finalize() {
89 const double fact = crossSection()/ sumOfWeights() /picobarn;
90 scale(_nKp,fact);
91 scale(_nK0,fact);
92 }
93 /// @}
94
95
96 /// @name Histograms
97 /// @{
98 BinnedHistoPtr<string> _nKp, _nK0;
99 string _ecms;
100 /// @}
101
102
103 };
104
105
106 RIVET_DECLARE_PLUGIN(BESIII_2018_I1653121);
107
108}
|