44 :verboseLevel(0),trackID(0),
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)
G4ThreeVector GetMomentum() const
static constexpr double mm
void SetPreAssignedDecayProperTime(G4double)
CLHEP::Hep3Vector G4ThreeVector
G4int PushProducts(G4DynamicParticle *aParticle)
G4double GetKineticEnergy() const
G4ThreeVector GetPolarization() const
static G4double angle[DIM]
const G4DecayProducts * GetPreAssignedDecayProducts() const
G4int GetPDGEncoding() const
G4ParticleDefinition * GetDefinition() const
const G4ThreeVector & GetMomentumDirection() const
static constexpr double nanosecond
const G4String & GetParticleName() const
G4ParticleDefinition * GetG4code() const
G4int GetAtomicNumber() const
void SetWeight(G4double aValue)
static double normal(HepRandomEngine *eptr)
G4double GetWeight() const
G4DecayTable * GetDecayTable() const
G4PrimaryParticle * GetPrimary(G4int i=0) const
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4PrimaryParticle * GetDaughter() const
static constexpr double eplus
void SetTrackID(G4int id)
void SetPrimaryParticle(G4PrimaryParticle *p)
G4PrimaryVertex * GetPrimaryVertex(G4int i=0) const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4PrimaryVertex * GetNext() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double GetProperTime() const
G4double GetWeight() const
G4bool IsShortLived() const
void AddElectron(G4int orbit, G4int number=1)
static G4ParticleTable * GetParticleTable()
G4PrimaryParticle * GetNext() const
std::vector< G4Track * > G4TrackVector
void SetParentID(const G4int aValue)
G4double GetCharge() const
static const G4double T0[78]
Hep3Vector cross(const Hep3Vector &) const
static constexpr double deg
void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts)
void SetCharge(G4double charge)
void SetMass(G4double mass)
void SetTrackID(const G4int aValue)
G4GLOB_DLL std::ostream G4cerr