Rivet analyses referenceBABAR_2006_I716277Cross section for $e^+e^-\to\eta\gamma$ and $\eta^\prime\gamma$ at 10.58 GeVExperiment: BABAR (PEP-II) Inspire ID: 716277 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Cross section for $e^+e^-\to\eta\gamma$ and $\eta^\prime\gamma$ at 10.58 GeV Source code: BABAR_2006_I716277.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_2006_I716277 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2006_I716277);
15
16
17 /// @name Analysis methods
18 /// @{
19
20 /// Book histograms and initialise projections before the run
21 void init() {
22 // Initialise and register projections
23 declare(FinalState(), "FS");
24 declare(UnstableParticles(), "UFS");
25 book(_numEtaGamma, "TMP/EtaGamma");
26 book(_numEtaPrimeGamma, "TMP/EtaPrimeGamma");
27 }
28
29 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
30 for(const Particle &child: p.children()) {
31 if(child.children().empty()) {
32 --nRes[child.pid()];
33 --ncount;
34 }
35 else
36 findChildren(child,nRes,ncount);
37 }
38 }
39
40 /// Perform the per-event analysis
41 void analyze(const Event& event) {
42
43 const FinalState& fs = apply<FinalState>(event, "FS");
44
45 map<long,int> nCount;
46 int ntotal(0);
47 for (const Particle& p : fs.particles()) {
48 nCount[p.pid()] += 1;
49 ++ntotal;
50 }
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 eta/eta prime
56 if(p.pid()!=221 && p.pid()!=331) continue;
57 map<long,int> nRes = nCount;
58 int ncount = ntotal;
59 findChildren(p,nRes,ncount);
60 // eta pi+pi-
61 if(ncount!=1) continue;
62 bool matched = true;
63 for(auto const & val : nRes) {
64 if(val.first==22) {
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 if(p.pid()==221)
77 _numEtaGamma->fill();
78 else
79 _numEtaPrimeGamma->fill();
80 }
81 }
82 }
83
84 /// Normalise histograms etc., after the run
85 void finalize() {
86 for (unsigned int ix=1;ix<3;++ix) {
87 double sigma,error;
88 if(ix==1) {
89 sigma = _numEtaGamma->val();
90 error = _numEtaGamma->err();
91 }
92 else {
93 sigma = _numEtaPrimeGamma->val();
94 error = _numEtaPrimeGamma->err();
95 }
96 sigma *= crossSection()/ sumOfWeights() /femtobarn;
97 error *= crossSection()/ sumOfWeights() /femtobarn;
98 Estimate1DPtr mult;
99 book(mult, 1, 1, ix);
100 for (auto& b : mult->bins()) {
101 if (inRange(sqrtS()/GeV, b.xMin(), b.xMax())) {
102 b.set(sigma, error);
103 }
104 }
105 }
106 }
107
108 /// @}
109
110
111 /// @name Histograms
112 /// @{
113 CounterPtr _numEtaGamma,_numEtaPrimeGamma;
114 /// @}
115
116
117 };
118
119
120 RIVET_DECLARE_PLUGIN(BABAR_2006_I716277);
121
122
123}
|