BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDMix.cc
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
// Environment:
4
// This software is part of the EvtGen package developed jointly
5
// for the BaBar and CLEO collaborations. If you use all or part
6
// of it, please give an appropriate acknowledgement.
7
//
8
// Copyright Information: See EvtGen/COPYRIGHT
9
// Copyright (C) 1998 Caltech, UCSB
10
//
11
// Module: EvtDMix.cc
12
//
13
// Description: Routine to decay a particle according th phase space
14
//
15
// Modification history:
16
//
17
// RYD January 8, 1997 Module created
18
//
19
//------------------------------------------------------------------------
20
//
21
#include "
EvtDMix.hh
"
22
#include "
../EvtGenBase/EvtGenKine.hh
"
23
#include "
../EvtGenBase/EvtPDL.hh
"
24
#include "
../EvtGenBase/EvtParticle.hh
"
25
#include "
../EvtGenBase/EvtPatches.hh
"
26
#include "
../EvtGenBase/EvtRandom.hh
"
27
#include "
../EvtGenBase/EvtReport.hh
"
28
#include <stdlib.h>
29
#include <string>
30
31
EvtDMix::~EvtDMix
() {}
32
33
void
EvtDMix::getName
( std::string& model_name ) { model_name =
"DMIX"
; }
34
35
EvtDecayBase
*
EvtDMix::clone
() {
return
new
EvtDMix
; }
36
37
void
EvtDMix::init
() {
38
39
// check that there are 0 arguments
40
checkNArg
( 3 );
41
_rd =
getArg
( 0 );
42
_xpr =
getArg
( 1 );
43
_ypr =
getArg
( 2 );
44
}
45
46
void
EvtDMix::initProbMax
() {
noProbMax
(); }
47
48
void
EvtDMix::decay
(
EvtParticle
* p ) {
49
50
// unneeded - lange - may13-02
51
// if ( p->getNDaug() != 0 ) {
52
// Will end up here because maxrate multiplies by 1.2
53
// report(DEBUG,"EvtGen") << "In EvtDMix: has "
54
// <<" daugthers should not be here!"<<endl;
55
// return;
56
//}
57
58
p->
initializePhaseSpace
(
getNDaug
(),
getDaugs
() );
59
60
double
ctau =
EvtPDL::getctau
( p->
getId
() );
61
if
( ctau == 0. )
return
;
62
63
double
pdf, random, gt,
weight
;
64
65
double
maxPdf =
66
_rd + sqrt( _rd ) * _ypr * 50. + 2500.0 * ( _xpr * _xpr + _ypr * _ypr ) / 4.0;
67
bool
keepGoing =
true
;
68
while
( keepGoing )
69
{
70
random =
EvtRandom::Flat
();
71
gt = -log( random );
72
weight
= random;
73
pdf = _rd + sqrt( _rd ) * _ypr * gt + gt * gt * ( _xpr * _xpr + _ypr * _ypr ) / 4.0;
74
pdf *=
exp
( -1.0 * gt );
75
pdf /=
weight
;
76
if
( pdf > maxPdf )
77
std::cout << pdf <<
" "
<<
weight
<<
" "
<< maxPdf <<
" "
<< gt << std::endl;
78
if
( pdf > maxPdf *
EvtRandom::Flat
() ) keepGoing =
false
;
79
}
80
81
p->
setLifetime
( gt * ctau );
82
83
return
;
84
}
exp
EvtComplex exp(const EvtComplex &c)
Definition
EvtComplex.hh:209
EvtDMix.hh
EvtGenKine.hh
EvtPDL.hh
EvtParticle.hh
EvtPatches.hh
EvtRandom.hh
EvtReport.hh
weight
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
Definition
KarFin.h:34
EvtDMix::initProbMax
void initProbMax()
Definition
EvtDMix.cc:46
EvtDMix::EvtDMix
EvtDMix()
Definition
EvtDMix.hh:33
EvtDMix::clone
EvtDecayBase * clone()
Definition
EvtDMix.cc:35
EvtDMix::~EvtDMix
virtual ~EvtDMix()
Definition
EvtDMix.cc:31
EvtDMix::getName
void getName(std::string &name)
Definition
EvtDMix.cc:33
EvtDMix::init
void init()
Definition
EvtDMix.cc:37
EvtDMix::decay
void decay(EvtParticle *p)
Definition
EvtDMix.cc:48
EvtDecayBase::getArg
double getArg(int j)
Definition
EvtDecayBase.cc:520
EvtDecayBase::EvtDecayBase
EvtDecayBase()
Definition
EvtDecayBase.cc:205
EvtDecayBase::noProbMax
void noProbMax()
Definition
EvtDecayBase.cc:267
EvtDecayBase::getNDaug
int getNDaug()
Definition
EvtDecayBase.hh:67
EvtDecayBase::getDaugs
EvtId * getDaugs()
Definition
EvtDecayBase.hh:68
EvtDecayBase::checkNArg
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
Definition
EvtDecayBase.cc:449
EvtPDL::getctau
static double getctau(EvtId i)
Definition
EvtPDL.hh:60
EvtParticle
Definition
EvtParticle.hh:42
EvtParticle::getId
EvtId getId() const
Definition
EvtParticle.cc:100
EvtParticle::setLifetime
void setLifetime(double tau)
Definition
EvtParticle.cc:84
EvtParticle::initializePhaseSpace
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
Definition
EvtParticle.cc:1042
EvtRandom::Flat
static double Flat()
Definition
EvtRandom.cc:69
EvtRandom::Flat
static double Flat(double min, double max)
Definition
EvtRandom.cc:55
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenModels
EvtDMix.cc
Generated by
1.16.1