Rivet analyses referenceBESIII_2023_I2642062Cross section for $e^+e^-\to\Lambda\bar{\Lambda}$ between threshold and 3 GeVExperiment: BESIII (BEPC) Inspire ID: 2642062 Status: VALIDATED NOHEPDATA Authors:
Beam energies: ANY
Measurement of the cross section for $e^+e^-\to\Lambda\bar{\Lambda}$ between threshold and 3 GeV Source code: BESIII_2023_I2642062.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_2023_I2642062 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2023_I2642062);
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"); declare(UnstableParticles(), "UFS");
24 book(_sigmaLambda,"TMP/sigma", refData(1, 1, 1));
25 }
26
27 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
28 for (const Particle& child : p.children()) {
29 if (child.children().empty()) {
30 nRes[child.pid()]-=1;
31 --ncount;
32 }
33 else {
34 findChildren(child,nRes,ncount);
35 }
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 Lambdas
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())!=3122) 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())!=3122) 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 (const auto& val : nRes2) {
86 if (val.second!=0) {
87 matched = false;
88 break;
89 }
90 }
91 if (matched) {
92 _sigmaLambda->fill(sqrtS());
93 break;
94 }
95 }
96 if (matched) break;
97 }
98 }
99
100
101 /// Normalise histograms etc., after the run
102 void finalize() {
103 scale(_sigmaLambda,crossSection()/ sumOfWeights() /picobarn);
104 Estimate1DPtr tmp;
105 book(tmp,1,1,1);
106 barchart(_sigmaLambda,tmp);
107 }
108
109 /// @}
110
111
112 /// @name Histograms
113 /// @{
114 Histo1DPtr _sigmaLambda;
115 /// @}
116
117
118 };
119
120
121 RIVET_DECLARE_PLUGIN(BESIII_2023_I2642062);
122
123}
|