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: (5.3, 5.3) GeV 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 e+ e- > eta(') gamma
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, 1, 1, 1);
26 book(_numEtaPrimeGamma, 1, 1, 2);
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("10.58"s);
78 else
79 _numEtaPrimeGamma->fill("10.58"s);
80 }
81 }
82 }
83
84 /// Normalise histograms etc., after the run
85 void finalize() {
86 double fact = crossSection()/ sumOfWeights() /femtobarn;
87 scale(_numEtaGamma,fact);
88 scale(_numEtaPrimeGamma,fact);
89 }
90
91 /// @}
92
93
94 /// @name Histograms
95 /// @{
96 BinnedHistoPtr<string> _numEtaGamma,_numEtaPrimeGamma;
97 /// @}
98
99
100 };
101
102
103 RIVET_DECLARE_PLUGIN(BABAR_2006_I716277);
104
105
106}
|