checks
This commit is contained in:
@@ -56,6 +56,7 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
this->minEnergy = minEnergy;
|
||||
this->maxEnergy = maxEnergy;
|
||||
this->partSpecies = partSpecies;
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user