BOSS 8.0.0
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 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 28 of file EvtSingleParticle.hh.

Constructor & Destructor Documentation

◆ EvtSingleParticle()

EvtSingleParticle::EvtSingleParticle ( )
inline

Definition at line 31 of file EvtSingleParticle.hh.

31{}

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 36 of file EvtSingleParticle.cc.

36{ return new EvtSingleParticle(); }

◆ decay()

void EvtSingleParticle::decay ( EvtParticle * p)
virtual

Implements EvtDecayBase.

Definition at line 103 of file EvtSingleParticle.cc.

103 {
104
105 EvtParticle* d;
106 EvtVector4R p4;
107
108 double mass = EvtPDL::getMass( getDaug( 0 ) );
109
111 d = p->getDaug( 0 );
112
113 // generate flat distribution in p
114 // we are now in the parents restframe! This means the
115 // restframe of the e+e- collison.
116 double pcm;
117 if ( pmin == pmax ) pcm = pmin; // pingrg, 2008-04-15
118 if ( pmin < pmax ) pcm = EvtRandom::Flat( pmin, pmax );
119
120 // generate flat distribution in phi.
121 double phi;
122 if ( phimin == phimax ) phi = phimin; // pingrg 2008-10-22
123 else phi = EvtRandom::Flat( phimin, phimax );
124
125 double cthetalab;
126
127 do {
128 // generate flat distribution in costheta
129 double ctheta;
130 if ( cthetamin == cthetamax ) ctheta = cthetamin;
131 else ctheta = EvtRandom::Flat( cthetamin, cthetamax );
132 double stheta = sqrt( 1.0 - ctheta * ctheta );
133 p4.set( sqrt( mass * mass + pcm * pcm ), pcm * cos( phi ) * stheta,
134 pcm * sin( phi ) * stheta, pcm * ctheta );
135
136 d->init( getDaug( 0 ), p4 );
137
138 // get 4 vector in the lab frame!
139 EvtVector4R p4lab = d->getP4Lab();
140 cthetalab = p4lab.get( 3 ) / p4lab.d3mag();
141 } while ( cthetalab > cthetamax || cthetalab < cthetamin );
142
143 return;
144}
double mass
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
EvtVector4R getP4Lab()
EvtParticle * getDaug(int i)
static double Flat()
Definition EvtRandom.cc:69
double get(int i) const
double d3mag() const
void set(int i, double d)

◆ getName()

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

Implements EvtDecayBase.

Definition at line 34 of file EvtSingleParticle.cc.

34{ model_name = "SINGLE"; }

◆ init()

void EvtSingleParticle::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 38 of file EvtSingleParticle.cc.

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

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