/// \file GCR1PrimaryGeneratorAction.cc /// \brief Implementation of the B1PrimaryGeneratorAction class //=====================================INCLUDE===================================== #include "GCR1PrimaryGeneratorAction.hh" #include "Randomize.hh" #include "G4SystemOfUnits.hh" #include "G4RandomDirection.hh" #include "G4ParticleGun.hh" #include "G4ParticleTable.hh" #include "G4ParticleDefinition.hh" #include "GCR1RunAction.hh" #include "G4UnitsTable.hh" #include "CLHEP/Random/RandGauss.h" #include "G4IonTable.hh" #include "G4Event.hh" //=====================================INCLUDE===================================== GCR1PrimaryGeneratorAction::GCR1PrimaryGeneratorAction() : G4VUserPrimaryGeneratorAction() { G4int n_particle = 1; fParticleGun = new G4ParticleGun(n_particle); fParticleGun->SetParticleMomentumDirection(G4RandomDirection()); } GCR1PrimaryGeneratorAction::~GCR1PrimaryGeneratorAction() { delete fParticleGun; } /*//Helium-4 G4int Z_He4 = 2, A_He4 = 4; G4double He4Charge = 0.*eplus; G4double He4excitEnergy = 0.*keV; G4ParticleDefinition* He4 = G4IonTable::GetIonTable()->GetIon(Z_He4,A_He4,He4excitEnergy); */ //Lithium-7 G4int Z_Li7 = 3, A_Li7 = 7; G4double Li7Charge = 0.*eplus; G4double Li7excitEnergy = 0.*keV; G4ParticleDefinition* Li7 = G4IonTable::GetIonTable()->GetIon(Z_Li7,A_Li7,Li7excitEnergy); //Beryllium-9 G4int Z_Be9 = 4, A_Be9 = 9; G4double Be9Charge = 0.*eplus; G4double Be9excitEnergy = 0.*keV; G4ParticleDefinition* Be9 = G4IonTable::GetIonTable()->GetIon(Z_Be9,A_Be9,Be9excitEnergy); //Bore-11 G4int Z_B11 = 5, A_B11 = 11; G4double B11Charge = 0.*eplus; G4double B11excitEnergy = 0.*keV; G4ParticleDefinition* B11 = G4IonTable::GetIonTable()->GetIon(Z_B11,A_B11,B11excitEnergy); //Carbone-12 G4int Z_C12 = 6, A_C12 = 12; G4double C12Charge = 0.*eplus; G4double C12excitEnergy = 0.*keV; G4ParticleDefinition* C12 = G4IonTable::GetIonTable()->GetIon(Z_C12,A_C12,C12excitEnergy); //Azote-14 G4int Z_N14 = 7, A_N14 = 14; G4double N14Charge = 0.*eplus; G4double N14excitEnergy = 0.*keV; G4ParticleDefinition* N14 = G4IonTable::GetIonTable()->GetIon(Z_N14,A_N14,N14excitEnergy); //Oxygen-16 G4int Z_O16 = 8, A_O16 = 16; G4double O16Charge = 0.*eplus; G4double O16excitEnergy = 0.*keV; G4ParticleDefinition* O16 = G4IonTable::GetIonTable()->GetIon(Z_O16,A_O16,O16excitEnergy); //Fluor-19 G4int Z_F19 = 9, A_F19 = 19; G4double F19Charge = 0.*eplus; G4double F19excitEnergy = 0.*keV; G4ParticleDefinition* F19 = G4IonTable::GetIonTable()->GetIon(Z_F19,A_F19,F19excitEnergy); //Neon-20 G4int Z_Ne20 = 10, A_Ne20 = 20; G4double Ne20Charge = 0.*eplus; G4double Ne20excitEnergy = 0.*keV; G4ParticleDefinition* Ne20 = G4IonTable::GetIonTable()->GetIon(Z_Ne20,A_Ne20,Ne20excitEnergy); //Sodium-23 G4int Z_Na23 = 11, A_Na23 = 23; G4double Na23Charge = 0.*eplus; G4double Na23excitEnergy = 0.*keV; G4ParticleDefinition* Na23 = G4IonTable::GetIonTable()->GetIon(Z_Na23,A_Na23,Na23excitEnergy); //Magnesium-24 G4int Z_Mg24 = 12, A_Mg24 = 24; G4double Mg24Charge = 0.*eplus; G4double Mg24excitEnergy = 0.*keV; G4ParticleDefinition* Mg24 = G4IonTable::GetIonTable()->GetIon(Z_Mg24,A_Mg24,Mg24excitEnergy); //Aluminium-27 G4int Z_Al27 = 13, A_Al27 = 27; G4double Al27Charge = 0.*eplus; G4double Al27excitEnergy = 0.*keV; G4ParticleDefinition* Al27 = G4IonTable::GetIonTable()->GetIon(Z_Al27,A_Al27,Al27excitEnergy); //Silicium-28 G4int Z_Si28 = 14, A_Si28 = 28; G4double Si28Charge = 0.*eplus; G4double Si28excitEnergy = 0.*keV; G4ParticleDefinition* Si28 = G4IonTable::GetIonTable()->GetIon(Z_Si28,A_Si28,Si28excitEnergy); //Phosphore-31 G4int Z_P31 = 15, A_P31 = 31; G4double P31Charge = 0.*eplus; G4double P31excitEnergy = 0.*keV; G4ParticleDefinition* P31 = G4IonTable::GetIonTable()->GetIon(Z_P31,A_P31,P31excitEnergy); //Soufre-32 G4int Z_S32 = 16, A_S32 = 32; G4double S32Charge = 0.*eplus; G4double S32excitEnergy = 0.*keV; G4ParticleDefinition* S32 = G4IonTable::GetIonTable()->GetIon(Z_S32,A_S32,S32excitEnergy); //Chlore-35 G4int Z_Cl35 = 17, A_Cl35 = 35; G4double Cl35Charge = 0.*eplus; G4double Cl35excitEnergy = 0.*keV; G4ParticleDefinition* Cl35 = G4IonTable::GetIonTable()->GetIon(Z_Cl35,A_Cl35,Cl35excitEnergy); //Argon-40 G4int Z_Ar40 = 18, A_Ar40 = 40; G4double Ar40Charge = 0.*eplus; G4double Ar40excitEnergy = 0.*keV; G4ParticleDefinition* Ar40 = G4IonTable::GetIonTable()->GetIon(Z_Ar40,A_Ar40,Ar40excitEnergy); //Potassium-39 G4int Z_K39 = 19, A_K39 = 39; G4double K39Charge = 0.*eplus; G4double K39excitEnergy = 0.*keV; G4ParticleDefinition* K39 = G4IonTable::GetIonTable()->GetIon(Z_K39,A_K39,K39excitEnergy); //Calcium-40 G4int Z_Ca40 = 20, A_Ca40 = 40; G4double Ca40Charge = 0.*eplus; G4double Ca40excitEnergy = 0.*keV; G4ParticleDefinition* Ca40 = G4IonTable::GetIonTable()->GetIon(Z_Ca40,A_Ca40,Ca40excitEnergy); //Scandium-45 G4int Z_Sc45 = 21, A_Sc45 = 45; G4double Sc45Charge = 0.*eplus; G4double Sc45excitEnergy = 0.*keV; G4ParticleDefinition* Sc45 = G4IonTable::GetIonTable()->GetIon(Z_Sc45,A_Sc45,Sc45excitEnergy); //Titane-48 G4int Z_Ti48 = 22, A_Ti48 = 48; G4double Ti48Charge = 0.*eplus; G4double Ti48excitEnergy = 0.*keV; G4ParticleDefinition* Ti48 = G4IonTable::GetIonTable()->GetIon(Z_Ti48,A_Ti48,Ti48excitEnergy); //Vanadium-51 G4int Z_V51 = 23, A_V51 = 51; G4double V51Charge = 0.*eplus; G4double V51excitEnergy = 0.*keV; G4ParticleDefinition* V51 = G4IonTable::GetIonTable()->GetIon(Z_V51,A_V51,V51excitEnergy); //Chrome-52 G4int Z_Cr52 = 24, A_Cr52 = 52; G4double Cr52Charge = 0.*eplus; G4double Cr52excitEnergy = 0.*keV; G4ParticleDefinition* Cr52 = G4IonTable::GetIonTable()->GetIon(Z_Cr52,A_Cr52,Cr52excitEnergy); //Manganese-55 G4int Z_Mn55 = 25, A_Mn55 = 55; G4double Mn55Charge = 0.*eplus; G4double Mn55excitEnergy = 0.*keV; G4ParticleDefinition* Mn55 = G4IonTable::GetIonTable()->GetIon(Z_Mn55,A_Mn55,Mn55excitEnergy); //Fer-56 G4int Z_Fe56 = 26, A_Fe56 = 56; G4double Fe56Charge = 0.*eplus; G4double Fe56excitEnergy = 0.*keV; G4ParticleDefinition* Fe56 = G4IonTable::GetIonTable()->GetIon(Z_Fe56,A_Fe56,Fe56excitEnergy); //Cobalt-59 G4int Z_Co59 = 27, A_Co59 = 59; G4double Co59Charge = 0.*eplus; G4double Co59excitEnergy = 0.*keV; G4ParticleDefinition* Co59 = G4IonTable::GetIonTable()->GetIon(Z_Co59,A_Co59,Co59excitEnergy); //Nickel-59 G4int Z_Ni59 = 28, A_Ni59 = 59; G4double Ni59Charge = 0.*eplus; G4double Ni59excitEnergy = 0.*keV; G4ParticleDefinition* Ni59 = G4IonTable::GetIonTable()->GetIon(Z_Ni59,A_Ni59,Ni59excitEnergy); //Cuivre-64 G4int Z_Cu64 = 29, A_Cu64 = 64; G4double Cu64Charge = 0.*eplus; G4double Cu64excitEnergy = 0.*keV; G4ParticleDefinition* Cu64 = G4IonTable::GetIonTable()->GetIon(Z_Cu64,A_Cu64,Cu64excitEnergy); //Zinc-65 G4int Z_Zn65 = 30, A_Zn65 = 65; G4double Zn65Charge = 0.*eplus; G4double Zn65excitEnergy = 0.*keV; G4ParticleDefinition* Zn65 = G4IonTable::GetIonTable()->GetIon(Z_Zn65,A_Zn65,Zn65excitEnergy); //Gallium-70 G4int Z_Ga70 = 31, A_Ga70 = 70; G4double Ga70Charge = 0.*eplus; G4double Ga70excitEnergy = 0.*keV; G4ParticleDefinition* Ga70 = G4IonTable::GetIonTable()->GetIon(Z_Ga70,A_Ga70,Ga70excitEnergy); //Germanium-73 G4int Z_Ge73 = 32, A_Ge73 = 73; G4double Ge73Charge = 0.*eplus; G4double Ge73excitEnergy = 0.*keV; G4ParticleDefinition* Ge73 = G4IonTable::GetIonTable()->GetIon(Z_Ge73,A_Ge73,Ge73excitEnergy); //Arsenic-75 G4int Z_As75 = 33, A_As75 = 75; G4double As75Charge = 0.*eplus; G4double As75excitEnergy = 0.*keV; G4ParticleDefinition* As75 = G4IonTable::GetIonTable()->GetIon(Z_As75,A_As75,As75excitEnergy); //Sélénium-79 G4int Z_Se79 = 34, A_Se79 = 79; G4double Se79Charge = 0.*eplus; G4double Se79excitEnergy = 0.*keV; G4ParticleDefinition* Se79 = G4IonTable::GetIonTable()->GetIon(Z_Se79,A_Se79,Se79excitEnergy); //Brome-80 G4int Z_Br80 = 35, A_Br80 = 80; G4double Br80Charge = 0.*eplus; G4double Br80excitEnergy = 0.*keV; G4ParticleDefinition* Br80 = G4IonTable::GetIonTable()->GetIon(Z_Br80,A_Br80,Br80excitEnergy); //Krypton-84 G4int Z_Kr84 = 36, A_Kr84 = 84; G4double Kr84Charge = 0.*eplus; G4double Kr84excitEnergy = 0.*keV; G4ParticleDefinition* Kr84 = G4IonTable::GetIonTable()->GetIon(Z_Kr84,A_Kr84,Kr84excitEnergy); //Rubidium-85 G4int Z_Rb85 = 37, A_Rb85 = 85; G4double Rb85Charge = 0.*eplus; G4double Rb85excitEnergy = 0.*keV; G4ParticleDefinition* Rb85 = G4IonTable::GetIonTable()->GetIon(Z_Rb85,A_Rb85,Rb85excitEnergy); //Strontium-88 G4int Z_Sr88 = 38, A_Sr88 = 88; G4double Sr88Charge = 0.*eplus; G4double Sr88excitEnergy = 0.*keV; G4ParticleDefinition* Sr88 = G4IonTable::GetIonTable()->GetIon(Z_Sr88,A_Sr88,Sr88excitEnergy); //Yttrium-89 G4int Z_Y89 = 39, A_Y89 = 89; G4double Y89Charge = 0.*eplus; G4double Y89excitEnergy = 0.*keV; G4ParticleDefinition* Y89 = G4IonTable::GetIonTable()->GetIon(Z_Y89,A_Y89,Y89excitEnergy); void GCR1PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { auto particule = "proton"; auto randpart = G4UniformRand(); auto fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/H+.txt"; //903900927 //99429102 //9944718 if (randpart > 0.903900927 and randpart <= 0.99429102){ particule = "alpha"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/He.txt"; G4cout<<"Alpha DEFINED"< 0.99429102 and randpart <= 0.99944718) { particule = "Li7"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Li.txt"; G4cout<<"Lithium DEFINED"< 0.9944718 and randpart <= 0.994483852) { particule = "Be9"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Be.txt"; G4cout<<"Beryllium DEFINED"< 0.994483852 and randpart <= 0.994520008) { particule = "B11"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/B.txt"; G4cout<<"Bore DEFINED"< 0.994520008 and randpart <= 0.99632781) { particule = "C12"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/C.txt"; G4cout<<"Carbon DEFINED"< 0.99632781 and randpart <= 0.996930411) { particule = "N14"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/N.txt"; } else if (randpart > 0.996930411 and randpart <= 0.998738213) { particule = "O16"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/O.txt"; } else if (randpart > 0.998738213 and randpart <= 0.998756291) { particule = "F19"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/F.txt"; } else if (randpart > 0.998756291 and randpart <= 0.998937071) { particule = "Ne20"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Ne.txt"; } else if (randpart > 0.998937071 and randpart <= 0.998997331) { particule = "Na23"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Na.txt"; } else if (randpart > 0.998997331 and randpart <= 0.999449281) { particule = "Mg24"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Mg.txt"; } else if (randpart > 0.999449281 and randpart <= 0.999485438) { particule = "Al27"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Al.txt"; } else if (randpart > 0.999485438 and randpart <= 0.999666218) { particule = "Si28"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Si.txt"; } else if (randpart > 0.999666218 and randpart <= 0.999675257) { particule = "P31"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/P.txt"; } else if (randpart > 0.999675257 and randpart <= 0.999735517) { particule = "S32"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/S.txt"; } else if (randpart > 0.999735517 and randpart <= 0.999744556) { particule = "Cl35"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Cl.txt"; } else if (randpart > 0.999744556 and randpart <= 0.999759018) { particule = "Ar40"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Ar.txt"; } else if (randpart > 0.999759018 and randpart <= 0.99977107) { particule = "K39"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/K.txt"; } else if (randpart > 0.99977107 and randpart <= 0.999789148) { particule = "Ca40"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Ca.txt"; } else if (randpart > 0.999789148 and randpart <= 0.999795174) { particule = "Sc45"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Sc.txt"; } else if (randpart > 0.999795174 and randpart <= 0.999813252) { particule = "Ti48"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Ti.txt"; } else if (randpart > 0.999813252 and randpart <= 0.999825304) { particule = "V51"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/V.txt"; } else if (randpart > 0.999825304 and randpart <= 0.999841574) { particule = "Cr52"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Cr.txt"; } else if (randpart > 0.999841574 and randpart <= 0.999854229) { particule = "Mn55"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Mn.txt"; } else if (randpart > 0.999854229 and randpart <= 0.999989814) { particule = "Fe56"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Fe.txt"; } else if (randpart > 0.999989814 and randpart <= 0.999990718) { particule = "Co59"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Co.txt"; } else if (randpart > 0.999990718 and randpart <= 0.999999757) { particule = "Ni59"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Ni.txt"; } else if (randpart > 0.999999757 and randpart <= 0.999999848) { particule = "Cu64"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Cu.txt"; } else if (randpart > 0.999999848 and randpart <= 0.999999938) { particule = "Zn65"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Zn.txt"; } else if (randpart > 0.999999938 and randpart <= 0.999999947) { particule = "Ga70"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Ga.txt"; } else if (randpart > 0.999999947 and randpart <= 0.999999965) { particule = "Ge73"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Ge.txt"; } else if (randpart > 0.999999965 and randpart <= 0.999999971) { particule = "As75"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/As.txt"; } else if (randpart > 0.999999971 and randpart <= 0.99999998) { particule = "Se79"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Se.txt"; } else if (randpart > 0.99999998 and randpart <= 0.999999982) { particule = "Br80"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Br.txt"; } else if (randpart > 0.999999982 and randpart <= 0.999999988) { particule = "Kr84"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Kr.txt"; } else if (randpart > 0.999999988 and randpart <= 0.99999998976) { particule = "Rb85"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Rb.txt"; } else if (randpart > 0.99999998976 and randpart <= 0.99999999879) { particule = "Sr88"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Sr.txt"; } else if (randpart > 0.99999999879 and randpart <= 1) { particule = "Y89"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/Y.txt"; } else { particule = "proton"; fileused = "/home/nisscher/g4work/test_GCR_1/GCR_1/data_spectrum/H+.txt"; G4cout<<"Hydrogen DEFINED"< E(0); std::vector P(0); long double a,b; int j_file; j_file=0; while(!file.eof()) { file >> a >> b; // extracts 2 floating point values seperated by whitespace E.push_back(a); P.push_back(b); j_file++; } // Point source long double randomfreq, freqmin, freqmax,energy,energymin, energymax; G4double size = 300; G4double zsize = size + 50; G4double x0 = size * (G4UniformRand()-0.5); G4double y0 = size * (G4UniformRand()-0.5); G4double z0 = zsize * 0.5; fParticleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0)); randomfreq = CLHEP::RandFlat::shoot(0.,1.); int i=0; bool found=0; while(found==0){ // increment i while random freq is less than the freq in beta array if(randomfreq <= P[i]){ found=1; } else{ i++;} } energymin = E[i-1]; energymax = E[i]; freqmin=P[i-1]; freqmax=P[i]; if (energymax ==E[0] || freqmax == P[0] ){ energymin=0; freqmin=0; } energy=energymin+((randomfreq-freqmin)*(energymax-energymin)/(freqmax-freqmin)); if (particule == "proton") { G4ParticleTable* particleTable= G4ParticleTable::GetParticleTable(); G4ParticleDefinition* particle = particleTable->FindParticle(particule); fParticleGun->SetParticleDefinition(particle); G4cout<<"Hydrogen SELECTED"<FindParticle(particule); fParticleGun->SetParticleDefinition(particle); G4cout<<"Alpha SELECTED"<SetParticleDefinition(Li7); fParticleGun->SetParticleCharge(Li7Charge); G4cout<<"Lithium SELECTED"<SetParticleDefinition(Be9); fParticleGun->SetParticleCharge(Be9Charge); G4cout<<"Beryllium SELECTED"<SetParticleDefinition(B11); fParticleGun->SetParticleCharge(B11Charge); G4cout<<"Bore SELECTED"<SetParticleDefinition(C12); fParticleGun->SetParticleCharge(C12Charge); G4cout<<"Carbon SELECTED"<SetParticleDefinition(N14); fParticleGun->SetParticleCharge(N14Charge); } else if (particule == "O16") { fParticleGun->SetParticleDefinition(O16); fParticleGun->SetParticleCharge(O16Charge); } else if (particule == "F19") { fParticleGun->SetParticleDefinition(F19); fParticleGun->SetParticleCharge(F19Charge); } else if (particule == "Ne20") { fParticleGun->SetParticleDefinition(Ne20); fParticleGun->SetParticleCharge(Ne20Charge); } else if (particule == "Na23") { fParticleGun->SetParticleDefinition(Na23); fParticleGun->SetParticleCharge(Na23Charge); } else if (particule == "Mg24") { fParticleGun->SetParticleDefinition(Mg24); fParticleGun->SetParticleCharge(Mg24Charge); } else if (particule == "Al27") { fParticleGun->SetParticleDefinition(Al27); fParticleGun->SetParticleCharge(Al27Charge); } else if (particule == "Si28") { fParticleGun->SetParticleDefinition(Si28); fParticleGun->SetParticleCharge(Si28Charge); } else if (particule == "P31") { fParticleGun->SetParticleDefinition(P31); fParticleGun->SetParticleCharge(P31Charge); } else if (particule == "S32") { fParticleGun->SetParticleDefinition(S32); fParticleGun->SetParticleCharge(S32Charge); } else if (particule == "Cl35") { fParticleGun->SetParticleDefinition(Cl35); fParticleGun->SetParticleCharge(Cl35Charge); } else if (particule == "Ar40") { fParticleGun->SetParticleDefinition(Ar40); fParticleGun->SetParticleCharge(Ar40Charge); } else if (particule == "K39") { fParticleGun->SetParticleDefinition(K39); fParticleGun->SetParticleCharge(K39Charge); } else if (particule == "Ca40") { fParticleGun->SetParticleDefinition(Ca40); fParticleGun->SetParticleCharge(Ca40Charge); } else if (particule == "Sc45") { fParticleGun->SetParticleDefinition(Sc45); fParticleGun->SetParticleCharge(Sc45Charge); } else if (particule == "Ti48") { fParticleGun->SetParticleDefinition(Ti48); fParticleGun->SetParticleCharge(Ti48Charge); } else if (particule == "V51") { fParticleGun->SetParticleDefinition(V51); fParticleGun->SetParticleCharge(V51Charge); } else if (particule == "Cr52") { fParticleGun->SetParticleDefinition(Cr52); fParticleGun->SetParticleCharge(Cr52Charge); } else if (particule == "Mn55") { fParticleGun->SetParticleDefinition(Mn55); fParticleGun->SetParticleCharge(Mn55Charge); } else if (particule == "Fe56") { fParticleGun->SetParticleDefinition(Fe56); fParticleGun->SetParticleCharge(Fe56Charge); } else if (particule == "Co59") { fParticleGun->SetParticleDefinition(Co59); fParticleGun->SetParticleCharge(Co59Charge); } else if (particule == "Ni59") { fParticleGun->SetParticleDefinition(Ni59); fParticleGun->SetParticleCharge(Ni59Charge); } else if (particule == "Cu64") { fParticleGun->SetParticleDefinition(Cu64); fParticleGun->SetParticleCharge(Cu64Charge); } else if (particule == "Zn65") { fParticleGun->SetParticleDefinition(Zn65); fParticleGun->SetParticleCharge(Zn65Charge); } else if (particule == "Ga70") { fParticleGun->SetParticleDefinition(Ga70); fParticleGun->SetParticleCharge(Ga70Charge); } else if (particule == "As75") { fParticleGun->SetParticleDefinition(As75); fParticleGun->SetParticleCharge(As75Charge); } else if (particule == "Se79") { fParticleGun->SetParticleDefinition(Se79); fParticleGun->SetParticleCharge(Se79Charge); } else if (particule == "Br80") { fParticleGun->SetParticleDefinition(Br80); fParticleGun->SetParticleCharge(Br80Charge); } else if (particule == "Kr84") { fParticleGun->SetParticleDefinition(Kr84); fParticleGun->SetParticleCharge(Kr84Charge); } else if (particule == "Rb85") { fParticleGun->SetParticleDefinition(Rb85); fParticleGun->SetParticleCharge(Rb85Charge); } else if (particule == "Sr88") { fParticleGun->SetParticleDefinition(Sr88); fParticleGun->SetParticleCharge(Sr88Charge); } else if (particule == "Y89") { fParticleGun->SetParticleDefinition(Y89); fParticleGun->SetParticleCharge(Y89Charge); } else { G4ParticleTable* particleTable= G4ParticleTable::GetParticleTable(); G4ParticleDefinition* particle = particleTable->FindParticle(particule); fParticleGun->SetParticleDefinition(particle); } fParticleGun->SetParticleEnergy(energy); fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0,0,-1)); fParticleGun->GeneratePrimaryVertex(anEvent); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......