Rivet analyses referenceBABAR_2010_I844288Mass distribution in $e^+e^-\to e^+e^-D\bar{D}$ via $\gamma\gamma\to D\bar{D}$Experiment: BABAR (PEP-II) Inspire ID: 844288 Status: VALIDATED NOHEPDATA Authors:
Beam energies: (3.5, 8.0) GeV Run details:
Measurement of the $D\bar{D}$ mass distribution in $e^+e^-\to e^+e^-D\bar{D}$ via $\gamma\gamma\to D\bar{D}$. the data were read from the plots in the paper, but have been corrected for efficiency. The angluar distribution for the resonance is also measured. We assume the PDG code for the resonant particle is 100445, i.e. $\chi_{c2}(2P)$, although this can be chaged using the PID option. Source code: BABAR_2010_I844288.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 gamma gamma -> D Dbar
11 class BABAR_2010_I844288 : public Analysis {
12 public:
13
14 /// Constructor
15 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2010_I844288);
16
17
18 /// @name Analysis methods
19 /// @{
20
21 /// Book histograms and initialise projections before the run
22 void init() {
23 // set the PDG code
24 _pid = getOption<double>("PID", 100445);
25 // Initialise and register projections
26 declare(Beam(), "Beams");
27 declare(FinalState(),"FS");
28 declare(UnstableParticles(Cuts::abspid==411 ||
29 Cuts::abspid==421), "UFS");
30 // histograms
31 for (unsigned int ix=0;ix<2;++ix) {
32 book(_h[ix],1+ix,1,1);
33 }
34 }
35
36 void findChildren(const Particle & p,map<long,int> & nRes, int &ncount) {
37 for (const Particle &child : p.children()) {
38 if (child.children().empty()) {
39 --nRes[child.pid()];
40 --ncount;
41 } else {
42 findChildren(child,nRes,ncount);
43 }
44 }
45 }
46
47 bool findScattered(Particle beam, double& q2) {
48 bool found = false;
49 Particle scat = beam;
50 while (!scat.children().empty()) {
51 found = false;
52 for (const Particle & p : scat.children()) {
53 if (p.pid()==scat.pid()) {
54 scat=p;
55 found=true;
56 break;
57 }
58 }
59 if (!found) break;
60 }
61 if (!found) return false;
62 q2 = -(beam.momentum() - scat.momentum()).mass2();
63 return true;
64 }
65
66 /// Perform the per-event analysis
67 void analyze(const Event& event) {
68 // find scattered leptons and calc Q2
69 const Beam& beams = apply<Beam>(event, "Beams");
70 double q12 = -1, q22 = -1;
71 if (!findScattered(beams.beams().first, q12)) vetoEvent;
72 if (!findScattered(beams.beams().second, q22)) vetoEvent;
73 // check the final state
74 const FinalState & fs = apply<FinalState>(event, "FS");
75 map<long,int> nCount;
76 int ntotal(0);
77 for (const Particle& p : fs.particles()) {
78 nCount[p.pid()] += 1;
79 ++ntotal;
80 }
81 // find the meson
82 const FinalState& ufs = apply<FinalState>(event, "UFS");
83 for (const Particle& p1 : ufs.particles()) {
84 if(p1.children().empty() || p1.pid()<0) continue;
85 bool matched=false;
86 map<long,int> nRes = nCount;
87 int ncount = ntotal;
88 findChildren(p1,nRes,ncount);
89 for (const Particle& p2 : ufs.particles(Cuts::pid==-p1.pid())) {
90 map<long,int> nRes2 = nRes;
91 int ncount2 = ncount;
92 findChildren(p2,nRes2,ncount2);
93 matched = true;
94 for (const auto& val : nRes2) {
95 if (abs(val.first)==11) {
96 if (val.second!=1) {
97 matched = false;
98 break;
99 }
100 }
101 else if(val.second!=0) {
102 matched = false;
103 break;
104 }
105 }
106 if (matched) {
107 FourMomentum pDD = p1.momentum()+p2.momentum();
108 _h[0]->fill(pDD.mass());
109 if(p1.parents()[0].pid()==_pid && p2.parents()[0].pid()==_pid) {
110 Vector3 axis = pDD.p3().unit();
111 LorentzTransform boost = LorentzTransform::mkFrameTransformFromBeta(pDD.betaVec());
112 double cTheta = abs(axis.dot(boost.transform(p1).p3().unit()));
113 _h[1]->fill(cTheta);
114 }
115 break;
116 }
117 }
118 if (matched) break;
119 }
120 }
121
122 /// Normalise histograms etc., after the run
123 void finalize() {
124 normalize(_h, 1.0, false);
125 }
126
127 /// @}
128
129
130 /// @name Histograms
131 /// @{
132 int _pid;
133 Histo1DPtr _h[2];
134 /// @}
135
136
137 };
138
139
140 RIVET_DECLARE_PLUGIN(BABAR_2010_I844288);
141
142}
|