BOSS
7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipiB.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: EvtEtap2gpipiB.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
// qinlq Sep., 2011 Module created
19
//
20
//------------------------------------------------------------------------
21
22
#include "EvtGenBase/EvtPatches.hh"
23
#include <stdlib.h>
24
#include "EvtGenBase/EvtParticle.hh"
25
#include "EvtGenBase/EvtGenKine.hh"
26
#include "EvtGenBase/EvtPDL.hh"
27
#include "EvtGenBase/EvtVector4C.hh"
28
#include "EvtGenBase/EvtVector4R.hh"
29
#include "EvtGenBase/EvtTensor4C.hh"
30
#include "EvtGenBase/EvtDiracParticle.hh"
31
#include "EvtGenBase/EvtScalarParticle.hh"
32
#include "EvtGenBase/EvtVectorParticle.hh"
33
#include "EvtGenBase/EvtTensorParticle.hh"
34
#include "EvtGenBase/EvtPhotonParticle.hh"
35
#include "EvtGenBase/EvtNeutrinoParticle.hh"
36
#include "EvtGenBase/EvtStringParticle.hh"
37
#include "EvtGenBase/EvtRaritaSchwingerParticle.hh"
38
#include "EvtGenBase/EvtHighSpinParticle.hh"
39
#include "EvtGenBase/EvtReport.hh"
40
#include "EvtGenModels/EvtEtap2gpipiB.hh"
41
#include "EvtGenBase/EvtRandom.hh"
42
#include <string>
43
using namespace
std
;
//::endl;
44
45
EvtEtap2gpipiB::~EvtEtap2gpipiB
() {}
46
47
void
EvtEtap2gpipiB::getName
(std::string& model_name){
48
49
model_name=
"Etap2gpipiB"
;
50
51
}
52
53
EvtDecayBase
*
EvtEtap2gpipiB::clone
(){
54
55
return
new
EvtEtap2gpipiB
;
56
57
}
58
59
60
void
EvtEtap2gpipiB::init
(){
61
62
// check that there are 1 arguments:angular distribution parameter
63
checkNArg
(1);
64
checkNDaug
(3);
65
EvtSpinType::spintype
parenttype =
EvtPDL::getSpinType
(
getParentId
());
66
}
67
void
EvtEtap2gpipiB::initProbMax
(){
68
noProbMax
();
69
}
70
71
72
int
EvtEtap2gpipiB::nrun=1;
73
double
EvtEtap2gpipiB::max_amps=0.0;
74
75
void
EvtEtap2gpipiB::decay
(
EvtParticle
*p ){
76
77
double
amps,SamAmps,rd1;
78
79
80
// calculated the max amplitude square in 20000 events, is it enough larger?
81
82
if
(nrun==1){
83
int
ir,nd;
84
for
(ir=0;ir<=2000000;ir++){
85
// for(ir=0;ir<=20000;ir++){
86
loop0:
87
p->
initializePhaseSpace
(
getNDaug
(),
getDaugs
());
88
int
nd=p->
getNDaug
(),i;
89
_nd=nd;
90
for
(i=0;i<=nd-1;i++){
91
_p4Lab[i]=p->
getDaug
(i)->
getP4Lab
();
92
_p4CM[i]=p->
getDaug
(i)->
getP4
();
93
}
94
amps=
AmplitudeSquare
();
95
if
(amps<0)
goto
loop0;
96
if
(amps>max_amps) max_amps=amps*1.01;
97
98
//cout<<"amps= "<<amps<<endl;
99
//cout<<"max_amps= "<<max_amps<<endl;
100
101
if
(nrun<2){
//check decay card
102
EvtId
pid0= p->
getId
();
//etaprime
103
EvtId
pid1= p->
getDaug
(0)->
getId
();
//pi+
104
EvtId
pid2= p->
getDaug
(1)->
getId
();
//pi-
105
EvtId
pid3= p->
getDaug
(2)->
getId
();
//gamma
106
if
(pid0!=
EvtPDL::getId
(
"eta'"
)) { std::cout<<
"Etap2gpipiB need specify the parent as etaprime"
<<std::endl;abort();}
107
if
(pid3!=
EvtPDL::getId
(
"gamma"
)) { std::cout<<
"Etap2gpipiB need specify the daughters as pi+ pi- gamma"
<<std::endl;abort();}
108
}
109
nrun++;
110
}
111
}
112
113
//cout<<"max_amps= "<<max_amps<<endl;
114
115
116
if
(max_amps==0.0) {
report
(
ERROR
,
"EvtGen"
)<<
"The decay amplitude square should be positive number"
<<endl;abort();}
117
118
//cout<<"max_amp="<<max_amps<<endl;
119
120
loop:
121
p->
initializePhaseSpace
(
getNDaug
(),
getDaugs
());
122
int
i;
123
for
(i=0;i<=p->
getNDaug
()-1;i++){
124
_p4Lab[i]=p->
getDaug
(i)->
getP4Lab
();
125
_p4CM[i]=p->
getDaug
(i)->
getP4
();
126
}
127
// Put phase space results into the daughters.
128
amps=
AmplitudeSquare
();
129
if
(amps < 0)
goto
loop;
130
SamAmps=amps/max_amps;
131
rd1=
EvtRandom::Flat
(0.0, 1.0);
132
if
(rd1>=SamAmps)
goto
loop;
133
return ;
134
}
135
136
report
ostream & report(Severity severity, const char *facility)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtReport.cc:36
ERROR
@ ERROR
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtReport.hh:49
EvtDecayBase
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:33
EvtDecayBase::noProbMax
void noProbMax()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:304
EvtDecayBase::getParentId
EvtId getParentId()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:60
EvtDecayBase::getNDaug
int getNDaug()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:64
EvtDecayBase::checkNDaug
void checkNDaug(int d1, int d2=-1)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:504
EvtDecayBase::getDaugs
EvtId * getDaugs()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:65
EvtDecayBase::checkNArg
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:482
EvtEtap2gpipiB::AmplitudeSquare
double AmplitudeSquare()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtAmpsEtap2gpipiB.cc:163
EvtEtap2gpipiB::~EvtEtap2gpipiB
virtual ~EvtEtap2gpipiB()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipiB.cc:45
EvtEtap2gpipiB::getName
void getName(std::string &name)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipiB.cc:47
EvtEtap2gpipiB::init
void init()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipiB.cc:60
EvtEtap2gpipiB::initProbMax
void initProbMax()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipiB.cc:67
EvtEtap2gpipiB::decay
void decay(EvtParticle *p)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipiB.cc:75
EvtEtap2gpipiB::EvtEtap2gpipiB
EvtEtap2gpipiB()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipiB.hh:34
EvtEtap2gpipiB::clone
EvtDecayBase * clone()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtEtap2gpipiB.cc:53
EvtId
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtId.hh:27
EvtPDL::getSpinType
static EvtSpinType::spintype getSpinType(EvtId i)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPDL.hh:61
EvtPDL::getId
static EvtId getId(const std::string &name)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPDL.cc:287
EvtParticle
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.hh:42
EvtParticle::getP4Lab
EvtVector4R getP4Lab()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:685
EvtParticle::getId
EvtId getId() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:113
EvtParticle::getP4
const EvtVector4R & getP4() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:121
EvtParticle::getNDaug
int getNDaug() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:125
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:85
EvtParticle::initializePhaseSpace
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:1071
EvtRandom::Flat
static double Flat()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtRandom.cc:74
EvtSpinType::spintype
spintype
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtSpinType.hh:31
std
Definition:
RootEventData_rootcint.cxx:16
source
Generator
BesEvtGen
bak-BesEvtGen-00-04-08
src
EvtGen
EvtGenModels
EvtEtap2gpipiB.cc
Generated by
1.9.6