BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtSinglePoint.cc
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
//
4
// Module: EvtSinglePoint.cc
5
//
6
// Description: Special model to generate single particles with fixed momentu.
7
//
8
// Modification history:
9
//
10
// RYD Febuary 17,1998 Module created
11
//
12
//------------------------------------------------------------------------
13
//
14
#include "
EvtSinglePoint.hh
"
15
#include "
../EvtGenBase/EvtConst.hh
"
16
#include "
../EvtGenBase/EvtPDL.hh
"
17
#include "
../EvtGenBase/EvtParticle.hh
"
18
#include "
../EvtGenBase/EvtPatches.hh
"
19
#include "
../EvtGenBase/EvtRandom.hh
"
20
#include "
../EvtGenBase/EvtReport.hh
"
21
#include <stdlib.h>
22
#include <string>
23
using
std::endl;
24
25
EvtSinglePoint::~EvtSinglePoint
() {}
26
27
void
EvtSinglePoint::getName
( std::string& model_name ) { model_name =
"SinglePoint"
; }
28
29
EvtDecayBase
*
EvtSinglePoint::clone
() {
return
new
EvtSinglePoint
(); }
30
31
void
EvtSinglePoint::init
() {
32
33
// turn off checks for charge conservation
34
disableCheckQ
();
35
36
if
( (
getNArg
() == 3 ) )
37
{
38
px =
getArg
( 0 );
39
py =
getArg
( 1 );
40
pz =
getArg
( 2 );
41
}
42
else
43
{
44
std::cout <<
"expected three parameters: px, py, pz, but find "
<<
getNArg
()
45
<<
" parameters"
<< std::endl;
46
::abort();
47
}
48
}
49
50
void
EvtSinglePoint::decay
(
EvtParticle
* p ) {
51
52
EvtParticle
* d;
53
EvtVector4R
p4;
54
55
double
mass
=
EvtPDL::getMass
(
getDaug
( 0 ) );
56
57
p->
makeDaughters
(
getNDaug
(),
getDaugs
() );
58
d = p->
getDaug
( 0 );
59
60
// generate flat distribution in p
61
// we are now in the parents restframe! This means the
62
// restframe of the e+e- collison.
63
64
double
pmag;
65
pmag = sqrt( px * px + py * py + py * pz );
66
67
p4.
set
( sqrt(
mass
*
mass
+ pmag * pmag ), px, py, pz );
68
d->
init
(
getDaug
( 0 ), p4 );
69
return
;
70
}
mass
double mass
Definition
CosmicGenerator.cxx:128
EvtConst.hh
EvtPDL.hh
EvtParticle.hh
EvtPatches.hh
EvtRandom.hh
EvtReport.hh
EvtSinglePoint.hh
EvtDecayBase::getArg
double getArg(int j)
Definition
EvtDecayBase.cc:520
EvtDecayBase::EvtDecayBase
EvtDecayBase()
Definition
EvtDecayBase.cc:205
EvtDecayBase::disableCheckQ
void disableCheckQ()
Definition
EvtDecayBase.hh:65
EvtDecayBase::getNDaug
int getNDaug()
Definition
EvtDecayBase.hh:67
EvtDecayBase::getNArg
int getNArg()
Definition
EvtDecayBase.hh:70
EvtDecayBase::getDaugs
EvtId * getDaugs()
Definition
EvtDecayBase.hh:68
EvtDecayBase::getDaug
EvtId getDaug(int i)
Definition
EvtDecayBase.hh:69
EvtPDL::getMass
static double getMass(EvtId i)
Definition
EvtPDL.hh:44
EvtParticle
Definition
EvtParticle.hh:42
EvtParticle::makeDaughters
void makeDaughters(int ndaug, EvtId *id)
Definition
EvtParticle.cc:1150
EvtParticle::init
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition
EvtParticle.cc:80
EvtSinglePoint::clone
EvtDecayBase * clone()
Definition
EvtSinglePoint.cc:29
EvtSinglePoint::getName
void getName(std::string &name)
Definition
EvtSinglePoint.cc:27
EvtSinglePoint::EvtSinglePoint
EvtSinglePoint()
Definition
EvtSinglePoint.hh:24
EvtSinglePoint::init
void init()
Definition
EvtSinglePoint.cc:31
EvtSinglePoint::~EvtSinglePoint
virtual ~EvtSinglePoint()
Definition
EvtSinglePoint.cc:25
EvtSinglePoint::decay
void decay(EvtParticle *p)
Definition
EvtSinglePoint.cc:50
EvtVector4R
Definition
EvtVector4R.hh:29
EvtVector4R::set
void set(int i, double d)
Definition
EvtVector4R.hh:173
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenModels
EvtSinglePoint.cc
Generated by
1.16.1