Rivet analyses referenceBESIII_2020_I1823448Cross section for $e^+e^-\to\Xi^-\bar{\Xi}^+$ between 2.644 and 3.080 GeVExperiment: BESIII (BEPC) Inspire ID: 1823448 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the cross section for $e^+e^-\to\Xi^-\bar{\Xi}^+$ between 2.644 and 3.080. Source code: BESIII_2020_I1823448.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 Xi- Xibar+ cross section
10 class BESIII_2020_I1823448 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2020_I1823448);
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(_nXi, "/TMP/nXi" );
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(unsigned int ix=0;ix<ufs.particles().size();++ix) {
52 const Particle& p1 = ufs.particles()[ix];
53 if(abs(p1.pid())!=3312) continue;
54 bool matched = false;
55 // check fs
56 bool fs = true;
57 for(const Particle & child : p1.children()) {
58 if(child.pid()==p1.pid()) {
59 fs = false;
60 break;
61 }
62 }
63 if(!fs) continue;
64 // find the children
65 map<long,int> nRes = nCount;
66 int ncount = ntotal;
67 findChildren(p1,nRes,ncount);
68 for(unsigned int iy=ix+1;iy<ufs.particles().size();++iy) {
69 const Particle& p2 = ufs.particles()[iy];
70 if(abs(p2.pid())!=3312) continue;
71 // check fs
72 bool fs = true;
73 for(const Particle & child : p2.children()) {
74 if(child.pid()==p2.pid()) {
75 fs = false;
76 break;
77 }
78 }
79 if(!fs) continue;
80 map<long,int> nRes2 = nRes;
81 int ncount2 = ncount;
82 findChildren(p2,nRes2,ncount2);
83 if(ncount2!=0) continue;
84 matched=true;
85 for(auto const & val : nRes2) {
86 if(val.second!=0) {
87 matched = false;
88 break;
89 }
90 }
91 if(matched) {
92 _nXi->fill();
93 break;
94 }
95 }
96 if(matched) break;
97 }
98 }
99
100
101 /// Normalise histograms etc., after the run
102 void finalize() {
103 double sigma = _nXi->val();
104 double error = _nXi->err();
105 sigma *= crossSection()/ sumOfWeights() /picobarn;
106 error *= crossSection()/ sumOfWeights() /picobarn;
107 Scatter2D temphisto(refData(1, 1, 4));
108 Scatter2DPtr mult;
109 book(mult,1, 1, 4);
110 for (size_t b = 0; b < temphisto.numPoints(); b++) {
111 const double x = temphisto.point(b).x();
112 pair<double,double> ex = temphisto.point(b).xErrs();
113 pair<double,double> ex2 = ex;
114 if(ex2.first ==0.) ex2. first=0.0001;
115 if(ex2.second==0.) ex2.second=0.0001;
116 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
117 mult->addPoint(x, sigma, ex, make_pair(error,error));
118 }
119 else {
120 mult->addPoint(x, 0., ex, make_pair(0.,.0));
121 }
122 }
123 }
124
125 ///@}
126
127
128 /// @name Histograms
129 ///@{
130 CounterPtr _nXi;
131 ///@}
132
133
134 };
135
136
137 RIVET_DECLARE_PLUGIN(BESIII_2020_I1823448);
138
139}
|