Rivet analyses referenceBESIII_2017_I1628093Cross section for $e^+e^-\to \Lambda_c^+\bar{\Lambda}_c^-$ near thresholdExperiment: BESIII (BEPC) Inspire ID: 1628093 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Cross section for $e^+e^-\to \Lambda_c^+\bar{\Lambda}_c^-$ near threshold. Source code: BESIII_2017_I1628093.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 Add a short analysis description here
10 class BESIII_2017_I1628093 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2017_I1628093);
15
16
17 /// @name Analysis methods
18 //@{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22
23 // Initialise and register projections
24 declare(FinalState(), "FS");
25 declare(UnstableParticles(), "UFS");
26 book(_nLambda,"/TMP/nLambda");
27
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 const FinalState& ufs = apply<FinalState>(event, "UFS");
52
53 for(unsigned int ix=0;ix<ufs.particles().size();++ix) {
54 const Particle& p1 = ufs.particles()[ix];
55 if(abs(p1.pid())!=4122) continue;
56 map<long,int> nRes = nCount;
57 int ncount = ntotal;
58 findChildren(p1,nRes,ncount);
59 bool matched=false;
60 for(unsigned int iy=0;iy<ufs.particles().size();++iy) {
61 if(ix==iy) continue;
62 const Particle& p2 = ufs.particles()[iy];
63 if(p2.pid() != -p1.pid()) continue;
64 map<long,int> nRes2 = nRes;
65 int ncount2 = ncount;
66 findChildren(p2,nRes2,ncount2);
67 if(ncount2!=0) continue;
68 matched=true;
69 for(auto const & val : nRes2) {
70 if(val.second!=0) {
71 matched = false;
72 break;
73 }
74 }
75 if(matched) {
76 break;
77 }
78 }
79 if(matched) {
80 _nLambda->fill();
81 break;
82 }
83 }
84 }
85
86
87 /// Normalise histograms etc., after the run
88 void finalize() {
89 double sigma = _nLambda->val();
90 double error = _nLambda->err();
91 sigma *= crossSection()/ sumOfWeights() /picobarn;
92 error *= crossSection()/ sumOfWeights() /picobarn;
93 Scatter2D temphisto(refData(1, 1, 1));
94 Scatter2DPtr mult;
95 book(mult,1, 1, 1);
96 for (size_t b = 0; b < temphisto.numPoints(); b++) {
97 const double x = temphisto.point(b).x();
98 pair<double,double> ex = temphisto.point(b).xErrs();
99 pair<double,double> ex2 = ex;
100 if(ex2.first ==0.) ex2. first=0.0001;
101 if(ex2.second==0.) ex2.second=0.0001;
102 if (inRange(sqrtS()/MeV, x-ex2.first, x+ex2.second)) {
103 mult->addPoint(x, sigma, ex, make_pair(error,error));
104 }
105 else {
106 mult->addPoint(x, 0., ex, make_pair(0.,.0));
107 }
108 }
109 }
110
111 //@}
112
113
114 /// @name Histograms
115 //@{
116 CounterPtr _nLambda;
117 //@}
118
119
120 };
121
122
123 // The hook for the plugin system
124 RIVET_DECLARE_PLUGIN(BESIII_2017_I1628093);
125
126
127}
|