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 for (const Particle& p : ufs.particles(Cuts::pid==221 or Cuts::pid==333)) {
59 if(p.children().empty()) continue;
60 map<long,int> nRes = nCount;
61 int ncount = ntotal;
62 findChildren(p,nRes,ncount);
63
64 if(p.pid()==221) {
65 bool matchedKK = false;
66 if(ncount==2) {
67 matchedKK = true;
68 for(auto const & val : nRes) {
69 if(abs(val.first)==321) {
70 if(val.second!=1) {
71 matchedKK = false;
72 break;
73 }
74 }
75 else if(val.second!=0) {
76 matchedKK = false;
77 break;
78 }
79 }
80 }
81 if(matchedKK) _nMeson[4]->fill();
82 for (const Particle& p2 : ufs.particles()) {
83 if(p2.pid()!=333) continue;
84 if(p2.parents()[0].isSame(p)) continue;
85 map<long,int> nResB = nRes;
86 int ncountB = ncount;
87 findChildren(p2,nResB,ncountB);
88 if(ncountB!=0) continue;
89 bool matched2 = true;
90 for(auto const & val : nResB) {
91 if(val.second!=0) {
92 matched2 = false;
93 break;
94 }
95 }
96 if(matched2) {
97 _nMeson[5]->fill();
98 break;
99 }
100 }
101 }
102 else if(p.pid()==333) {
103 if(ncount!=1) continue;
104 bool matched = true;
105 for(auto const & val : nRes) {
106 if(val.first==111) {
107 if(val.second!=1) {
108 matched = false;
109 break;
110 }
111 }
112 else if(val.second!=0) {
113 matched = false;
114 break;
115 }
116 }
117 if(matched)
118 _nMeson[3]->fill();
119 }
120 }
121
122
123 if(ntotal==3 && nCount[310]==1 &&
124 ((nCount[ 211]==1&&nCount[-321]==1)||
125 (nCount[-211]==1&&nCount[ 321]==1)))
126 _nMeson[1]->fill();
127 else if(ntotal==3 && nCount[321]==1 &&
128 nCount[-321]==1 && nCount[111]==1)
129 _nMeson[2]->fill();
130 }
131
132
133 /// Normalise histograms etc., after the run
134 void finalize() {
135 for(unsigned int ix=1;ix<6;++ix) {
136 double sigma = _nMeson[ix]->val();
137 double error = _nMeson[ix]->err();
138 sigma *= crossSection()/ sumOfWeights() /nanobarn;
139 error *= crossSection()/ sumOfWeights() /nanobarn;
140 Estimate1DPtr mult;
141 book(mult, ix, 1, 1);
142 for (auto& b : mult->bins()) {
143 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
144 b.set(sigma, error);
145 }
146 }
147 }
148 }
149
150 /// @}
151
152
153 /// @name Histograms
154 /// @{
155 CounterPtr _nMeson[6];
156 /// @}
157
158
159 };
160
161
162 RIVET_DECLARE_PLUGIN(BABAR_2008_I765258);
163
164}
|