BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtSingleParticle2 Class Reference

#include <EvtSingleParticle2.hh>

Inheritance diagram for EvtSingleParticle2:

Public Member Functions

 EvtSingleParticle2 ()
virtual ~EvtSingleParticle2 ()
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 EvtSingleParticle2.hh.

Constructor & Destructor Documentation

◆ EvtSingleParticle2()

EvtSingleParticle2::EvtSingleParticle2 ( )
inline

Definition at line 31 of file EvtSingleParticle2.hh.

31{}

Referenced by clone().

◆ ~EvtSingleParticle2()

EvtSingleParticle2::~EvtSingleParticle2 ( )
virtual

Definition at line 32 of file EvtSingleParticle2.cc.

32{}

Member Function Documentation

◆ clone()

EvtDecayBase * EvtSingleParticle2::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 36 of file EvtSingleParticle2.cc.

36{ return new EvtSingleParticle2(); }

◆ decay()

void EvtSingleParticle2::decay ( EvtParticle * p)
virtual

Implements EvtDecayBase.

Definition at line 100 of file EvtSingleParticle2.cc.

100 {
101
102 EvtParticle* d;
103 EvtVector4R p4;
104
105 double mass = EvtPDL::getMass( getDaug( 0 ) );
106
108 d = p->getDaug( 0 );
109
110 // generate flat distribution in p
111 // we are now in the parents restframe! This means the
112 // restframe of the e+e- collison.
113
114 double theta;
115 if ( thetamax == thetamin ) { theta = thetamax; }
116 else theta = EvtRandom::Flat( thetamin, thetamax );
117 double phi;
118 if ( phimin == phimax ) { phi = phimin; }
119 else phi = EvtRandom::Flat( phimin, phimax );
120 double pxy;
121 if ( pxymin == pxymax ) { pxy = pxymin; }
122 else pxy = EvtRandom::Flat( pxymin, pxymax );
123
124 pmag = pxy / sin( theta );
125 cthetamax = cos( thetamax );
126 cthetamin = cos( thetamin );
127 double cthetalab;
128
129 // do{
130 // generate flat distribution in costheta
131
132 p4.set( sqrt( mass * mass + pmag * pmag ), pmag * cos( phi ) * sin( theta ),
133 pmag * sin( phi ) * sin( theta ), pmag * cos( theta ) );
134 d->init( getDaug( 0 ), p4 );
135 // get 4 vector in the lab frame!
136 EvtVector4R p4lab = d->getP4Lab();
137 cthetalab = p4lab.get( 3 ) / p4lab.d3mag();
138 // }while (cthetalab>cthetamax||cthetalab<cthetamin);
139
140 return;
141}
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 EvtSingleParticle2::getName ( std::string & name)
virtual

Implements EvtDecayBase.

Definition at line 34 of file EvtSingleParticle2.cc.

34{ model_name = "SINGLE2"; }

◆ init()

void EvtSingleParticle2::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 38 of file EvtSingleParticle2.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 pxymin = getArg( 0 );
51 pxymax = getArg( 1 );
52
53 thetamin = getArg( 2 );
54 thetamax = 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 pxymin = getArg( 0 );
64 pxymax = getArg( 1 );
65
66 thetamin = getArg( 2 );
67 thetamax = getArg( 3 );
68
69 phimin = 0.0;
70 phimax = EvtConst::twoPi;
71 }
72
73 if ( getNArg() == 2 )
74 {
75 // copy the arguments into eaiser to remember names!
76 pxymin = getArg( 0 );
77 pxymax = getArg( 1 );
78
79 thetamin = 0.376383;
80 thetamax = 2.76521; //|cos(theta)|<0.93
81
82 phimin = 0.0;
83 phimax = EvtConst::twoPi;
84 }
85 }
86 else
87 {
88
89 report( ERROR, "EvtGen" ) << "EvtSingleParticle generator expected "
90 << " 5, 3, or 1 arguments but found:" << getNArg() << endl;
91 report( ERROR, "EvtGen" ) << "Will terminate execution!" << endl;
92 ::abort();
93 }
94
95 report( INFO, "EvtGen" ) << "The single particle generator has been configured:" << endl;
96 report( INFO, "EvtGen" ) << thetamax << " > theta > " << thetamin << endl;
97 report( INFO, "EvtGen" ) << phimax << " > phi > " << phimin << endl;
98}
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: