BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDecayProb.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: EvtGen/EvtDecayProb.cc
12
//
13
// Description:
14
//
15
// Modification history:
16
//
17
// DJL/RYD August 11, 1998 Module created
18
//
19
//------------------------------------------------------------------------
20
#include "
EvtPatches.hh
"
21
22
#include "
EvtDecayBase.hh
"
23
#include "
EvtDecayProb.hh
"
24
#include "
EvtPDL.hh
"
25
#include "
EvtParticle.hh
"
26
#include "
EvtRadCorr.hh
"
27
#include "
EvtRandom.hh
"
28
#include "
EvtReport.hh
"
29
using
std::endl;
30
31
void
EvtDecayProb::makeDecay
(
EvtParticle
* p ) {
32
33
int
ntimes = 10000;
34
35
double
dummy;
36
37
do
{
38
_weight = 1.0;
39
_daugsDecayedByParentModel
=
false
;
40
41
decay
( p );
42
// report(INFO,"EvtGen") << _weight << endl;
43
// debugging
44
45
ntimes--;
46
47
_prob = _prob / _weight;
48
49
dummy =
getProbMax
( _prob ) *
EvtRandom::Flat
();
50
p->
setDecayProb
( _prob /
getProbMax
( _prob ) );
51
// report(INFO,"EvtGen") << _prob <<" "<<dummy<<" "<<ntimes<<endl;
52
}
while
( ntimes && ( _prob < dummy ) );
53
// report(INFO,"EvtGen") << ntimes <<endl;
54
if
( ntimes == 0 )
55
{
56
report
(
DEBUG
,
"EvtGen"
) <<
"Tried accept/reject:10000"
57
<<
" times, and rejected all the times!"
<< endl;
58
report
(
DEBUG
,
"EvtGen"
) <<
"Is therefore accepting the last event!"
<< endl;
59
report
(
DEBUG
,
"EvtGen"
) <<
"Decay of particle:"
<<
EvtPDL::name
( p->
getId
() ).c_str()
60
<<
"(channel:"
<< p->
getChannel
() <<
") with mass "
<< p->
mass
()
61
<< endl;
62
63
int
ii;
64
for
( ii = 0; ii < p->
getNDaug
(); ii++ )
65
{
66
report
(
DEBUG
,
"EvtGen"
) <<
"Daughter "
<< ii <<
":"
67
<<
EvtPDL::name
( p->
getDaug
( ii )->
getId
() ).c_str()
68
<<
" with mass "
<< p->
getDaug
( ii )->
mass
() << endl;
69
}
70
}
71
72
EvtSpinDensity
rho;
73
rho.
SetDiag
( p->
getSpinStates
() );
74
p->
setSpinDensityBackward
( rho );
75
if
(
getPHOTOS
() ||
EvtRadCorr::alwaysRadCorr
() ) {
EvtRadCorr::doRadCorr
( p ); }
76
77
// Now decay the daughters.
78
if
( !
daugsDecayedByParentModel
() )
79
{
80
int
i;
81
for
( i = 0; i < p->
getNDaug
(); i++ )
82
{
83
// Need to set the spin density of the daughters to be
84
// diagonal.
85
rho.
SetDiag
( p->
getDaug
( i )->
getSpinStates
() );
86
p->
getDaug
( i )->
setSpinDensityForward
( rho );
87
88
// Now decay the daughter. Really!
89
p->
getDaug
( i )->
decay
();
90
}
91
}
92
}
EvtDecayBase.hh
EvtDecayProb.hh
EvtPDL.hh
EvtParticle.hh
EvtPatches.hh
EvtRadCorr.hh
EvtRandom.hh
report
ostream & report(Severity severity, const char *facility)
Definition
EvtReport.cc:34
EvtReport.hh
DEBUG
@ DEBUG
Definition
EvtReport.hh:53
EvtDecayBase::getPHOTOS
int getPHOTOS()
Definition
EvtDecayBase.hh:71
EvtDecayBase::decay
virtual void decay(EvtParticle *p)=0
EvtDecayBase::getProbMax
double getProbMax(double prob)
Definition
EvtDecayBase.cc:65
EvtDecayBase::daugsDecayedByParentModel
bool daugsDecayedByParentModel()
Definition
EvtDecayBase.hh:109
EvtDecayBase::_daugsDecayedByParentModel
bool _daugsDecayedByParentModel
Definition
EvtDecayBase.hh:108
EvtDecayProb::makeDecay
void makeDecay(EvtParticle *p)
Definition
EvtDecayProb.cc:31
EvtPDL::name
static std::string name(EvtId i)
Definition
EvtPDL.hh:70
EvtParticle
Definition
EvtParticle.hh:42
EvtParticle::setSpinDensityBackward
void setSpinDensityBackward(const EvtSpinDensity &rho)
Definition
EvtParticle.hh:348
EvtParticle::setSpinDensityForward
void setSpinDensityForward(const EvtSpinDensity &rho)
Definition
EvtParticle.hh:320
EvtParticle::setDecayProb
void setDecayProb(double p)
Definition
EvtParticle.cc:1181
EvtParticle::decay
void decay()
Definition
EvtParticle.cc:407
EvtParticle::getId
EvtId getId() const
Definition
EvtParticle.cc:100
EvtParticle::getSpinStates
int getSpinStates() const
Definition
EvtParticle.cc:104
EvtParticle::getNDaug
int getNDaug() const
Definition
EvtParticle.cc:112
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition
EvtParticle.cc:80
EvtParticle::mass
double mass() const
Definition
EvtParticle.cc:114
EvtParticle::getChannel
int getChannel() const
Definition
EvtParticle.cc:110
EvtRadCorr::alwaysRadCorr
static bool alwaysRadCorr()
Definition
EvtRadCorr.cc:61
EvtRadCorr::doRadCorr
static void doRadCorr(EvtParticle *p)
Definition
EvtRadCorr.cc:48
EvtRandom::Flat
static double Flat()
Definition
EvtRandom.cc:69
EvtSpinDensity
Definition
EvtSpinDensity.hh:26
EvtSpinDensity::SetDiag
void SetDiag(int n)
Definition
EvtSpinDensity.cc:101
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenBase
EvtDecayProb.cc
Generated by
1.16.1