seems to work with different geometries
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user