63 for(
auto tr :
TV)
delete tr;
69 while(nextVertex !=
nullptr)
72 nextVertex = nextVertex->
GetNext();
88 primaryVertex->
Print();
92 G4cout <<
"G4PrimaryTransformer::PrimaryVertex ("
96 << T0 / nanosecond <<
"(nsec))" <<
G4endl;
101 while( primaryParticle !=
nullptr )
104 primaryParticle = primaryParticle->
GetNext();
120 <<
") --- Ignored" <<
G4endl;
124 while(daughter !=
nullptr)
127 daughter = daughter->
GetNext();
137 <<
") --- Transferred with momentum "
151 G4Exception(
"G4PrimaryTransformer::GenerateSingleTrack",
153 "Polarization of the optical photon is null.\
154 Random polarization is assumed.");
155 G4cerr <<
"This warning message is issued up to 10 times." <<
G4endl;
166 if (modul2 > 0.) e_perpend = (1./std::sqrt(modul2))*product;
170 + std::sin(angle)*e_perpend;
171 DP->SetPolarization(polar.
x(),polar.
y(),polar.
z());
175 DP->SetPolarization(primaryParticle->
GetPolX(),
181 DP->SetPreAssignedDecayProperTime(primaryParticle->
GetProperTime());
187 if(pmas>=0.) { DP->SetMass(pmas); }
195 DP->SetCharge(primaryParticle->
GetCharge());
202 if (n_e>0) DP->AddElectron(0,n_e);
211 DP->SetPrimaryParticle(primaryParticle);
217 DP->SetPDGcode(primaryParticle->
GetPDGcode());
248 TV.push_back( track );
256 if(daughter ==
nullptr)
return;
259 if(decayProducts ==
nullptr)
264 while(daughter !=
nullptr)
273 <<
") --- Ignored" <<
G4endl;
284 <<
") --- Attached with momentum " << daughter->
GetMomentum()
290 DP->SetPrimaryParticle(daughter);
296 DP->SetPreAssignedDecayProperTime(daughter->
GetProperTime());
313 DP->SetPolarization(daughter->
GetPolX(),
316 decayProducts->PushProducts(DP);
327 daughter = daughter->
GetNext();
336 G4cerr <<
"unknownParticleDefined cannot be set true because" <<
G4endl
337 <<
"G4UnknownParticle is not defined in the physics list." <<
G4endl
338 <<
"Command ignored." <<
G4endl;
348 if(decayProducts !=
nullptr && decayProducts->entries()>0)
return true;
350 <<
"G4PrimaryTransformer: a shortlived primary particle is found"
352 <<
" without any valid decay table nor pre-assigned decay mode."
355 "This primary particle will be ignored.");
363 if(partDef ==
nullptr)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
std::vector< G4Track * > G4TrackVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
Hep3Vector cross(const Hep3Vector &) const
void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts)
const G4DecayProducts * GetPreAssignedDecayProducts() const
G4ParticleDefinition * GetDefinition() const
G4PrimaryVertex * GetPrimaryVertex(G4int i=0) const
G4int GetAtomicNumber() const
G4bool IsShortLived() const
G4int GetPDGEncoding() const
G4DecayTable * GetDecayTable() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4double GetWeight() const
G4double GetCharge() const
G4double GetKineticEnergy() const
G4double GetProperTime() const
const G4ThreeVector & GetMomentumDirection() const
void SetTrackID(G4int id)
G4ThreeVector GetPolarization() const
G4PrimaryParticle * GetNext() const
G4ThreeVector GetMomentum() const
G4PrimaryParticle * GetDaughter() const
G4PrimaryVertex * GetNext() const
G4double GetWeight() const
G4PrimaryParticle * GetPrimary(G4int i=0) const
void SetWeight(G4double aValue)
void SetTrackID(const G4int aValue)
void SetParentID(const G4int aValue)