BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/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 "EvtGenBase/EvtPatches.hh"
15#include <stdlib.h>
16#include "EvtGenBase/EvtParticle.hh"
17#include "EvtGenBase/EvtRandom.hh"
18#include "EvtGenBase/EvtPDL.hh"
19#include "EvtGenModels/EvtSinglePoint.hh"
20#include "EvtGenBase/EvtReport.hh"
21#include <string>
22#include "EvtGenBase/EvtConst.hh"
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
virtual void init(EvtId part_n, const EvtVector4R &p4)=0