#include "SolidMaterials.hh" #include "SM1WLSFibre.hh" #include "SolidMPPC.hh" #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4LogicalBorderSurface.hh" #include "G4OpBoundaryProcess.hh" #include "G4ThreeVector.hh" #include "G4VisAttributes.hh" #include "G4Transform3D.hh" #include "G4UnionSolid.hh" #include "G4Box.hh" #include "G4SubtractionSolid.hh" #include "G4Tubs.hh" #include "G4PVPlacement.hh" #include "G4UnitsTable.hh" #include "G4LogicalBorderSurface.hh" #include "G4SystemOfUnits.hh" #include "G4PhysicalConstants.hh" #include #include #include SM1WLSFibre::SM1WLSFibre(G4int verboseLevel){ fverboseLevel = verboseLevel; } SM1WLSFibre::~SM1WLSFibre() {} // NumberMPPC indicates if the fiber will have 1 or 2 MPPC on its extremes G4LogicalVolume *SM1WLSFibre::WLSConstruction(G4int NumberMPPC, G4double FibLength, G4double FibXZ) { G4Material * mate; // make colours ********************************************************* G4Colour white (1.0, 1.0, 1.0) ; G4Colour white_t (1.0, 1.0, 1.0, .95) ; G4Colour grey (0.5, 0.5, 0.5) ; G4Colour lgrey (.75, .75, .75) ; G4Colour red (1.0, 0.0, 0.0) ; G4Colour blue (0.0, 0.0, 1.0) ; G4Colour blue_t (0.0, 0.0, 1.0, .75) ; G4Colour cyan (0.0, 1.0, 1.0, 0.5) ; G4Colour magenta (1.0, 0.0, 1.0) ; G4Colour yellow (1.0, 1.0, 0.0) ; G4Colour lblue (0.0, 0.0, .75) ; G4Colour black (0.0, 0.0, 0.0) ; G4Colour green (0.0, 1.0, 0.0, 0.5) ; G4Colour lgreen (0.0, .75, 0.0) ; G4double AlmirrorThickness = 1.*mm; G4double GreaseThickness = 50.*um; G4double CoreXZ = FibXZ-2.*0.04*FibXZ; //Build MPPC mate = G4Material::GetMaterial("MPPCFilm"); mppcConstruction = new SolidMPPC(fverboseLevel); logMPPC = mppcConstruction->MPPCConstruction(); G4double MPPCThickness = mppcConstruction->GetThickness(); G4VisAttributes* vatMPPC= new G4VisAttributes(yellow); vatMPPC->SetVisibility(true); vatMPPC->SetForceSolid(true); logMPPC->SetVisAttributes(vatMPPC); //Build fiber total along the Y axe (fiber+MPPC+Almirror+cladding+grease) G4double FibBoxLength; mate = G4Material::GetMaterial("Air"); if(NumberMPPC==1){ // the fiber have only 1 MPPC FibBoxLength = FibLength+MPPCThickness+GreaseThickness+AlmirrorThickness; }else{ // the fiber have 2 MPPCs FibBoxLength = FibLength+2.*MPPCThickness+2.*GreaseThickness; } G4Box * FibBox = new G4Box("FibBox",0.5*FibXZ,0.5*FibBoxLength,0.5*FibXZ); logFibre = new G4LogicalVolume(FibBox,mate,"logFibre",0,0,0); // build the core ************************************************************* mate = G4Material::GetMaterial("Polystyrene"); G4Box * CoreBox = new G4Box("CoreBox",0.5*CoreXZ,0.5*FibLength,0.5*CoreXZ); logCore = new G4LogicalVolume(CoreBox,mate,"logCore",0,0,0); //Color Settings G4VisAttributes* vatCore= new G4VisAttributes(lgreen); vatCore->SetVisibility(true); vatCore->SetForceSolid(true); logCore->SetVisAttributes(vatCore); if(fverboseLevel>0){ G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << "Fiber core: mass=" << logCore->GetMass()/g << ", volume=" << CoreBox->GetCubicVolume()/cm3 << G4endl; G4cout << "Fiber core: TOTmass=" << 288.*logCore->GetMass()/g << ", volume=" << 288.*CoreBox->GetCubicVolume()/cm3 << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } // build the cladding ***************************************************** mate = G4Material::GetMaterial("PMMA"); G4Box * CladBoxOuter = new G4Box("CladBoxOuter",0.5*FibXZ,0.5*FibLength,0.5*FibXZ); G4Box * CladBoxInner = new G4Box("CladBoxInner",0.5*CoreXZ,0.5*FibLength,0.5*CoreXZ); G4SubtractionSolid * CladBox = new G4SubtractionSolid("CladBox",CladBoxOuter,CladBoxInner,0, G4ThreeVector(0,0,0)); logClad = new G4LogicalVolume(CladBox,mate,"logClad",0,0,0); G4VisAttributes* vatClad= new G4VisAttributes(green); vatClad->SetVisibility(true); vatClad->SetForceSolid(true); logClad->SetVisAttributes(vatClad); if(fverboseLevel>0){ G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << "Fiber cladding: mass=" << logClad->GetMass()/g << ", volume=" << CladBox->GetCubicVolume()/cm3 << G4endl; G4cout << "Fiber cladding: TOTmass=" << 288.*logClad->GetMass()/g << ", volume=" << 288.*CladBox->GetCubicVolume()/cm3 << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } //Build Grease mate = G4Material::GetMaterial("Grease"); G4Box * GreaseBox = new G4Box("GreaseBox",0.5*FibXZ,0.5*GreaseThickness,0.5*FibXZ); logGrease = new G4LogicalVolume(GreaseBox,mate,"logGrease",0,0,0); G4VisAttributes* vatGrease = new G4VisAttributes(lgrey); vatGrease->SetVisibility(true); vatGrease->SetForceSolid(true); logGrease->SetVisAttributes(vatGrease); if(fverboseLevel>0){ G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << "Fiber grease: mass=" << logGrease->GetMass()/g << ", volume=" << GreaseBox->GetCubicVolume()/cm3 << G4endl; G4cout << "Fiber grease: TOTmass=" << 288.*logGrease->GetMass()/g << ", volume=" << 288.*GreaseBox->GetCubicVolume()/cm3 << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } //Build Mirror mate = G4Material::GetMaterial("Mirror"); G4Box * MirrorBox = new G4Box("MirrorBox",0.5*FibXZ,0.5*AlmirrorThickness,0.5*FibXZ); logMirror = new G4LogicalVolume(MirrorBox,mate,"logMirror",0,0,0); G4VisAttributes* vatMirror = new G4VisAttributes(white); vatMirror->SetVisibility(true); vatMirror->SetForceSolid(true); logMirror->SetVisAttributes(vatMirror); if(fverboseLevel>0){ G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << "Fiber mirror: mass=" << logMirror->GetMass()/g << ", volume=" << MirrorBox->GetCubicVolume()/cm3 << G4endl; G4cout << "Fiber mirror: TOTmass=" << 288.*logMirror->GetMass()/g << ", volume=" << 288.*MirrorBox->GetCubicVolume()/cm3 << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } physMPPC = new G4PVPlacement(0, G4ThreeVector(0,0.5*(FibBoxLength-MPPCThickness),0), logMPPC, "physMPPC", logFibre, false, 0); physGrease = new G4PVPlacement(0, G4ThreeVector(0,0.5*(FibBoxLength-GreaseThickness)-MPPCThickness,0), logGrease, "physGrease", logFibre, false, 0); if(NumberMPPC==1){ // the fiber have only 1 MPPC, and then an Al mirror on the other extreme physCore = new G4PVPlacement(0, G4ThreeVector(0,0.5*(AlmirrorThickness-GreaseThickness-MPPCThickness),0), logCore, "physCore", logFibre, false, 0); physClad = new G4PVPlacement(0, G4ThreeVector(0,0.5*(AlmirrorThickness-GreaseThickness-MPPCThickness),0), logClad, "physClad", logFibre, false, 0); physMirror = new G4PVPlacement(0, G4ThreeVector(0,-0.5*FibBoxLength+0.5*AlmirrorThickness,0), logMirror, "physMirror", logFibre, false, 0); }else{ // the fiber have 2 MPPCs physCore = new G4PVPlacement(0, G4ThreeVector(0,0,0), logCore, "physCore", logFibre, false, 0); physClad = new G4PVPlacement(0, G4ThreeVector(0,0,0), logClad, "physClad", logFibre, false, 0); physMPPC = new G4PVPlacement(0, G4ThreeVector(0,-0.5*(FibBoxLength-MPPCThickness),0), logMPPC, "physMPPC", logFibre, false, 1); physGrease = new G4PVPlacement(0, G4ThreeVector(0,-0.5*FibLength-0.5*GreaseThickness,0), logGrease, "physGrease", logFibre, false, 1); } return logFibre; }