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