Rivet analyses referenceBABAR_2017_I1511276Cross section for $e^+e^-\to K_S^0K_L^0$ with $\pi^0$, $\eta$ and $\pi^0\pi^0$ between threshold and 4 GeVExperiment: BABAR (PEP-II) Inspire ID: 1511276 Status: VALIDATED NOHEPDATA Authors:
Beam energies: ANY Run details:
Cross section for $e^+e^-\to K_S^0K_L^0$ with $\pi^0$, $\eta$ and $\pi^0\pi^0$ between threshold and 4 GeV using radiative events. Source code: BABAR_2017_I1511276.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_2017_I1511276 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2017_I1511276);
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(_nKKpi , "TMP/KKpi");
28 book(_nPhipi , "TMP/Phipi");
29 book(_nKKeta , "TMP/KKeta");
30 book(_nKKpipi, "TMP/KKpipi");
31
32 }
33
34 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
35 for(const Particle &child : p.children()) {
36 if(child.children().empty()) {
37 nRes[child.pid()]-=1;
38 --ncount;
39 }
40 else
41 findChildren(child,nRes,ncount);
42 }
43 }
44
45 /// Perform the per-event analysis
46 void analyze(const Event& event) {
47 const FinalState& fs = apply<FinalState>(event, "FS");
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 // stable histos
55 if( ntotal == 3 && nCount[130] == 1 &&
56 nCount[310] == 1 && nCount[111] == 1)
57 _nKKpi->fill();
58 else if( ntotal == 4 && nCount[130] == 1 &&
59 nCount[310] == 1 && nCount[111] == 2)
60 _nKKpipi->fill();
61 // unstable particles
62 const FinalState& ufs = apply<FinalState>(event, "UFS");
63 for (const Particle& p : ufs.particles()) {
64 if(p.children().empty()) continue;
65 if(p.pid()!=333 && p.pid()!=221) continue;
66 map<long,int> nRes=nCount;
67 int ncount = ntotal;
68 findChildren(p,nRes,ncount);
69 bool matched = true;
70 if(p.pid()==333 && ncount==1) {
71 for(auto const & val : nRes) {
72 if(val.first==111) {
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)
84 _nPhipi->fill();
85 }
86 else if(p.pid()==221 && ncount==2) {
87 for(auto const & val : nRes) {
88 if(val.first==130 || val.first==310) {
89 if(val.second!=1) {
90 matched = false;
91 break;
92 }
93 }
94 else if(val.second!=0) {
95 matched = false;
96 break;
97 }
98 }
99 if(matched)
100 _nKKeta->fill();
101 }
102 }
103 }
104
105
106 /// Normalise histograms etc., after the run
107 void finalize() {
108 for(unsigned int ix=1;ix<5;++ix) {
109 double sigma = 0., error = 0.;
110 if(ix==1) {
111 sigma = _nKKpi->val();
112 error = _nKKpi->err();
113 }
114 else if (ix==2) {
115 sigma = _nPhipi->val();
116 error = _nPhipi->err();
117 }
118 else if (ix==3) {
119 sigma = _nKKeta->val();
120 error = _nKKeta->err();
121 }
122 else if (ix==4) {
123 sigma = _nKKpipi->val();
124 error = _nKKpipi->err();
125 }
126
127 sigma *= crossSection()/ sumOfWeights() /nanobarn;
128 error *= crossSection()/ sumOfWeights() /nanobarn;
129
130 Estimate1DPtr mult;
131 book(mult, ix, 1, 1);
132 for (auto& b : mult->bins()) {
133 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
134 b.set(sigma, error);
135 }
136 }
137 }
138 }
139
140 /// @}
141
142
143 /// @name Histograms
144 /// @{
145 CounterPtr _nKKpi,_nPhipi,_nKKeta,_nKKpipi;
146 /// @}
147
148
149 };
150
151
152 RIVET_DECLARE_PLUGIN(BABAR_2017_I1511276);
153
154
155}
|