BOSS 7.0.4
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//
15#include <stdlib.h>
18#include "EvtGenBase/EvtPDL.hh"
21#include <string>
23using std::endl;
24
26
27void EvtSinglePoint::getName(std::string& model_name){
28
29 model_name="SinglePoint";
30
31}
32
34
35 return new EvtSinglePoint();
36
37}
38
40
41
42 //turn off checks for charge conservation
44
45 if ((getNArg()==3)) {
46 px = getArg(0);
47 py = getArg(1);
48 pz = getArg(2);
49
50 } else{
51 std::cout<<"expected three parameters: px, py, pz, but find "<<getNArg()<<" parameters"<<std::endl;
52 ::abort();
53 }
54
55}
56
58
59 EvtParticle *d;
60 EvtVector4R p4;
61
62 double mass=EvtPDL::getMass(getDaug(0));
63
65 d=p->getDaug(0);
66
67 //generate flat distribution in p
68 //we are now in the parents restframe! This means the
69 //restframe of the e+e- collison.
70
71 double pmag;
72 pmag = sqrt(px*px + py*py + py*pz);
73
74
75 p4.set(sqrt(mass*mass+pmag*pmag),px,py,pz);
76 d->init( getDaug(0),p4);
77 return ;
78}
79
80
81
double mass
double getArg(int j)
void disableCheckQ()
Definition: EvtDecayBase.hh:62
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
EvtId getDaug(int i)
Definition: EvtDecayBase.hh:66
static double getMass(EvtId i)
Definition: EvtPDL.hh:46
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:85
EvtDecayBase * clone()
void getName(std::string &name)
virtual ~EvtSinglePoint()
void decay(EvtParticle *p)
void set(int i, double d)
Definition: EvtVector4R.hh:183