Rivet analyses referenceBABAR_2017_I1591716Cross section for $e^+e^-\to K_S^0K^\pm\pi^\mp$ with $\pi^0$, $\eta$ between threshold and 4 GeVExperiment: BABAR (PEP-II) Inspire ID: 1591716 Status: VALIDATED NOHEPDATA Authors:
Beam energies: ANY Run details:
Cross section for $e^+e^-\to K_S^0K^\pm\pi^\mp$ with $\pi^0$, $\eta$ between threshold and 4 GeV using radiative events. Source code: BABAR_2017_I1591716.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_I1591716 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2017_I1591716);
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(_nKKpipi, "TMP/KKpipi");
28 book(_nKKpieta, "TMP/KKpieta");
29
30 }
31
32 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
33 for (const Particle &child : p.children()) {
34 if(child.children().empty()) {
35 nRes[child.pid()]-=1;
36 --ncount;
37 }
38 else
39 findChildren(child,nRes,ncount);
40 }
41 }
42
43
44 /// Perform the per-event analysis
45 void analyze(const Event& event) {
46 const FinalState& fs = apply<FinalState>(event, "FS");
47 map<long,int> nCount;
48 int ntotal(0);
49 for (const Particle& p : fs.particles()) {
50 nCount[p.pid()] += 1;
51 ++ntotal;
52 }
53 // stable histos
54 if( ntotal == 4 && nCount[310] == 1 && nCount[111] == 1 &&
55 ( (nCount[ 321]==1 && nCount[-211]==1) ||
56 (nCount[-321]==1 && nCount[ 211]==1)))
57 _nKKpipi->fill();
58
59 // unstable particles
60 const FinalState& ufs = apply<FinalState>(event, "UFS");
61 for (const Particle& p : ufs.particles()) {
62 if(p.children().empty()) continue;
63 if(p.pid()!=221) continue;
64 map<long,int> nRes=nCount;
65 int ncount = ntotal;
66 findChildren(p,nRes,ncount);
67 bool matched = true;
68 if(p.pid()==221 && ncount==3) {
69 for(auto const & val : nRes) {
70 if(val.first==310 || val.first==111) {
71 if(val.second!=1) {
72 matched = false;
73 break;
74 }
75 }
76 else if(abs(val.first)==321 || abs(val.first)==211)
77 continue;
78 else if(val.second!=0) {
79 matched = false;
80 break;
81 }
82 }
83 if(matched) {
84 if((nRes[321]==1 && nRes[-211]==1 && nRes[-321]==0 && nRes[211]==0) ||
85 (nRes[321]==0 && nRes[-211]==0 && nRes[-321]==1 && nRes[211]==1))
86 _nKKpieta->fill();
87 }
88 }
89 }
90 }
91
92
93 /// Normalise histograms etc., after the run
94 void finalize() {
95 for(unsigned int ix=1;ix<3;++ix) {
96 double sigma = 0., error = 0.;
97 if(ix==1) {
98 sigma = _nKKpipi->val();
99 error = _nKKpipi->err();
100 }
101 else if (ix==2) {
102 sigma = _nKKpieta->val();
103 error = _nKKpieta->err();
104 }
105
106 sigma *= crossSection()/ sumOfWeights() /nanobarn;
107 error *= crossSection()/ sumOfWeights() /nanobarn;
108
109 Estimate1DPtr mult;
110 book(mult, ix, 1, 1);
111 for (auto& b : mult->bins()) {
112 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
113 b.set(sigma, error);
114 }
115 }
116 }
117 }
118
119 /// @}
120
121
122 /// @name Histograms
123 /// @{
124 CounterPtr _nKKpipi,_nKKpieta;
125 /// @}
126
127
128 };
129
130
131 RIVET_DECLARE_PLUGIN(BABAR_2017_I1591716);
132
133
134}
|