BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BOSS_Gen/BesEvtGen/src/EvtGen/EvtGenModels/EvtDIY.cc
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
// Environment:
4
// This software is part of models developed at BES collaboration
5
// based on the EvtGen framework. If you use all or part
6
// of it, please give an appropriate acknowledgement.
7
//
8
// Copyright Information: See EvtGen/BesCopyright
9
// Copyright (A) 2006 Ping Rong-Gang @IHEP
10
//
11
// Module: EvtDIY.cc
12
//
13
// Description: Model provided by user, see the mannual
14
//
15
// Modification history:
16
//
17
// Ping R.-G. December, 2006 Module created
18
//
19
//------------------------------------------------------------------------
20
21
#include "
EvtDIY.hh
"
22
#include "
../EvtGenBase/EvtDiracParticle.hh
"
23
#include "
../EvtGenBase/EvtGenKine.hh
"
24
#include "
../EvtGenBase/EvtHighSpinParticle.hh
"
25
#include "
../EvtGenBase/EvtNeutrinoParticle.hh
"
26
#include "
../EvtGenBase/EvtPDL.hh
"
27
#include "
../EvtGenBase/EvtParticle.hh
"
28
#include "
../EvtGenBase/EvtPatches.hh
"
29
#include "
../EvtGenBase/EvtPhotonParticle.hh
"
30
#include "
../EvtGenBase/EvtRandom.hh
"
31
#include "
../EvtGenBase/EvtRaritaSchwingerParticle.hh
"
32
#include "
../EvtGenBase/EvtReport.hh
"
33
#include "
../EvtGenBase/EvtScalarParticle.hh
"
34
#include "
../EvtGenBase/EvtStringParticle.hh
"
35
#include "
../EvtGenBase/EvtTensor4C.hh
"
36
#include "
../EvtGenBase/EvtTensorParticle.hh
"
37
#include "
../EvtGenBase/EvtVector4C.hh
"
38
#include "
../EvtGenBase/EvtVector4R.hh
"
39
#include "
../EvtGenBase/EvtVectorParticle.hh
"
40
#include <stdlib.h>
41
#include <string>
42
using namespace
std
;
//::endl;
43
44
EvtDIY::~EvtDIY
() {}
45
46
void
EvtDIY::getName
( std::string& model_name ) { model_name =
"DIY"
; }
47
48
EvtDecayBase
*
EvtDIY::clone
() {
return
new
EvtDIY
; }
49
50
void
EvtDIY::init
() {
51
52
// check that there are 1 arguments:angular distribution parameter
53
// checkNArg(0);
54
// checkNDaug(2);
55
EvtSpinType::spintype
parenttype =
EvtPDL::getSpinType
(
getParentId
() );
56
// if ( parenttype == EvtSpinType::SCALAR ){
57
// report(ERROR,"EvtGen")<<"Scalar decays with flat distribution"<<endl;
58
// ::abort();
59
// }
60
}
61
void
EvtDIY::initProbMax
() {
noProbMax
(); }
62
63
static
int
nrun = 1;
64
static
double
max_amps = 0.0;
65
66
void
EvtDIY::decay
(
EvtParticle
* p ) {
67
68
double
amps, SamAmps, rd1;
69
// calculated the max amplitude square in 20000 events, is it enough larger?
70
if
( nrun == 1 )
71
{
72
int
ir, nd;
73
for
( ir = 0; ir <= 200000; ir++ )
74
{
75
loop0:
76
p->
initializePhaseSpace
(
getNDaug
(),
getDaugs
() );
77
int
nd = p->
getNDaug
(), i;
78
_nd = nd;
79
for
( i = 0; i <= nd - 1; i++ )
80
{
81
_p4Lab[i] = p->
getDaug
( i )->
getP4Lab
();
82
_p4CM[i] = p->
getDaug
( i )->
getP4
();
83
}
84
amps =
AmplitudeSquare
();
85
if
( amps < 0 )
goto
loop0;
86
if
( amps > max_amps ) max_amps = amps * 1.01;
87
nrun++;
88
}
89
}
90
if
( max_amps == 0.0 )
91
{
92
report
(
ERROR
,
"EvtGen"
) <<
"The decay amplitude square should be positive number"
93
<< endl;
94
abort();
95
}
96
// cout<<"max_amp="<<max_amps<<endl;
97
98
loop:
99
p->
initializePhaseSpace
(
getNDaug
(),
getDaugs
() );
100
int
i;
101
for
( i = 0; i <= p->
getNDaug
() - 1; i++ )
102
{
103
_p4Lab[i] = p->
getDaug
( i )->
getP4Lab
();
104
_p4CM[i] = p->
getDaug
( i )->
getP4
();
105
}
106
// Put phase space results into the daughters.
107
amps =
AmplitudeSquare
();
108
if
( amps < 0 )
goto
loop;
109
SamAmps = amps / max_amps;
110
rd1 =
EvtRandom::Flat
( 0.0, 1.0 );
111
if
( rd1 >= SamAmps )
goto
loop;
112
return
;
113
}
EvtDIY.hh
EvtDiracParticle.hh
EvtGenKine.hh
EvtHighSpinParticle.hh
EvtNeutrinoParticle.hh
EvtPDL.hh
EvtParticle.hh
EvtPatches.hh
EvtPhotonParticle.hh
EvtRandom.hh
EvtRaritaSchwingerParticle.hh
report
ostream & report(Severity severity, const char *facility)
Definition
EvtReport.cc:34
EvtReport.hh
ERROR
@ ERROR
Definition
EvtReport.hh:49
EvtScalarParticle.hh
EvtStringParticle.hh
EvtTensor4C.hh
EvtTensorParticle.hh
EvtVector4C.hh
EvtVector4R.hh
EvtVectorParticle.hh
EvtDIY::initProbMax
void initProbMax()
Definition
BOSS_Gen/BesEvtGen/src/EvtGen/EvtGenModels/EvtDIY.cc:61
EvtDIY::getName
void getName(std::string &name)
Definition
BOSS_Gen/BesEvtGen/src/EvtGen/EvtGenModels/EvtDIY.cc:46
EvtDIY::AmplitudeSquare
double AmplitudeSquare()
Definition
UserDIY.cc:182
EvtDIY::~EvtDIY
virtual ~EvtDIY()
Definition
BOSS_Gen/BesEvtGen/src/EvtGen/EvtGenModels/EvtDIY.cc:44
EvtDIY::clone
EvtDecayBase * clone()
Definition
BOSS_Gen/BesEvtGen/src/EvtGen/EvtGenModels/EvtDIY.cc:48
EvtDIY::init
void init()
Definition
BOSS_Gen/BesEvtGen/src/EvtGen/EvtGenModels/EvtDIY.cc:50
EvtDIY::EvtDIY
EvtDIY()
Definition
EvtDIY.hh:32
EvtDIY::decay
void decay(EvtParticle *p)
Definition
BOSS_Gen/BesEvtGen/src/EvtGen/EvtGenModels/EvtDIY.cc:66
EvtDecayBase::EvtDecayBase
EvtDecayBase()
Definition
EvtDecayBase.cc:205
EvtDecayBase::noProbMax
void noProbMax()
Definition
EvtDecayBase.cc:267
EvtDecayBase::getParentId
EvtId getParentId()
Definition
EvtDecayBase.hh:63
EvtDecayBase::getNDaug
int getNDaug()
Definition
EvtDecayBase.hh:67
EvtDecayBase::getDaugs
EvtId * getDaugs()
Definition
EvtDecayBase.hh:68
EvtPDL::getSpinType
static EvtSpinType::spintype getSpinType(EvtId i)
Definition
EvtPDL.hh:66
EvtParticle
Definition
EvtParticle.hh:42
EvtParticle::getP4Lab
EvtVector4R getP4Lab()
Definition
EvtParticle.cc:694
EvtParticle::getP4
const EvtVector4R & getP4() const
Definition
EvtParticle.cc:108
EvtParticle::getNDaug
int getNDaug() const
Definition
EvtParticle.cc:112
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition
EvtParticle.cc:80
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
EvtSpinType::spintype
spintype
Definition
EvtSpinType.hh:30
std
Definition
x86_64-el9-gcc13-dbg/Event/RootEventData/RootEventDataDict.cxx:101
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenModels
EvtDIY.cc
Generated by
1.16.1