Rivet analyses referenceBESIII_2021_I1867196Cross section for $e^+e^-\to D_S^{*+} D_{s0}^*(2317)^-$, $D_S^{*+} D_{s1}^*(2460)^-$, $D_S^{*+} D_{s1}^*(2536)^-$ between 4.6 and 4.7 GeVExperiment: BESIII (BEPC) Inspire ID: 1867196 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the cross section for Cross section for $e^+e^-\to D_S^{*+} D_{s0}^*(2317)^-$, $D_S^{*+} D_{s1}^*(2460)^-$, $D_S^{*+} D_{s1}^*(2536)^-$ between 4.6 and 4.7 GeV by the BESIII collaboration. Source code: BESIII_2021_I1867196.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 e+e- -> D_s* D_sJ
10 class BESIII_2021_I1867196 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2021_I1867196);
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 // Histograms
26 for(unsigned int ix=0;ix<3;++ix) {
27 book(_numD[ix],"TMP/num_"+to_string(ix));
28 }
29 }
30
31 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
32 for (const Particle &child : p.children()) {
33 if(child.children().empty()) {
34 nRes[child.pid()]-=1;
35 --ncount;
36 }
37 else
38 findChildren(child,nRes,ncount);
39 }
40 }
41
42 /// Perform the per-event analysis
43 void analyze(const Event& event) {
44
45 const FinalState& fs = apply<FinalState>(event, "FS");
46
47 map<long,int> nCount;
48 int ntotal(0);
49 for (const Particle& p : fs.particles()) {
50 nCount[p.pid()] += 1;
51 ++ntotal;
52 }
53 const FinalState& ufs = apply<FinalState>(event, "UFS");
54 // loop over D_s*
55 for(const Particle & Dstar : ufs.particles(Cuts::abspid==433)) {
56 map<long,int> nRes = nCount;
57 int ncount = ntotal;
58 findChildren(Dstar,nRes,ncount);
59 bool matched=false;
60 for(const Particle & p : ufs.particles(Cuts::abspid==10431 or
61 Cuts::abspid==10433 or
62 Cuts::abspid==20433)) {
63 // check particle and antiparticle
64 if(Dstar.pid()*p.pid()>0) continue;
65 map<long,int> nRes2 = nRes;
66 int ncount2 = ncount;
67 findChildren(p,nRes2,ncount2);
68 if(ncount2!=0) continue;
69 matched=true;
70 for(auto const & val : nRes2) {
71 if(val.second!=0) {
72 matched = false;
73 break;
74 }
75 }
76 if(matched) {
77 if(p.abspid()==10431) _numD[0]->fill();
78 else if(p.abspid()==20433) _numD[1]->fill();
79 else if(p.abspid()==10433) _numD[2]->fill();
80 break;
81 }
82 }
83 if(matched) break;
84 }
85 }
86
87
88 /// Normalise histograms etc., after the run
89 void finalize() {
90 double fact = crossSection()/picobarn/sumOfWeights();
91 for(unsigned int ix=0;ix<3;++ix) {
92 double sigma = _numD[ix]->val()*fact;
93 double error = _numD[ix]->err()*fact;
94 Scatter2D temphisto(refData(1+ix, 1, 1));
95 Scatter2DPtr mult;
96 book(mult, 1+ix, 1, 1);
97 for (size_t b = 0; b < temphisto.numPoints(); b++) {
98 const double x = temphisto.point(b).x();
99 pair<double,double> ex = temphisto.point(b).xErrs();
100 pair<double,double> ex2 = ex;
101 if(ex2.first ==0.) ex2. first=0.0001;
102 if(ex2.second==0.) ex2.second=0.0001;
103 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
104 mult->addPoint(x, sigma, ex, make_pair(error,error));
105 }
106 else {
107 mult->addPoint(x, 0., ex, make_pair(0.,.0));
108 }
109 }
110 }
111 }
112
113 ///@}
114
115
116 /// @name Histograms
117 ///@{
118 CounterPtr _numD[3];
119 ///@}
120
121
122 };
123
124
125 RIVET_DECLARE_PLUGIN(BESIII_2021_I1867196);
126
127}
|