Belle II Software development
EvtPHSPBBMix Class Reference

The class provides routine to decay vector-> particle particle with B0 mixing, coherent B0B0-like mixing if any. More...

#include <EvtPHSPBMix.h>

Inheritance diagram for EvtPHSPBBMix:

Public Member Functions

 EvtPHSPBBMix ()
 Default constructor.
 
virtual ~EvtPHSPBBMix ()
 Default destructor.
 
std::string getName ()
 Get function Name

 
EvtDecayBase * clone ()
 Clone the decay

 
void decay (EvtParticle *p)
 Decay function.
 
void init ()
 Init function.
 
void initProbMax ()
 Init maximal prob.
 
int nRealDaughters ()
 Number of real daughters.
 

Private Member Functions

void prlp (int) const
 Number of real daughters.
 
EvtComplex Amplitude (const double &t1, const double &t2, bool B1_is_B0, bool B2_is_B0) const
 Calculate amplitude.
 

Private Attributes

double _freq {0}
 mixing frequency in hbar/mm
 
double _C {0}
 C eigenvalue, 0= incoherent.
 
bool _BBpipi {0}
 Is BBpipi?
 
bool _print_info {false}
 Print evtgeninfo?
 

Detailed Description

The class provides routine to decay vector-> particle particle with B0 mixing, coherent B0B0-like mixing if any.

Definition at line 36 of file EvtPHSPBMix.h.

Constructor & Destructor Documentation

◆ EvtPHSPBBMix()

EvtPHSPBBMix ( )
inline

Default constructor.

Definition at line 41 of file EvtPHSPBMix.h.

41{}

◆ ~EvtPHSPBBMix()

~EvtPHSPBBMix ( )
virtual

Default destructor.

Definition at line 47 of file EvtPHSPBMix.cc.

47{}

Member Function Documentation

◆ Amplitude()

EvtComplex Amplitude ( const double &  t1,
const double &  t2,
bool  B1_is_B0,
bool  B2_is_B0 
) const
private

Calculate amplitude.

Definition at line 323 of file EvtPHSPBMix.cc.

324{
325 if (_C != 0 && _C != -1 && _C != 1)
326 return EvtComplex(0., 0.);
327
328 const double f(_freq);
329 if (B1_is_B0 && !B2_is_B0) {
330 if (_C == 0)
331 return EvtComplex(cos(f * t1 / 2.) * cos(f * t2 / 2.), 0.);
332 else
333 return EvtComplex(cos(f * (t2 + _C * t1) / 2.) / sqrt(2.), 0.);
334 }
335 if (!B1_is_B0 && B2_is_B0) {
336 if (_C == 0)
337 return EvtComplex(-sin(f * t1 / 2.) * sin(f * t2 / 2.), 0.);
338 else
339 return EvtComplex(cos(f * (t2 + _C * t1) / 2.) * _C / sqrt(2.), 0.);
340 }
341 if (B1_is_B0 && B2_is_B0) {
342 if (_C == 0)
343 return EvtComplex(0., -cos(f * t1 / 2.) * sin(f * t2 / 2.));
344 else
345 return EvtComplex(0., -sin(f * (t2 + _C * t1) / 2.) / sqrt(2.));
346 }
347 if (!B1_is_B0 && !B2_is_B0) {
348 if (_C == 0)
349 return EvtComplex(0., -sin(f * t1 / 2.) * cos(f * t2 / 2.));
350 else
351 return EvtComplex(0., -sin(f * (t2 + _C * t1) / 2.) * _C / sqrt(2.));
352 }
353 // no way to reach this but compiler complains without a return statement
354 return EvtComplex(0., 0.);
355}
double _C
C eigenvalue, 0= incoherent.
Definition: EvtPHSPBMix.h:76
double _freq
mixing frequency in hbar/mm
Definition: EvtPHSPBMix.h:73
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ clone()

EvtDecayBase * clone ( )

Clone the decay

Definition at line 55 of file EvtPHSPBMix.cc.

56{
57 return new EvtPHSPBBMix;
58}
EvtPHSPBBMix()
Default constructor.
Definition: EvtPHSPBMix.h:41

◆ decay()

void decay ( EvtParticle *  p)

Decay function.

Definition at line 230 of file EvtPHSPBMix.cc.

231{
232 //p->initializePhaseSpace(getNDaug(),getDaugs());
233 //return;
234
235 if (_print_info) prlp(1);
236
237 static const EvtId B0(EvtPDL::getId("B0"));
238 static const EvtId B0B(EvtPDL::getId("anti-B0"));
239
240 // generate a final state according to phase space
241
242 // const bool ADaug(getNDaug()==4);//true if aliased daughters
243 if (_print_info) prlp(102);
244
245 const bool NCC(getNDaug() >= 4 && !_BBpipi); //true if daughters not charged-conjugated
246 // const bool BBpi(getNDaug()==
247 if (_print_info) prlp(103);
248 if (NCC) {
249 if (_print_info) prlp(2);
250 std::vector<EvtId> tempDaug(getNDaug() - 2);
251 tempDaug[0] = getDaug(0);
252 tempDaug[1] = getDaug(1);
253 if (getNDaug() == 5)
254 tempDaug[2] = getDaug(2);
255
256 p->initializePhaseSpace(getNDaug() - 2, tempDaug.data());
257
258 if (_print_info) prlp(222);
259 } else { //nominal case.
260 p->initializePhaseSpace(getNDaug(), getDaugs());
261
262 }
263 if (_print_info) prlp(3);
264 EvtParticle* s1, *s2;
265
266 s1 = p->getDaug(0);
267 s2 = p->getDaug(1);
268 //delete any daughters - if there are daughters, they
269 //are from the initialization and will be redone later
270 if (s1->getNDaug() > 0) { s1->deleteDaughters();}
271 if (s2->getNDaug() > 0) { s2->deleteDaughters();}
272
273 EvtVector4R p1 = s1->getP4();
274 EvtVector4R p2 = s2->getP4();
275
276 // throw 2 random numbers to decide whether B1 and B2 are B0 or B0B
277 const EvtId B1(EvtRandom::random() > 0.5 ? B0 : B0B);
278 const EvtId B2(EvtRandom::random() > 0.5 ? B0 : B0B);
279 if (_print_info) prlp(5);
280
281 if (NCC)
282
283 {
284 if (getNDaug() == 4) {
285 s1->init(B1 == B0 ? getDaug(0) : getDaug(2), p1);
286 s2->init(B2 == B0 ? getDaug(3) : getDaug(1), p2);
287 }
288 if (getNDaug() == 5) {
289 s1->init(B1 == B0 ? getDaug(0) : getDaug(3), p1);
290 s2->init(B2 == B0 ? getDaug(4) : getDaug(1), p2);
291 }
292 } else {
293 s1->init(B1 == B0 ? getDaug(0) : getDaug(1), p1);
294 s2->init(B2 == B0 ? getDaug(0) : getDaug(1), p2);
295 }
296
297 if (_print_info) prlp(6);
298
299 // choose a decay time for each final state particle using the
300 // lifetime (which must be the same for both particles) in pdt.table
301 // and calculate the lifetime difference for this event
302 s1->setLifetime();
303 s2->setLifetime();
304
305 const double t1(s1->getLifetime());
306 const double t2(s2->getLifetime());
307
308 // calculate the oscillation amplitude, based on whether this event is mixed or not
309 EvtComplex osc_amp(Amplitude(t1, t2, B1 == B0, B2 == B0)); //Amplitude return <B0(B)B0(B)|B1B2>
310 if (_print_info) prlp(8);
311
312
313 // store the amplitudes for each parent spin basis state
314 double norm = 1.0 / p1.d3mag();
315 if (_print_info) prlp(9);
316 vertex(0, norm * osc_amp * p1 * (p->eps(0)));
317 vertex(1, norm * osc_amp * p1 * (p->eps(1)));
318 vertex(2, norm * osc_amp * p1 * (p->eps(2)));
319 if (_print_info) prlp(10);
320 return ;
321}
void prlp(int) const
Number of real daughters.
Definition: EvtPHSPBMix.cc:225
bool _print_info
Print evtgeninfo?
Definition: EvtPHSPBMix.h:82
EvtComplex Amplitude(const double &t1, const double &t2, bool B1_is_B0, bool B2_is_B0) const
Calculate amplitude.
Definition: EvtPHSPBMix.cc:323
bool _BBpipi
Is BBpipi?
Definition: EvtPHSPBMix.h:79

◆ getName()

std::string getName ( )

Get function Name

Definition at line 49 of file EvtPHSPBMix.cc.

50{
51 return "PHSP_BB_MIX";
52}

◆ init()

void init ( )

Init function.

Definition at line 60 of file EvtPHSPBMix.cc.

61{
62 // check that there we are provided exactly one parameter
63 //One arg: Delta m
64 const unsigned short int narg(2);
65 if (getNArg() != narg) {
66 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "EvtPHSPBBMix generator expected "
67 << " " << narg
68 << "argument(s) (deltam, C=-1, +1 or 0 (incoherent)) but found:"
69 << getNArg() << endl;
70 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Will terminate execution!" << endl;
71 ::abort();
72 }
73
74
75 //report(DEBUG,"EvtGen") << "EvtPHSPBBMIX::init point (2)"<<std::endl;
76 //usage: mixing P0-P0b : 2 arg. -> P0 P0b PHSP_BB_MIX dm -1;
77 // : mixing P0*-P0b + cc : 4 arg. -> P0* P0b P0*b P0 PHSP_BB_MIX dm +1;
78 // : mixing P0-P0b pi : 3 arg. -> P0 P0b pi0 PHSP_BB_MIX dm -1;
79 // : mixing P0*-P0b pi : 5 arg. -> P0* P0b pi0 P0*b P0 PHSP_BB_MIX dm +1;
80 // : mixing P0-P0b pi pi : 4 arg. -> P0 P0b pi pi PHSP_BB_MIX dm -1;
81
82 if (getNDaug() < 2 || getNDaug() > 5) {
83 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "PHSP_BB_MIX n daughters not ok :"
84 << getNDaug() << endl;
85 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Will terminate execution!" << endl;
86 ::abort();
87 }
88 // checkNDaug(2,3,4,5,6);
89 // report(DEBUG,"EvtGen") << "EvtPHSPBBMIX::init point (3)"<<std::endl;
90
91
92
93 _BBpipi = false;
94
95 if (getNDaug() == 4 && (EvtPDL::chargeConj(getDaug(0)) == getDaug(1)))
96 _BBpipi = true;
97
98
99 if (!_BBpipi && getNDaug() > 3) {
100 if (!(EvtPDL::chargeConj(getDaug(0)) == getDaug(getNDaug() - 2) && EvtPDL::chargeConj(getDaug(1)) == getDaug(getNDaug() - 1))) {
101 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "EvtPHSPBBMix generator expected daughters "
102 << "to be charge conjugate." << endl
103 << " Found " << EvtPDL::name(getDaug(0)).c_str()
104 << "," << EvtPDL::name(getDaug(1)).c_str()
105 << "," << EvtPDL::name(getDaug(2)).c_str()
106 << " and "
107 << EvtPDL::name(getDaug(3)).c_str() << endl;
108 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Will terminate execution!" << endl;
109 ::abort();
110 }
111 } else {
112
113 if (!(EvtPDL::chargeConj(getDaug(0)) == getDaug(1))) {
114 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "EvtPHSPBBMix generator expected daughters "
115 << "to be charge conjugate." << endl
116 << " Found " << EvtPDL::name(getDaug(0)).c_str()
117 << " and "
118 << EvtPDL::name(getDaug(1)).c_str() << endl;
119 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Will terminate execution!" << endl;
120 ::abort();
121 }
122
123 }
124 //report(DEBUG,"EvtGen") << "EvtPHSPBBMIX::init point (4)"<<std::endl;
125 // check that we are asked to decay a vector particle into a pair
126 // of scalar particles
127
128 // checkSpinParent(EvtSpinType::VECTOR);
129
130 // checkSpinDaughter(0,EvtSpinType::SCALAR);
131 // checkSpinDaughter(1,EvtSpinType::SCALAR);
132
133 // check that our daughter particles are charge conjugates of each other
134
135
136 // check that both daughter particles have the same lifetime
137 if (EvtPDL::getctau(getDaug(0)) != EvtPDL::getctau(getDaug(1))) {
138 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "EvtPHSPBBMix generator expected daughters "
139 << "to have the same lifetime." << endl
140 << " Found ctau = "
141 << EvtPDL::getctau(getDaug(0)) << " mm and "
142 << EvtPDL::getctau(getDaug(1)) << " mm" << endl;
143 EvtGenReport(EVTGEN_ERROR, "EvtGen") << "Will terminate execution!" << endl;
144 ::abort();
145 }
146 // precompute quantities that will be used to generate events
147 // and print out a summary of parameters for this decay
148 //report(DEBUG,"EvtGen") << "EvtPHSPBBMIX::init point (5)"<<std::endl;
149
150 // mixing frequency in hbar/mm
151 _freq = getArg(0) / EvtConst::c;
152
153 _C = getArg(1);
154
155 // deltaG
156 //double gamma= 1/EvtPDL::getctau(getDaug(0)); // gamma/c (1/mm)
157 // q/p
158 // decay amplitudes
159 // CPT violation in mixing
160 // some printout
161 double tau = 1e12 * EvtPDL::getctau(getDaug(0)) / EvtConst::c; // in ps
162 double dm = 1e-12 * getArg(0); // B0/anti-B0 mass difference in hbar/ps
163 double x = dm * tau;
164
165 //report(DEBUG,"EvtGen") << "EvtPHSPBBMIX::init point (6)"<<std::endl;
166
167
168 std::ostringstream sss;
169 sss << " " << EvtPDL::name(getParentId()).c_str() << " --> "
170 << EvtPDL::name(getDaug(0)).c_str() << " + "
171 << EvtPDL::name(getDaug(1)).c_str();
172 switch (getNDaug()) {
173 case 3:
174 case 5:
175 sss << " + " << EvtPDL::name(getDaug(2)).c_str();
176 break;
177 case 4:
178 if (_BBpipi)
179 sss << " + " << EvtPDL::name(getDaug(2)).c_str() << " + " << EvtPDL::name(getDaug(3)).c_str();
180 break;
181 default: ;
182 }
183 EvtGenReport(EVTGEN_INFO, "EvtGen") << "PHSP_BB_MIX will generate mixing :"
184 << endl << endl
185 << sss.str() << endl << endl
186 << "using parameters:" << endl << endl
187 << " delta(m) = " << dm << " hbar/ps" << endl
188 << " C (B0-B0b) = " << _C << endl
189 << " _freq = " << _freq << " hbar/mm" << endl
190 << " dgog = " << 0 << endl
191 << " dGamma = " << 0 << " hbar/mm" << endl
192 << " q/p = " << 1 << endl
193 << " tau = " << tau << " ps" << endl
194 << " x = " << x << endl
195 << endl;
196
197
198
199
200
201}

◆ initProbMax()

void initProbMax ( )

Init maximal prob.

function

Definition at line 218 of file EvtPHSPBMix.cc.

219{
220 // this value is ok for reasonable values of all the parameters
221 setProbMax(4.0);
222 //noProbMax();
223}

◆ nRealDaughters()

int nRealDaughters ( )

Number of real daughters.

Definition at line 203 of file EvtPHSPBMix.cc.

204{
205 if (getNDaug() > 3) {
206 if (_BBpipi)
207 return 4;
208 else
209 return getNDaug() - 2;
210 }
211 //else
212 return getNDaug();
213
214
215}

◆ prlp()

void prlp ( int  i) const
private

Number of real daughters.

Definition at line 225 of file EvtPHSPBMix.cc.

226{
227 EvtGenReport(EVTGEN_INFO, "EvtGen") << "decay p" << i << endl;
228}

Member Data Documentation

◆ _BBpipi

bool _BBpipi {0}
private

Is BBpipi?

Definition at line 79 of file EvtPHSPBMix.h.

◆ _C

double _C {0}
private

C eigenvalue, 0= incoherent.

Definition at line 76 of file EvtPHSPBMix.h.

◆ _freq

double _freq {0}
private

mixing frequency in hbar/mm

Definition at line 73 of file EvtPHSPBMix.h.

◆ _print_info

bool _print_info {false}
private

Print evtgeninfo?

Definition at line 82 of file EvtPHSPBMix.h.


The documentation for this class was generated from the following files: