12 #include "G4ParticleDefinition.hh"
13 #include "G4DynamicParticle.hh"
16 #include "G4StepPoint.hh"
17 #include "G4TheoFSGenerator.hh"
18 #include "G4FTFModel.hh"
19 #include "G4ExcitedStringDecay.hh"
20 #include "G4LundStringFragmentation.hh"
21 #include "G4GeneratorPrecompoundInterface.hh"
23 #include "G4Proton.hh"
24 #include "G4Neutron.hh"
25 #include "G4PionPlus.hh"
26 #include "G4PionMinus.hh"
27 #include "G4AntiProton.hh"
28 #include "G4AntiNeutron.hh"
29 #include "G4KaonPlus.hh"
30 #include "G4KaonMinus.hh"
31 #include "G4KaonZeroLong.hh"
32 #include "G4KaonZeroShort.hh"
33 #include "G4KaonZero.hh"
34 #include "G4AntiKaonZero.hh"
35 #include "G4GenericIon.hh"
37 #include "G4Lambda.hh"
38 #include "G4OmegaMinus.hh"
39 #include "G4SigmaMinus.hh"
40 #include "G4SigmaPlus.hh"
41 #include "G4SigmaZero.hh"
42 #include "G4XiMinus.hh"
43 #include "G4XiZero.hh"
44 #include "G4AntiLambda.hh"
45 #include "G4AntiOmegaMinus.hh"
46 #include "G4AntiSigmaMinus.hh"
47 #include "G4AntiSigmaPlus.hh"
48 #include "G4AntiSigmaZero.hh"
49 #include "G4AntiXiMinus.hh"
50 #include "G4AntiXiZero.hh"
51 #include "G4AntiAlpha.hh"
52 #include "G4AntiDeuteron.hh"
53 #include "G4AntiTriton.hh"
54 #include "G4AntiHe3.hh"
56 #include "G4Material.hh"
57 #include "G4DecayPhysics.hh"
58 #include "G4ParticleTable.hh"
59 #include "G4SystemOfUnits.hh"
64 unsigned int distAlgo,
76 G4GeneratorPrecompoundInterface* cascade
78 theLund =
new G4LundStringFragmentation();
109 theG4Hadron[20]= G4AntiOmegaMinus::AntiOmegaMinus();
110 theG4Hadron[21]= G4AntiSigmaMinus::AntiSigmaMinus();
120 G4GenericIon::GenericIon();
121 G4DecayPhysics decays;
122 decays.ConstructParticle();
123 G4ParticleTable* partTable = G4ParticleTable::GetParticleTable();
124 partTable->SetReadiness();
168 dummyStep->SetPreStepPoint(
new G4StepPoint());
190 int thePid = Particle.
pid();
195 if(
theId[currIdx] == thePid) {
198 if(7 == currIdx || 8 == currIdx) {
224 if (currInteractionLength >
radLengths) {
return; }
227 double px = Particle.
momentum().px();
228 double py = Particle.
momentum().py();
229 double pz = Particle.
momentum().pz();
230 double norm = 1.0/
sqrt(px*px + py*py + pz*pz);
231 G4ThreeVector
dir(px*norm, py*norm, pz*norm);
238 G4DynamicParticle* dynParticle =
new G4DynamicParticle(
theG4Hadron[currIdx],dir,e-mass);
249 int nsec = result->GetNumberOfSecondaries();
262 for (
int j=0;
j<nsec; ++
j) {
264 const G4DynamicParticle* dp = result->GetSecondary(
j)->GetParticle();
265 int thePid = dp->GetParticleDefinition()->GetPDGEncoding();
270 curr4Mom *= result->GetTrafoToLab();
277 if(111 == thePid || 221 == thePid || 331 == thePid) {
279 double e = 0.5*dp->GetParticleDefinition()->GetPDGMass();
280 double fi = random->
flatShoot()*CLHEP::twopi;
281 double cth = 2*random->
flatShoot() - 1.0;
282 double sth =
sqrt((1.0 - cth)*(1.0 + cth));
283 G4LorentzVector lv(e*sth*
cos(fi),e*sth*
sin(fi),e*cth,e);
297 const G4LorentzVector& lv,
int pdgid)
320 if ( fabs(Particle.
charge()) > 1E-6 ) {
323 double chargeDiff = fabs(aDaughter.
charge()-Particle.
charge());
324 if ( fabs(chargeDiff) < 1E-6 ) {
331 distance = (aDaughter.Vect().Unit().Cross(Particle.Vect().Unit())).R();
336 distance = (aDaughter.Vect().Cross(Particle.Vect())).R()
337 /aDaughter.Vect().Mag2();
G4FTFModel * theStringModel
double flatShoot(double xmin=0.0, double xmax=1.0) const
Sin< T >::type sin(const T &t)
int pid() const
get the HEP particle ID number
std::vector< double > theNuclIntLength
void compute(ParticlePropagator &Particle, RandomEngineAndDistribution const *)
Generate a nuclear interaction according to the probability that it happens.
const XYZTLorentzVector & momentum() const
the momentum fourvector
void saveDaughter(ParticlePropagator &Particle, const G4LorentzVector &lv, int pdgid)
Cos< T >::type cos(const T &t)
std::vector< const G4ParticleDefinition * > theG4Hadron
double charge() const
get the MEASURED charge
G4HadProjectile theProjectile
double distanceToPrimary(const RawParticle &Particle, const RawParticle &aDaughter) const
const G4ParticleDefinition * currParticle
G4LundStringFragmentation * theLund
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
std::vector< RawParticle > _theUpdatedState
~NuclearInteractionFTFSimulator()
Default Destructor.
G4ExcitedStringDecay * theStringDecay
NuclearInteractionFTFSimulator(unsigned int distAlgo, double distCut)
Constructor.
int theClosestChargedDaughterId
G4TheoFSGenerator * theHadronicModel