seems to work with different geometries

This commit is contained in:
Jan Kieseler
2023-09-21 09:06:20 +02:00
parent cee740716c
commit 8d2302b5dc
8 changed files with 58 additions and 38 deletions
+4 -6
View File
@@ -41,10 +41,8 @@ namespace B4a
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::SteppingAction(const DetectorConstruction* detConstruction,
EventAction* eventAction)
: fDetConstruction(detConstruction),
fEventAction(eventAction)
SteppingAction::SteppingAction(EventAction* eventAction)
: fEventAction(eventAction)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -62,14 +60,14 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
//return;
//find the layer through the constructionwrapper that corresponds to the volume
auto cw = fDetConstruction->getConstructionWrapper();
auto cw = DetectorConstruction::getDetectorConstruction()->getConstructionWrapper();
if(cw == nullptr){
G4cout << "ConstructionWrapper not found" << G4endl;
throw std::runtime_error("ConstructionWrapper not found");
}
auto sensor = fDetConstruction->getConstructionWrapper()->getSensorByVolume(volume);
auto sensor = DetectorConstruction::getDetectorConstruction()->getConstructionWrapper()->getSensorByVolume(volume);
if(sensor == nullptr){
//can simply be not an active volume, so no need to throw an error
//G4cout << "Sensor not found in" << volume->GetName() << G4endl; //DEBUG