fixes
This commit is contained in:
@@ -53,14 +53,18 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
void Build() const override;
|
||||
|
||||
void setGeneratorProperties(G4double minEnergy, G4double maxEnergy, G4String partSpecies){
|
||||
this->minEnergy = minEnergy;
|
||||
this->maxEnergy = maxEnergy;
|
||||
this->partSpecies = partSpecies;
|
||||
if(gen==nullptr){
|
||||
throw std::runtime_error("PrimaryGeneratorAction not found");
|
||||
}
|
||||
gen->setMinPartEnergy(minEnergy);
|
||||
gen->setMaxPartEnergy(maxEnergy);
|
||||
gen->setPartSpecies(partSpecies);
|
||||
G4cout << "ActionInitialization: Setting particle species to " << partSpecies << G4endl;
|
||||
}
|
||||
|
||||
private:
|
||||
B4::DetectorConstruction* fDetConstruction = nullptr;
|
||||
mutable B4::PrimaryGeneratorAction * gen = nullptr;
|
||||
G4double minEnergy=1000;
|
||||
G4double maxEnergy=1000;
|
||||
G4String partSpecies="e-";
|
||||
|
||||
Reference in New Issue
Block a user