Rivet analyses referenceBESIII_2022_I1989527Cross section for $e^+e^-\to D^{*+}D^{*-}$ and $D^\pm D^{*\mp}$ between 4.08 and 4.6 GeVExperiment: BESIII (BEPC) Inspire ID: 1989527 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (2.0, 2.0); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.1, 2.1); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.2, 2.2); (2.3, 2.3); (2.3, 2.3); (2.3, 2.3) GeV Run details:
Cross section for $e^+e^-\to D^{*+}D^{*-}$ and $D^\pm D^{*\mp}$ between 4.08 and 4.6 GeV. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples. Source code: BESIII_2022_I1989527.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*+D*-, D+- D*-+
10 class BESIII_2022_I1989527 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2022_I1989527);
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(_nDSS, 1,1,3);
26 book(_nDS, 2,1,3);
27 for (const string& en : _nDS.binning().edges<0>()) {
28 const double end = std::stod(en)*GeV;
29 if (isCompatibleWithSqrtS(end)) {
30 _ecms = en;
31 break;
32 }
33 }
34 if (_ecms.empty()) MSG_ERROR("Beam energy incompatible with analysis.");
35 }
36
37 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
38 for (const Particle &child : p.children()) {
39 if (child.children().empty()) {
40 nRes[child.pid()]-=1;
41 --ncount;
42 }
43 else {
44 findChildren(child,nRes,ncount);
45 }
46 }
47 }
48
49
50 /// Perform the per-event analysis
51 void analyze(const Event& event) {
52 const FinalState& fs = apply<FinalState>(event, "FS");
53
54 map<long,int> nCount;
55 int ntotal(0);
56 for (const Particle& p : fs.particles()) {
57 nCount[p.pid()] += 1;
58 ++ntotal;
59 }
60 const FinalState& ufs = apply<FinalState>(event, "UFS");
61
62 for (unsigned int ix=0; ix<ufs.particles().size(); ++ix) {
63 const Particle& p1 = ufs.particles()[ix];
64 if(abs(p1.pid())!=413) continue;
65 map<long,int> nRes = nCount;
66 int ncount = ntotal;
67 findChildren(p1,nRes,ncount);
68 bool matched=false;
69 int sign = -p1.pid()/abs(p1.pid());
70 for (unsigned int iy=0; iy<ufs.particles().size(); ++iy) {
71 if (ix==iy) continue;
72 const Particle& p2 = ufs.particles()[iy];
73 if (!p2.parents().empty() && p2.parents()[0].pid()==p1.pid()) {
74 continue;
75 }
76 if (p2.pid()!=sign*413 && p2.pid()!=sign*411) continue;
77 map<long,int> nRes2 = nRes;
78 int ncount2 = ncount;
79 findChildren(p2,nRes2,ncount2);
80 if (ncount2!=0) continue;
81 matched=true;
82 for (const auto& val : nRes2) {
83 if (val.second!=0) {
84 matched = false;
85 break;
86 }
87 }
88 if (matched) {
89 sign = abs(p2.pid());
90 break;
91 }
92 }
93 if (matched) {
94 if (sign==411) _nDS->fill(_ecms);
95 else if(sign==413) _nDSS->fill(_ecms);
96 }
97 }
98 }
99
100
101 /// Normalise histograms etc., after the run
102 void finalize() {
103 scale({_nDS, _nDSS}, crossSection()/ sumOfWeights() /picobarn);
104 }
105
106 /// @}
107
108
109 /// @name Histograms
110 /// @{
111 BinnedHistoPtr<string> _nDSS,_nDS;
112 string _ecms;
113 /// @}
114
115
116 };
117
118
119 RIVET_DECLARE_PLUGIN(BESIII_2022_I1989527);
120
121}
|