Rivet analyses referenceBABAR_2006_I719111Charm hadron spectra in B0, ˉB0 and B± decaysExperiment: BABAR (PEP-II) Inspire ID: 719111 Status: VALIDATED Authors:
Beam energies: ANY Run details:
Spectra of D0, ˉD0, D±, D±s, Λ+c, ˉΛ−c in B0, ˉB0 and B± decays measured by BaBar at the Υ(4S). Source code: BABAR_2006_I719111.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief Charm meson spectra in bottom decays
9 class BABAR_2006_I719111 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(BABAR_2006_I719111);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21
22 // Initialise and register projections
23 declare(UnstableParticles(), "UFS");
24
25 // Book histograms
26 book(_h_Bm_D0 , 1, 1, 1);
27 book(_h_Bm_Dbar0 , 1, 1, 2);
28 book(_h_Bm_Dp , 2, 1, 1);
29 book(_h_Bm_Dm , 2, 1, 2);
30 book(_h_Bm_Dsp , 3, 1, 1);
31 book(_h_Bm_Dsm , 3, 1, 2);
32 book(_h_Bm_lam , 4, 1, 1);
33 book(_h_Bm_lbar , 4, 1, 2);
34 book(_h_Bbar0_D0 , 5, 1, 1);
35 book(_h_Bbar0_Dbar0, 5, 1, 2);
36 book(_h_Bbar0_Dp , 6, 1, 1);
37 book(_h_Bbar0_Dm , 6, 1, 2);
38 book(_h_Bbar0_Dsp , 7, 1, 1);
39 book(_h_Bbar0_Dsm , 7, 1, 2);
40 book(_h_Bbar0_lam , 8, 1, 1);
41 book(_h_Bbar0_lbar , 8, 1, 2);
42
43 book(_c_Bm ,"/TMP/Bm");
44 book(_c_Bbar0,"/TMP/B0");
45 }
46
47 void findDecayProducts(Particle p,
48 Particles & D0, Particles & Dbar0,
49 Particles & Dp, Particles & Dm,
50 Particles & Dsp, Particles & Dsm,
51 Particles & lam, Particles & lbar) {
52 for(const Particle & child : p.children()) {
53 if(child.pid()==421)
54 D0.push_back(child);
55 else if(child.pid()==-421)
56 Dbar0.push_back(child);
57 else if(child.pid()==411)
58 Dp.push_back(child);
59 else if(child.pid()==-411)
60 Dm.push_back(child);
61 else if(child.pid()==431)
62 Dsp.push_back(child);
63 else if(child.pid()==-431)
64 Dsm.push_back(child);
65 else if(child.pid()==4122)
66 lam.push_back(child);
67 else if(child.pid()==-4122)
68 lbar.push_back(child);
69 else if(!child.children().empty())
70 findDecayProducts(child,D0,Dbar0,Dp,Dm, Dsp, Dsm, lam, lbar);
71 }
72 }
73
74 /// Perform the per-event analysis
75 void analyze(const Event& event) {
76 const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
77 for(const Particle & p : ufs.particles(Cuts::abspid==511 || Cuts::abspid==521)) {
78 if(p.abspid()==511)
79 _c_Bbar0->fill();
80 else if(p.abspid()==521)
81 _c_Bm ->fill();
82 Particles D0, Dbar0, Dp, Dm, Dsp, Dsm, lam, lbar;
83 findDecayProducts(p,D0,Dbar0,Dp,Dm, Dsp, Dsm, lam, lbar);
84 LorentzTransform boost =
85 LorentzTransform::mkFrameTransformFromBeta(p.momentum().betaVec());
86 if(p.pid()>0) {
87 swap(D0, Dbar0);
88 swap(Dp, Dm);
89 swap(Dsp, Dsm);
90 swap(lam, lbar);
91 }
92 for(const Particle & child : D0) {
93 double pChild = boost.transform(child.momentum()).p3().mod();
94 if(p.abspid()==521)
95 _h_Bm_D0 ->fill(pChild);
96 else
97 _h_Bbar0_D0->fill(pChild);
98 }
99 for(const Particle & child : Dbar0) {
100 double pChild = boost.transform(child.momentum()).p3().mod();
101 if(p.abspid()==521)
102 _h_Bm_Dbar0 ->fill(pChild);
103 else
104 _h_Bbar0_Dbar0->fill(pChild);
105 }
106 for(const Particle & child : Dp) {
107 double pChild = boost.transform(child.momentum()).p3().mod();
108 if(p.abspid()==521)
109 _h_Bm_Dp ->fill(pChild);
110 else
111 _h_Bbar0_Dp->fill(pChild);
112 }
113 for(const Particle & child : Dm) {
114 double pChild = boost.transform(child.momentum()).p3().mod();
115 if(p.abspid()==521)
116 _h_Bm_Dm ->fill(pChild);
117 else
118 _h_Bbar0_Dm->fill(pChild);
119 }
120 for(const Particle & child : Dsp) {
121 double pChild = boost.transform(child.momentum()).p3().mod();
122 if(p.abspid()==521)
123 _h_Bm_Dsp ->fill(pChild);
124 else
125 _h_Bbar0_Dsp->fill(pChild);
126 }
127 for(const Particle & child : Dsm) {
128 double pChild = boost.transform(child.momentum()).p3().mod();
129 if(p.abspid()==521)
130 _h_Bm_Dsm ->fill(pChild);
131 else
132 _h_Bbar0_Dsm->fill(pChild);
133 }
134 for(const Particle & child : lam) {
135 double pChild = boost.transform(child.momentum()).p3().mod();
136 if(p.abspid()==521)
137 _h_Bm_lam ->fill(pChild);
138 else
139 _h_Bbar0_lam->fill(pChild);
140 }
141 for(const Particle & child : lbar) {
142 double pChild = boost.transform(child.momentum()).p3().mod();
143 if(p.abspid()==521)
144 _h_Bm_lbar ->fill(pChild);
145 else
146 _h_Bbar0_lbar->fill(pChild);
147 }
148 }
149 }
150
151
152 /// Normalise histograms etc., after the run
153 void finalize() {
154 scale(_h_Bm_D0 ,100./ _c_Bm->val());
155 scale(_h_Bm_Dbar0 ,100./ _c_Bm->val());
156 scale(_h_Bm_Dp ,100./ _c_Bm->val());
157 scale(_h_Bm_Dm ,100./ _c_Bm->val());
158 scale(_h_Bm_Dsp ,100./ _c_Bm->val());
159 scale(_h_Bm_Dsm ,100./ _c_Bm->val());
160 scale(_h_Bm_lam ,100./ _c_Bm->val());
161 scale(_h_Bm_lbar ,100./ _c_Bm->val());
162 scale(_h_Bbar0_D0 ,100./ _c_Bbar0->val());
163 scale(_h_Bbar0_Dbar0,100./ _c_Bbar0->val());
164 scale(_h_Bbar0_Dp ,100./ _c_Bbar0->val());
165 scale(_h_Bbar0_Dm ,100./ _c_Bbar0->val());
166 scale(_h_Bbar0_Dsp ,100./ _c_Bbar0->val());
167 scale(_h_Bbar0_Dsm ,100./ _c_Bbar0->val());
168 scale(_h_Bbar0_lam ,100./ _c_Bbar0->val());
169 scale(_h_Bbar0_lbar ,100./ _c_Bbar0->val());
170 }
171
172 /// @}
173
174
175 /// @name Histograms
176 /// @{
177 Histo1DPtr _h_Bm_D0,_h_Bm_Dbar0,_h_Bm_Dp,_h_Bm_Dm,_h_Bm_Dsp,_h_Bm_Dsm,
178 _h_Bm_lam,_h_Bm_lbar,_h_Bbar0_D0;
179 Histo1DPtr _h_Bbar0_Dbar0,_h_Bbar0_Dp,_h_Bbar0_Dm,
180 _h_Bbar0_Dsp,_h_Bbar0_Dsm,_h_Bbar0_lam,_h_Bbar0_lbar;
181
182 CounterPtr _c_Bm ,_c_Bbar0;
183 /// @}
184
185 };
186
187
188 RIVET_DECLARE_PLUGIN(BABAR_2006_I719111);
189
190
191}
|