File indexing completed on 2025-11-04 09:30:15
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 
0018 
0019 
0020 
0021 
0022 
0023 
0024 
0025 
0026 
0027 
0028 
0029 
0030 
0031 
0032 
0033 
0034 #ifndef WLSDetectorConstruction_h
0035 #define WLSDetectorConstruction_h 1
0036 
0037 #include "G4Cache.hh"
0038 #include "G4RotationMatrix.hh"
0039 #include "G4VUserDetectorConstruction.hh"
0040 #include "globals.hh"
0041 
0042 #include <CLHEP/Units/SystemOfUnits.h>
0043 
0044 class WLSMaterials;
0045 class WLSDetectorMessenger;
0046 class WLSPhotonDetSD;
0047 
0048 class G4Box;
0049 class G4EllipticalTube;
0050 class G4LogicalVolume;
0051 class G4Material;
0052 class G4Tubs;
0053 class G4VisAttributes;
0054 class G4VPhysicalVolume;
0055 
0056 class WLSDetectorConstruction : public G4VUserDetectorConstruction
0057 {
0058   public:
0059     WLSDetectorConstruction();
0060     ~WLSDetectorConstruction() override;
0061 
0062     G4VPhysicalVolume* Construct() override;
0063     G4VPhysicalVolume* ConstructDetector();
0064 
0065     void ConstructSDandField() override;
0066 
0067     
0068     void SetWorldMaterial(G4String);
0069     void SetWLSFiberMaterial(G4String);
0070     void SetCoupleMaterial(G4String);
0071 
0072     void SetPhotonDetGeometry(G4String);
0073     void SetNumberOfCladding(G4int);  
0074 
0075     void SetWLSLength(G4double);  
0076     void SetWLSRadius(G4double);
0077     void SetClad1Radius(G4double);
0078     void SetClad2Radius(G4double);
0079     void SetPhotonDetHalfLength(G4double);
0080     void SetGap(G4double);
0081     void SetPhotonDetAlignment(G4double);
0082     
0083     void SetXYRatio(G4double);
0084     
0085     void SetSurfaceRoughness(G4double);
0086     
0087     void SetMirrorReflectivity(G4double);
0088     
0089     void SetMirrorPolish(G4double);
0090     
0091     void SetPhotonDetReflectivity(G4double);
0092     
0093     void SetPhotonDetPolish(G4double);
0094 
0095     void SetMirror(G4bool);
0096 
0097     void SetBarLength(G4double);
0098     void SetBarBase(G4double);
0099     void SetHoleRadius(G4double);
0100     void SetCoatingThickness(G4double);
0101     void SetCoatingRadius(G4double);
0102 
0103     G4double GetWLSFiberLength();
0104     G4double GetWLSFiberEnd();
0105     G4double GetWLSFiberRMax();
0106     G4double GetSurfaceRoughness();
0107     G4bool IsPerfectFiber();
0108 
0109     G4double GetBarLength();
0110     G4double GetBarBase();
0111     G4double GetHoleRadius();
0112     G4double GetHoleLength();
0113     G4double GetFiberRadius();
0114 
0115     G4double GetCoatingThickness();
0116     G4double GetCoatingRadius();
0117 
0118     G4Material* FindMaterial(G4String);
0119 
0120   private:
0121     std::vector<G4VisAttributes*> fVisAttributes;
0122 
0123     WLSMaterials* fMaterials = nullptr;
0124 
0125     G4LogicalVolume* fLogicHole = nullptr;
0126     G4LogicalVolume* fLogicWorld = nullptr;
0127 
0128     G4VPhysicalVolume* fPhysiWorld = nullptr;
0129     G4VPhysicalVolume* fPhysiHole = nullptr;
0130 
0131     G4double fWorldSizeX = -1.;
0132     G4double fWorldSizeY = -1.;
0133     G4double fWorldSizeZ = -1.;
0134 
0135     G4double fWLSfiberRX = -1.;
0136     G4double fWLSfiberRY = 0.5 * CLHEP::mm;
0137     G4double fWLSfiberZ = 1. * CLHEP::m;
0138 
0139     G4double fClad1RX = -1.;
0140     G4double fClad1RY = -1.;
0141     G4double fClad1Z = -1.;
0142 
0143     G4double fClad2RX = -1.;
0144     G4double fClad2RY = -1.;
0145     G4double fClad2Z = -1.;
0146 
0147     G4double fClrfiberHalfL = -1.;
0148     G4double fClrfiberZ = -1.;
0149 
0150     G4double fCoupleRX = -1.;
0151     G4double fCoupleRY = -1.;
0152     G4double fCoupleZ = -1.;
0153 
0154     G4double fMirrorRmax = -1.;
0155     G4double fMirrorZ = 0.1 * CLHEP::mm;
0156     G4bool fMirrorToggle = true;
0157 
0158     G4String fMPPCShape = "Circle";
0159     G4double fMPPCHalfL = -1.;
0160     G4double fMPPCZ = 0.05 * CLHEP::mm;
0161     G4double fMPPCDist = 0.;
0162     G4double fMPPCTheta = 0;
0163 
0164     G4double fWLSfiberOrigin = 0.;
0165     G4double fCoupleOrigin = 0.;
0166     G4double fMirrorOrigin = 0.;
0167     G4double fMPPCOriginX = 0.;
0168     G4double fMPPCOriginZ = 0.;
0169 
0170     G4int fNumOfCladLayers = 0;
0171 
0172     G4double fMirrorPolish = 1.;
0173     G4double fMirrorReflectivity = 1.;
0174     G4double fMPPCPolish = 1.;
0175     G4double fMPPCReflectivity = 0.;
0176     G4double fExtrusionPolish = 1.;
0177     G4double fExtrusionReflectivity = 1.;
0178     G4double fSurfaceRoughness = 1.;
0179     G4double fXYRatio = 1.;
0180 
0181     G4double fBarLength = 1. * CLHEP::m;
0182     G4double fBarBase = 9.6 * CLHEP::mm;
0183     G4double fHoleRadius = 0.9 * CLHEP::mm;
0184     G4double fHoleLength = -1.;
0185     G4double fCoatingThickness = 0.25 * CLHEP::mm;
0186     G4double fCoatingRadius = 1.875 * CLHEP::mm;
0187 
0188     void UpdateGeometryParameters();
0189 
0190     WLSDetectorMessenger* fDetectorMessenger = nullptr;
0191     G4Cache<WLSPhotonDetSD*> fmppcSD;
0192 };
0193 
0194 #endif