Rivet analyses referenceBABAR_2014_I1287920Cross section for $e^+e^-\to$ $K_S^0K_L^0$, $K_S^0K_L^0\pi^+\pi^-$, $K_S^0K_S^0\pi^+\pi^-$, $K_S^0K_S^0K^+K^-$ between 1.06 and 2.2 GeVExperiment: BABAR (PEP-II) Inspire ID: 1287920 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the cross section for $e^+e^-\to$ $K_S^0K_L^0$, $K_S^0K_L^0\pi^+\pi^-$, $K_S^0K_S^0\pi^+\pi^-$, $K_S^0K_S^0K^+K^-$ via radiative return, including for energies between 1.06 and 2.2 GeV Source code: BABAR_2014_I1287920.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4
5
6namespace Rivet {
7
8
9 /// @brief e+e- > K0K0 (+pions)
10 class BABAR_2014_I1287920 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2014_I1287920);
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
26 // Book histograms
27 book(_nKSKL , "TMP/nKSKL");
28 book(_nKSKLpipi, "TMP/nKSKLpipi");
29 book(_nKSKSpipi, "TMP/nKSKSpipi");
30 book(_nKSKSKpKm, "TMP/nKSKSKpKm");
31 }
32
33
34 /// Perform the per-event analysis
35 void analyze(const Event& event) {
36 const FinalState& fs = apply<FinalState>(event, "FS");
37
38 map<long,int> nCount;
39 int ntotal(0);
40 for (const Particle& p : fs.particles()) {
41 nCount[p.pid()] += 1;
42 ++ntotal;
43 }
44
45 if(ntotal==2 && nCount[130]==1 && nCount[310]==1)
46 _nKSKL->fill();
47 else if( ntotal==4 && nCount[130]==1 && nCount[310]==1 && nCount[211]==1 && nCount[-211]==1)
48 _nKSKLpipi->fill();
49 else if( ntotal==4 && nCount[310]==2 && nCount[211]==1 && nCount[-211]==1 )
50 _nKSKSpipi->fill();
51 else if( ntotal==4 && nCount[310]==2 && nCount[321]==1 && nCount[-321]==1)
52 _nKSKSKpKm->fill();
53
54 }
55
56
57 /// Normalise histograms etc., after the run
58 void finalize() {
59
60 for(unsigned int ix=9;ix<13;++ix) {
61 double sigma = 0., error = 0.;
62 if(ix==9) {
63 sigma = _nKSKL->val();
64 error = _nKSKL->err();
65 }
66 else if(ix==10) {
67 sigma = _nKSKLpipi->val();
68 error = _nKSKLpipi->err();
69 }
70 else if(ix==11) {
71 sigma = _nKSKSpipi->val();
72 error = _nKSKSpipi->err();
73 }
74 else if(ix==12) {
75 sigma = _nKSKSKpKm->val();
76 error = _nKSKSKpKm->err();
77 }
78 sigma *= crossSection()/ sumOfWeights() /nanobarn;
79 error *= crossSection()/ sumOfWeights() /nanobarn;
80 Scatter2D temphisto(refData(ix, 1, 1));
81 Scatter2DPtr mult;
82 book(mult, ix, 1, 1);
83 for (size_t b = 0; b < temphisto.numPoints(); b++) {
84 const double x = temphisto.point(b).x();
85 pair<double,double> ex = temphisto.point(b).xErrs();
86 pair<double,double> ex2 = ex;
87 if(ex2.first ==0.) ex2. first=0.0001;
88 if(ex2.second==0.) ex2.second=0.0001;
89 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
90 mult->addPoint(x, sigma, ex, make_pair(error,error));
91 }
92 else {
93 mult->addPoint(x, 0., ex, make_pair(0.,.0));
94 }
95 }
96 }
97 }
98
99 //@}
100
101
102 /// @name Histograms
103 //@{
104 CounterPtr _nKSKL,_nKSKLpipi,_nKSKSpipi,_nKSKSKpKm;
105 //@}
106
107
108 };
109
110
111 // The hook for the plugin system
112 RIVET_DECLARE_PLUGIN(BABAR_2014_I1287920);
113
114
115}
|