Rivet analyses referenceDELPHI_1995_I395026Production of $B^*$ mesons at LEP1Experiment: DELPHI (LEP) Inspire ID: 395026 Status: VALIDATED Authors:
Beam energies: (45.6, 45.6) GeV Run details:
Spectrum for the production of $B^*$ mesons at LEP1. The polarization and ratio of vector to pseudoscalar $B$ meson production is also measured. Source code: DELPHI_1995_I395026.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/Beam.hh"
4#include "Rivet/Projections/ChargedFinalState.hh"
5#include "Rivet/Projections/UnstableParticles.hh"
6
7#define I_KNOW_THE_INITIAL_QUARKS_PROJECTION_IS_DODGY_BUT_NEED_TO_USE_IT
8#include "Rivet/Projections/InitialQuarks.hh"
9
10namespace Rivet {
11
12 /// @brief B* production at LEP1
13 class DELPHI_1995_I395026 : public Analysis {
14 public:
15
16 /// Constructor
17 RIVET_DEFAULT_ANALYSIS_CTOR(DELPHI_1995_I395026);
18
19
20 /// @name Analysis methods
21 /// @{
22
23 /// Book histograms and initialise projections before the run
24 void init() {
25
26 // // Initialise and register projections
27 declare(Beam(), "Beams");
28 declare(ChargedFinalState(), "FS");
29 declare(InitialQuarks(), "IQF");
30 declare(UnstableParticles(), "UFS");
31
32 // Book histograms
33 book(_h_ctheta1, 5,1,1);
34 book(_h_ctheta2, "/TMP/ctheta",20,-1.,1.);
35 book(_h_z , 4,1,1);
36 book(_c_hadron , "/TMP/chadron");
37 book(_c_bottom , "/TMP/cbottom");
38 book(_c_bStar , "/TMP/cbStar ");
39 book(_c_B , "/TMP/cB ");
40 }
41
42
43 /// Perform the per-event analysis
44 void analyze(const Event& event) {
45 // First, veto on leptonic events by requiring at least 4 charged FS particles
46 const FinalState& fs = apply<FinalState>(event, "FS");
47 const size_t numParticles = fs.particles().size();
48
49 // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
50 if (numParticles < 2) {
51 MSG_DEBUG("Failed leptonic event cut");
52 vetoEvent;
53 }
54 MSG_DEBUG("Passed leptonic event cut");
55
56 int flavour = 0;
57 const InitialQuarks& iqf = apply<InitialQuarks>(event, "IQF");
58
59 // If we only have two quarks (qqbar), just take the flavour.
60 // If we have more than two quarks, look for the highest energetic q-qbar pair.
61 if (iqf.particles().size() == 2) {
62 flavour = iqf.particles().front().abspid();
63 }
64 else {
65 map<int, double> quarkmap;
66 for (const Particle& p : iqf.particles()) {
67 if (quarkmap[p.pid()] < p.E()) {
68 quarkmap[p.pid()] = p.E();
69 }
70 }
71 double maxenergy = 0.;
72 for (int i = 1; i <= 5; ++i) {
73 if (quarkmap[i]+quarkmap[-i] > maxenergy) {
74 flavour = i;
75 }
76 }
77 }
78 if (flavour==5) _c_bottom->fill();
79 _c_hadron->fill();
80 // Get beams and average beam momentum
81 const ParticlePair& beams = apply<Beam>(event, "Beams").beams();
82 const double meanBeamMom = ( beams.first.p3().mod() +
83 beams.second.p3().mod() ) / 2.0;
84 MSG_DEBUG("Avg beam momentum = " << meanBeamMom);
85
86 // loop over the particles
87 for(const Particle& p : apply<UnstableParticles>(event, "UFS").particles(Cuts::abspid==513 or Cuts::abspid==523 or
88 Cuts::abspid==511 or Cuts::abspid==521)) {
89 int sign = p.pid()/p.abspid();
90 // count number of Bs not from mixing or B*
91 if(p.abspid()==511 || p.abspid()==521) {
92 if(p.parents()[0].abspid()==p.abspid()) continue;
93 if(p.parents()[0].abspid()==513 || p.parents()[0].abspid()==523) continue;
94 _c_B->fill();
95 }
96 // B*
97 else {
98 _c_bStar->fill();
99 double xE = p.momentum().t()/meanBeamMom;
100 _h_z->fill(xE);
101 Particle decay;
102 if(p.children().size()!=2) continue;
103 int mid = p.abspid()-2;
104 if(p.children()[0].pid()==sign*mid &&
105 p.children()[1].pid()==22) {
106 decay = p.children()[1];
107 }
108 else if(p.children()[1].pid()==sign*mid &&
109 p.children()[0].pid()==22) {
110 decay = p.children()[0];
111 }
112 else
113 continue;
114 LorentzTransform boost = LorentzTransform::mkFrameTransformFromBeta(p.momentum().betaVec());
115 Vector3 e1z = p.p3().unit();
116 FourMomentum pp = boost.transform(decay.momentum());
117 Vector3 axis1 = boost.transform(decay.momentum()).p3().unit();
118 double ctheta = e1z.dot(axis1);
119 _h_ctheta1->fill(ctheta);
120 _h_ctheta2->fill(ctheta);
121 }
122 }
123 }
124
125 pair<double,double> calcRho(Histo1DPtr hist) {
126 if(hist->numEntries()==0.) return make_pair(0.,0.);
127 double sum1(0.),sum2(0.);
128 for (const auto& bin : hist->bins() ) {
129 double Oi = bin.sumW();
130 if(Oi==0.) continue;
131 double ai = 0.125*( -bin.xMin()*(3.+sqr(bin.xMin())) + bin.xMax()*(3.+sqr(bin.xMax())));
132 double bi = 0.375*( -bin.xMin()*(1.-sqr(bin.xMin())) + bin.xMax()*(1.-sqr(bin.xMax())));
133 double Ei = bin.errW();
134 sum1 += sqr(bi/Ei);
135 sum2 += bi/sqr(Ei)*(Oi-ai);
136 }
137 return make_pair(sum2/sum1,sqrt(1./sum1));
138 }
139
140 /// Normalise histograms etc., after the run
141 void finalize() {
142 // spectrum
143 scale(_h_z ,1./_c_hadron->val());
144 // polarization
145 scale(_h_ctheta1,1./_c_hadron->val());
146 normalize(_h_ctheta2);
147 pair<double,double> rho = calcRho(_h_ctheta2);
148 BinnedEstimatePtr<string> h_rho;
149 book(h_rho, 3,1,1);
150 h_rho->bin(1).set(rho.first, rho.second);
151 // no of B* per hadronic Z
152 double val = _c_bStar->val()/_c_hadron->val();
153 double err = val*sqrt(sqr(_c_bStar->err()/_c_bStar->val())+sqr(_c_hadron->err()/_c_hadron->val()));
154 BinnedEstimatePtr<string> h_nBS;
155 book(h_nBS,2,1,1);
156 h_nBS->bin(1).set(val, err);
157 // no of B* per b bbar
158 val = _c_bStar->val()/_c_bottom->val();
159 err = val*sqrt(sqr(_c_bStar->err()/_c_bStar->val())+sqr(_c_bottom->err()/_c_bottom->val()));
160 BinnedEstimatePtr<string> h1;
161 book(h1,1,1,1);
162 h1->bin(1).set(val, err);
163 Counter ctemp = *_c_bStar+*_c_B;
164 // no of B*/B+B*
165 val = _c_bStar->val()/ctemp.val();
166 err = val*sqrt(sqr(_c_bStar->err()/_c_bStar->val())+sqr(ctemp.err()/ctemp.val()));
167 h1->bin(2).set(val, err);
168 // average x_E
169 val = _h_z->xMean();
170 err = _h_z->xStdErr();
171 h1->bin(3).set(val, err);
172 }
173
174 /// @}
175
176
177 /// @name Histograms
178 /// @{
179 Histo1DPtr _h_ctheta1, _h_ctheta2, _h_z;
180 CounterPtr _c_hadron,_c_bottom,_c_bStar,_c_B;
181 /// @}
182
183
184 };
185
186
187 RIVET_DECLARE_PLUGIN(DELPHI_1995_I395026);
188
189
190}
|