Rivet analyses referenceBABAR_2008_I765258Cross Section for $e^+e^-\to$ $K^+K^-\eta$, $K^+K^-\pi^0$ and $K^0_SK^\pm\pi^\mp$ from threshold to 4.6 GeVExperiment: BABAR (PEP-II) Inspire ID: 765258 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the cross section for $e^+e^-\to$ $K^+K^-\eta$, $K^+K^-\pi^0$ and $K^0_SK^\pm\pi^\mp$ via radiative return, including the identification of $\phi$ and $\eta$ mesons for energies from threshold to 4.6 GeV. Source code: BABAR_2008_I765258.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 BABAR_2008_I765258 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2008_I765258);
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 for(unsigned int ix=1;ix<6;++ix) {
29 stringstream ss;
30 ss << "TMP/n" << ix;
31 book(_nMeson[ix], ss.str());
32 }
33
34 }
35
36 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
37 for (const Particle &child : p.children()) {
38 if(child.children().empty()) {
39 nRes[child.pid()]-=1;
40 --ncount;
41 }
42 else
43 findChildren(child,nRes,ncount);
44 }
45 }
46
47 /// Perform the per-event analysis
48 void analyze(const Event& event) {
49 const FinalState& fs = apply<FinalState>(event, "FS");
50
51 map<long,int> nCount;
52 int ntotal(0);
53 for (const Particle& p : fs.particles()) {
54 nCount[p.pid()] += 1;
55 ++ntotal;
56 }
57 const FinalState& ufs = apply<FinalState>(event, "UFS");
58
59 for (const Particle& p : ufs.particles(Cuts::pid==221 or Cuts::pid==333)) {
60 if(p.children().empty()) continue;
61 map<long,int> nRes = nCount;
62 int ncount = ntotal;
63 findChildren(p,nRes,ncount);
64
65 if(p.pid()==221) {
66 bool matchedKK = false;
67 if(ncount==2) {
68 matchedKK = true;
69 for(auto const & val : nRes) {
70 if(abs(val.first)==321) {
71 if(val.second!=1) {
72 matchedKK = false;
73 break;
74 }
75 }
76 else if(val.second!=0) {
77 matchedKK = false;
78 break;
79 }
80 }
81 }
82 if(matchedKK) _nMeson[4]->fill();
83 for (const Particle& p2 : ufs.particles()) {
84 if(p2.pid()!=333) continue;
85 if(p2.parents()[0].isSame(p)) continue;
86 map<long,int> nResB = nRes;
87 int ncountB = ncount;
88 findChildren(p2,nResB,ncountB);
89 if(ncountB!=0) continue;
90 bool matched2 = true;
91 for(auto const & val : nResB) {
92 if(val.second!=0) {
93 matched2 = false;
94 break;
95 }
96 }
97 if(matched2) {
98 _nMeson[5]->fill();
99 break;
100 }
101 }
102 }
103 else if(p.pid()==333) {
104 if(ncount!=1) continue;
105 bool matched = true;
106 for(auto const & val : nRes) {
107 if(val.first==111) {
108 if(val.second!=1) {
109 matched = false;
110 break;
111 }
112 }
113 else if(val.second!=0) {
114 matched = false;
115 break;
116 }
117 }
118 if(matched)
119 _nMeson[3]->fill();
120 }
121 }
122
123
124 if(ntotal==3 && nCount[310]==1 &&
125 ((nCount[ 211]==1&&nCount[-321]==1)||
126 (nCount[-211]==1&&nCount[ 321]==1)))
127 _nMeson[1]->fill();
128 else if(ntotal==3 && nCount[321]==1 &&
129 nCount[-321]==1 && nCount[111]==1)
130 _nMeson[2]->fill();
131 }
132
133
134 /// Normalise histograms etc., after the run
135 void finalize() {
136 for(unsigned int ix=1;ix<6;++ix) {
137 double sigma = _nMeson[ix]->val();
138 double error = _nMeson[ix]->err();
139 sigma *= crossSection()/ sumOfWeights() /nanobarn;
140 error *= crossSection()/ sumOfWeights() /nanobarn;
141 Scatter2D temphisto(refData(ix, 1, 1));
142 Scatter2DPtr mult;
143 book(mult, ix, 1, 1);
144 for (size_t b = 0; b < temphisto.numPoints(); b++) {
145 const double x = temphisto.point(b).x();
146 pair<double,double> ex = temphisto.point(b).xErrs();
147 pair<double,double> ex2 = ex;
148 if(ex2.first ==0.) ex2. first=0.0001;
149 if(ex2.second==0.) ex2.second=0.0001;
150 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
151 mult->addPoint(x, sigma, ex, make_pair(error,error));
152 }
153 else {
154 mult->addPoint(x, 0., ex, make_pair(0.,.0));
155 }
156 }
157 }
158 }
159
160 //@}
161
162
163 /// @name Histograms
164 //@{
165 CounterPtr _nMeson[6];
166 //@}
167
168
169 };
170
171
172 // The hook for the plugin system
173 RIVET_DECLARE_PLUGIN(BABAR_2008_I765258);
174
175
176}
|