diff --git a/include/ActionInitialization.hh b/include/ActionInitialization.hh index 87d8257..4f05e33 100644 --- a/include/ActionInitialization.hh +++ b/include/ActionInitialization.hh @@ -56,6 +56,7 @@ class ActionInitialization : public G4VUserActionInitialization this->minEnergy = minEnergy; this->maxEnergy = maxEnergy; this->partSpecies = partSpecies; + } private: diff --git a/include/PrimaryGeneratorAction.hh b/include/PrimaryGeneratorAction.hh index 1b84a98..851b651 100644 --- a/include/PrimaryGeneratorAction.hh +++ b/include/PrimaryGeneratorAction.hh @@ -59,7 +59,34 @@ public: G4double getPartEnergy() const{return partEnergy;} void setMinPartEnergy(G4double value){minPartEnergy = value;} void setMaxPartEnergy(G4double value){maxPartEnergy = value;} - void setPartSpecies(G4String value){partSpecies = value;} + void setPartSpecies(G4String value){ + partSpecies = value; + if(partSpecies == "e-"){ + G4cout << "Particle species set to electron" << G4endl; + } + if(partSpecies == "e+"){ + G4cout << "Particle species set to positron" << G4endl; + } + else if(partSpecies == "gamma"){ + G4cout << "Particle species set to gamma" << G4endl; + } + else if(partSpecies == "proton"){ + G4cout << "Particle species set to proton" << G4endl; + } + else if(partSpecies == "neutron"){ + G4cout << "Particle species set to neutron" << G4endl; + } + else if(partSpecies == "pi+"){ + G4cout << "Particle species set to charged pion" << G4endl; + } + else if(partSpecies == "pi-"){ + G4cout << "Particle species set to charged pion" << G4endl; + } + else{ + G4cout << "Particle species "<< partSpecies << " not recognized" << G4endl; + throw std::invalid_argument("Particle species not recognized"); + } + } private: G4ParticleGun* fParticleGun = nullptr; // G4 particle gun G4double partEnergy;