Rivet analyses referenceBABAR_2012_I946659Mass distributions in $B\to D^{(*)}p\bar{p}$ + pionsExperiment: BABAR (PEP-II) Inspire ID: 946659 Status: VALIDATED NOHEPDATA Authors:
Beam energies: ANY Run details:
Measurements of mass distributions in Mass distributions in $B\to D^{(*)}p\bar{p}$ + pions. The data were read from the plots in the paper but are background subtracted and efficiency corrected. Source code: BABAR_2012_I946659.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4#include "Rivet/Projections/DecayedParticles.hh"
5
6namespace Rivet {
7
8
9 /// @brief B -> p pbar + pions
10 class BABAR_2012_I946659 : public Analysis {
11 public:
12
13 /// Constructor
14 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2012_I946659);
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 UnstableParticles ufs = UnstableParticles(Cuts::abspid==511 or
24 Cuts::abspid==521);
25 declare(ufs, "UFS");
26 DecayedParticles BB(ufs);
27 BB.addStable( 411);
28 BB.addStable(-411);
29 BB.addStable( 421);
30 BB.addStable(-421);
31 BB.addStable( 413);
32 BB.addStable(-413);
33 BB.addStable( 423);
34 BB.addStable(-423);
35 declare(BB, "BB");
36 // histograms
37 for(unsigned int iy=0;iy<4;++iy) {
38 for(unsigned int ix=0;ix<4;++ix) {
39 if(ix<2) book(_h[ix][iy],1,1+ix,1+iy);
40 book(_h[ix+2][iy],2,1+ix,1+iy);
41 book(_h[ix+6][iy],3,1+ix,1+iy);
42 }
43 }
44 book(_nB[0],"/TMP/nB0");
45 book(_nB[1],"/TMP/nBP");
46 }
47
48
49 /// Perform the per-event analysis
50 void analyze(const Event& event) {
51 static const map<PdgId,unsigned int> & mode1 = { { 421,1},{ 2212,1}, {-2212,1}};
52 static const map<PdgId,unsigned int> & mode1CC = { {-421,1},{ 2212,1}, {-2212,1}};
53 static const map<PdgId,unsigned int> & mode2 = { { 423,1},{ 2212,1}, {-2212,1}};
54 static const map<PdgId,unsigned int> & mode2CC = { {-423,1},{ 2212,1}, {-2212,1}};
55 static const map<PdgId,unsigned int> & mode3 = { { 411,1},{ 2212,1}, {-2212,1}, {-211,1}};
56 static const map<PdgId,unsigned int> & mode3CC = { {-411,1},{ 2212,1}, {-2212,1}, { 211,1}};
57 static const map<PdgId,unsigned int> & mode4 = { { 413,1},{ 2212,1}, {-2212,1}, {-211,1}};
58 static const map<PdgId,unsigned int> & mode4CC = { {-413,1},{ 2212,1}, {-2212,1}, { 211,1}};
59 static const map<PdgId,unsigned int> & mode5 = { { 421,1},{ 2212,1}, {-2212,1}, {-211,1}};
60 static const map<PdgId,unsigned int> & mode5CC = { {-421,1},{ 2212,1}, {-2212,1}, { 211,1}};
61 static const map<PdgId,unsigned int> & mode6 = { { 423,1},{ 2212,1}, {-2212,1}, {-211,1}};
62 static const map<PdgId,unsigned int> & mode6CC = { {-423,1},{ 2212,1}, {-2212,1}, { 211,1}};
63 static const map<PdgId,unsigned int> & mode7 = { { 421,1},{ 2212,1}, {-2212,1}, { 211,1}, {-211,1}};
64 static const map<PdgId,unsigned int> & mode7CC = { {-421,1},{ 2212,1}, {-2212,1}, { 211,1}, {-211,1}};
65 static const map<PdgId,unsigned int> & mode8 = { { 423,1},{ 2212,1}, {-2212,1}, { 211,1}, {-211,1}};
66 static const map<PdgId,unsigned int> & mode8CC = { {-423,1},{ 2212,1}, {-2212,1}, { 211,1}, {-211,1}};
67 static const map<PdgId,unsigned int> & mode9 = { { 411,1},{ 2212,1}, {-2212,1}, { 211,2}};
68 static const map<PdgId,unsigned int> & mode9CC = { {-411,1},{ 2212,1}, {-2212,1}, { 211,2}};
69 static const map<PdgId,unsigned int> & mode10 = { { 413,1},{ 2212,1}, {-2212,1}, {-211,2}};
70 static const map<PdgId,unsigned int> & mode10CC = { {-413,1},{ 2212,1}, {-2212,1}, { 211,2}};
71 DecayedParticles BB = apply<DecayedParticles>(event, "BB");
72 // loop over particles
73 for(unsigned int ix=0;ix<BB.decaying().size();++ix) {
74 int sign = 1, imode = -1, idd=421;
75 if(BB.decaying()[ix].abspid()==511) {
76 _nB[0]->fill();
77 if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,3,mode1)) {
78 sign=1;
79 imode=0;
80 idd=421;
81 }
82 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,3,mode1CC)) {
83 sign=-1;
84 imode=0;
85 idd=421;
86 }
87 else if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,3,mode2)) {
88 sign=1;
89 imode=1;
90 idd=423;
91 }
92 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,3,mode2CC)) {
93 sign=-1;
94 imode=1;
95 idd=423;
96 }
97 else if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,4,mode3)) {
98 sign=1;
99 imode=2;
100 idd=411;
101 }
102 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,4,mode3CC)) {
103 sign=-1;
104 imode=2;
105 idd=411;
106 }
107 else if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,4,mode4)) {
108 sign=1;
109 imode=3;
110 idd=413;
111 }
112 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,4,mode4CC)) {
113 sign=-1;
114 imode=3;
115 idd=413;
116 }
117 else if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,5,mode7)) {
118 sign=1;
119 imode=6;
120 idd=421;
121 }
122 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,5,mode7CC)) {
123 sign=-1;
124 imode=6;
125 idd=421;
126 }
127 else if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,5,mode8)) {
128 sign=1;
129 imode=7;
130 idd=423;
131 }
132 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,5,mode8CC)) {
133 sign=-1;
134 imode=7;
135 idd=423;
136 }
137 else
138 continue;
139 }
140 else {
141 _nB[1]->fill();
142 if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,4,mode5)) {
143 sign=1;
144 imode=4;
145 idd=421;
146 }
147 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,4,mode5CC)) {
148 sign=-1;
149 imode=4;
150 idd=421;
151 }
152 else if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,4,mode6)) {
153 sign=1;
154 imode=5;
155 idd=423;
156 }
157 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,4,mode6CC)) {
158 sign=-1;
159 imode=5;
160 idd=423;
161 }
162 else if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,5,mode9)) {
163 sign=1;
164 imode=8;
165 idd=411;
166 }
167 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,5,mode9CC)) {
168 sign=-1;
169 imode=8;
170 idd=411;
171 }
172 else if (BB.decaying()[ix].pid()<0 && BB.modeMatches(ix,5,mode10)) {
173 sign=1;
174 imode=9;
175 idd=413;
176 }
177 else if (BB.decaying()[ix].pid()>0 && BB.modeMatches(ix,5,mode10CC)) {
178 sign=-1;
179 imode=9;
180 idd=413;
181 }
182 else
183 continue;
184 }
185 const Particle & DD = BB.decayProducts()[ix].at( sign*idd )[0];
186 const Particle & pp = BB.decayProducts()[ix].at( sign*2212)[0];
187 const Particle & pbar = BB.decayProducts()[ix].at(-sign*2212)[0];
188 double mppbar = (pp.momentum()+pbar.momentum()).mass();
189 double mpD = (pp.momentum()+DD.momentum()).mass();
190 if(imode==0) {
191 if(sqr(mppbar)>5.) _h[0][0]->fill(mpD);
192 else _h[0][1]->fill(mpD);
193 if(sqr(mpD)>9.) _h[0][2]->fill(mppbar);
194 else _h[0][3]->fill(mppbar);
195 }
196 else if(imode==1) {
197 if(sqr(mppbar)>5.) _h[1][0]->fill(mpD);
198 else _h[1][1]->fill(mpD);
199 if(sqr(mpD)>10.5) _h[1][2]->fill(mppbar);
200 else _h[1][3]->fill(mppbar);
201 }
202 else {
203 _h[imode][0]->fill(mppbar);
204 _h[imode][1]->fill((pbar.momentum()+DD.momentum()).mass());
205 _h[imode][2]->fill(mpD);
206 const Particles & pim = BB.decayProducts()[ix].at(-sign*211);
207 for(unsigned int iy=0;iy<pim.size();++iy) {
208 _h[imode][3]->fill((pp.momentum()+pim[iy].momentum()).mass());
209 }
210 if(imode==6 || imode==7 ) {
211 const Particle & pip = BB.decayProducts()[ix].at(sign*211)[0];
212 _h[imode][3]->fill((pp.momentum()+pip.momentum()).mass());
213 }
214 }
215 }
216 }
217
218
219 /// Normalise histograms etc., after the run
220 void finalize() {
221 for(unsigned int ix=0;ix<10;++ix) {
222 CounterPtr temp = (ix<4 || ix==6 || ix==7) ? _nB[0] : _nB[1];
223 for(unsigned int iy=0;iy<4;++iy) {
224 if(iy==3 && ix>5)
225 scale(_h[ix][iy],0.5e5/ *temp);
226 else
227 scale(_h[ix][iy],1e5/ *temp);
228 }
229 }
230 }
231
232 /// @}
233
234
235 /// @name Histograms
236 /// @{
237 Histo1DPtr _h[10][4];
238 CounterPtr _nB[2];
239 /// @}
240
241
242 };
243
244
245 RIVET_DECLARE_PLUGIN(BABAR_2012_I946659);
246
247}
|