Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -36,15 +36,15 @@ class WLSDetectorConstruction;
|
||||
|
||||
class WLSActionInitialization : public G4VUserActionInitialization
|
||||
{
|
||||
public:
|
||||
WLSActionInitialization(WLSDetectorConstruction*);
|
||||
~WLSActionInitialization() override = default;
|
||||
public:
|
||||
WLSActionInitialization(WLSDetectorConstruction*);
|
||||
~WLSActionInitialization() override = default;
|
||||
|
||||
void BuildForMaster() const override;
|
||||
void Build() const override;
|
||||
void BuildForMaster() const override;
|
||||
void Build() const override;
|
||||
|
||||
private:
|
||||
WLSDetectorConstruction* fDetector = nullptr;
|
||||
private:
|
||||
WLSDetectorConstruction* fDetector = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
#ifndef WLSDetectorConstruction_h
|
||||
#define WLSDetectorConstruction_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Cache.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
class WLSMaterials;
|
||||
@@ -54,140 +55,140 @@ class G4VPhysicalVolume;
|
||||
|
||||
class WLSDetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
WLSDetectorConstruction();
|
||||
~WLSDetectorConstruction() override;
|
||||
public:
|
||||
WLSDetectorConstruction();
|
||||
~WLSDetectorConstruction() override;
|
||||
|
||||
G4VPhysicalVolume* Construct() override;
|
||||
G4VPhysicalVolume* ConstructDetector();
|
||||
G4VPhysicalVolume* Construct() override;
|
||||
G4VPhysicalVolume* ConstructDetector();
|
||||
|
||||
void ConstructSDandField() override;
|
||||
void ConstructSDandField() override;
|
||||
|
||||
// Set Material Commands for World and WLSfiber
|
||||
void SetWorldMaterial(G4String);
|
||||
void SetWLSFiberMaterial(G4String);
|
||||
void SetCoupleMaterial(G4String);
|
||||
// Set Material Commands for World and WLSfiber
|
||||
void SetWorldMaterial(G4String);
|
||||
void SetWLSFiberMaterial(G4String);
|
||||
void SetCoupleMaterial(G4String);
|
||||
|
||||
void SetPhotonDetGeometry(G4String);
|
||||
void SetNumberOfCladding(G4int); // Maximum 2 claddings
|
||||
void SetPhotonDetGeometry(G4String);
|
||||
void SetNumberOfCladding(G4int); // Maximum 2 claddings
|
||||
|
||||
void SetWLSLength(G4double); // Total length of WLS fiber
|
||||
void SetWLSRadius(G4double);
|
||||
void SetClad1Radius(G4double);
|
||||
void SetClad2Radius(G4double);
|
||||
void SetPhotonDetHalfLength(G4double);
|
||||
void SetGap(G4double);
|
||||
void SetPhotonDetAlignment(G4double);
|
||||
// Set the ratio of x and y (x/y) radius of the ellipse
|
||||
void SetXYRatio(G4double);
|
||||
// Set the Roughness in between each layer
|
||||
void SetSurfaceRoughness(G4double);
|
||||
// Set the reflectivity of the mirror
|
||||
void SetMirrorReflectivity(G4double);
|
||||
// Set the polish of the mirror
|
||||
void SetMirrorPolish(G4double);
|
||||
// Set the reflectivity of the mirror
|
||||
void SetPhotonDetReflectivity(G4double);
|
||||
// Set the polish of the mirror
|
||||
void SetPhotonDetPolish(G4double);
|
||||
void SetWLSLength(G4double); // Total length of WLS fiber
|
||||
void SetWLSRadius(G4double);
|
||||
void SetClad1Radius(G4double);
|
||||
void SetClad2Radius(G4double);
|
||||
void SetPhotonDetHalfLength(G4double);
|
||||
void SetGap(G4double);
|
||||
void SetPhotonDetAlignment(G4double);
|
||||
// Set the ratio of x and y (x/y) radius of the ellipse
|
||||
void SetXYRatio(G4double);
|
||||
// Set the Roughness in between each layer
|
||||
void SetSurfaceRoughness(G4double);
|
||||
// Set the reflectivity of the mirror
|
||||
void SetMirrorReflectivity(G4double);
|
||||
// Set the polish of the mirror
|
||||
void SetMirrorPolish(G4double);
|
||||
// Set the reflectivity of the mirror
|
||||
void SetPhotonDetReflectivity(G4double);
|
||||
// Set the polish of the mirror
|
||||
void SetPhotonDetPolish(G4double);
|
||||
|
||||
void SetMirror(G4bool);
|
||||
void SetMirror(G4bool);
|
||||
|
||||
void SetBarLength(G4double);
|
||||
void SetBarBase(G4double);
|
||||
void SetHoleRadius(G4double);
|
||||
void SetCoatingThickness(G4double);
|
||||
void SetCoatingRadius(G4double);
|
||||
void SetBarLength(G4double);
|
||||
void SetBarBase(G4double);
|
||||
void SetHoleRadius(G4double);
|
||||
void SetCoatingThickness(G4double);
|
||||
void SetCoatingRadius(G4double);
|
||||
|
||||
G4double GetWLSFiberLength();
|
||||
G4double GetWLSFiberEnd();
|
||||
G4double GetWLSFiberRMax();
|
||||
G4double GetSurfaceRoughness();
|
||||
G4bool IsPerfectFiber();
|
||||
G4double GetWLSFiberLength();
|
||||
G4double GetWLSFiberEnd();
|
||||
G4double GetWLSFiberRMax();
|
||||
G4double GetSurfaceRoughness();
|
||||
G4bool IsPerfectFiber();
|
||||
|
||||
G4double GetBarLength();
|
||||
G4double GetBarBase();
|
||||
G4double GetHoleRadius();
|
||||
G4double GetHoleLength();
|
||||
G4double GetFiberRadius();
|
||||
G4double GetBarLength();
|
||||
G4double GetBarBase();
|
||||
G4double GetHoleRadius();
|
||||
G4double GetHoleLength();
|
||||
G4double GetFiberRadius();
|
||||
|
||||
G4double GetCoatingThickness();
|
||||
G4double GetCoatingRadius();
|
||||
G4double GetCoatingThickness();
|
||||
G4double GetCoatingRadius();
|
||||
|
||||
G4Material* FindMaterial(G4String);
|
||||
G4Material* FindMaterial(G4String);
|
||||
|
||||
private:
|
||||
std::vector<G4VisAttributes*> fVisAttributes;
|
||||
private:
|
||||
std::vector<G4VisAttributes*> fVisAttributes;
|
||||
|
||||
WLSMaterials* fMaterials = nullptr;
|
||||
WLSMaterials* fMaterials = nullptr;
|
||||
|
||||
G4LogicalVolume* fLogicHole = nullptr;
|
||||
G4LogicalVolume* fLogicWorld = nullptr;
|
||||
G4LogicalVolume* fLogicHole = nullptr;
|
||||
G4LogicalVolume* fLogicWorld = nullptr;
|
||||
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr;
|
||||
G4VPhysicalVolume* fPhysiHole = nullptr;
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr;
|
||||
G4VPhysicalVolume* fPhysiHole = nullptr;
|
||||
|
||||
G4double fWorldSizeX = -1.;
|
||||
G4double fWorldSizeY = -1.;
|
||||
G4double fWorldSizeZ = -1.;
|
||||
G4double fWorldSizeX = -1.;
|
||||
G4double fWorldSizeY = -1.;
|
||||
G4double fWorldSizeZ = -1.;
|
||||
|
||||
G4double fWLSfiberRX = -1.;
|
||||
G4double fWLSfiberRY = 0.5 * CLHEP::mm;
|
||||
G4double fWLSfiberZ = 1. * CLHEP::m;
|
||||
G4double fWLSfiberRX = -1.;
|
||||
G4double fWLSfiberRY = 0.5 * CLHEP::mm;
|
||||
G4double fWLSfiberZ = 1. * CLHEP::m;
|
||||
|
||||
G4double fClad1RX = -1.;
|
||||
G4double fClad1RY = -1.;
|
||||
G4double fClad1Z = -1.;
|
||||
G4double fClad1RX = -1.;
|
||||
G4double fClad1RY = -1.;
|
||||
G4double fClad1Z = -1.;
|
||||
|
||||
G4double fClad2RX = -1.;
|
||||
G4double fClad2RY = -1.;
|
||||
G4double fClad2Z = -1.;
|
||||
G4double fClad2RX = -1.;
|
||||
G4double fClad2RY = -1.;
|
||||
G4double fClad2Z = -1.;
|
||||
|
||||
G4double fClrfiberHalfL = -1.;
|
||||
G4double fClrfiberZ = -1.;
|
||||
G4double fClrfiberHalfL = -1.;
|
||||
G4double fClrfiberZ = -1.;
|
||||
|
||||
G4double fCoupleRX = -1.;
|
||||
G4double fCoupleRY = -1.;
|
||||
G4double fCoupleZ = -1.;
|
||||
G4double fCoupleRX = -1.;
|
||||
G4double fCoupleRY = -1.;
|
||||
G4double fCoupleZ = -1.;
|
||||
|
||||
G4double fMirrorRmax = -1.;
|
||||
G4double fMirrorZ = 0.1 * CLHEP::mm;
|
||||
G4bool fMirrorToggle = true;
|
||||
G4double fMirrorRmax = -1.;
|
||||
G4double fMirrorZ = 0.1 * CLHEP::mm;
|
||||
G4bool fMirrorToggle = true;
|
||||
|
||||
G4String fMPPCShape = "Circle";
|
||||
G4double fMPPCHalfL = -1.;
|
||||
G4double fMPPCZ = 0.05 * CLHEP::mm;
|
||||
G4double fMPPCDist = 0.;
|
||||
G4double fMPPCTheta = 0;
|
||||
G4String fMPPCShape = "Circle";
|
||||
G4double fMPPCHalfL = -1.;
|
||||
G4double fMPPCZ = 0.05 * CLHEP::mm;
|
||||
G4double fMPPCDist = 0.;
|
||||
G4double fMPPCTheta = 0;
|
||||
|
||||
G4double fWLSfiberOrigin = 0.;
|
||||
G4double fCoupleOrigin = 0.;
|
||||
G4double fMirrorOrigin = 0.;
|
||||
G4double fMPPCOriginX = 0.;
|
||||
G4double fMPPCOriginZ = 0.;
|
||||
G4double fWLSfiberOrigin = 0.;
|
||||
G4double fCoupleOrigin = 0.;
|
||||
G4double fMirrorOrigin = 0.;
|
||||
G4double fMPPCOriginX = 0.;
|
||||
G4double fMPPCOriginZ = 0.;
|
||||
|
||||
G4int fNumOfCladLayers = 0;
|
||||
G4int fNumOfCladLayers = 0;
|
||||
|
||||
G4double fMirrorPolish = 1.;
|
||||
G4double fMirrorReflectivity = 1.;
|
||||
G4double fMPPCPolish = 1.;
|
||||
G4double fMPPCReflectivity = 0.;
|
||||
G4double fExtrusionPolish = 1.;
|
||||
G4double fExtrusionReflectivity = 1.;
|
||||
G4double fSurfaceRoughness = 1.;
|
||||
G4double fXYRatio = 1.;
|
||||
G4double fMirrorPolish = 1.;
|
||||
G4double fMirrorReflectivity = 1.;
|
||||
G4double fMPPCPolish = 1.;
|
||||
G4double fMPPCReflectivity = 0.;
|
||||
G4double fExtrusionPolish = 1.;
|
||||
G4double fExtrusionReflectivity = 1.;
|
||||
G4double fSurfaceRoughness = 1.;
|
||||
G4double fXYRatio = 1.;
|
||||
|
||||
G4double fBarLength = 1. * CLHEP::m;
|
||||
G4double fBarBase = 9.6 * CLHEP::mm;
|
||||
G4double fHoleRadius = 0.9 * CLHEP::mm;
|
||||
G4double fHoleLength = -1.;
|
||||
G4double fCoatingThickness = 0.25 * CLHEP::mm;
|
||||
G4double fCoatingRadius = 1.875 * CLHEP::mm;
|
||||
G4double fBarLength = 1. * CLHEP::m;
|
||||
G4double fBarBase = 9.6 * CLHEP::mm;
|
||||
G4double fHoleRadius = 0.9 * CLHEP::mm;
|
||||
G4double fHoleLength = -1.;
|
||||
G4double fCoatingThickness = 0.25 * CLHEP::mm;
|
||||
G4double fCoatingRadius = 1.875 * CLHEP::mm;
|
||||
|
||||
void UpdateGeometryParameters();
|
||||
void UpdateGeometryParameters();
|
||||
|
||||
WLSDetectorMessenger* fDetectorMessenger = nullptr;
|
||||
G4Cache<WLSPhotonDetSD*> fmppcSD;
|
||||
WLSDetectorMessenger* fDetectorMessenger = nullptr;
|
||||
G4Cache<WLSPhotonDetSD*> fmppcSD;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -50,38 +50,38 @@ class G4UIcmdWithoutParameter;
|
||||
|
||||
class WLSDetectorMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
WLSDetectorMessenger(WLSDetectorConstruction*);
|
||||
~WLSDetectorMessenger() override;
|
||||
public:
|
||||
WLSDetectorMessenger(WLSDetectorConstruction*);
|
||||
~WLSDetectorMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
|
||||
private:
|
||||
WLSDetectorConstruction* fDetector = nullptr;
|
||||
private:
|
||||
WLSDetectorConstruction* fDetector = nullptr;
|
||||
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
|
||||
G4UIcmdWithAString* fSetPhotonDetGeometryCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fSetNumOfCladLayersCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetWLSLengthCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetWLSRadiusCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetClad1RadiusCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetClad2RadiusCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetPhotonDetHalfLengthCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetGapCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetPhotonDetAlignmentCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetXYRatioCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetSurfaceRoughnessCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetMirrorPolishCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetMirrorReflectivityCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetPhotonDetPolishCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetPhotonDetReflectivityCmd = nullptr;
|
||||
G4UIcmdWithABool* fSetMirrorCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetBarLengthCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetBarBaseCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetHoleRadiusCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetCoatingThicknessCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetCoatingRadiusCmd = nullptr;
|
||||
G4UIcmdWithAString* fSetPhotonDetGeometryCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fSetNumOfCladLayersCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetWLSLengthCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetWLSRadiusCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetClad1RadiusCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetClad2RadiusCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetPhotonDetHalfLengthCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetGapCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetPhotonDetAlignmentCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetXYRatioCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetSurfaceRoughnessCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetMirrorPolishCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetMirrorReflectivityCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetPhotonDetPolishCmd = nullptr;
|
||||
G4UIcmdWithADouble* fSetPhotonDetReflectivityCmd = nullptr;
|
||||
G4UIcmdWithABool* fSetMirrorCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetBarLengthCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetBarBaseCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetHoleRadiusCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetCoatingThicknessCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetCoatingRadiusCmd = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,46 +41,46 @@ class WLSEventActionMessenger;
|
||||
|
||||
class WLSEventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
WLSEventAction();
|
||||
~WLSEventAction() override;
|
||||
public:
|
||||
WLSEventAction();
|
||||
~WLSEventAction() override;
|
||||
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
|
||||
G4int GetEventNo();
|
||||
void SetEventVerbose(G4int);
|
||||
G4int GetEventNo();
|
||||
void SetEventVerbose(G4int);
|
||||
|
||||
void AddTIR() { fNTIR += 1; };
|
||||
void AddExiting() { fNExiting += 1; };
|
||||
void AddEscapedEnd() { fEscapedEnd += 1; };
|
||||
void AddEscapedMid() { fEscapedMid += 1; };
|
||||
void AddBounce() { fBounce += 1; };
|
||||
void AddWLSBounce() { fWLSBounce += 1; };
|
||||
void AddClad1Bounce() { fClad1Bounce += 1; };
|
||||
void AddClad2Bounce() { fClad2Bounce += 1; };
|
||||
void AddReflected() { fReflected += 1; };
|
||||
void AddEscaped() { fEscaped += 1; };
|
||||
void AddMirror() { fMirror += 1; };
|
||||
void AddTIR() { fNTIR += 1; };
|
||||
void AddExiting() { fNExiting += 1; };
|
||||
void AddEscapedEnd() { fEscapedEnd += 1; };
|
||||
void AddEscapedMid() { fEscapedMid += 1; };
|
||||
void AddBounce() { fBounce += 1; };
|
||||
void AddWLSBounce() { fWLSBounce += 1; };
|
||||
void AddClad1Bounce() { fClad1Bounce += 1; };
|
||||
void AddClad2Bounce() { fClad2Bounce += 1; };
|
||||
void AddReflected() { fReflected += 1; };
|
||||
void AddEscaped() { fEscaped += 1; };
|
||||
void AddMirror() { fMirror += 1; };
|
||||
|
||||
private:
|
||||
WLSEventActionMessenger* fEventMessenger = nullptr;
|
||||
private:
|
||||
WLSEventActionMessenger* fEventMessenger = nullptr;
|
||||
|
||||
G4int fVerboseLevel = 0;
|
||||
G4int fVerboseLevel = 0;
|
||||
|
||||
G4int fMPPCCollID = 0;
|
||||
G4int fMPPCCollID = 0;
|
||||
|
||||
G4int fNTIR = 0;
|
||||
G4int fNExiting = 0;
|
||||
G4int fEscapedEnd = 0;
|
||||
G4int fEscapedMid = 0;
|
||||
G4int fBounce = 0;
|
||||
G4int fWLSBounce = 0;
|
||||
G4int fClad1Bounce = 0;
|
||||
G4int fClad2Bounce = 0;
|
||||
G4int fReflected = 0;
|
||||
G4int fEscaped = 0;
|
||||
G4int fMirror = 0;
|
||||
G4int fNTIR = 0;
|
||||
G4int fNExiting = 0;
|
||||
G4int fEscapedEnd = 0;
|
||||
G4int fEscapedMid = 0;
|
||||
G4int fBounce = 0;
|
||||
G4int fWLSBounce = 0;
|
||||
G4int fClad1Bounce = 0;
|
||||
G4int fClad2Bounce = 0;
|
||||
G4int fReflected = 0;
|
||||
G4int fEscaped = 0;
|
||||
G4int fMirror = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,16 +42,16 @@ class G4UIcmdWithAnInteger;
|
||||
|
||||
class WLSEventActionMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
WLSEventActionMessenger(WLSEventAction*);
|
||||
~WLSEventActionMessenger() override;
|
||||
public:
|
||||
WLSEventActionMessenger(WLSEventAction*);
|
||||
~WLSEventActionMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
|
||||
private:
|
||||
WLSEventAction* fEventAction = nullptr;
|
||||
private:
|
||||
WLSEventAction* fEventAction = nullptr;
|
||||
|
||||
G4UIcmdWithAnInteger* fSetVerboseCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fSetVerboseCmd = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,27 +41,27 @@ class G4NistManager;
|
||||
|
||||
class WLSMaterials
|
||||
{
|
||||
public:
|
||||
~WLSMaterials();
|
||||
public:
|
||||
~WLSMaterials();
|
||||
|
||||
static WLSMaterials* GetInstance();
|
||||
G4Material* GetMaterial(const G4String);
|
||||
static WLSMaterials* GetInstance();
|
||||
G4Material* GetMaterial(const G4String);
|
||||
|
||||
private:
|
||||
WLSMaterials();
|
||||
void CreateMaterials();
|
||||
private:
|
||||
WLSMaterials();
|
||||
void CreateMaterials();
|
||||
|
||||
static WLSMaterials* fInstance;
|
||||
static WLSMaterials* fInstance;
|
||||
|
||||
G4NistManager* fNistMan = nullptr;
|
||||
G4NistManager* fNistMan = nullptr;
|
||||
|
||||
G4Material* fAir = nullptr;
|
||||
G4Material* fPMMA = nullptr;
|
||||
G4Material* fPethylene = nullptr;
|
||||
G4Material* fFPethylene = nullptr;
|
||||
G4Material* fPolystyrene = nullptr;
|
||||
G4Material* fSilicone = nullptr;
|
||||
G4Material* fCoating = nullptr;
|
||||
G4Material* fAir = nullptr;
|
||||
G4Material* fPMMA = nullptr;
|
||||
G4Material* fPethylene = nullptr;
|
||||
G4Material* fFPethylene = nullptr;
|
||||
G4Material* fPolystyrene = nullptr;
|
||||
G4Material* fSilicone = nullptr;
|
||||
G4Material* fCoating = nullptr;
|
||||
};
|
||||
|
||||
#endif /*WLSMaterials_h*/
|
||||
|
||||
@@ -43,42 +43,42 @@
|
||||
|
||||
class WLSPhotonDetHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
WLSPhotonDetHit();
|
||||
WLSPhotonDetHit(G4ThreeVector pExit, G4ThreeVector pArrive, G4double pTime, G4double pEnergy);
|
||||
~WLSPhotonDetHit() override = default;
|
||||
public:
|
||||
WLSPhotonDetHit();
|
||||
WLSPhotonDetHit(G4ThreeVector pExit, G4ThreeVector pArrive, G4double pTime, G4double pEnergy);
|
||||
~WLSPhotonDetHit() override = default;
|
||||
|
||||
WLSPhotonDetHit(const WLSPhotonDetHit& right);
|
||||
const WLSPhotonDetHit& operator=(const WLSPhotonDetHit& right);
|
||||
WLSPhotonDetHit(const WLSPhotonDetHit& right);
|
||||
const WLSPhotonDetHit& operator=(const WLSPhotonDetHit& right);
|
||||
|
||||
G4bool operator==(const WLSPhotonDetHit& right) const;
|
||||
G4bool operator==(const WLSPhotonDetHit& right) const;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void* aHit);
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void* aHit);
|
||||
|
||||
inline void SetArrivalPos(G4ThreeVector xyz) { fPosArrive = xyz; }
|
||||
inline G4ThreeVector GetArrivalPos() { return fPosArrive; }
|
||||
inline void SetArrivalPos(G4ThreeVector xyz) { fPosArrive = xyz; }
|
||||
inline G4ThreeVector GetArrivalPos() { return fPosArrive; }
|
||||
|
||||
inline void SetExitPos(G4ThreeVector xyz) { fPosExit = xyz; }
|
||||
inline G4ThreeVector GetExitPos() { return fPosExit; }
|
||||
inline void SetExitPos(G4ThreeVector xyz) { fPosExit = xyz; }
|
||||
inline G4ThreeVector GetExitPos() { return fPosExit; }
|
||||
|
||||
inline void SetArrivalTime(G4double t) { fArrivalTime = t; }
|
||||
inline G4double GetArrivalTime() { return fArrivalTime; }
|
||||
inline void SetArrivalTime(G4double t) { fArrivalTime = t; }
|
||||
inline G4double GetArrivalTime() { return fArrivalTime; }
|
||||
|
||||
inline void SetEnergy(G4double en) { fEnergy = en; }
|
||||
inline G4double GetEnergy() { return fEnergy; }
|
||||
inline void SetEnergy(G4double en) { fEnergy = en; }
|
||||
inline G4double GetEnergy() { return fEnergy; }
|
||||
|
||||
void Print() override;
|
||||
void Print() override;
|
||||
|
||||
private:
|
||||
// the arrival time of the photon
|
||||
G4double fArrivalTime = 0.;
|
||||
// where the photon hit the detector (detector's coordinate)
|
||||
G4ThreeVector fPosArrive;
|
||||
// where the photon exited the fiber (world's coordinate)
|
||||
G4ThreeVector fPosExit;
|
||||
// energy of photon
|
||||
G4double fEnergy = 0.;
|
||||
private:
|
||||
// the arrival time of the photon
|
||||
G4double fArrivalTime = 0.;
|
||||
// where the photon hit the detector (detector's coordinate)
|
||||
G4ThreeVector fPosArrive;
|
||||
// where the photon exited the fiber (world's coordinate)
|
||||
G4ThreeVector fPosExit;
|
||||
// energy of photon
|
||||
G4double fEnergy = 0.;
|
||||
};
|
||||
|
||||
//--------------------------------------------------
|
||||
@@ -95,14 +95,13 @@ extern G4ThreadLocal G4Allocator<WLSPhotonDetHit>* WLSPhotonDetHitAllocator;
|
||||
|
||||
inline void* WLSPhotonDetHit::operator new(size_t)
|
||||
{
|
||||
if(!WLSPhotonDetHitAllocator)
|
||||
WLSPhotonDetHitAllocator = new G4Allocator<WLSPhotonDetHit>;
|
||||
return (void*) WLSPhotonDetHitAllocator->MallocSingle();
|
||||
if (!WLSPhotonDetHitAllocator) WLSPhotonDetHitAllocator = new G4Allocator<WLSPhotonDetHit>;
|
||||
return (void*)WLSPhotonDetHitAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
inline void WLSPhotonDetHit::operator delete(void* aHit)
|
||||
{
|
||||
WLSPhotonDetHitAllocator->FreeSingle((WLSPhotonDetHit*) aHit);
|
||||
WLSPhotonDetHitAllocator->FreeSingle((WLSPhotonDetHit*)aHit);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,19 +43,19 @@ class G4HCofThisEvent;
|
||||
|
||||
class WLSPhotonDetSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
WLSPhotonDetSD(G4String);
|
||||
~WLSPhotonDetSD() override = default;
|
||||
public:
|
||||
WLSPhotonDetSD(G4String);
|
||||
~WLSPhotonDetSD() override = default;
|
||||
|
||||
void Initialize(G4HCofThisEvent*) override;
|
||||
void Initialize(G4HCofThisEvent*) override;
|
||||
|
||||
G4bool ProcessHits(G4Step*, G4TouchableHistory*) override;
|
||||
G4bool ProcessHits(G4Step*, G4TouchableHistory*) override;
|
||||
|
||||
void EndOfEvent(G4HCofThisEvent*) override;
|
||||
void EndOfEvent(G4HCofThisEvent*) override;
|
||||
|
||||
private:
|
||||
WLSPhotonDetHitsCollection* fPhotonDetHitCollection = nullptr;
|
||||
G4int fHCID = -1;
|
||||
private:
|
||||
WLSPhotonDetHitsCollection* fPhotonDetHitCollection = nullptr;
|
||||
G4int fHCID = -1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
#ifndef WLSPrimaryGeneratorAction_h
|
||||
#define WLSPrimaryGeneratorAction_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class WLSDetectorConstruction;
|
||||
class WLSPrimaryGeneratorMessenger;
|
||||
@@ -46,32 +46,32 @@ class G4PhysicsTable;
|
||||
|
||||
class WLSPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
WLSPrimaryGeneratorAction(WLSDetectorConstruction*);
|
||||
~WLSPrimaryGeneratorAction() override;
|
||||
public:
|
||||
WLSPrimaryGeneratorAction(WLSDetectorConstruction*);
|
||||
~WLSPrimaryGeneratorAction() override;
|
||||
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
|
||||
void BuildEmissionSpectrum();
|
||||
void SetOptPhotonPolar(G4double);
|
||||
void SetDecayTimeConstant(G4double);
|
||||
void BuildEmissionSpectrum();
|
||||
void SetOptPhotonPolar(G4double);
|
||||
void SetDecayTimeConstant(G4double);
|
||||
|
||||
void SetUseSampledEnergy(G4bool v) { fUseSampledEnergy = v; }
|
||||
void SetUseSampledEnergy(G4bool v) { fUseSampledEnergy = v; }
|
||||
|
||||
protected:
|
||||
G4PhysicsTable* fIntegralTable = nullptr;
|
||||
protected:
|
||||
G4PhysicsTable* fIntegralTable = nullptr;
|
||||
|
||||
private:
|
||||
void SetOptPhotonPolar();
|
||||
void SetOptPhotonTime();
|
||||
private:
|
||||
void SetOptPhotonPolar();
|
||||
void SetOptPhotonTime();
|
||||
|
||||
WLSDetectorConstruction* fDetector = nullptr;
|
||||
G4GeneralParticleSource* fParticleGun = nullptr;
|
||||
WLSPrimaryGeneratorMessenger* fGunMessenger = nullptr;
|
||||
WLSDetectorConstruction* fDetector = nullptr;
|
||||
G4GeneralParticleSource* fParticleGun = nullptr;
|
||||
WLSPrimaryGeneratorMessenger* fGunMessenger = nullptr;
|
||||
|
||||
static G4bool fFirst;
|
||||
G4double fTimeConstant = 0.;
|
||||
G4bool fUseSampledEnergy = false;
|
||||
static G4bool fFirst;
|
||||
G4double fTimeConstant = 0.;
|
||||
G4bool fUseSampledEnergy = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,19 +44,19 @@ class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
class WLSPrimaryGeneratorMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
WLSPrimaryGeneratorMessenger(WLSPrimaryGeneratorAction*);
|
||||
~WLSPrimaryGeneratorMessenger() override;
|
||||
public:
|
||||
WLSPrimaryGeneratorMessenger(WLSPrimaryGeneratorAction*);
|
||||
~WLSPrimaryGeneratorMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
|
||||
private:
|
||||
WLSPrimaryGeneratorAction* fAction = nullptr;
|
||||
private:
|
||||
WLSPrimaryGeneratorAction* fAction = nullptr;
|
||||
|
||||
G4UIdirectory* fGunDir = nullptr;
|
||||
G4UIdirectory* fGunDir = nullptr;
|
||||
|
||||
G4UIcmdWithADoubleAndUnit* fSetPolarizationCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetDecayTimeConstantCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetPolarizationCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSetDecayTimeConstantCmd = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,111 +38,111 @@
|
||||
|
||||
class WLSRun : public G4Run
|
||||
{
|
||||
public:
|
||||
WLSRun() = default;
|
||||
~WLSRun() override = default;
|
||||
public:
|
||||
WLSRun() = default;
|
||||
~WLSRun() override = default;
|
||||
|
||||
void AddTIR(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fNTIR += nd;
|
||||
fNTIR2 += nd * nd;
|
||||
};
|
||||
void AddExiting(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fNExiting += nd;
|
||||
fNExiting2 += nd * nd;
|
||||
};
|
||||
void AddEscapedEnd(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fEscapedEnd += nd;
|
||||
fEscapedEnd2 += nd * nd;
|
||||
};
|
||||
void AddEscapedMid(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fEscapedMid += nd;
|
||||
fEscapedMid2 += nd * nd;
|
||||
};
|
||||
void AddBounce(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fBounce += nd;
|
||||
fBounce2 += nd * nd;
|
||||
};
|
||||
void AddWLSBounce(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fWLSBounce += nd;
|
||||
fWLSBounce2 += nd * nd;
|
||||
};
|
||||
void AddClad1Bounce(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fClad1Bounce += nd;
|
||||
fClad1Bounce2 += nd * nd;
|
||||
};
|
||||
void AddClad2Bounce(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fClad2Bounce += nd;
|
||||
fClad2Bounce2 += nd * nd;
|
||||
};
|
||||
void AddReflected(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fReflected += nd;
|
||||
fReflected2 += nd * nd;
|
||||
};
|
||||
void AddEscaped(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fEscaped += nd;
|
||||
fEscaped2 += nd * nd;
|
||||
};
|
||||
void AddMirror(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fMirror += nd;
|
||||
fMirror2 += nd * nd;
|
||||
};
|
||||
void AddDetectorHits(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fDetectorHits += nd;
|
||||
fDetectorHits2 += nd * nd;
|
||||
};
|
||||
void AddTIR(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fNTIR += nd;
|
||||
fNTIR2 += nd * nd;
|
||||
};
|
||||
void AddExiting(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fNExiting += nd;
|
||||
fNExiting2 += nd * nd;
|
||||
};
|
||||
void AddEscapedEnd(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fEscapedEnd += nd;
|
||||
fEscapedEnd2 += nd * nd;
|
||||
};
|
||||
void AddEscapedMid(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fEscapedMid += nd;
|
||||
fEscapedMid2 += nd * nd;
|
||||
};
|
||||
void AddBounce(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fBounce += nd;
|
||||
fBounce2 += nd * nd;
|
||||
};
|
||||
void AddWLSBounce(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fWLSBounce += nd;
|
||||
fWLSBounce2 += nd * nd;
|
||||
};
|
||||
void AddClad1Bounce(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fClad1Bounce += nd;
|
||||
fClad1Bounce2 += nd * nd;
|
||||
};
|
||||
void AddClad2Bounce(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fClad2Bounce += nd;
|
||||
fClad2Bounce2 += nd * nd;
|
||||
};
|
||||
void AddReflected(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fReflected += nd;
|
||||
fReflected2 += nd * nd;
|
||||
};
|
||||
void AddEscaped(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fEscaped += nd;
|
||||
fEscaped2 += nd * nd;
|
||||
};
|
||||
void AddMirror(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fMirror += nd;
|
||||
fMirror2 += nd * nd;
|
||||
};
|
||||
void AddDetectorHits(G4int n)
|
||||
{
|
||||
G4double nd(n);
|
||||
fDetectorHits += nd;
|
||||
fDetectorHits2 += nd * nd;
|
||||
};
|
||||
|
||||
void EndOfRun();
|
||||
void Merge(const G4Run*) override;
|
||||
void EndOfRun();
|
||||
void Merge(const G4Run*) override;
|
||||
|
||||
private:
|
||||
G4double fNTIR = 0.;
|
||||
G4double fNTIR2 = 0.;
|
||||
G4double fNExiting = 0.;
|
||||
G4double fNExiting2 = 0.;
|
||||
G4double fEscapedEnd = 0.;
|
||||
G4double fEscapedEnd2 = 0.;
|
||||
G4double fEscapedMid = 0.;
|
||||
G4double fEscapedMid2 = 0.;
|
||||
G4double fBounce = 0.;
|
||||
G4double fBounce2 = 0.;
|
||||
G4double fWLSBounce = 0.;
|
||||
G4double fWLSBounce2 = 0.;
|
||||
G4double fClad1Bounce = 0.;
|
||||
G4double fClad1Bounce2 = 0.;
|
||||
G4double fClad2Bounce = 0.;
|
||||
G4double fClad2Bounce2 = 0.;
|
||||
G4double fReflected = 0.;
|
||||
G4double fReflected2 = 0.;
|
||||
G4double fEscaped = 0.;
|
||||
G4double fEscaped2 = 0.;
|
||||
G4double fMirror = 0.;
|
||||
G4double fMirror2 = 0.;
|
||||
G4double fDetectorHits = 0.;
|
||||
G4double fDetectorHits2 = 0.;
|
||||
private:
|
||||
G4double fNTIR = 0.;
|
||||
G4double fNTIR2 = 0.;
|
||||
G4double fNExiting = 0.;
|
||||
G4double fNExiting2 = 0.;
|
||||
G4double fEscapedEnd = 0.;
|
||||
G4double fEscapedEnd2 = 0.;
|
||||
G4double fEscapedMid = 0.;
|
||||
G4double fEscapedMid2 = 0.;
|
||||
G4double fBounce = 0.;
|
||||
G4double fBounce2 = 0.;
|
||||
G4double fWLSBounce = 0.;
|
||||
G4double fWLSBounce2 = 0.;
|
||||
G4double fClad1Bounce = 0.;
|
||||
G4double fClad1Bounce2 = 0.;
|
||||
G4double fClad2Bounce = 0.;
|
||||
G4double fClad2Bounce2 = 0.;
|
||||
G4double fReflected = 0.;
|
||||
G4double fReflected2 = 0.;
|
||||
G4double fEscaped = 0.;
|
||||
G4double fEscaped2 = 0.;
|
||||
G4double fMirror = 0.;
|
||||
G4double fMirror2 = 0.;
|
||||
G4double fDetectorHits = 0.;
|
||||
G4double fDetectorHits2 = 0.;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,16 +41,16 @@ class G4Run;
|
||||
|
||||
class WLSRunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
WLSRunAction();
|
||||
~WLSRunAction() override = default;
|
||||
public:
|
||||
WLSRunAction();
|
||||
~WLSRunAction() override = default;
|
||||
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
G4Run* GenerateRun() override;
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
G4Run* GenerateRun() override;
|
||||
|
||||
private:
|
||||
WLSRun* fRun = nullptr;
|
||||
private:
|
||||
WLSRun* fRun = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,16 +39,16 @@
|
||||
|
||||
class WLSStackingAction : public G4UserStackingAction
|
||||
{
|
||||
public:
|
||||
WLSStackingAction() = default;
|
||||
~WLSStackingAction() override = default;
|
||||
public:
|
||||
WLSStackingAction() = default;
|
||||
~WLSStackingAction() override = default;
|
||||
|
||||
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track*) override;
|
||||
void NewStage() override;
|
||||
void PrepareNewEvent() override;
|
||||
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track*) override;
|
||||
void NewStage() override;
|
||||
void PrepareNewEvent() override;
|
||||
|
||||
private:
|
||||
G4int fPhotonCounter = 0;
|
||||
private:
|
||||
G4int fPhotonCounter = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,58 +47,58 @@ class G4StepPoint;
|
||||
|
||||
class WLSSteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
WLSSteppingAction(WLSDetectorConstruction*, WLSEventAction*);
|
||||
~WLSSteppingAction() override;
|
||||
public:
|
||||
WLSSteppingAction(WLSDetectorConstruction*, WLSEventAction*);
|
||||
~WLSSteppingAction() override;
|
||||
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
|
||||
// Set the bounce limit, 0 for no limit
|
||||
void SetBounceLimit(G4int);
|
||||
// Set the bounce limit, 0 for no limit
|
||||
void SetBounceLimit(G4int);
|
||||
|
||||
G4int GetNumberOfBounces();
|
||||
G4int GetNumberOfClad1Bounces();
|
||||
G4int GetNumberOfClad2Bounces();
|
||||
G4int GetNumberOfWLSBounces();
|
||||
// return number of successful events and reset the counter
|
||||
G4int ResetSuccessCounter();
|
||||
G4int GetNumberOfBounces();
|
||||
G4int GetNumberOfClad1Bounces();
|
||||
G4int GetNumberOfClad2Bounces();
|
||||
G4int GetNumberOfWLSBounces();
|
||||
// return number of successful events and reset the counter
|
||||
G4int ResetSuccessCounter();
|
||||
|
||||
private:
|
||||
// Artificially kill the photon after it has bounced more than this number
|
||||
G4int fBounceLimit = 100000;
|
||||
// number of photons that reach the end
|
||||
G4int fCounterEnd = 0;
|
||||
// number of photons that didn't make it to the end
|
||||
G4int fCounterMid = 0;
|
||||
// total number of bounces that a photon been through
|
||||
G4int fCounterBounce = 0;
|
||||
// number of bounces that a photon been through within the fibre
|
||||
G4int fCounterWLSBounce = 0;
|
||||
// number of bounces that a photon been through from Cladding 1 to 2
|
||||
G4int fCounterClad1Bounce = 0;
|
||||
// number of bounces that a photon been through from Cladding 2 to World
|
||||
G4int fCounterClad2Bounce = 0;
|
||||
private:
|
||||
// Artificially kill the photon after it has bounced more than this number
|
||||
G4int fBounceLimit = 100000;
|
||||
// number of photons that reach the end
|
||||
G4int fCounterEnd = 0;
|
||||
// number of photons that didn't make it to the end
|
||||
G4int fCounterMid = 0;
|
||||
// total number of bounces that a photon been through
|
||||
G4int fCounterBounce = 0;
|
||||
// number of bounces that a photon been through within the fibre
|
||||
G4int fCounterWLSBounce = 0;
|
||||
// number of bounces that a photon been through from Cladding 1 to 2
|
||||
G4int fCounterClad1Bounce = 0;
|
||||
// number of bounces that a photon been through from Cladding 2 to World
|
||||
G4int fCounterClad2Bounce = 0;
|
||||
|
||||
// initial gamma of the photon
|
||||
G4double fInitGamma = -1.;
|
||||
// initial theta of the photon
|
||||
G4double fInitTheta = -1.;
|
||||
// initial gamma of the photon
|
||||
G4double fInitGamma = -1.;
|
||||
// initial theta of the photon
|
||||
G4double fInitTheta = -1.;
|
||||
|
||||
G4OpBoundaryProcess* fOpProcess = nullptr;
|
||||
G4OpBoundaryProcess* fOpProcess = nullptr;
|
||||
|
||||
WLSDetectorConstruction* fDetector = nullptr;
|
||||
WLSSteppingActionMessenger* fSteppingMessenger = nullptr;
|
||||
WLSEventAction* fEventAction = nullptr;
|
||||
WLSDetectorConstruction* fDetector = nullptr;
|
||||
WLSSteppingActionMessenger* fSteppingMessenger = nullptr;
|
||||
WLSEventAction* fEventAction = nullptr;
|
||||
|
||||
inline void ResetCounters()
|
||||
{
|
||||
fCounterBounce = 0;
|
||||
fCounterWLSBounce = 0;
|
||||
fCounterClad1Bounce = 0;
|
||||
fCounterClad2Bounce = 0;
|
||||
fInitGamma = -1;
|
||||
fInitTheta = -1;
|
||||
}
|
||||
inline void ResetCounters()
|
||||
{
|
||||
fCounterBounce = 0;
|
||||
fCounterWLSBounce = 0;
|
||||
fCounterClad1Bounce = 0;
|
||||
fCounterClad2Bounce = 0;
|
||||
fInitGamma = -1;
|
||||
fInitTheta = -1;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,16 +43,16 @@ class G4UIcmdWithAnInteger;
|
||||
|
||||
class WLSSteppingActionMessenger : public G4UImessenger
|
||||
{
|
||||
public:
|
||||
WLSSteppingActionMessenger(WLSSteppingAction*);
|
||||
~WLSSteppingActionMessenger() override;
|
||||
public:
|
||||
WLSSteppingActionMessenger(WLSSteppingAction*);
|
||||
~WLSSteppingActionMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
|
||||
private:
|
||||
WLSSteppingAction* fSteppingAction = nullptr;
|
||||
G4UIdirectory* fSteppingDir = nullptr;
|
||||
G4UIcmdWithAnInteger* fSetBounceLimitCmd = nullptr;
|
||||
private:
|
||||
WLSSteppingAction* fSteppingAction = nullptr;
|
||||
G4UIdirectory* fSteppingDir = nullptr;
|
||||
G4UIcmdWithAnInteger* fSetBounceLimitCmd = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,11 +38,11 @@
|
||||
|
||||
class WLSTrackingAction : public G4UserTrackingAction
|
||||
{
|
||||
public:
|
||||
WLSTrackingAction() = default;
|
||||
~WLSTrackingAction() override = default;
|
||||
public:
|
||||
WLSTrackingAction() = default;
|
||||
~WLSTrackingAction() override = default;
|
||||
|
||||
void PreUserTrackingAction(const G4Track*) override;
|
||||
void PreUserTrackingAction(const G4Track*) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
#ifndef WLSTrajectory_h
|
||||
#define WLSTrajectory_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4TrajectoryPoint.hh"
|
||||
#include "G4VTrajectory.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -48,69 +48,59 @@ typedef std::vector<G4VTrajectoryPoint*> WLSTrajectoryPointContainer;
|
||||
|
||||
class WLSTrajectory : public G4VTrajectory
|
||||
{
|
||||
public:
|
||||
WLSTrajectory() = default;
|
||||
WLSTrajectory(const G4Track*);
|
||||
WLSTrajectory(WLSTrajectory&);
|
||||
~WLSTrajectory() override;
|
||||
public:
|
||||
WLSTrajectory() = default;
|
||||
WLSTrajectory(const G4Track*);
|
||||
WLSTrajectory(WLSTrajectory&);
|
||||
~WLSTrajectory() override;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
inline int operator==(const WLSTrajectory& right) const
|
||||
{
|
||||
return (this == &right);
|
||||
}
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
inline int operator==(const WLSTrajectory& right) const { return (this == &right); }
|
||||
|
||||
inline G4int GetTrackID() const override { return fTrackID; }
|
||||
inline G4int GetParentID() const override { return fParentID; }
|
||||
inline G4String GetParticleName() const override { return fParticleName; }
|
||||
inline G4double GetCharge() const override { return fPDGCharge; }
|
||||
inline G4int GetPDGEncoding() const override { return fPDGEncoding; }
|
||||
inline G4ThreeVector GetInitialMomentum() const override
|
||||
{
|
||||
return fInitialMomentum;
|
||||
}
|
||||
inline G4int GetTrackID() const override { return fTrackID; }
|
||||
inline G4int GetParentID() const override { return fParentID; }
|
||||
inline G4String GetParticleName() const override { return fParticleName; }
|
||||
inline G4double GetCharge() const override { return fPDGCharge; }
|
||||
inline G4int GetPDGEncoding() const override { return fPDGEncoding; }
|
||||
inline G4ThreeVector GetInitialMomentum() const override { return fInitialMomentum; }
|
||||
|
||||
void ShowTrajectory(std::ostream& os = G4cout) const override;
|
||||
void AppendStep(const G4Step* aStep) override;
|
||||
void MergeTrajectory(G4VTrajectory* secondTrajectory) override;
|
||||
void ShowTrajectory(std::ostream& os = G4cout) const override;
|
||||
void AppendStep(const G4Step* aStep) override;
|
||||
void MergeTrajectory(G4VTrajectory* secondTrajectory) override;
|
||||
|
||||
G4ParticleDefinition* GetParticleDefinition();
|
||||
G4ParticleDefinition* GetParticleDefinition();
|
||||
|
||||
int GetPointEntries() const override { return fpPointsContainer->size(); }
|
||||
G4VTrajectoryPoint* GetPoint(G4int i) const override
|
||||
{
|
||||
return (*fpPointsContainer)[i];
|
||||
}
|
||||
int GetPointEntries() const override { return fpPointsContainer->size(); }
|
||||
G4VTrajectoryPoint* GetPoint(G4int i) const override { return (*fpPointsContainer)[i]; }
|
||||
|
||||
const std::map<G4String, G4AttDef>* GetAttDefs() const override;
|
||||
std::vector<G4AttValue>* CreateAttValues() const override;
|
||||
const std::map<G4String, G4AttDef>* GetAttDefs() const override;
|
||||
std::vector<G4AttValue>* CreateAttValues() const override;
|
||||
|
||||
private:
|
||||
WLSTrajectoryPointContainer* fpPointsContainer = nullptr;
|
||||
private:
|
||||
WLSTrajectoryPointContainer* fpPointsContainer = nullptr;
|
||||
|
||||
G4int fTrackID = 0;
|
||||
G4int fParentID = 0;
|
||||
G4double fPDGCharge = 0.;
|
||||
G4int fPDGEncoding = 0;
|
||||
G4String fParticleName;
|
||||
G4ThreeVector fInitialMomentum;
|
||||
G4int fTrackID = 0;
|
||||
G4int fParentID = 0;
|
||||
G4double fPDGCharge = 0.;
|
||||
G4int fPDGEncoding = 0;
|
||||
G4String fParticleName;
|
||||
G4ThreeVector fInitialMomentum;
|
||||
|
||||
G4ParticleDefinition* fParticleDefinition = nullptr;
|
||||
G4ParticleDefinition* fParticleDefinition = nullptr;
|
||||
};
|
||||
|
||||
extern G4ThreadLocal G4Allocator<WLSTrajectory>* WLSTrajectoryAllocator;
|
||||
|
||||
inline void* WLSTrajectory::operator new(size_t)
|
||||
{
|
||||
if(!WLSTrajectoryAllocator)
|
||||
WLSTrajectoryAllocator = new G4Allocator<WLSTrajectory>;
|
||||
return (void*) WLSTrajectoryAllocator->MallocSingle();
|
||||
if (!WLSTrajectoryAllocator) WLSTrajectoryAllocator = new G4Allocator<WLSTrajectory>;
|
||||
return (void*)WLSTrajectoryAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
inline void WLSTrajectory::operator delete(void* aTrajectory)
|
||||
{
|
||||
WLSTrajectoryAllocator->FreeSingle((WLSTrajectory*) aTrajectory);
|
||||
WLSTrajectoryAllocator->FreeSingle((WLSTrajectory*)aTrajectory);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,11 +34,11 @@
|
||||
#ifndef WLSTrajectoryPoint_h
|
||||
#define WLSTrajectoryPoint_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4StepStatus.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4TrajectoryPoint.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Track;
|
||||
class G4Step;
|
||||
@@ -46,47 +46,43 @@ class G4VProcess;
|
||||
|
||||
class WLSTrajectoryPoint : public G4TrajectoryPoint
|
||||
{
|
||||
public:
|
||||
WLSTrajectoryPoint() = default;
|
||||
WLSTrajectoryPoint(const G4Track*);
|
||||
WLSTrajectoryPoint(const G4Step*);
|
||||
WLSTrajectoryPoint(const WLSTrajectoryPoint& right);
|
||||
~WLSTrajectoryPoint() override = default;
|
||||
public:
|
||||
WLSTrajectoryPoint() = default;
|
||||
WLSTrajectoryPoint(const G4Track*);
|
||||
WLSTrajectoryPoint(const G4Step*);
|
||||
WLSTrajectoryPoint(const WLSTrajectoryPoint& right);
|
||||
~WLSTrajectoryPoint() override = default;
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void* aTrajectoryPoint);
|
||||
inline G4bool operator==(const WLSTrajectoryPoint& right) const
|
||||
{
|
||||
return (this == &right);
|
||||
};
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void* aTrajectoryPoint);
|
||||
inline G4bool operator==(const WLSTrajectoryPoint& right) const { return (this == &right); };
|
||||
|
||||
inline G4double GetTime() const { return fTime; };
|
||||
inline const G4ThreeVector GetMomentum() const { return fMomentum; };
|
||||
inline G4StepStatus GetStepStatus() const { return fStepStatus; };
|
||||
inline G4String GetVolumeName() const { return fVolumeName; };
|
||||
inline G4double GetTime() const { return fTime; };
|
||||
inline const G4ThreeVector GetMomentum() const { return fMomentum; };
|
||||
inline G4StepStatus GetStepStatus() const { return fStepStatus; };
|
||||
inline G4String GetVolumeName() const { return fVolumeName; };
|
||||
|
||||
const std::map<G4String, G4AttDef>* GetAttDefs() const override;
|
||||
std::vector<G4AttValue>* CreateAttValues() const override;
|
||||
const std::map<G4String, G4AttDef>* GetAttDefs() const override;
|
||||
std::vector<G4AttValue>* CreateAttValues() const override;
|
||||
|
||||
private:
|
||||
G4double fTime = 0.;
|
||||
G4ThreeVector fMomentum;
|
||||
G4StepStatus fStepStatus = fUndefined;
|
||||
G4String fVolumeName;
|
||||
private:
|
||||
G4double fTime = 0.;
|
||||
G4ThreeVector fMomentum;
|
||||
G4StepStatus fStepStatus = fUndefined;
|
||||
G4String fVolumeName;
|
||||
};
|
||||
|
||||
extern G4ThreadLocal G4Allocator<WLSTrajectoryPoint>* WLSTrajPointAllocator;
|
||||
|
||||
inline void* WLSTrajectoryPoint::operator new(size_t)
|
||||
{
|
||||
if(!WLSTrajPointAllocator)
|
||||
WLSTrajPointAllocator = new G4Allocator<WLSTrajectoryPoint>;
|
||||
return (void*) WLSTrajPointAllocator->MallocSingle();
|
||||
if (!WLSTrajPointAllocator) WLSTrajPointAllocator = new G4Allocator<WLSTrajectoryPoint>;
|
||||
return (void*)WLSTrajPointAllocator->MallocSingle();
|
||||
}
|
||||
|
||||
inline void WLSTrajectoryPoint::operator delete(void* aTrajectoryPoint)
|
||||
{
|
||||
WLSTrajPointAllocator->FreeSingle((WLSTrajectoryPoint*) aTrajectoryPoint);
|
||||
WLSTrajPointAllocator->FreeSingle((WLSTrajectoryPoint*)aTrajectoryPoint);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,42 +39,39 @@
|
||||
|
||||
enum TrackStatus
|
||||
{
|
||||
undefined = 0,
|
||||
left = 1, // track is going -z
|
||||
right = 2, // track is going +z
|
||||
defined = 3, // left or right flag is on (Can't be Set)
|
||||
EscapedFromSide = 4, // photon escaped through the side of the fiber
|
||||
EscapedFromReadOut = 8, // photon escaped through read-out end of the fiber
|
||||
ReflectedAtMirror = 16, // photon has been reflected by mirror at far end
|
||||
ReflectedAtReadOut = 32, // photon has been reflected at the read-out end
|
||||
murderee = 64, // photon is artificially killed
|
||||
InsideOfFiber = 128, // Flag is on if the photon is inside of fiber
|
||||
OutsideOfFiber = 256 // Flag is on if the photon is outside of fiber
|
||||
undefined = 0,
|
||||
left = 1, // track is going -z
|
||||
right = 2, // track is going +z
|
||||
defined = 3, // left or right flag is on (Can't be Set)
|
||||
EscapedFromSide = 4, // photon escaped through the side of the fiber
|
||||
EscapedFromReadOut = 8, // photon escaped through read-out end of the fiber
|
||||
ReflectedAtMirror = 16, // photon has been reflected by mirror at far end
|
||||
ReflectedAtReadOut = 32, // photon has been reflected at the read-out end
|
||||
murderee = 64, // photon is artificially killed
|
||||
InsideOfFiber = 128, // Flag is on if the photon is inside of fiber
|
||||
OutsideOfFiber = 256 // Flag is on if the photon is outside of fiber
|
||||
};
|
||||
|
||||
class WLSUserTrackInformation : public G4VUserTrackInformation
|
||||
{
|
||||
public:
|
||||
WLSUserTrackInformation() = default;
|
||||
~WLSUserTrackInformation() override = default;
|
||||
public:
|
||||
WLSUserTrackInformation() = default;
|
||||
~WLSUserTrackInformation() override = default;
|
||||
|
||||
const G4ThreeVector& GetExitPosition() const { return fExitPosition; }
|
||||
void SetExitPosition(const G4ThreeVector& pos) { fExitPosition = pos; }
|
||||
const G4ThreeVector& GetExitPosition() const { return fExitPosition; }
|
||||
void SetExitPosition(const G4ThreeVector& pos) { fExitPosition = pos; }
|
||||
|
||||
// Try adding a status flag and return if it is successful or not
|
||||
// Cannot Add Undefine or a flag that conflicts with another flag
|
||||
// Return true if the addition of flag is successful, false otherwise
|
||||
G4bool AddStatusFlag(TrackStatus s);
|
||||
// Try adding a status flag and return if it is successful or not
|
||||
// Cannot Add Undefine or a flag that conflicts with another flag
|
||||
// Return true if the addition of flag is successful, false otherwise
|
||||
G4bool AddStatusFlag(TrackStatus s);
|
||||
|
||||
// Check if a certain flag is on
|
||||
G4bool IsStatus(TrackStatus s)
|
||||
{
|
||||
return s == undefined ? !(fStatus &= defined) : fStatus & s;
|
||||
}
|
||||
// Check if a certain flag is on
|
||||
G4bool IsStatus(TrackStatus s) { return s == undefined ? !(fStatus &= defined) : fStatus & s; }
|
||||
|
||||
private:
|
||||
G4int fStatus = undefined;
|
||||
G4ThreeVector fExitPosition;
|
||||
private:
|
||||
G4int fStatus = undefined;
|
||||
G4ThreeVector fExitPosition;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user