9#include "EvtGenBase/EvtParticle.hh"
10#include "EvtGenBase/EvtPDL.hh"
11#include "EvtGenBase/EvtScalarParticle.hh"
12#include "EvtGenBase/EvtDiracSpinor.hh"
13#include "EvtGenBase/EvtId.hh"
14#include "EvtGenBase/EvtAmp.hh"
16#include "generators/evtgen/models/EvtBSemiTauonicAmplitude.h"
17#include "generators/evtgen/models/EvtBSemiTauonicHelicityAmplitudeCalculator.h"
31 EvtVector4R p4Boosted = boostTo(p->getP4(), p4boost,
true);
32 const double theta = acos(p4Boosted.get(3) / p4Boosted.d3mag());
33 const double phi = atan2(p4Boosted.get(2), p4Boosted.get(1));
36 EvtDiracSpinor spRest[2] = {p->sp(0), p->sp(1)};
38 sp[0] = boostTo(spRest[0], p4boost);
39 sp[1] = boostTo(spRest[1], p4boost);
41 EvtDiracSpinor spplus;
42 EvtDiracSpinor spminus;
46 if (EvtPDL::getStdHep(p->getId()) > 0) {
47 spplus.set(1.0, 0.0, 0.0, 0.0);
48 spminus.set(0.0, 1.0, 0.0, 0.0);
49 norm =
sqrt(real(sp[0].get_spinor(0) * sp[0].get_spinor(0) + sp[0].get_spinor(1) * sp[0].get_spinor(1)));
51 spplus.set(0.0, 0.0, 0.0, 1.0);
52 spminus.set(0.0, 0.0, 1.0, 0.0);
53 norm =
sqrt(real(sp[0].get_spinor(2) * sp[0].get_spinor(2) + sp[0].get_spinor(3) * sp[0].get_spinor(3)));
56 spplus.applyRotateEuler(phi, theta, -phi);
57 spminus.applyRotateEuler(phi, theta, -phi);
62 for (
int i = 0; i < 2; i++) {
63 if (EvtPDL::getStdHep(p->getId()) > 0) {
64 R.set(0, i, (spplus * sp[i]) / norm);
65 R.set(1, i, (spminus * sp[i]) / norm);
67 R.set(0, i, (sp[i]*spplus) / norm);
68 R.set(1, i, (sp[i]*spminus) / norm);
78 EvtId lepton, EvtId nudaug,
92 EvtScalarParticle* scalar_part;
93 EvtParticle* root_part;
95 scalar_part =
new EvtScalarParticle;
98 scalar_part->noLifeTime();
102 p_init.set(EvtPDL::getMass(parent), 0.0, 0.0, 0.0);
103 scalar_part->init(parent, p_init);
105 root_part =
static_cast<EvtParticle*
>(scalar_part);
107 root_part->setDiagonalSpinDensity();
109 EvtParticle* daughter, *lep, *trino;
115 listdaug[1] = lepton;
116 listdaug[2] = nudaug;
118 amp.init(parent, 3, listdaug);
120 root_part->makeDaughters(3, listdaug);
121 daughter = root_part->getDaug(0);
122 lep = root_part->getDaug(1);
123 trino = root_part->getDaug(2);
126 daughter->noLifeTime();
134 rho.setDiag(root_part->getSpinStates());
138 double m = root_part->mass();
140 EvtVector4R p4meson, p4lepton, p4nu, p4w;
142 double q2, elepton, plepton;
144 double erho, prho, costl;
146 double maxfoundprob = 0.0;
150 for (massiter = 0; massiter < 3; massiter++) {
152 mass[0] = EvtPDL::getMeanMass(meson);
153 mass[1] = EvtPDL::getMeanMass(lepton);
154 mass[2] = EvtPDL::getMeanMass(nudaug);
156 mass[0] = EvtPDL::getMinMass(meson);
159 mass[0] = EvtPDL::getMaxMass(meson);
160 if ((mass[0] + mass[1] + mass[2]) > m) mass[0] = m - mass[1] - mass[2] - 0.00001;
163 double q2min = mass[1] * mass[1];
164 double q2max = (m - mass[0]) * (m - mass[0]);
165 double dq2 = (q2max - q2min) / 25;
170 for (i = 0; i < 25; i++) {
171 q2 = q2min + (i + 0.5) * dq2;
173 erho = (m * m + mass[0] * mass[0] - q2) / (2.0 * m);
175 prho =
sqrt(erho * erho - mass[0] * mass[0]);
177 p4meson.set(erho, 0.0, 0.0, -1.0 * prho);
178 p4w.set(m - erho, 0.0, 0.0, prho);
184 elepton = (q2 + mass[1] * mass[1]) / (2.0 *
sqrt(q2));
185 plepton =
sqrt(elepton * elepton - mass[1] * mass[1]);
190 for (j = 0; j < 3; j++) {
192 costl = 0.99 * (j - 1.0);
196 p4lepton.set(elepton, 0.0,
197 plepton *
sqrt(1.0 - costl * costl), plepton * costl);
198 p4nu.set(plepton, 0.0,
199 -1.0 * plepton *
sqrt(1.0 - costl * costl), -1.0 * plepton * costl);
201 EvtVector4R boost((m - erho), 0.0, 0.0, 1.0 * prho);
202 p4lepton = boostTo(p4lepton, boost);
203 p4nu = boostTo(p4nu, boost);
207 daughter->init(meson, p4meson);
208 lep->init(lepton, p4lepton);
209 trino->init(nudaug, p4nu);
211 CalcAmp(root_part, amp, CalcHelAmp);
217 prob = rho.normalizedProb(amp.getSpinDensity());
225 double a = probctl[1];
226 double b = 0.5 * (probctl[2] - probctl[0]);
227 double c = 0.5 * (probctl[2] + probctl[0]) - probctl[1];
230 if (probctl[1] > prob) prob = probctl[1];
231 if (probctl[2] > prob) prob = probctl[2];
233 if (fabs(c) > 1e-20) {
234 double ctlx = -0.5 * b / c;
235 if (fabs(ctlx) < 1.0) {
236 double probtmp = a + b * ctlx + c * ctlx * ctlx;
237 if (probtmp > prob) prob = probtmp;
242 if (prob > maxfoundprob) {
247 if (EvtPDL::getWidth(meson) <= 0.0) {
253 root_part->deleteTree();
virtual void CalcAmp(EvtParticle *parent, EvtAmp &, EvtBSemiTauonicHelicityAmplitudeCalculator *HelicityAmplitudeCalculator)=0
The function calculates the spin dependent amplitude.
The class calculates the helicity amplitude of semi-tauonic B decays including new physics effects ba...
EvtSpinDensity RotateToHelicityBasisInBoostedFrame(const EvtParticle *p, EvtVector4R p4boost)
The function calculates the rotation matrix to convert the spin basis to the helicity basis in the bo...
double sqrt(double a)
sqrt for double
double CalcMaxProb(EvtId parent, EvtId meson, EvtId lepton, EvtId nudaug, EvtBSemiTauonicHelicityAmplitudeCalculator *HelicityAmplitudeCalculator)
The function calculates the maximum probability.
Abstract base class for different kinds of events.