Rivet analyses referenceCMD2_2005_I658856Cross section for $e^+e^-\to\pi\gamma$ and $\eta\gamma$ for energies between 600 MeV and 1380 MeVExperiment: CMD2 (VEPP-2M) Inspire ID: 658856 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Cross section for $e^+e^-\to\pi\gamma$ and $\eta\gamma$ for energies between 600 MeV and 1380 MeV Source code: CMD2_2005_I658856.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 CMD2_2005_I658856 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(CMD2_2005_I658856);
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(_numEtaGamma, "TMP/EtaGamma");
27 book(_numPi0Gamma, "TMP/Pi0Gamma");
28 }
29
30 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
31 for (const Particle &child : p.children()) {
32 if(child.children().empty()) {
33 --nRes[child.pid()];
34 --ncount;
35 }
36 else
37 findChildren(child,nRes,ncount);
38 }
39 }
40
41 /// Perform the per-event analysis
42 void analyze(const Event& event) {
43
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 if(ntotal==2 && nCount[22]==1 && nCount[111]==1)
53 _numPi0Gamma->fill();
54
55
56 const FinalState& ufs = apply<FinalState>(event, "UFS");
57 for (const Particle& p : ufs.particles()) {
58 if(p.children().empty()) continue;
59 // find the omega
60 if(p.pid()==221) {
61 map<long,int> nRes = nCount;
62 int ncount = ntotal;
63 findChildren(p,nRes,ncount);
64 // eta pi+pi-
65 if(ncount!=1) continue;
66 bool matched = true;
67 for(auto const & val : nRes) {
68 if(val.first==22) {
69 if(val.second !=1) {
70 matched = false;
71 break;
72 }
73 }
74 else if(val.second!=0) {
75 matched = false;
76 break;
77 }
78 }
79 if(matched)
80 _numEtaGamma->fill();
81 }
82 }
83
84 }
85
86
87 /// Normalise histograms etc., after the run
88 void finalize() {
89
90 for(unsigned int ix=1;ix<3;++ix) {
91 Scatter2D temphisto(refData(ix, 1, 1));
92 double sigma,error;
93 if(ix==1) {
94 sigma = _numEtaGamma->val();
95 error = _numEtaGamma->err();
96 }
97 else {
98 sigma = _numPi0Gamma->val();
99 error = _numPi0Gamma->err();
100 }
101 sigma *= crossSection()/ sumOfWeights() /nanobarn;
102 error *= crossSection()/ sumOfWeights() /nanobarn;
103 Scatter2DPtr mult;
104 book(mult, ix, 1, 1);
105 for (size_t b = 0; b < temphisto.numPoints(); b++) {
106 const double x = temphisto.point(b).x();
107 pair<double,double> ex = temphisto.point(b).xErrs();
108 pair<double,double> ex2 = ex;
109 if(ex2.first ==0.) ex2. first=0.0001;
110 if(ex2.second==0.) ex2.second=0.0001;
111 if (inRange(sqrtS()/MeV, x-ex2.first, x+ex2.second)) {
112 mult->addPoint(x, sigma, ex, make_pair(error,error));
113 }
114 else {
115 mult->addPoint(x, 0., ex, make_pair(0.,.0));
116 }
117 }
118 }
119 }
120
121 //@}
122
123
124 /// @name Histograms
125 //@{
126 CounterPtr _numEtaGamma,_numPi0Gamma;
127 //@}
128
129
130 };
131
132
133 // The hook for the plugin system
134 RIVET_DECLARE_PLUGIN(CMD2_2005_I658856);
135
136
137}
|