69 : fMaterials(NULL), fLogicHole(NULL), fLogicWorld(NULL),
70 fPhysiWorld(NULL), fPhysiHole(NULL)
76 fSurfaceRoughness = 1;
80 fMirrorReflectivity = 1.;
83 fMPPCReflectivity = 0.;
85 fExtrusionPolish = 1.;
86 fExtrusionReflectivity = 1.;
92 fWLSfiberOrigin = 0.0;
94 fMPPCShape =
"Circle";
95 fMPPCHalfL = fWLSfiberRY;
100 fClrfiberZ = fMPPCZ + 10.*
nm;
105 fHoleRadius = 0.9*
mm;
106 fHoleLength = fBarLength;
107 fCoatingThickness = 0.25*
mm;
108 fCoatingRadius = 1.875*
mm;
115 if (fDetectorMessenger)
delete fDetectorMessenger;
116 if (fMaterials)
delete fMaterials;
134 UpdateGeometryParameters();
148 new G4Box(
"World", fWorldSizeX, fWorldSizeY, fWorldSizeZ);
186 G4double refl_TiO2[] = {fExtrusionReflectivity,fExtrusionReflectivity};
187 assert(
sizeof(refl_TiO2) ==
sizeof(p_TiO2));
189 assert(
sizeof(effi_TiO2) ==
sizeof(p_TiO2));
191 TiO2SurfaceProperty -> AddProperty(
"REFLECTIVITY",p_TiO2,refl_TiO2,nbins);
192 TiO2SurfaceProperty -> AddProperty(
"EFFICIENCY",p_TiO2,effi_TiO2,nbins);
194 TiO2Surface -> SetMaterialPropertiesTable(TiO2SurfaceProperty);
373 void WLSDetectorConstruction::ConstructFiber()
375 if (!(fLogicHole) || !(fPhysiHole) ) {
376 std::ostringstream o;
377 o <<
"The Fiber Hole has not been constructed";
378 G4Exception(
"WLSDetectorConstruction::ConstructFiber",
"",
393 if (fSurfaceRoughness < 1.)
404 switch ( fNumOfCladLayers ) {
443 logicPlacement = logicClad2;
444 physiPlacement = physiClad2;
484 logicPlacement = logicClad1;
485 physiPlacement = physiClad1;
558 G4double refl_mirror[] = {fMirrorReflectivity,fMirrorReflectivity};
559 assert(
sizeof(refl_mirror) ==
sizeof(p_mirror));
561 assert(
sizeof(effi_mirror) ==
sizeof(effi_mirror));
563 mirrorSurfaceProperty->
564 AddProperty(
"REFLECTIVITY",p_mirror,refl_mirror,nbins);
565 mirrorSurfaceProperty->
566 AddProperty(
"EFFICIENCY",p_mirror,effi_mirror,nbins);
568 mirrorSurface -> SetMaterialPropertiesTable(mirrorSurfaceProperty);
586 G4VSolid* solidCouple =
new G4Box(
"Couple",fCoupleRX,fCoupleRY,fCoupleZ);
607 if (fMPPCTheta > std::atan(fMPPCDist / fMPPCHalfL)) {
610 fMPPCOriginX = std::sin(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
611 fMPPCOriginZ = -fCoupleZ+std::cos(fMPPCTheta)*(fMPPCDist+fClrfiberZ);
612 G4cerr <<
"Invalid alignment. Alignment Reset to 0" <<
G4endl;
618 if ( fMPPCShape ==
"Square" )
620 new G4Box(
"ClearFiber",fClrfiberHalfL,fClrfiberHalfL,fClrfiberZ);
645 if ( fMPPCShape ==
"Square" )
646 solidPhotonDet =
new G4Box(
"PhotonDet",fMPPCHalfL,fMPPCHalfL,fMPPCZ);
676 G4double refl_mppc[] = {fMPPCReflectivity,fMPPCReflectivity};
677 assert(
sizeof(refl_mppc) ==
sizeof(p_mppc));
679 assert(
sizeof(effi_mppc) ==
sizeof(p_mppc));
681 photonDetSurfaceProperty->
AddProperty(
"REFLECTIVITY",p_mppc,refl_mppc,nbins);
682 photonDetSurfaceProperty->
AddProperty(
"EFFICIENCY",p_mppc,effi_mppc,nbins);
693 if (!fmppcSD.
Get()) {
694 G4String mppcSDName =
"WLS/PhotonDet";
704 void WLSDetectorConstruction::UpdateGeometryParameters()
706 fWLSfiberRX = fXYRatio * fWLSfiberRY;
708 fClad1RX = fWLSfiberRX + 0.03*fWLSfiberRX;
709 fClad1RY = fWLSfiberRY + 0.03*fWLSfiberRY;
710 fClad1Z = fWLSfiberZ;
712 fClad2RX = fClad1RX + 0.03*fWLSfiberRX;
713 fClad2RY = fClad1RY + 0.03*fWLSfiberRY;
714 fClad2Z = fWLSfiberZ;
716 fWorldSizeX = fClad2RX + fMPPCDist + fMPPCHalfL + 1.*
cm;
717 fWorldSizeY = fClad2RY + fMPPCDist + fMPPCHalfL + 1.*
cm;
718 fWorldSizeZ = fWLSfiberZ + fMPPCDist + fMPPCHalfL + 1.*
cm;
720 fCoupleRX = fWorldSizeX;
721 fCoupleRY = fWorldSizeY;
722 fCoupleZ = (fWorldSizeZ - fWLSfiberZ) / 2;
724 fClrfiberHalfL = fMPPCHalfL;
726 fMirrorRmax = fClad2RY;
728 fCoupleOrigin = fWLSfiberOrigin + fWLSfiberZ + fCoupleZ;
729 fMirrorOrigin = fWLSfiberOrigin - fWLSfiberZ - fMirrorZ;
730 fMPPCOriginX = std::sin(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
731 fMPPCOriginZ = -fCoupleZ + std::cos(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
745 unsigned int place = 0;
747 while (place < rotation.size()) {
752 const G4String tmpstring=rotation.substr(place+1);
754 angle = strtod(tmpstring.c_str(),&
p) *
deg;
756 if (!p || (*p != (
char)
',' && *p != (
char)
'\0')) {
757 G4cerr <<
"Invalid rotation specification: " <<
758 rotation.c_str() <<
G4endl;
764 switch(rotation.substr(place,1).c_str()[0]) {
775 G4cerr <<
" Invalid rotation specification: "
780 rot = thisRotation * rot;
781 place = rotation.find(
',',place);
782 if (place > rotation.size())
break;
796 if (shape ==
"Circle" || shape ==
"Square" ) fMPPCShape = shape;
806 fNumOfCladLayers = num;
824 fWLSfiberRY = radius;
883 fSurfaceRoughness = roughness;
893 fMirrorPolish = polish;
903 fMirrorReflectivity = reflectivity;
913 fMPPCPolish = polish;
923 fMPPCReflectivity = reflectivity;
933 fMirrorToggle = flag;
970 fHoleRadius = radius;
979 fCoatingThickness = thick;
988 fCoatingRadius = radius;
1019 {
return fCoatingThickness; }
1029 return fWLSfiberOrigin + fWLSfiberZ;
1036 if (fNumOfCladLayers == 2)
return fClad2RY;
1037 if (fNumOfCladLayers == 1)
return fClad1RY;
1045 return fSurfaceRoughness;
1053 return fSurfaceRoughness == 1. && fXYRatio == 1.
1054 && (!fMirrorToggle ||
1055 (fMirrorPolish == 1. && fMirrorReflectivity == 1.));
virtual G4VPhysicalVolume * Construct()
void SetPhotonDetPolish(G4double)
G4double GetSurfaceRoughness()
void SetNumberOfCladding(G4int)
static constexpr double mm
void SetBarLength(G4double)
G4double GetCoatingRadius()
CLHEP::Hep3Vector G4ThreeVector
virtual ~WLSDetectorConstruction()
CLHEP::HepRotation G4RotationMatrix
void SetClad2Radius(G4double)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4double GetWLSFiberLength()
void SetXYRatio(G4double)
void SetPhotonDetHalfLength(G4double)
void SetUserLimits(G4UserLimits *pULimits)
void SetWLSLength(G4double)
void SetPhotonDetReflectivity(G4double)
static G4double angle[DIM]
Definition of the WLSMaterials class.
void SetMirrorPolish(G4double)
void SetClad1Radius(G4double)
static constexpr double rad
Definition of the WLSDetectorConstruction class.
void SetCoatingRadius(G4double)
G4MaterialPropertyVector * AddProperty(const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
HepRotation inverse() const
static void CleanSurfaceTable()
static G4RotationMatrix StringToRotationMatrix(G4String rotation)
static constexpr double twopi
static G4PhysicalVolumeStore * GetInstance()
WLSDetectorConstruction()
static constexpr double m
void SetCoatingThickness(G4double)
static constexpr double cm
static void CleanSurfaceTable()
static G4LogicalVolumeStore * GetInstance()
static G4SolidStore * GetInstance()
static constexpr double eV
void SetBarBase(G4double)
G4double GetCoatingThickness()
G4double GetFiberRadius()
static G4GeometryManager * GetInstance()
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
void SetHoleRadius(G4double)
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
G4double GetWLSFiberRMax()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void AddNewDetector(G4VSensitiveDetector *aSD)
static G4RunManager * GetRunManager()
static constexpr double nm
void SetPhotonDetAlignment(G4double)
static G4SDManager * GetSDMpointer()
void SetPhotonDetGeometry(G4String)
virtual void ConstructSDandField()
Definition of the WLSPhotonDetSD class.
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4Material * FindMaterial(G4String)
void SetWLSRadius(G4double)
Definition of the WLSDetectorMessenger class.
static constexpr double deg
static constexpr double ms
static WLSMaterials * GetInstance()
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
void SetMirrorReflectivity(G4double)
void Put(const value_type &val) const
void SetSurfaceRoughness(G4double)
G4double GetWLSFiberEnd()
G4GLOB_DLL std::ostream G4cerr
G4VPhysicalVolume * ConstructDetector()