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-";
|
||||
|
||||
@@ -90,9 +90,9 @@ public:
|
||||
private:
|
||||
G4ParticleGun* fParticleGun = nullptr; // G4 particle gun
|
||||
G4double partEnergy;
|
||||
G4double minPartEnergy; //MeV
|
||||
G4double maxPartEnergy;
|
||||
G4String partSpecies;
|
||||
G4double minPartEnergy=100; //MeV
|
||||
G4double maxPartEnergy=100;
|
||||
G4String partSpecies="e-";
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user