#include "NemenixWLSFibre.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 #include #include "G4Box.hh" #include "G4SubtractionSolid.hh" #include "G4Tubs.hh" #include "G4PVPlacement.hh" #include "G4UnitsTable.hh" #include #include "G4LogicalBorderSurface.hh" #include "G4SystemOfUnits.hh" #include "G4PhysicalConstants.hh" #include "NemenixMPPC.hh" #include "G4SDManager.hh" NemenixWLSFibre::NemenixWLSFibre(){ // fSolidMPPCSD = NULL; } NemenixWLSFibre::~NemenixWLSFibre() {} G4LogicalVolume *NemenixWLSFibre::WLSConstruction(G4double FibLength, G4double FibXY) { 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 FibXY = 3*mm; //Build fibre total G4Box * FibBox = new G4Box("FibBox",0.5*FibXY,0.5*FibXY,0.5*FibLength+1.*mm); mate = G4Material::GetMaterial("Air"); logFibre = new G4LogicalVolume(FibBox,mate,"logFibre",0,0,0); // build the core ************************************************************* mate = G4Material::GetMaterial("Polystyrene"); G4double CoreXY = FibXY-2.*0.04*FibXY; G4Box * CoreBox = new G4Box("CoreBox",0.5*CoreXY,0.5*CoreXY,0.5*FibLength); logCore = new G4LogicalVolume(CoreBox,mate,"logCore",0,0,0); physCore = new G4PVPlacement(0, G4ThreeVector(0,0,0), logCore, "physCore", logFibre, false, 0); //Color Settings G4VisAttributes* vatCore= new G4VisAttributes(lgreen); vatCore->SetVisibility(true); vatCore->SetForceSolid(true); logCore->SetVisAttributes(vatCore); // build the cladding ***************************************************** mate = G4Material::GetMaterial("PMMA"); G4Box * CladBoxOuter = new G4Box("CladBoxOuter",0.5*FibXY,0.5*FibXY,0.5*FibLength); G4Box * CladBoxInner = new G4Box("CladBoxInner",0.5*CoreXY,0.5*CoreXY,0.5*FibLength); G4SubtractionSolid * CladBox = new G4SubtractionSolid("CladBox",CladBoxOuter,CladBoxInner,0, G4ThreeVector(0,0,0)); logClad = new G4LogicalVolume(CladBox,mate,"logClad",0,0,0); physClad = new G4PVPlacement(0, G4ThreeVector(0,0,0), logClad, "physClad", logFibre, false, 0); G4VisAttributes* vatClad= new G4VisAttributes(blue); vatClad->SetVisibility(false); vatClad->SetForceSolid(true); logClad->SetVisAttributes(vatClad); // //Build MPPC mate = G4Material::GetMaterial("MPPCFilm"); mppcConstruction = new NemenixMPPC(); logMPPC = mppcConstruction->MPPCConstruction(FibXY); // G4Box * MPPCBox = new G4Box("MPPCBox",0.5*FibXY,0.5*FibXY,0.5*(1.*mm-50*um)); // logMPPC = new G4LogicalVolume(MPPCBox,mate,"logMPPC",0,0,0); physMPPC = new G4PVPlacement(0, G4ThreeVector(0,0,0.5*FibLength+0.5*1.*mm+0.5*50.*um), logMPPC, "physMPPC", logFibre, false, 0); G4VisAttributes* vatMPPC= new G4VisAttributes(yellow); vatMPPC->SetVisibility(true); vatMPPC->SetForceSolid(true); logMPPC->SetVisAttributes(vatMPPC); //Build Grease mate = G4Material::GetMaterial("Grease"); G4Box * GreaseBox = new G4Box("GreaseBox",0.5*FibXY,0.5*FibXY,0.5*50*um); logGrease = new G4LogicalVolume(GreaseBox,mate,"logGrease",0,0,0); physGrease = new G4PVPlacement(0, G4ThreeVector(0,0,0.5*FibLength+0.5*50*um), logGrease, "physGrease", logFibre, false, 0); G4VisAttributes* vatGrease = new G4VisAttributes(green); vatGrease->SetVisibility(true); vatGrease->SetForceSolid(true); logGrease->SetVisAttributes(vatGrease); //Build Mirror mate = G4Material::GetMaterial("Mirror"); G4Box * MirrorBox = new G4Box("MirrorBox",0.5*FibXY,0.5*FibXY,0.5*(1.*mm)); logMirror = new G4LogicalVolume(MirrorBox,mate,"logMirror",0,0,0); physMirror = new G4PVPlacement(0, G4ThreeVector(0,0,-0.5*FibLength-0.5*1.*mm), logMirror, "physMirror", logFibre, false, 0); G4VisAttributes* vatMirror = new G4VisAttributes(white); vatMirror->SetVisibility(true); vatMirror->SetForceSolid(true); logMirror->SetVisAttributes(vatMirror); // fSolidMPPCSD = NULL; // G4SDManager* SDman = G4SDManager::GetSDMpointer(); // // // if(!fSolidMPPCSD){ // fSolidMPPCSD = new SolidMPPCSD("SolidMPPCSD"); // SDman->AddNewDetector(fSolidMPPCSD); // } // logMPPC->SetSensitiveDetector(fSolidMPPCSD); return logFibre; } //void SolidWLSFibre::ConstructSDandField() //{ // // Sensitive detectors // G4SDManager* SDman = G4SDManager::GetSDMpointer(); // fSolidMPPCSD = new SolidMPPCSD("SolidMPPCSD"); // SDman->AddNewDetector(fSolidMPPCSD); // logMPPC->SetSensitiveDetector( fSolidMPPCSD ); // //}