Rivet analyses referenceBESIII_2018_I1691798Cross Section for $K^0_SK^\pm\pi^\mp$ between 3.8 and 4.6 GeVExperiment: BESIII (BEPC II) Inspire ID: 1691798 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Measurement of the cross section for $K^0_SK^\pm\pi^\mp$ between 3.8 and 4.6 GeV. Source code: BESIII_2018_I1691798.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4
5namespace Rivet {
6
7
8 /// @brief Add a short analysis description here
9 class BESIII_2018_I1691798 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(BESIII_2018_I1691798);
14
15
16 /// @name Analysis methods
17 //@{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 // Initialise and register projections
22 declare(FinalState(), "FS");
23 book(_nKKpi, "/TMP/nKKpi" );
24 }
25
26
27 /// Perform the per-event analysis
28 void analyze(const Event& event) {
29 const FinalState& fs = apply<FinalState>(event, "FS");
30
31 map<long,int> nCount;
32 int ntotal(0);
33 for (const Particle& p : fs.particles()) {
34 nCount[p.pid()] += 1;
35 ++ntotal;
36 }
37
38 if(ntotal==3 && nCount[310]==1 &&
39 ((nCount[ 321]=1 && nCount[-211] ==1) ||
40 (nCount[-321]=1 && nCount[ 211] ==1)))
41 _nKKpi->fill();
42 }
43
44
45 /// Normalise histograms etc., after the run
46 void finalize() {
47 double sigma = _nKKpi->val();
48 double error = _nKKpi->err();
49 sigma *= crossSection()/ sumOfWeights() /picobarn;
50 error *= crossSection()/ sumOfWeights() /picobarn;
51 Scatter2D temphisto(refData(1, 1, 1));
52 Scatter2DPtr mult;
53 book(mult, 1, 1, 1);
54 for (size_t b = 0; b < temphisto.numPoints(); b++) {
55 const double x = temphisto.point(b).x();
56 pair<double,double> ex = temphisto.point(b).xErrs();
57 pair<double,double> ex2 = ex;
58 if(ex2.first ==0.) ex2. first=0.0001;
59 if(ex2.second==0.) ex2.second=0.0001;
60 if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) {
61 mult->addPoint(x, sigma, ex, make_pair(error,error));
62 }
63 else {
64 mult->addPoint(x, 0., ex, make_pair(0.,.0));
65 }
66 }
67 }
68
69 //@}
70
71
72 /// @name Histograms
73 //@{
74 CounterPtr _nKKpi;
75 //@}
76
77
78 };
79
80
81 // The hook for the plugin system
82 RIVET_DECLARE_PLUGIN(BESIII_2018_I1691798);
83
84
85}
|