#include "NemenixMPPC.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 "G4LogicalSkinSurface.hh" #include "G4SystemOfUnits.hh" #include "G4PhysicalConstants.hh" #include "G4SDManager.hh" NemenixMPPC::NemenixMPPC(){ } NemenixMPPC::~NemenixMPPC() {} G4LogicalVolume *NemenixMPPC::MPPCConstruction(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) ; //Build MPPC mate = G4Material::GetMaterial("MPPCFilm"); 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); G4VisAttributes* vatMPPC= new G4VisAttributes(yellow); vatMPPC->SetVisibility(true); vatMPPC->SetForceSolid(true); logMPPC->SetVisAttributes(vatMPPC); G4double fMPPCPolish = 1.; // G4double fMPPCReflectivity = 0.; G4OpticalSurface* photonDetSurface = new G4OpticalSurface("PhotonDetSurface", glisur, ground, dielectric_metal, fMPPCPolish); G4int MPPCentries = 0; G4double MPPCenergy[500]; G4double MPPCindex[500]; G4double MPPCreflect[500]; G4double MPPCdetect[500]; // G4double MPPCAbsLength[500]; G4double MPPCEff[500]; G4double indexconst = 1.59; G4double reflectconst = 0.0; // G4double MPPCAbsLengthConst = 1e-20*m; std::ifstream ReadMPPC; G4String MPPCfile = "./properties/MPPC-PDE-vs-wavelength.txt"; ReadMPPC.open(MPPCfile); if (ReadMPPC.is_open()){ while(!ReadMPPC.eof()){ G4String filler; G4double wavelength; ReadMPPC >> wavelength >> filler >> MPPCdetect[MPPCentries]; MPPCenergy[MPPCentries] = (1240/wavelength)*eV; MPPCindex[MPPCentries] = indexconst; MPPCreflect[MPPCentries] = reflectconst; // MPPCAbsLength[MPPCentries] = MPPCAbsLengthConst; MPPCEff[MPPCentries] = 1.0; MPPCentries++; } } else G4cout << "Error opening file: " << MPPCfile << G4endl; ReadMPPC.close(); G4MaterialPropertiesTable *mppcMPT = new G4MaterialPropertiesTable(); //mppcMPT->AddProperty("ABSLENGTH",MPPCenergy,MPPCAbsLength,MPPCentries); mppcMPT->AddProperty("EFFICIENCY",MPPCenergy,MPPCEff,MPPCentries); mppcMPT->AddProperty("REFLECTIVITY",MPPCenergy,MPPCreflect,MPPCentries); mppcMPT->AddProperty("RINDEX",MPPCenergy,MPPCindex,MPPCentries); photonDetSurface->SetMaterialPropertiesTable(mppcMPT); new G4LogicalSkinSurface("PhotonDetSurface",logMPPC,photonDetSurface); return logMPPC; } //void SolidMPPC::ConstructSDandField() //{ // G4SDManager* SDman = G4SDManager::GetSDMpointer(); // // G4String mppcSDName = "SolidMPPCSD"; // SolidMPPCSD* mppcSD = new SolidMPPCSD(mppcSDName); // SDman->AddNewDetector(mppcSD); // logMPPC->SetSensitiveDetector(mppcSD); // //}