Rivet analyses referenceBABAR_2018_I1647139Cross section for $e^+e^-\to\eta\pi^+\pi^-$ between 1.2 and 3.5 GeVExperiment: BABAR (PEP-II) Inspire ID: 1647139 Status: VALIDATED NOHEPDATA Authors:
Beam energies: ANY Run details:
Measurement of the cross section for $e^+e^-\to\eta\pi^+\pi^-$ at energies between 1.2 and 3.5 GeV using radiative events. Source code: BABAR_2018_I1647139.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_2018_I1647139 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2018_I1647139);
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 book(_numEtaPiPi, "TMP/EtaPiPi");
27
28 }
29
30
31 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
32 for (const Particle &child : p.children()) {
33 if(child.children().empty()) {
34 --nRes[child.pid()];
35 --ncount;
36 }
37 else
38 findChildren(child,nRes,ncount);
39 }
40 }
41
42 /// Perform the per-event analysis
43 void analyze(const Event& event) {
44 const FinalState& fs = apply<FinalState>(event, "FS");
45
46 map<long,int> nCount;
47 int ntotal(0);
48 for (const Particle& p : fs.particles()) {
49 nCount[p.pid()] += 1;
50 ++ntotal;
51 }
52 const FinalState& ufs = apply<FinalState>(event, "UFS");
53 for (const Particle& p : ufs.particles()) {
54 if(p.children().empty()) continue;
55 // find the omega
56 if(p.pid()==221) {
57 map<long,int> nRes = nCount;
58 int ncount = ntotal;
59 findChildren(p,nRes,ncount);
60 // eta pi+pi-
61 if(ncount!=2) continue;
62 bool matched = true;
63 for(auto const & val : nRes) {
64 if(abs(val.first)==211) {
65 if(val.second !=1) {
66 matched = false;
67 break;
68 }
69 }
70 else if(val.second!=0) {
71 matched = false;
72 break;
73 }
74 }
75 if(matched)
76 _numEtaPiPi->fill();
77 }
78 }
79 }
80
81
82 /// Normalise histograms etc., after the run
83 void finalize() {
84
85 double sigma = _numEtaPiPi->val();
86 double error = _numEtaPiPi->err();
87 sigma *= crossSection()/ sumOfWeights() /nanobarn;
88 error *= crossSection()/ sumOfWeights() /nanobarn;
89 Estimate1DPtr mult;
90 book(mult, 1, 1, 1);
91 for (auto& b : mult->bins()) {
92 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
93 b.set(sigma, error);
94 }
95 }
96 }
97
98 /// @}
99
100
101 /// @name Histograms
102 /// @{
103 CounterPtr _numEtaPiPi;
104 /// @}
105
106
107 };
108
109
110 RIVET_DECLARE_PLUGIN(BABAR_2018_I1647139);
111
112
113}
|