Rivet analyses referenceBESIII_2021_I1940960Measurement of cross section for $e^+e^-\to\Sigma^0\bar{\Sigma}^0$ between 2.3864 and 3.02 GeVExperiment: BESIII (BEPC) Inspire ID: 1940960 Status: VALIDATED Authors:
Beam energies: (1.2, 1.2) GeV Run details:
Measurement of the cross section for $e^+e^-\to\Sigma^0\bar{\Sigma}^0$ between 2.3864 and 3.02 GeV by the BESIII collaboration. Source code: BESIII_2021_I1940960.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 Sigma0 SigmaBar0 cross section
10 class BESIII_2021_I1940960 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2021_I1940960);
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(_nSigma, "/TMP/nSigma" );
26 }
27
28 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
29 for(const Particle &child : p.children()) {
30 if(child.children().empty()) {
31 nRes[child.pid()]-=1;
32 --ncount;
33 }
34 else
35 findChildren(child,nRes,ncount);
36 }
37 }
38
39 /// Perform the per-event analysis
40 void analyze(const Event& event) {
41 const FinalState& fs = apply<FinalState>(event, "FS");
42 // total hadronic and muonic cross sections
43 map<long,int> nCount;
44 int ntotal(0);
45 for (const Particle& p : fs.particles()) {
46 nCount[p.pid()] += 1;
47 ++ntotal;
48 }
49 // find the Xis
50 const FinalState& ufs = apply<UnstableParticles>(event, "UFS");
51 for(const Particle & p1 : ufs.particles(Cuts::pid==3212)) {
52 bool matched = false;
53 // check fs
54 bool fs = true;
55 for(const Particle & child : p1.children()) {
56 if(child.pid()==p1.pid()) {
57 fs = false;
58 break;
59 }
60 }
61 if(!fs) continue;
62 // find the children
63 map<long,int> nRes = nCount;
64 int ncount = ntotal;
65 findChildren(p1,nRes,ncount);
66 for(const Particle & p2 : ufs.particles(Cuts::pid==-3212)) {
67 // check fs
68 bool fs = true;
69 for(const Particle & child : p2.children()) {
70 if(child.pid()==p2.pid()) {
71 fs = false;
72 break;
73 }
74 }
75 if(!fs) continue;
76 map<long,int> nRes2 = nRes;
77 int ncount2 = ncount;
78 findChildren(p2,nRes2,ncount2);
79 if(ncount2!=0) continue;
80 matched=true;
81 for(auto const & val : nRes2) {
82 if(val.second!=0) {
83 matched = false;
84 break;
85 }
86 }
87 if(matched) {
88 _nSigma->fill();
89 break;
90 }
91 }
92 if(matched) break;
93 }
94 }
95
96
97 /// Normalise histograms etc., after the run
98 void finalize() {
99 double sigma = _nSigma->val();
100 double error = _nSigma->err();
101 sigma *= crossSection()/ sumOfWeights() /picobarn;
102 error *= crossSection()/ sumOfWeights() /picobarn;
103 Scatter2D temphisto(refData(1, 1, 1));
104 Scatter2DPtr mult;
105 book(mult,1, 1, 1);
106 for (size_t b = 0; b < temphisto.numPoints(); b++) {
107 const double x = temphisto.point(b).x();
108 pair<double,double> ex = temphisto.point(b).xErrs();
109 pair<double,double> ex2 = ex;
110 if(ex2.first ==0.) ex2. first=0.0001;
111 if(ex2.second==0.) ex2.second=0.0001;
112 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
113 mult->addPoint(x, sigma, ex, make_pair(error,error));
114 }
115 else {
116 mult->addPoint(x, 0., ex, make_pair(0.,.0));
117 }
118 }
119 }
120
121 ///@}
122
123
124 /// @name Histograms
125 ///@{
126 CounterPtr _nSigma;
127 ///@}
128
129
130 };
131
132
133 RIVET_DECLARE_PLUGIN(BESIII_2021_I1940960);
134
135}
|