Rivet analyses referenceBABAR_2009_I821653e+e−→e+e−π0 via intermediate photons at 10.58 GeVExperiment: BABAR (PEP-II) Inspire ID: 821653 Status: VALIDATED Authors:
Beam energies: (5.3, 5.3) GeV Run details:
Measurement of the cross sections for the production of π0 in photon-photon collisions, i.e. e+e−→γγe+e− followed by γγ→π0, by the Babar experiment at 10.58 GeV Source code: BABAR_2009_I821653.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/FinalState.hh"
4#include "Rivet/Projections/UnstableParticles.hh"
5#include "Rivet/Projections/Beam.hh"
6
7namespace Rivet {
8
9
10 /// @brief e+e- > e+e- pi0
11 class BABAR_2009_I821653 : public Analysis {
12 public:
13
14 /// Constructor
15 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2009_I821653);
16
17
18 /// @name Analysis methods
19 ///@{
20
21 /// Book histograms and initialise projections before the run
22 void init() {
23
24 // Initialise and register projections
25 declare(Beam(), "Beams");
26 declare(FinalState(),"FS");
27 declare(UnstableParticles(), "UFS");
28 // book the histograms
29 book(_h_pi0,1,1,1);
30
31 }
32
33 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
34 for (const Particle &child : p.children()) {
35 if (child.children().empty()) {
36 --nRes[child.pid()];
37 --ncount;
38 } else {
39 findChildren(child,nRes,ncount);
40 }
41 }
42 }
43
44 bool findScattered(Particle beam, double& q2) {
45 bool found = false;
46 Particle scat = beam;
47 while (!scat.children().empty()) {
48 found = false;
49 for (const Particle & p : scat.children()) {
50 if (p.pid()==scat.pid()) {
51 scat=p;
52 found=true;
53 break;
54 }
55 }
56 if (!found) break;
57 }
58 if (!found) return false;
59 q2 = -(beam.momentum() - scat.momentum()).mass2();
60 return true;
61 }
62
63 /// Perform the per-event analysis
64 void analyze(const Event& event) {
65 // find scattered leptons and calc Q2
66 const Beam& beams = apply<Beam>(event, "Beams");
67 double q12 = -1, q22 = -1;
68 if (!findScattered(beams.beams().first, q12)) vetoEvent;
69 if (!findScattered(beams.beams().second, q22)) vetoEvent;
70 double scale = max(q12,q22);
71 // check the final state
72 const FinalState & fs = apply<FinalState>(event, "FS");
73 map<long,int> nCount;
74 int ntotal(0);
75 for (const Particle& p : fs.particles()) {
76 nCount[p.pid()] += 1;
77 ++ntotal;
78 }
79 // find the meson
80 const FinalState& ufs = apply<FinalState>(event, "UFS");
81 for (const Particle& p : ufs.particles(Cuts::pid==111)) {
82 if(p.children().empty()) continue;
83 map<long,int> nRes = nCount;
84 int ncount = ntotal;
85 findChildren(p,nRes,ncount);
86 bool matched = true;
87 for(auto const & val : nRes) {
88 if(abs(val.first)==11) {
89 if(val.second!=1) {
90 matched = false;
91 break;
92 }
93 }
94 else if(val.second!=0) {
95 matched = false;
96 break;
97 }
98 }
99 if (matched) {
100 _h_pi0->fill(scale);
101 break;
102 }
103 }
104 }
105
106
107 /// Normalise histograms etc., after the run
108 void finalize() {
109 // normalize the cross sections
110 scale(_h_pi0, crossSection()/femtobarn/sumW());
111 }
112
113 ///@}
114
115
116 /// @name Histograms
117 ///@{
118 Histo1DPtr _h_pi0;
119 ///@}
120
121
122 };
123
124
125 RIVET_DECLARE_PLUGIN(BABAR_2009_I821653);
126
127}
|