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

#include <EvtParticleFactory.hh>

Static Public Member Functions

static EvtParticleparticleFactory (EvtSpinType::spintype spinType)
static EvtParticleparticleFactory (EvtId id, EvtVector4R p4)
static EvtParticleparticleFactory (EvtId id, EvtVector4R p4, EvtSpinDensity rho)

Detailed Description

Definition at line 31 of file EvtParticleFactory.hh.

Member Function Documentation

◆ particleFactory() [1/3]

EvtParticle * EvtParticleFactory::particleFactory ( EvtId id,
EvtVector4R p4 )
static

Definition at line 186 of file EvtParticleFactory.cc.

186 {
187
188 EvtSpinDensity rho;
190
191 return particleFactory( id, p4, rho );
192}
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
static EvtParticle * particleFactory(EvtSpinType::spintype spinType)
void SetDiag(int n)
static int getSpinStates(spintype stype)

◆ particleFactory() [2/3]

EvtParticle * EvtParticleFactory::particleFactory ( EvtId id,
EvtVector4R p4,
EvtSpinDensity rho )
static

Definition at line 72 of file EvtParticleFactory.cc.

73 {
74
76
77 if ( thisSpin == EvtSpinType::SCALAR )
78 {
79 EvtScalarParticle* myPart;
80 myPart = new EvtScalarParticle;
81 myPart->init( id, p4 );
82 myPart->setSpinDensityForward( rho );
83 return myPart;
84 }
85
86 if ( thisSpin == EvtSpinType::VECTOR )
87 {
88 EvtVectorParticle* myPart;
89 myPart = new EvtVectorParticle;
90 myPart->init( id, p4 );
91 myPart->setSpinDensityForward( rho );
92 return myPart;
93 }
94 if ( thisSpin == EvtSpinType::DIRAC )
95 {
96 EvtDiracParticle* myPart;
97 myPart = new EvtDiracParticle;
98 myPart->init( id, p4 );
99 myPart->setSpinDensityForward( rho );
100 return myPart;
101 }
102 if ( thisSpin == EvtSpinType::NEUTRINO )
103 {
104 EvtNeutrinoParticle* myPart;
105 myPart = new EvtNeutrinoParticle;
106 myPart->init( id, p4 );
107 myPart->setSpinDensityForward( rho );
108 return myPart;
109 }
110 if ( thisSpin == EvtSpinType::PHOTON )
111 {
112 EvtPhotonParticle* myPart;
113 myPart = new EvtPhotonParticle;
114 myPart->init( id, p4 );
115 myPart->setSpinDensityForward( rho );
116 return myPart;
117 }
118 if ( thisSpin == EvtSpinType::TENSOR )
119 {
120 EvtTensorParticle* myPart;
121 myPart = new EvtTensorParticle;
122 myPart->init( id, p4 );
123 myPart->setSpinDensityForward( rho );
124 return myPart;
125 }
126 if ( thisSpin == EvtSpinType::STRING )
127 {
128 EvtStringParticle* myPart;
129 myPart = new EvtStringParticle;
130 myPart->init( id, p4 );
131 myPart->setSpinDensityForward( rho );
132 return myPart;
133 }
134 if ( thisSpin == EvtSpinType::SPIN3 )
135 {
136 EvtHighSpinParticle* myPart;
137 myPart = new EvtHighSpinParticle;
138 myPart->init( id, p4 );
139 myPart->setSpinDensityForward( rho );
140 return myPart;
141 }
142 if ( thisSpin == EvtSpinType::SPIN5HALF )
143 {
144 EvtHighSpinParticle* myPart;
145 myPart = new EvtHighSpinParticle;
146 myPart->init( id, p4 );
147 myPart->setSpinDensityForward( rho );
148 return myPart;
149 }
150 if ( thisSpin == EvtSpinType::SPIN7HALF )
151 {
152 EvtHighSpinParticle* myPart;
153 myPart = new EvtHighSpinParticle;
154 myPart->init( id, p4 );
155 myPart->setSpinDensityForward( rho );
156 return myPart;
157 }
158 if ( thisSpin == EvtSpinType::RARITASCHWINGER )
159 {
160 EvtRaritaSchwingerParticle* myPart;
161 myPart = new EvtRaritaSchwingerParticle;
162 myPart->init( id, p4 );
163 myPart->setSpinDensityForward( rho );
164 return myPart;
165 }
166 if ( thisSpin == EvtSpinType::SPIN4 )
167 {
168 EvtHighSpinParticle* myPart;
169 myPart = new EvtHighSpinParticle;
170 myPart->init( id, p4 );
171 myPart->setSpinDensityForward( rho );
172 return myPart;
173 }
174
175 report( ERROR, "EvtGen" ) << "Error in EvtParticleFactory::particleFactory" << endl;
176 report( ERROR, "EvtGen" ) << "Tried to create non-existing particle"
177 << " with spin type:" << thisSpin
178 << " and name:" << EvtPDL::name( id ).c_str() << endl;
179 report( ERROR, "EvtGen" ) << "Will terminate execution" << endl;
180
181 ::abort();
182
183 return 0;
184}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
void init(EvtId part_n, const EvtVector4R &p4)
void init(EvtId id, const EvtVector4R &p)
void init(EvtId part_n, const EvtVector4R &p4)
static std::string name(EvtId i)
Definition EvtPDL.hh:70
void setSpinDensityForward(const EvtSpinDensity &rho)
void init(EvtId part_n, double e, double px, double py, double pz)
void init(EvtId id, const EvtVector4R &p4)
void init(EvtId part_n, double e, double px, double py, double pz)
void init(EvtId id, const EvtVector4R &p4)
void init(EvtId part_n, double e, double px, double py, double pz)
void init(EvtId part_n, double e, double px, double py, double pz)

◆ particleFactory() [3/3]

EvtParticle * EvtParticleFactory::particleFactory ( EvtSpinType::spintype spinType)
static

Definition at line 46 of file EvtParticleFactory.cc.

46 {
47
48 if ( spinType == EvtSpinType::SCALAR ) { return new EvtScalarParticle; }
49
50 if ( spinType == EvtSpinType::VECTOR ) { return new EvtVectorParticle; }
51 if ( spinType == EvtSpinType::DIRAC ) { return new EvtDiracParticle; }
52 if ( spinType == EvtSpinType::NEUTRINO ) { return new EvtNeutrinoParticle; }
53 if ( spinType == EvtSpinType::PHOTON ) { return new EvtPhotonParticle; }
54 if ( spinType == EvtSpinType::TENSOR ) { return new EvtTensorParticle; }
55 if ( spinType == EvtSpinType::STRING ) { return new EvtStringParticle; }
56 if ( spinType == EvtSpinType::RARITASCHWINGER ) { return new EvtRaritaSchwingerParticle; }
57 if ( spinType == EvtSpinType::SPIN5HALF ) { return new EvtHighSpinParticle; }
58 if ( spinType == EvtSpinType::SPIN3 ) { return new EvtHighSpinParticle; }
59 if ( spinType == EvtSpinType::SPIN7HALF ) { return new EvtHighSpinParticle; }
60 if ( spinType == EvtSpinType::SPIN4 ) { return new EvtHighSpinParticle; }
61
62 report( ERROR, "EvtGen" ) << "Error in EvtParticleFactory::particleFactory" << endl;
63 report( ERROR, "EvtGen" ) << "Tried to create non-existing particle"
64 << " with spin type:" << spinType << endl;
65 report( ERROR, "EvtGen" ) << "Will terminate execution" << endl;
66
67 ::abort();
68
69 return 0;
70}

Referenced by EvtConExc::findMaxXS(), EvtConExc::gamHXSection(), EvtGen::generateDecay(), EvtConExc::init(), EvtParticle::makeDaughters(), particleFactory(), and EvtPsi3Sdecay::PHSPDecay().


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