Rivet analyses referenceBESIII_2019_I1743841Cross section for $K^+K^-K^+K^-$ and $K^+K^-\phi$ for $E_{\text{CMS}}=2.10$ to $3.08$ GeVExperiment: BESIII (BEPC) Inspire ID: 1743841 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the cross section for $e^+e^- \to$ $K^+K^-K^+K^-$ and $K^+K^-\phi$ for center of mass energies between 2.10 and 3.08 GeV by the BESIII experiment. Source code: BESIII_2019_I1743841.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 2K+2K- and K+K- phi cross section
10 class BESIII_2019_I1743841 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2019_I1743841);
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 counters
26 book(_c2Kp2Km , "TMP/2Kp2Km" );
27 book(_cKpKmPhi, "TMP/KpKmPhi");
28 }
29
30 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
31 for( const Particle &child : p.children()) {
32 if(child.children().empty()) {
33 nRes[child.pid()]-=1;
34 --ncount;
35 }
36 else
37 findChildren(child,nRes,ncount);
38 }
39 }
40
41 /// Perform the per-event analysis
42 void analyze(const Event& event) {
43 const FinalState& fs = apply<FinalState>(event, "FS");
44
45 map<long,int> nCount;
46 int ntotal(0);
47 for (const Particle& p : fs.particles()) {
48 nCount[p.pid()] += 1;
49 ++ntotal;
50 }
51 if(ntotal==4 && nCount[321]==2 && nCount[-321]==2)
52 _c2Kp2Km->fill();
53 const FinalState& ufs = apply<FinalState>(event, "UFS");
54 for (const Particle& p : ufs.particles(Cuts::pid==333)) {
55 if(p.children().empty()) continue;
56 map<long,int> nRes=nCount;
57 int ncount = ntotal;
58 findChildren(p,nRes,ncount);
59 // phi K+K-
60 if(ncount==2) {
61 bool matched = true;
62 for(auto const & val : nRes) {
63 if(abs(val.first)==321) {
64 if(val.second!=1) {
65 matched = false;
66 break;
67 }
68 }
69 else if(val.second!=0) {
70 matched = false;
71 break;
72 }
73 }
74 if(matched)
75 _cKpKmPhi->fill();
76 }
77 }
78 }
79
80
81 /// Normalise histograms etc., after the run
82 void finalize() {
83 for(unsigned int ix=1;ix<3;++ix) {
84 double sigma = 0., error = 0.;
85 if(ix==1) {
86 sigma = _c2Kp2Km->val();
87 error = _c2Kp2Km->err();
88 }
89 else {
90 sigma = _cKpKmPhi->val();
91 error = _cKpKmPhi->err();
92 }
93 sigma *= crossSection()/ sumOfWeights() /picobarn;
94 error *= crossSection()/ sumOfWeights() /picobarn;
95 Estimate1DPtr mult;
96 book(mult,ix, 1, 1);
97 for (auto& b : mult->bins()) {
98 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
99 b.set(sigma, error);
100 }
101 }
102 }
103 }
104
105 /// @}
106
107
108 /// @name Histograms
109 /// @{
110 CounterPtr _c2Kp2Km,_cKpKmPhi;
111 /// @}
112
113 };
114
115
116 RIVET_DECLARE_PLUGIN(BESIII_2019_I1743841);
117
118}
|