seems to work with different geometries
This commit is contained in:
@@ -40,6 +40,7 @@ class ConstructionWrapper;
|
||||
namespace B4
|
||||
{
|
||||
|
||||
|
||||
/// Detector construction class to define materials and geometry.
|
||||
/// The calorimeter is a box made of a given number of layers. A layer consists
|
||||
/// of an absorber plate and of a detection gap. The layer is replicated.
|
||||
@@ -59,13 +60,24 @@ namespace B4
|
||||
class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
DetectorConstruction( ConstructionWrapper* Cw): G4VUserDetectorConstruction(), cw(Cw){}
|
||||
|
||||
static DetectorConstruction* _global_detector_construction;
|
||||
static DetectorConstruction* getDetectorConstruction(){
|
||||
return _global_detector_construction;
|
||||
}
|
||||
|
||||
DetectorConstruction( ConstructionWrapper* Cw): G4VUserDetectorConstruction(), cw(Cw){
|
||||
_global_detector_construction=this;
|
||||
}
|
||||
~DetectorConstruction() override = default;
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct() override;
|
||||
void ConstructSDandField() override;
|
||||
|
||||
void setConstructionWrapper(ConstructionWrapper* Cw){
|
||||
this->cw = Cw;
|
||||
}
|
||||
|
||||
ConstructionWrapper* getConstructionWrapper(){
|
||||
return cw;
|
||||
|
||||
@@ -56,9 +56,6 @@ class EventAction : public G4UserEventAction
|
||||
void BeginOfEventAction(const G4Event* event) override;
|
||||
void EndOfEventAction(const G4Event* event) override;
|
||||
|
||||
void setConstructionWrapper(const ConstructionWrapper * Cw){
|
||||
this->cw = Cw;
|
||||
}
|
||||
void setPrimaryGeneratorAction(const B4::PrimaryGeneratorAction * Gen){
|
||||
this->gen = Gen;
|
||||
}
|
||||
@@ -67,7 +64,6 @@ class EventAction : public G4UserEventAction
|
||||
}
|
||||
|
||||
private:
|
||||
const ConstructionWrapper * cw=nullptr;
|
||||
const B4::PrimaryGeneratorAction * gen=nullptr;
|
||||
const B4::RunAction * run=nullptr;
|
||||
};
|
||||
|
||||
@@ -32,11 +32,8 @@
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "ConstructionWrapper.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
namespace B4
|
||||
{
|
||||
class DetectorConstruction;
|
||||
}
|
||||
|
||||
namespace B4a
|
||||
{
|
||||
@@ -52,15 +49,12 @@ class EventAction;
|
||||
class SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
SteppingAction(const B4::DetectorConstruction* detConstruction,
|
||||
EventAction* eventAction);
|
||||
SteppingAction(EventAction* eventAction);
|
||||
~SteppingAction() override = default;
|
||||
|
||||
void UserSteppingAction(const G4Step* step) override;
|
||||
|
||||
|
||||
private:
|
||||
const B4::DetectorConstruction* fDetConstruction = nullptr;
|
||||
EventAction* fEventAction = nullptr;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user