BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtSingleParticle Class Reference

#include <EvtSingleParticle.hh>

+ Inheritance diagram for EvtSingleParticle:

Public Member Functions

 EvtSingleParticle ()
 
virtual ~EvtSingleParticle ()
 
void getName (std::string &name)
 
EvtDecayBaseclone ()
 
void decay (EvtParticle *p)
 
void init ()
 
- Public Member Functions inherited from EvtDecayIncoherent
void makeDecay (EvtParticle *p)
 
virtual ~EvtDecayIncoherent ()
 
void setDaughterSpinDensity (int daughter)
 
int isDaughterSpinDensitySet (int daughter)
 
- Public Member Functions inherited from EvtDecayBase
virtual void getName (std::string &name)=0
 
virtual void decay (EvtParticle *p)=0
 
virtual void makeDecay (EvtParticle *p)=0
 
virtual EvtDecayBaseclone ()=0
 
virtual void init ()
 
virtual void initProbMax ()
 
virtual std::string commandName ()
 
virtual void command (std::string cmd)
 
double getProbMax (double prob)
 
double resetProbMax (double prob)
 
 EvtDecayBase ()
 
virtual ~EvtDecayBase ()
 
virtual bool matchingDecay (const EvtDecayBase &other) const
 
EvtId getParentId ()
 
double getBranchingFraction ()
 
void disableCheckQ ()
 
void checkQ ()
 
int getNDaug ()
 
EvtIdgetDaugs ()
 
EvtId getDaug (int i)
 
int getNArg ()
 
int getPHOTOS ()
 
void setPHOTOS ()
 
void setVerbose ()
 
void setSummary ()
 
double * getArgs ()
 
std::string * getArgsStr ()
 
double getArg (int j)
 
std::string getArgStr (int j)
 
std::string getModelName ()
 
int getDSum ()
 
int summary ()
 
int verbose ()
 
void saveDecayInfo (EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
 
void printSummary ()
 
void setProbMax (double prbmx)
 
void noProbMax ()
 
void checkNArg (int a1, int a2=-1, int a3=-1, int a4=-1)
 
void checkNDaug (int d1, int d2=-1)
 
void checkSpinParent (EvtSpinType::spintype sp)
 
void checkSpinDaughter (int d1, EvtSpinType::spintype sp)
 
virtual int nRealDaughters ()
 

Additional Inherited Members

- Static Public Member Functions inherited from EvtDecayBase
static void findMasses (EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
 
static void findMass (EvtParticle *p)
 
static double findMaxMass (EvtParticle *p)
 
- Protected Member Functions inherited from EvtDecayBase
bool daugsDecayedByParentModel ()
 
- Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel
 

Detailed Description

Definition at line 29 of file EvtSingleParticle.hh.

Constructor & Destructor Documentation

◆ EvtSingleParticle()

EvtSingleParticle::EvtSingleParticle ( )
inline

Definition at line 33 of file EvtSingleParticle.hh.

33{}

Referenced by clone().

◆ ~EvtSingleParticle()

EvtSingleParticle::~EvtSingleParticle ( )
virtual

Definition at line 32 of file EvtSingleParticle.cc.

32{}

Member Function Documentation

◆ clone()

EvtDecayBase * EvtSingleParticle::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 40 of file EvtSingleParticle.cc.

40 {
41
42 return new EvtSingleParticle();
43
44}

◆ decay()

void EvtSingleParticle::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

Definition at line 115 of file EvtSingleParticle.cc.

115 {
116
117 EvtParticle *d;
118 EvtVector4R p4;
119
120 double mass=EvtPDL::getMass(getDaug(0));
121
123 d=p->getDaug(0);
124
125 //generate flat distribution in p
126 //we are now in the parents restframe! This means the
127 //restframe of the e+e- collison.
128 double pcm;
129 if (pmin==pmax) pcm=pmin; //pingrg, 2008-04-15
130 if (pmin< pmax) pcm=EvtRandom::Flat(pmin,pmax);
131
132 //generate flat distribution in phi.
133 double phi;
134 if(phimin==phimax) phi=phimin; //pingrg 2008-10-22
135 else phi=EvtRandom::Flat(phimin,phimax);
136
137 double cthetalab;
138
139 do{
140 //generate flat distribution in costheta
141 double ctheta;
142 if(cthetamin==cthetamax) ctheta=cthetamin;
143 else ctheta=EvtRandom::Flat(cthetamin,cthetamax);
144 double stheta=sqrt(1.0-ctheta*ctheta);
145 p4.set(sqrt(mass*mass+pcm*pcm),pcm*cos(phi)*stheta,
146 pcm*sin(phi)*stheta,pcm*ctheta);
147
148 d->init( getDaug(0),p4);
149
150 //get 4 vector in the lab frame!
151 EvtVector4R p4lab=d->getP4Lab();
152 cthetalab=p4lab.get(3)/p4lab.d3mag();
153 }while (cthetalab>cthetamax||cthetalab<cthetamin);
154
155 return ;
156}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
double mass
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
EvtVector4R getP4Lab()
Definition: EvtParticle.cc:683
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:85
static double Flat()
Definition: EvtRandom.cc:73
double get(int i) const
Definition: EvtVector4R.hh:179
double d3mag() const
Definition: EvtVector4R.cc:186
void set(int i, double d)
Definition: EvtVector4R.hh:183

◆ getName()

void EvtSingleParticle::getName ( std::string &  name)
virtual

Implements EvtDecayBase.

Definition at line 34 of file EvtSingleParticle.cc.

34 {
35
36 model_name="SINGLE";
37
38}

◆ init()

void EvtSingleParticle::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 46 of file EvtSingleParticle.cc.

46 {
47
48
49 //turn off checks for charge conservation
51
52 if ((getNArg()==6)||(getNArg()==4)||(getNArg()==2)) {
53
54 if (getNArg()==6){
55 //copy the arguments into eaiser to remember names!
56
57 pmin=getArg(0);
58 pmax=getArg(1);
59
60 cthetamin=getArg(2);
61 cthetamax=getArg(3);
62
63 phimin=getArg(4);
64 phimax=getArg(5);
65
66 }
67
68 if (getNArg()==4){
69 //copy the arguments into eaiser to remember names!
70
71 pmin=getArg(0);
72 pmax=getArg(1);
73
74 cthetamin=getArg(2);
75 cthetamax=getArg(3);
76
77 phimin=0.0;
78 phimax=EvtConst::twoPi;
79
80 }
81
82 if (getNArg()==2){
83 //copy the arguments into eaiser to remember names!
84
85 pmin=getArg(0);
86 pmax=getArg(1);
87
88 cthetamin=-1.0;
89 cthetamax=1.0;
90
91 phimin=0.0;
92 phimax=EvtConst::twoPi;
93
94 }
95
96
97 }else{
98
99 report(ERROR,"EvtGen") << "EvtSingleParticle generator expected "
100 << " 6, 4, or 2 arguments but found:"<<getNArg()<<endl;
101 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
102 ::abort();
103
104 }
105
106
107 report(INFO,"EvtGen") << "The single particle generator has been configured:"
108 <<endl;
109 report(INFO,"EvtGen") << pmax << " > p > " << pmin <<endl;
110 report(INFO,"EvtGen") << cthetamax << " > costheta > " << cthetamin <<endl;
111 report(INFO,"EvtGen") << phimax << " > phi > " << phimin <<endl;
112
113}
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
@ INFO
Definition: EvtReport.hh:52
static const double twoPi
Definition: EvtConst.hh:29
double getArg(int j)
void disableCheckQ()
Definition: EvtDecayBase.hh:62

The documentation for this class was generated from the following files: