Rivet analyses referenceCLEOC_2005_I693873Cross section for $e^+e^-\to \pi^+\pi^-$, $K^+K^-$ and $p\bar{p}$ at 3.671 GeVExperiment: CLEOC (CESR) Inspire ID: 693873 Status: VALIDATED Authors:
Beam energies: (1.8, 1.8) GeV Run details:
Measurement of the cross section for $e^+e^-\to \pi^+\pi^-$, $K^+K^-$ and $p\bar{p}$ at 3.671 GeV by CLEO-c. Source code: CLEOC_2005_I693873.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 CLEOC_2005_I693873 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(CLEOC_2005_I693873);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21
22 // Initialise and register projections
23 declare(FinalState(), "FS");
24
25 // Book histograms
26 book(_npipi, "TMP/npipi");
27 book(_nKK, "TMP/nKK");
28 book(_nppbar, "TMP/nppbar");
29 }
30
31
32 /// Perform the per-event analysis
33 void analyze(const Event& event) {
34
35 const FinalState& fs = apply<FinalState>(event, "FS");
36
37 map<long,int> nCount;
38 int ntotal(0);
39 for (const Particle& p : fs.particles()) {
40 nCount[p.pid()] += 1;
41 ++ntotal;
42 }
43 if(ntotal!=2) vetoEvent;
44
45 if(nCount[211]==1 && nCount[-211]==1)
46 _npipi->fill();
47 else if(nCount[321]==1 && nCount[-321]==1)
48 _nKK->fill();
49 else if(nCount[2212]==1 && nCount[-2212]==1)
50 _nppbar->fill();
51 }
52
53
54 /// Normalise histograms etc., after the run
55 void finalize() {
56
57 for(unsigned int ix=1;ix<4;++ix) {
58 double sigma = 0., error = 0.;
59 if (ix==1) {
60 sigma = _npipi->val();
61 error = _npipi->err();
62 }
63 else if (ix==2) {
64 sigma = _nKK->val();
65 error = _nKK->err();
66 }
67 else if (ix==3) {
68 sigma = _nppbar->val();
69 error = _nppbar->err();
70 }
71 sigma *= crossSection()/ sumOfWeights() /picobarn;
72 error *= crossSection()/ sumOfWeights() /picobarn;
73 Estimate1DPtr mult;
74 book(mult, 1, 1, ix);
75 for (auto& b : mult->bins()) {
76 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
77 b.set(sigma, error);
78 }
79 }
80 }
81
82 }
83
84 /// @}
85
86
87 /// @name Histograms
88 /// @{
89 CounterPtr _npipi,_nKK,_nppbar;
90 /// @}
91
92
93 };
94
95
96 RIVET_DECLARE_PLUGIN(CLEOC_2005_I693873);
97
98
99}
|