Rivet analyses referenceBABAR_2010_I864027$e^+e^-\to D^{(*)+}_sD^{(*)-}_s$ cross sections near thresholdExperiment: BABAR (PEP-II) Inspire ID: 864027 Status: VALIDATED Authors:
Beam energies: ANY Run details:
$e^+e^-\to D^{(*)+}_sD^{(*)-}_s$ cross sections measured near threshold by BABAR using ISR. Source code: BABAR_2010_I864027.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- > Ds(*)+ Ds*()-
10 class BABAR_2010_I864027 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2010_I864027);
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
27 // Book histograms
28 book( _c_DpDm, "/TMP/sigma_DpDm" );
29 book( _c_DpDmS, "/TMP/sigma_DpDmS" );
30 book(_c_DpSDmS, "/TMP/sigma_DpSDmS");
31 }
32
33 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
34 for(const Particle &child : p.children()) {
35 if(child.children().empty()) {
36 nRes[child.pid()]-=1;
37 --ncount;
38 }
39 else
40 findChildren(child,nRes,ncount);
41 }
42 }
43
44 /// Perform the per-event analysis
45 void analyze(const Event& event) {
46 const FinalState& fs = apply<FinalState>(event, "FS");
47 // total hadronic and muonic cross sections
48 map<long,int> nCount;
49 int ntotal(0);
50 for (const Particle& p : fs.particles()) {
51 nCount[p.pid()] += 1;
52 ++ntotal;
53 }
54 // unstable charm analysis
55 Particles ds = apply<UnstableParticles>(event, "UFS").particles(Cuts::abspid==431 or Cuts::abspid==433);
56 for(unsigned int ix=0;ix<ds.size();++ix) {
57 const Particle& p1 = ds[ix];
58 int id1 = abs(p1.pid());
59 // check fs
60 bool fs = true;
61 for (const Particle & child : p1.children()) {
62 if(child.pid()==p1.pid()) {
63 fs = false;
64 break;
65 }
66 }
67 if(!fs) continue;
68 // find the children
69 map<long,int> nRes = nCount;
70 int ncount = ntotal;
71 findChildren(p1,nRes,ncount);
72 bool matched=false;
73 int sign = p1.pid()/id1;
74 // loop over the other fs particles
75 for(unsigned int iy=ix+1;iy<ds.size();++iy) {
76 const Particle& p2 = ds[iy];
77 fs = true;
78 for (const Particle & child : p2.children()) {
79 if(child.pid()==p2.pid()) {
80 fs = false;
81 break;
82 }
83 }
84 if(!fs) continue;
85 if(p2.pid()/abs(p2.pid())==sign) continue;
86 int id2 = abs(p2.pid());
87 if(!p2.parents().empty() && p2.parents()[0].pid()==p1.pid())
88 continue;
89 map<long,int> nRes2 = nRes;
90 int ncount2 = ncount;
91 findChildren(p2,nRes2,ncount2);
92 if(ncount2!=0) continue;
93 matched=true;
94 for(auto const & val : nRes2) {
95 if(val.second!=0) {
96 matched = false;
97 break;
98 }
99 }
100 if(matched) {
101 if(id1==431 && id2==431) {
102 _c_DpDm->fill();
103 }
104 else if(id1==433 && id2==433) {
105 _c_DpSDmS->fill();
106 }
107 else if((id1==431 && id2==433) ||
108 (id1==433 && id2==431)) {
109 _c_DpDmS->fill();
110 }
111 break;
112 }
113 }
114 if(matched) break;
115 }
116 }
117
118
119 /// Normalise histograms etc., after the run
120 void finalize() {
121 double fact = crossSection()/ sumOfWeights()/nanobarn;
122 for(unsigned int iy=1;iy<4;++iy) {
123 double sigma = 0.0, error = 0.0;
124 if(iy==1) {
125 sigma = _c_DpDm->val()*fact;
126 error = _c_DpDm->err()*fact;
127 }
128 else if(iy==2) {
129 sigma = _c_DpDmS->val()*fact;
130 error = _c_DpDmS->err()*fact;
131 }
132 else if(iy==3) {
133 sigma = _c_DpSDmS->val()*fact;
134 error = _c_DpSDmS->err()*fact;
135 }
136 Estimate1DPtr mult;
137 book(mult, 1, 1, iy);
138 for (auto& b : mult->bins()) {
139 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
140 b.set(sigma, error);
141 }
142 }
143 }
144 }
145
146 /// @}
147
148
149 /// @name Histograms
150 /// @{
151 CounterPtr _c_DpDm,_c_DpDmS,_c_DpSDmS;
152 /// @}
153
154
155 };
156
157
158 RIVET_DECLARE_PLUGIN(BABAR_2010_I864027);
159
160}
|