68 : fMaterials(NULL), fLogicHole(NULL), fLogicWorld(NULL),
69 fPhysiWorld(NULL), fPhysiHole(NULL)
75 fSurfaceRoughness = 1;
79 fMirrorReflectivity = 1.;
82 fMPPCReflectivity = 0.;
84 fExtrusionPolish = 1.;
85 fExtrusionReflectivity = 1.;
91 fWLSfiberOrigin = 0.0;
93 fMPPCShape =
"Circle";
94 fMPPCHalfL = fWLSfiberRY;
99 fClrfiberZ = fMPPCZ + 10.*nm;
104 fHoleRadius = 0.9*
mm;
105 fHoleLength = fBarLength;
106 fCoatingThickness = 0.25*
mm;
107 fCoatingRadius = 1.875*
mm;
114 if (fDetectorMessenger)
delete fDetectorMessenger;
115 if (fMaterials)
delete fMaterials;
133 UpdateGeometryParameters();
147 new G4Box(
"World", fWorldSizeX, fWorldSizeY, fWorldSizeZ);
183 G4double refl_TiO2[2] = {fExtrusionReflectivity,fExtrusionReflectivity};
186 TiO2SurfaceProperty -> AddProperty(
"REFLECTIVITY",p_TiO2,refl_TiO2,2);
187 TiO2SurfaceProperty -> AddProperty(
"EFFICIENCY",p_TiO2,effi_TiO2,2);
189 TiO2Surface -> SetMaterialPropertiesTable(TiO2SurfaceProperty);
368 void WLSDetectorConstruction::ConstructFiber()
370 if (!(fLogicHole) || !(fPhysiHole) ) {
371 std::ostringstream o;
372 o <<
"The Fiber Hole has not been constructed";
373 G4Exception(
"WLSDetectorConstruction::ConstructFiber",
"",
388 if (fSurfaceRoughness < 1.)
399 switch ( fNumOfCladLayers ) {
438 logicPlacement = logicClad2;
439 physiPlacement = physiClad2;
478 logicPlacement = logicClad1;
479 physiPlacement = physiClad1;
550 G4double refl_mirror[2] = {fMirrorReflectivity,fMirrorReflectivity};
553 mirrorSurfaceProperty->
AddProperty(
"REFLECTIVITY",p_mirror,refl_mirror,2);
554 mirrorSurfaceProperty->
AddProperty(
"EFFICIENCY",p_mirror,effi_mirror,2);
556 mirrorSurface -> SetMaterialPropertiesTable(mirrorSurfaceProperty);
574 G4VSolid* solidCouple =
new G4Box(
"Couple",fCoupleRX,fCoupleRY,fCoupleZ);
595 if (fMPPCTheta > std::atan(fMPPCDist / fMPPCHalfL)) {
598 fMPPCOriginX = std::sin(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
599 fMPPCOriginZ = -fCoupleZ+std::cos(fMPPCTheta)*(fMPPCDist+fClrfiberZ);
600 G4cerr <<
"Invalid alignment. Alignment Reset to 0" <<
G4endl;
606 if ( fMPPCShape ==
"Square" )
608 new G4Box(
"ClearFiber",fClrfiberHalfL,fClrfiberHalfL,fClrfiberZ);
633 if ( fMPPCShape ==
"Square" )
634 solidPhotonDet =
new G4Box(
"PhotonDet",fMPPCHalfL,fMPPCHalfL,fMPPCZ);
663 G4double refl_mppc[2] = {fMPPCReflectivity,fMPPCReflectivity};
666 photonDetSurfaceProperty -> AddProperty(
"REFLECTIVITY",p_mppc,refl_mppc,2);
667 photonDetSurfaceProperty -> AddProperty(
"EFFICIENCY",p_mppc,effi_mppc,2);
669 photonDetSurface -> SetMaterialPropertiesTable(photonDetSurfaceProperty);
680 if (!fmppcSD.
Get()) {
681 G4String mppcSDName =
"WLS/PhotonDet";
690 void WLSDetectorConstruction::UpdateGeometryParameters()
692 fWLSfiberRX = fXYRatio * fWLSfiberRY;
694 fClad1RX = fWLSfiberRX + 0.03*fWLSfiberRX;
695 fClad1RY = fWLSfiberRY + 0.03*fWLSfiberRY;
696 fClad1Z = fWLSfiberZ;
698 fClad2RX = fClad1RX + 0.03*fWLSfiberRX;
699 fClad2RY = fClad1RY + 0.03*fWLSfiberRY;
700 fClad2Z = fWLSfiberZ;
702 fWorldSizeX = fClad2RX + fMPPCDist + fMPPCHalfL + 1.*
cm;
703 fWorldSizeY = fClad2RY + fMPPCDist + fMPPCHalfL + 1.*
cm;
704 fWorldSizeZ = fWLSfiberZ + fMPPCDist + fMPPCHalfL + 1.*
cm;
706 fCoupleRX = fWorldSizeX;
707 fCoupleRY = fWorldSizeY;
708 fCoupleZ = (fWorldSizeZ - fWLSfiberZ) / 2;
710 fClrfiberHalfL = fMPPCHalfL;
712 fMirrorRmax = fClad2RY;
714 fCoupleOrigin = fWLSfiberOrigin + fWLSfiberZ + fCoupleZ;
715 fMirrorOrigin = fWLSfiberOrigin - fWLSfiberZ - fMirrorZ;
716 fMPPCOriginX = std::sin(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
717 fMPPCOriginZ = -fCoupleZ + std::cos(fMPPCTheta) * (fMPPCDist + fClrfiberZ);
731 unsigned int place = 0;
733 while (place < rotation.size()) {
738 const G4String tmpstring=rotation.substr(place+1);
740 angle = strtod(tmpstring.c_str(),&
p) *
deg;
742 if (!p || (*p != (
char)
',' && *p != (
char)
'\0')) {
743 G4cerr <<
"Invalid rotation specification: " <<
744 rotation.c_str() <<
G4endl;
750 switch(rotation.substr(place,1).c_str()[0]) {
761 G4cerr <<
" Invalid rotation specification: "
766 rot = thisRotation * rot;
767 place = rotation.find(
',',place);
768 if (place > rotation.size())
break;
782 if (shape ==
"Circle" || shape ==
"Square" ) fMPPCShape = shape;
792 fNumOfCladLayers = num;
810 fWLSfiberRY = radius;
869 fSurfaceRoughness = roughness;
879 fMirrorPolish = polish;
889 fMirrorReflectivity = reflectivity;
899 fMPPCPolish = polish;
909 fMPPCReflectivity = reflectivity;
919 fMirrorToggle = flag;
957 fHoleRadius = radius;
966 fCoatingThickness = thick;
975 fCoatingRadius = radius;
1006 {
return fCoatingThickness; }
1016 return fWLSfiberOrigin + fWLSfiberZ;
1023 if (fNumOfCladLayers == 2)
return fClad2RY;
1024 if (fNumOfCladLayers == 1)
return fClad1RY;
1032 return fSurfaceRoughness;
1040 return fSurfaceRoughness == 1. && fXYRatio == 1.
1041 && (!fMirrorToggle ||
1042 (fMirrorPolish == 1. && fMirrorReflectivity == 1.));
virtual G4VPhysicalVolume * Construct()
void SetPhotonDetPolish(G4double)
G4double GetSurfaceRoughness()
void SetNumberOfCladding(G4int)
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)
Definition of the WLSMaterials class.
void SetMirrorPolish(G4double)
void SetClad1Radius(G4double)
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 G4PhysicalVolumeStore * GetInstance()
WLSDetectorConstruction()
void SetCoatingThickness(G4double)
static void CleanSurfaceTable()
static G4LogicalVolumeStore * GetInstance()
static G4SolidStore * GetInstance()
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)
static G4RunManager * GetRunManager()
void SetPhotonDetAlignment(G4double)
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 WLSMaterials * GetInstance()
void SetMirrorReflectivity(G4double)
void Put(const value_type &val) const
void SetSurfaceRoughness(G4double)
G4double GetWLSFiberEnd()
G4GLOB_DLL std::ostream G4cerr
G4VPhysicalVolume * ConstructDetector()