added multi particles
This commit is contained in:
@@ -53,15 +53,25 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
void BuildForMaster() const override;
|
||||
void Build() const override;
|
||||
|
||||
void setGeneratorProperties(G4double minEnergy, G4double maxEnergy, G4String partSpecies){
|
||||
void setGeneratorProperties(G4double minEnergy, G4double maxEnergy, const std::vector<std::string>& 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;
|
||||
G4cout << "ActionInitialization: Setting particle species to " ;
|
||||
for(const auto& p : partSpecies){
|
||||
G4cout << p << " ";
|
||||
}
|
||||
G4cout << G4endl;
|
||||
}
|
||||
void setGeneratorProperties(G4double minEnergy, G4double maxEnergy, const std::string& partSpecies){
|
||||
setGeneratorProperties(minEnergy, maxEnergy, std::vector<std::string>{partSpecies});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void setDetectorConstruction(B4::DetectorConstruction* det){
|
||||
fDetConstruction = det;
|
||||
@@ -80,7 +90,7 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
mutable B4::RunAction * runact = nullptr;
|
||||
G4double minEnergy=1000;
|
||||
G4double maxEnergy=1000;
|
||||
G4String partSpecies="e-";
|
||||
std::vector<std::string> partSpecies;
|
||||
G4String filename="";
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user