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