45 unknown(nullptr),unknownParticleDefined(false),
46 opticalphoton(nullptr),opticalphotonDefined(false),
75 for(
auto tr :
TV)
delete tr;
83 nextVertex = nextVertex->
GetNext();
98 primaryVertex->
Print();
100 G4cout <<
"G4PrimaryTransformer::PrimaryVertex ("
101 << X0 /
mm <<
"(mm),"
102 << Y0 /
mm <<
"(mm),"
103 << Z0 /
mm <<
"(mm),"
109 while( primaryParticle != 0 )
112 primaryParticle = primaryParticle->
GetNext();
121 if(!IsGoodForTrack(partDef))
128 <<
") --- Ignored" <<
G4endl;
134 GenerateSingleTrack(daughter,x0,y0,z0,t0,wv);
135 daughter = daughter->
GetNext();
147 <<
") --- Transfered with momentum " << primaryParticle->
GetMomentum()
155 if(opticalphotonDefined && partDef==opticalphoton && primaryParticle->
GetPolarization().
mag2()==0.)
160 "Polarization of the optical photon is null. Random polarization is assumed.");
161 G4cerr <<
"This warning message is issued up to 10 times." <<
G4endl;
172 if (modul2 > 0.) e_perpend = (1./std::sqrt(modul2))*product;
175 G4ThreeVector polar = std::cos(angle)*e_paralle + std::sin(angle)*e_perpend;
205 SetDecayProducts( primaryParticle, DP );
214 if(!CheckDynamicParticle(DP))
230 TV.push_back( track );
239 if(!daughter)
return;
249 if(!IsGoodForTrack(partDef))
255 <<
") --- Ignored" <<
G4endl;
258 SetDecayProducts(daughter,motherDP);
266 <<
") --- Attached with momentum " << daughter->
GetMomentum()
285 SetDecayProducts(daughter,DP);
287 if(!CheckDynamicParticle(DP))
293 daughter = daughter->
GetNext();
301 {
G4cerr <<
"unknownParticleDefined cannot be set true because G4UnknownParticle is not defined in the physics list."
311 if(decayProducts && decayProducts->
entries()>0)
return true;
313 <<
"G4PrimaryTransformer: a shortlived primary particle is found" <<
G4endl
314 <<
" without any valid decay table nor pre-assigned decay mode." <<
G4endl;
316 "This primary particle will be ignored.");
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void SetMass(G4double mass)
G4int PushProducts(G4DynamicParticle *aParticle)
G4ThreeVector GetMomentum() const
G4PrimaryParticle * GetPrimary(G4int i=0) const
CLHEP::Hep3Vector G4ThreeVector
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4int GetAtomicNumber() const
G4DecayTable * GetDecayTable() const
static G4ParticleTable * GetParticleTable()
void SetWeight(G4double aValue)
void SetTrackID(const G4int aValue)
static constexpr double mm
const G4ThreeVector & GetMomentumDirection() const
const G4String & GetParticleName() const
void SetPrimaryParticle(G4PrimaryParticle *p)
static double normal(HepRandomEngine *eptr)
G4double GetWeight() const
G4PrimaryParticle * GetDaughter() const
void SetTrackID(G4int id)
G4double GetWeight() const
void SetPreAssignedDecayProperTime(G4double)
G4PrimaryVertex * GetPrimaryVertex(G4int i=0) const
void SetCharge(G4double charge)
G4double GetKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
G4double GetProperTime() const
G4ParticleDefinition * GetG4code() const
static constexpr double deg
static const G4double T0[78]
void AddElectron(G4int orbit, G4int number=1)
G4ThreeVector GetPolarization() const
static constexpr double nanosecond
G4GLOB_DLL std::ostream G4cerr
Hep3Vector cross(const Hep3Vector &) const
G4PrimaryParticle * GetNext() const
const G4DecayProducts * GetPreAssignedDecayProducts() const
static constexpr double eplus
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts)
G4PrimaryVertex * GetNext() const
void SetParentID(const G4int aValue)
std::vector< G4Track * > G4TrackVector
G4int GetPDGEncoding() const
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4double GetCharge() const
G4bool IsShortLived() const