Rivet analyses referenceBELLE_2008_I759073Cross section for $e^+e^-\to D^0D^-\pi^++\text{c.c.}$ below 5 GeVExperiment: BELLE (KEKB) Inspire ID: 759073 Status: VALIDATED Authors:
Beams: e+ e- Beam energies: ANY Run details:
Cross section for $e^+e^-\to D^0D^-\pi^++\text{c.c.}$ below 5 GeV Source code: BELLE_2008_I759073.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 Cross section for D0 D- pi+ +c.c
10 class BELLE_2008_I759073 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BELLE_2008_I759073);
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(_nD0, "/TMP/nD0");
27 }
28
29 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
30 for (const Particle &child : p.children()) {
31 if(child.children().empty()) {
32 nRes[child.pid()]-=1;
33 --ncount;
34 }
35 else
36 findChildren(child,nRes,ncount);
37 }
38 }
39
40 /// Perform the per-event analysis
41 void analyze(const Event& event) {
42 const FinalState& fs = apply<FinalState>(event, "FS");
43
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 const FinalState& ufs = apply<FinalState>(event, "UFS");
51
52
53 for(unsigned int ix=0;ix<ufs.particles().size();++ix) {
54 const Particle& p1 = ufs.particles()[ix];
55 if(abs(p1.pid())!=421) continue;
56 map<long,int> nRes = nCount;
57 int ncount = ntotal;
58 findChildren(p1,nRes,ncount);
59 bool matched=false;
60 int id2 = p1.pid()>0 ? -411 : 411;
61 int ipi = p1.pid()>0 ? 211 : -211;
62 for(unsigned int iy=0;iy<ufs.particles().size();++iy) {
63 if(ix==iy) continue;
64 const Particle& p2 = ufs.particles()[iy];
65 if(p2.pid()!=id2) continue;
66 map<long,int> nRes2 = nRes;
67 int ncount2 = ncount;
68 findChildren(p2,nRes2,ncount2);
69 if(ncount2!=1) continue;
70 matched=true;
71 for(auto const & val : nRes2) {
72 if(val.first==ipi) {
73 if(val.second!=1) {
74 matched = false;
75 break;
76 }
77 }
78 else if(val.second!=0) {
79 matched = false;
80 break;
81 }
82 }
83 if(matched) break;
84 }
85 if(matched)
86 _nD0->fill();
87 }
88 }
89
90
91 /// Normalise histograms etc., after the run
92 void finalize() {
93 double sigma = _nD0->val();
94 double error = _nD0->err();
95 sigma *= crossSection()/ sumOfWeights() /nanobarn;
96 error *= crossSection()/ sumOfWeights() /nanobarn;
97 Estimate1DPtr mult;
98 book(mult, 1, 1, 1);
99 for (auto& b : mult->bins()) {
100 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
101 b.set(sigma, error);
102 }
103 }
104 }
105
106 /// @}
107
108 /// @name Histograms
109 /// @{
110 CounterPtr _nD0;
111 /// @}
112
113 };
114
115
116 RIVET_DECLARE_PLUGIN(BELLE_2008_I759073);
117
118
119}
|