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"
21#include <stdlib.h>
22#include <string>
23using std::endl;
24
26
27void EvtSinglePoint::getName( std::string& model_name ) { model_name = "SinglePoint"; }
28
30
32
33 // turn off checks for charge conservation
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
51
52 EvtParticle* d;
53 EvtVector4R p4;
54
55 double mass = EvtPDL::getMass( getDaug( 0 ) );
56
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}
double mass
double getArg(int j)
void disableCheckQ()
EvtId * getDaugs()
EvtId getDaug(int i)
static double getMass(EvtId i)
Definition EvtPDL.hh:44
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle * getDaug(int i)
EvtDecayBase * clone()
void getName(std::string &name)
virtual ~EvtSinglePoint()
void decay(EvtParticle *p)
void set(int i, double d)