From d75c95c93428d26ad8b82be4463738842cf6367f Mon Sep 17 00:00:00 2001 From: adrien-matta <a.matta@surrey.ac.uk> Date: Mon, 19 May 2014 14:58:28 +0100 Subject: [PATCH] * fixing warning in annular S1 --- NPLib/AnnularS1/TS1Data.h | 8 +- NPSimulation/AnnularS1/AnnularS1.cc | 11 +- NPSimulation/AnnularS1/AnnularS1.hh | 4 +- NPSimulation/MUST2/MUST2Array.cc | 718 +++++++++++++++++++++++++--- NPSimulation/MUST2/MUST2Array.hh | 383 ++++++++------- NPSimulation/Makefile | 2 +- 6 files changed, 882 insertions(+), 244 deletions(-) diff --git a/NPLib/AnnularS1/TS1Data.h b/NPLib/AnnularS1/TS1Data.h index 2186439b1..2f9720175 100644 --- a/NPLib/AnnularS1/TS1Data.h +++ b/NPLib/AnnularS1/TS1Data.h @@ -61,22 +61,22 @@ class TS1Data : public TObject { ///////////////////// GETTERS //////////////////////// // (Th,E) - const int GetS1ThetaEMult() const {return fS1_Theta_E_DetNbr.size();} + const unsigned int GetS1ThetaEMult() const {return fS1_Theta_E_DetNbr.size();} const int GetS1ThetaEDetectorNbr(const int& i) const {return fS1_Theta_E_DetNbr.at(i);} const int GetS1ThetaEStripNbr(const int& i) const {return fS1_Theta_E_StripNbr.at(i);} const double GetS1ThetaEEnergy(const int& i) const {return fS1_Theta_E_Energy.at(i);} // (Th,T) - const int GetS1ThetaTMult() const {return fS1_Theta_T_DetNbr.size();} + const unsigned int GetS1ThetaTMult() const {return fS1_Theta_T_DetNbr.size();} const int GetS1ThetaTDetectorNbr(const int& i) const {return fS1_Theta_T_DetNbr.at(i);} const int GetS1ThetaTStripNbr(const int& i) const {return fS1_Theta_T_StripNbr.at(i);} const double GetS1ThetaTTime(const int& i) const {return fS1_Theta_T_Time.at(i);} // (Ph,E) - const int GetS1PhiEMult() const {return fS1_Phi_E_DetNbr.size();} + const unsigned int GetS1PhiEMult() const {return fS1_Phi_E_DetNbr.size();} const int GetS1PhiEDetectorNbr(const int& i) const {return fS1_Phi_E_DetNbr.at(i);} const int GetS1PhiEStripNbr(const int& i) const {return fS1_Phi_E_StripNbr.at(i);} const double GetS1PhiEEnergy(const int& i) const {return fS1_Phi_E_Energy.at(i);} // (Ph,T) - const int GetS1PhiTMult() const {return fS1_Phi_T_DetNbr.size();} + const unsigned int GetS1PhiTMult() const {return fS1_Phi_T_DetNbr.size();} const int GetS1PhiTDetectorNbr(const int& i) const {return fS1_Phi_T_DetNbr.at(i);} const int GetS1PhiTStripNbr(const int& i) const {return fS1_Phi_T_StripNbr.at(i);} const double GetS1PhiTTime(const int& i) const {return fS1_Phi_T_Time.at(i);} diff --git a/NPSimulation/AnnularS1/AnnularS1.cc b/NPSimulation/AnnularS1/AnnularS1.cc index b95bfc272..595d3e2fb 100644 --- a/NPSimulation/AnnularS1/AnnularS1.cc +++ b/NPSimulation/AnnularS1/AnnularS1.cc @@ -149,7 +149,7 @@ void AnnularS1::VolumeMaker(G4int DetecNumber, // Wafer Shape to be substracted to the PCB G4Tubs* solidWaferShapeBase = new G4Tubs("WaferShape", - WaferInnerRadius, + 0, WaferOutterRadius, PCBThickness, 0*deg, @@ -179,17 +179,10 @@ void AnnularS1::VolumeMaker(G4int DetecNumber, // PCB final - G4SubtractionSolid* solidPCB1 = new G4SubtractionSolid("AnnularS1_PCB1", + G4SubtractionSolid* solidPCB = new G4SubtractionSolid("AnnularS1_PCB1", solidPCBBase, solidWaferShape); - G4Tubs* solidTub = - new G4Tubs("central_hole",0,PCBInnerRadius,PCBThickness,0,360*deg); - G4SubtractionSolid* solidPCB = new G4SubtractionSolid("AnnularS1_PCB", - solidPCB1, - solidTub); - - G4LogicalVolume* logicPCB = new G4LogicalVolume(solidPCB, Vacuum, "AnnularS1_PCB", 0, 0, 0); new G4PVPlacement(G4Transform3D(*norotation, G4ThreeVector()), diff --git a/NPSimulation/AnnularS1/AnnularS1.hh b/NPSimulation/AnnularS1/AnnularS1.hh index 6b41b5447..5b7fb1aac 100644 --- a/NPSimulation/AnnularS1/AnnularS1.hh +++ b/NPSimulation/AnnularS1/AnnularS1.hh @@ -119,8 +119,8 @@ namespace ANNULARS1{ // PCB const G4double PCBPointsX[8]={-40,40,60,60,40,-40,-60,-60}; const G4double PCBPointsY[8]={60,60,40,-40,-60,-60,-40,40}; - const G4double PCBThickness=2*mm; - const G4double PCBInnerRadius=20*mm; + const G4double PCBThickness=3.2*mm; + const G4double PCBInnerRadius=0*mm; // Wafer const G4double WaferOutterRadius = 50*mm; const G4double WaferInnerRadius = 23*mm; diff --git a/NPSimulation/MUST2/MUST2Array.cc b/NPSimulation/MUST2/MUST2Array.cc index b8907596e..cd161e8f2 100644 --- a/NPSimulation/MUST2/MUST2Array.cc +++ b/NPSimulation/MUST2/MUST2Array.cc @@ -9,7 +9,7 @@ * Original Author: Adrien MATTA contact address: matta@ipno.in2p3.fr * * * * Creation Date : January 2009 * - * Last update : October 2009 * + * Last update : May 2014 * *---------------------------------------------------------------------------* * Decription: * * This file describe the MUST2 charge particle Detector * @@ -28,9 +28,10 @@ #include "G4Trd.hh" #include "G4Box.hh" #include "G4Trap.hh" +#include "G4ExtrudedSolid.hh" +#include "G4SubtractionSolid.hh" //G4 various object - #include "G4MaterialTable.hh" #include "G4Element.hh" #include "G4ElementTable.hh" @@ -62,6 +63,13 @@ using namespace MUST2 ; MUST2Array::MUST2Array(){ m_Event = new TMust2Data() ; InitializeMaterial(); + + // Common vis attribute: + m_PCBVisAtt = new G4VisAttributes(G4Colour(0.2, 0.5, 0.2)) ; + m_SiliconVisAtt = new G4VisAttributes(G4Colour(0.3, 0.3, 0.3)) ; + m_SiLiVisAtt = new G4VisAttributes(G4Colour(0.3, 1, 0.3)); + m_CsIVisAtt = new G4VisAttributes(G4Colour(1, 0.5, 0)); + m_CoolingVisAtt = new G4VisAttributes(G4Colour(0.5, 0.25, 0.25)); } MUST2Array::~MUST2Array(){ @@ -70,7 +78,6 @@ MUST2Array::~MUST2Array(){ delete m_MaterialCsI; delete m_MaterialVacuum ; delete m_MaterialMyl; - delete m_MaterialHarvar; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... @@ -129,6 +136,447 @@ void MUST2Array::AddTelescope( G4double R, m_X1_Y128 .push_back(empty) ; m_X128_Y128 .push_back(empty) ; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +G4LogicalVolume* MUST2Array::GetLogicalVolumeMUST2Short(){ + //////////////////////////////////////////////////////////////// + ////////////// Starting Volume Definition ////////////////////// + //////////////////////////////////////////////////////////////// + G4Trd* solidMM = new G4Trd("MUST2Telescope" + DetectorNumber, 0.5*FaceFront, 0.5*FaceBack, 0.5*FaceFront, 0.5*FaceBack, 0.5*Length); + G4LogicalVolume* logicMM = new G4LogicalVolume(solidMM, m_MaterialIron, "MUST2Telescope" + DetectorNumber, 0, 0, 0); + G4String Name = "MUST2Telescope" + DetectorNumber ; + + new G4PVPlacement( G4Transform3D(*MMrot, MMpos), + logicMM , + Name , + world , + false , + 0 ); + + if (m_non_sensitive_part_visiualisation){ + G4VisAttributes* FrameVisAtt = new G4VisAttributes(G4Colour(0.80, 0.80, 0.80)); + FrameVisAtt->SetForceWireframe(true); + logicMM->SetVisAttributes(FrameVisAtt) ; + } + + else logicMM->SetVisAttributes(G4VisAttributes::Invisible) ; + + G4ThreeVector positionVacBox = G4ThreeVector(0, 0, VacBox_PosZ); + + G4Trd* solidVacBox = + new G4Trd("solidVacBox", 0.5*ActiveWaferSize, 0.5*CsIFaceFront, 0.5*ActiveWaferSize, 0.5*CsIFaceFront, 0.5*VacBoxThickness); + + G4LogicalVolume* logicVacBox = new G4LogicalVolume(solidVacBox, m_MaterialVacuum, "logicVacBox", 0, 0, 0); + + + new G4PVPlacement(0, positionVacBox, logicVacBox, Name + "_VacBox", logicMM, false, 0); + + logicVacBox->SetVisAttributes(G4VisAttributes::Invisible); + + + //////////////////////////////////////////////////////////////// + /////////////////Si Strip Construction////////////////////////// + //////////////////////////////////////////////////////////////// + // A no rotation matrix is always handy ;) + G4RotationMatrix* norotation = new G4RotationMatrix(); + + // Create the front support frame for Si and SiLi + vector<G4TwoVector> polygon; + for(unsigned int i = 0 ; i < 4 ; i++){ + G4TwoVector Point(PCBPointsX[i],PCBPointsY[i]); + polygon.push_back(Point); + } + + // The PCB lenth is used to rescale different part of the detector + G4double PCBlength = PCBPointsX[0] - PCBPointsX[1]; + + G4ExtrudedSolid* solidFrontFrameBase = new G4ExtrudedSolid("Must2 Front Frame", + polygon, + FrontFrameThickness*0.5, + G4TwoVector(0,0),FrontFrameFrontSize/PCBlength, + G4TwoVector(0,0),FrontFrameBackSize/PCBlength); + + G4ExtrudedSolid* solidCavityShape1 = new G4ExtrudedSolid("Cavity1", + polygon, + FrontFrameThickness*0.5+PCBThickness, + G4TwoVector(0,0),CavityShape1FrontSize/PCBlength, + G4TwoVector(0,0),CavityShape1BackSize/PCBlength); + + G4SubtractionSolid* solidFrontFrame1 = new G4SubtractionSolid("Frame1", + solidFrontFrameBase, + solidCavityShape1, + G4Transform3D(*norotation,G4ThreeVector(0,0,0))); + + G4Box* solidCavityShape2 = new G4Box("Cavity2", 0.5*CavityShape2Width, (0.5+0.5)*CavityShape2Width, 0.5*CavityShape2Thickness); + + G4SubtractionSolid* solidFrontFrame2 = new G4SubtractionSolid("Frame2", + solidFrontFrame1, + solidCavityShape2, + G4Transform3D(*norotation,G4ThreeVector(0,0.5*CavityShape2Width,CavityShape2Center))); + + G4ExtrudedSolid* solidCutOut = new G4ExtrudedSolid("Cutout", + polygon, + FrontFrameThickness*0.8, + G4TwoVector(0,0),1.1*FrontFrameBackSize/PCBlength, + G4TwoVector(0,0),1.1*FrontFrameBackSize/PCBlength); + + + G4SubtractionSolid* solidFrontFrame3 = new G4SubtractionSolid("Must2 Front Frame", + solidFrontFrame2, + solidCutOut, + G4Transform3D(*norotation,G4ThreeVector(0,FrontFrameBackSize*0.5*1.1+66*mm,0))); + + G4SubtractionSolid* solidFrontFrame = new G4SubtractionSolid("Must2 Front Frame", + solidFrontFrame3, + solidCutOut, + G4Transform3D(*norotation,G4ThreeVector(-FrontFrameBackSize*0.5*1.1-66*mm,0,0))); + + + G4LogicalVolume* logicFrontFrame = new G4LogicalVolume(solidFrontFrame,m_MaterialAluminium,"Must2 Front Frame", 0, 0, 0); + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,Silicon_PosZ+FrontFrameThickness*0.5+0.5*PCBThickness)), + logicFrontFrame, + "Must2 Front Fame", + logicMM, + false, + 0); + + + // Electronic bloc + G4Box* solidMUFEE = new G4Box("solidMUFEE", 0.5*MUFEESize, 0.5*MUFEESize, 0.5*MUFEEThickness); + G4Box* solidCooling = new G4Box("solidCooling", 0.5*MUFEESize, 0.5*MUFEESize, 0.5*CoolingThickness); + G4ExtrudedSolid* solidElecFrameShort = new G4ExtrudedSolid("SolidElecFrame", + polygon, + CoolingThickness*0.5, + G4TwoVector(0,0),FrontFrameBackSize/PCBlength, + G4TwoVector(0,0),FrontFrameBackSize/PCBlength); + + + G4LogicalVolume* logicMUFEE = new G4LogicalVolume(solidMUFEE,m_MaterialAluminium,"Must2 MUFEE", 0, 0, 0); + G4LogicalVolume* logicCooling = new G4LogicalVolume(solidCooling,m_MaterialAluminium,"Must2 Cooling", 0, 0, 0); + G4LogicalVolume* logicElecFrame = new G4LogicalVolume(solidElecFrameShort,m_MaterialAluminium,"Must2 Frame", 0, 0, 0); + + logicMUFEE->SetVisAttributes(m_PCBVisAtt); + logicCooling->SetVisAttributes(m_CoolingVisAtt); + + G4double CoolingPosition = FrontFrameThickness+Silicon_PosZ+0.5*CoolingThickness; + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,CoolingPosition)), + logicCooling, + "Must2 Cooling", + logicMM, + false, + 0); + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,CoolingPosition)), + logicElecFrame, + "Must2 Fame", + logicMM, + false, + 0); + + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,CoolingPosition-0.5*MUFEEThickness-0.5*CoolingThickness)), + logicMUFEE, + "Must2 Front Fame", + logicMM, + false, + 0); + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,CoolingPosition+0.5*MUFEEThickness+0.5*CoolingThickness)), + logicMUFEE, + "Must2 Front Fame", + logicMM, + false, + 0); + + + + + if (wSi) { + + // Volume containing the Silicon detector + G4ExtrudedSolid* solidSilicon = new G4ExtrudedSolid(Name, + polygon, + PCBThickness*0.5, + G4TwoVector(0,0),1, + G4TwoVector(0,0),1); + + G4LogicalVolume* logicSilicon = new G4LogicalVolume(solidSilicon,m_MaterialVacuum, Name, 0, 0, 0); + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,Silicon_PosZ)), + logicSilicon, + "Silicon", + logicMM, + false, + 0); + + logicSilicon->SetVisAttributes(G4VisAttributes::Invisible); + + // PCB Base + G4ExtrudedSolid* solidPCBBase = new G4ExtrudedSolid("PCBBase", + polygon, + PCBThickness*0.5, + G4TwoVector(0,0),1, + G4TwoVector(0,0),1); + + // Wafer Shape + G4Box* solidWaferShape = new G4Box("solidWaferShape", 0.5*WaferSize, 0.5*WaferSize, 0.6*PCBThickness); + + // PCB + + G4SubtractionSolid* solidPCB = new G4SubtractionSolid("PCB", + solidPCBBase, + solidWaferShape, + G4Transform3D(*norotation,G4ThreeVector(0,0,0))); + + G4LogicalVolume* logicPCB = new G4LogicalVolume(solidPCB, m_MaterialSilicon, "logicPCB", 0, 0, 0); + + new G4PVPlacement(0, G4ThreeVector(0,0,0), logicPCB, Name + "_Silicon", logicSilicon, false, 0); + + logicPCB->SetVisAttributes(m_PCBVisAtt); + + + // Wafer + G4Box* solidWafer = new G4Box("solidWaferShape", 0.5*WaferSize, 0.5*WaferSize, 0.5*WaferThickness); + G4LogicalVolume* logicWafer = new G4LogicalVolume(solidWafer, m_MaterialSilicon, "logicWafer", 0, 0, 0); + new G4PVPlacement(0, G4ThreeVector(0,0,0), logicWafer, Name + "_Silicon", logicSilicon, false, 0); + + + // Active Wafer + G4Box* solidActiveWafer = new G4Box("solidActiveWaferShape", 0.5*ActiveWaferSize, 0.5*ActiveWaferSize, 0.5*WaferThickness); + G4LogicalVolume* logicActiveWafer = new G4LogicalVolume(solidActiveWafer, m_MaterialSilicon, "logicActiveWafer", 0, 0, 0); + + new G4PVPlacement(0, G4ThreeVector(0,0,0), logicActiveWafer, Name + "_Silicon", logicSilicon, false, 0); + + G4ThreeVector positionAluStripFront = G4ThreeVector(0, 0, 0.5*WaferThickness+0.5*AluStripThickness); + G4ThreeVector positionAluStripBack = G4ThreeVector(0, 0, -0.5*WaferThickness-0.5*AluStripThickness); + + G4Box* solidAluStrip = new G4Box("AluBox", 0.5*ActiveWaferSize, 0.5*ActiveWaferSize, 0.5*AluStripThickness); + G4LogicalVolume* logicAluStrip = new G4LogicalVolume(solidAluStrip, m_MaterialAluminium, "logicAluStrip", 0, 0, 0); + + new G4PVPlacement(0, positionAluStripFront, logicAluStrip, "AluStripFront", logicSilicon, false, 0); + new G4PVPlacement(0, positionAluStripBack, logicAluStrip, "AluStripBack", logicSilicon, false, 0); + + logicAluStrip->SetVisAttributes(G4VisAttributes::Invisible); + + G4ThreeVector positionSilicon = G4ThreeVector(0, 0, Silicon_PosZ); + + new G4PVPlacement(0, G4ThreeVector(0, 0, Silicon_PosZ), logicSilicon, "Silicon", logicMM, false, 0); + + // Set Silicon strip sensible + logicActiveWafer->SetSensitiveDetector(m_StripScorer); + + // Visualisation of Silicon Strip + logicWafer->SetVisAttributes(m_SiliconVisAtt); + logicActiveWafer->SetVisAttributes(m_SiliconVisAtt); + } + //////////////////////////////////////////////////////////////// + //////////////////// SiLi Construction //////////////////////// + //////////////////////////////////////////////////////////////// + + if (wSiLi) { + G4double SiLiSpace = 8 * mm; + G4RotationMatrix* rotSiLi = new G4RotationMatrix(0,0,0); + G4Box* solidSiLi = new G4Box("SiLi", 0.5*ActiveWaferSize+0.5*SiLiSpace, 0.5*ActiveWaferSize, 0.5*SiLiThickness); + G4LogicalVolume* logicSiLi = new G4LogicalVolume(solidSiLi, m_MaterialAluminium, Name + "_SiLi" , 0, 0, 0); + + logicSiLi->SetVisAttributes(G4VisAttributes::Invisible); + + new G4PVPlacement( G4Transform3D(*rotSiLi, G4ThreeVector(0,0,0) ) , + logicSiLi , + Name + "_SiLi", + logicVacBox , + false , + 0); + + // SiLi are placed inside of the VacBox... + // Left/Right define when looking to detector from Si to CsI + G4double SiLi_HighY_Upper = 19.86 * mm; + G4double SiLi_HighY_Center = 25.39 * mm; + G4double SiLi_WidthX_Left = 22.85 * mm; + G4double SiLi_WidthX_Right = 24.9 * mm; + G4double SiLi_ShiftX = 0.775 * mm; + + // SiLi are organized by two group of 8 Up(9 to 15) and Down(1 to 8). + G4ThreeVector ShiftSiLiUp = G4ThreeVector(-0.25 * ActiveWaferSize - 0.5 * SiLiSpace, 0, 0) ; + G4ThreeVector ShiftSiLiDown = G4ThreeVector(0.25 * ActiveWaferSize + 0.5 * SiLiSpace, 0, 0) ; + + // SiLi : left side of SiLi detector + G4Box* solidSiLi_LT = new G4Box("SiLi_LT" , 0.5*SiLi_WidthX_Left , 0.5*SiLi_HighY_Upper , 0.5*SiLiThickness); + G4Box* solidSiLi_RT = new G4Box("SiLi_RT" , 0.5*SiLi_WidthX_Right , 0.5*SiLi_HighY_Upper , 0.5*SiLiThickness); + G4Box* solidSiLi_LC1 = new G4Box("SiLi_LC1" , 0.5*SiLi_WidthX_Left , 0.5*SiLi_HighY_Center , 0.5*SiLiThickness); + G4Box* solidSiLi_RC1 = new G4Box("SiLi_RC1" , 0.5*SiLi_WidthX_Right , 0.5*SiLi_HighY_Center , 0.5*SiLiThickness); + G4Box* solidSiLi_LB = new G4Box("SiLi_LB" , 0.5*SiLi_WidthX_Left , 0.5*SiLi_HighY_Upper , 0.5*SiLiThickness); + G4Box* solidSiLi_RB = new G4Box("SiLi_RB" , 0.5*SiLi_WidthX_Right , 0.5*SiLi_HighY_Upper , 0.5*SiLiThickness); + G4Box* solidSiLi_LC2 = new G4Box("SiLi_LC2" , 0.5*SiLi_WidthX_Left , 0.5*SiLi_HighY_Center , 0.5*SiLiThickness); + G4Box* solidSiLi_RC2 = new G4Box("SiLi_RC2" , 0.5*SiLi_WidthX_Right , 0.5*SiLi_HighY_Center , 0.5*SiLiThickness); + + G4LogicalVolume* logicSiLi_LT = new G4LogicalVolume(solidSiLi_LT , m_MaterialSilicon , "SiLi_LT" , 0 , 0 , 0); + G4LogicalVolume* logicSiLi_RT = new G4LogicalVolume(solidSiLi_RT , m_MaterialSilicon , "SiLi_RT" , 0 , 0 , 0); + G4LogicalVolume* logicSiLi_LC1 = new G4LogicalVolume(solidSiLi_LC1 , m_MaterialSilicon , "SiLi_LC1" , 0 , 0 , 0); + G4LogicalVolume* logicSiLi_RC1 = new G4LogicalVolume(solidSiLi_RC1 , m_MaterialSilicon , "SiLi_RC1" , 0 , 0 , 0); + G4LogicalVolume* logicSiLi_LB = new G4LogicalVolume(solidSiLi_LB , m_MaterialSilicon , "SiLi_LB" , 0 , 0 , 0); + G4LogicalVolume* logicSiLi_RB = new G4LogicalVolume(solidSiLi_RB , m_MaterialSilicon , "SiLi_RB" , 0 , 0 , 0); + G4LogicalVolume* logicSiLi_LC2 = new G4LogicalVolume(solidSiLi_LC2 , m_MaterialSilicon , "SiLi_LC2" , 0 , 0 , 0); + G4LogicalVolume* logicSiLi_RC2 = new G4LogicalVolume(solidSiLi_RC2 , m_MaterialSilicon , "SiLi_RC2" , 0 , 0 , 0); + + G4double interSiLi = 0.5 * mm; + + // Top + G4ThreeVector positionSiLi_LT_up = G4ThreeVector( -0.5 * SiLi_WidthX_Left - interSiLi - SiLi_ShiftX , + 0.5 * SiLi_HighY_Upper + SiLi_HighY_Center + 1.5 * interSiLi, + 0); + + positionSiLi_LT_up += ShiftSiLiUp ; + + G4ThreeVector positionSiLi_RT_up = G4ThreeVector( 0.5 * SiLi_WidthX_Right - SiLi_ShiftX, + 0.5 * SiLi_HighY_Upper + SiLi_HighY_Center + 1.5 * interSiLi, + 0); + + positionSiLi_RT_up += ShiftSiLiUp ; + + G4ThreeVector positionSiLi_LC1_up = G4ThreeVector( -0.5 * SiLi_WidthX_Left - interSiLi - SiLi_ShiftX , + 0.5 * SiLi_HighY_Center + 0.5 * interSiLi, + 0); + + positionSiLi_LC1_up += ShiftSiLiUp ; + + G4ThreeVector positionSiLi_RC1_up = G4ThreeVector( 0.5 * SiLi_WidthX_Right - SiLi_ShiftX, + 0.5 * SiLi_HighY_Center + 0.5 * interSiLi, + 0); + + positionSiLi_RC1_up += ShiftSiLiUp ; + + G4ThreeVector positionSiLi_LB_up = G4ThreeVector( -0.5 * SiLi_WidthX_Left - interSiLi - SiLi_ShiftX , + -0.5 * SiLi_HighY_Upper - SiLi_HighY_Center - 1.5 * interSiLi , + 0); + + positionSiLi_LB_up += ShiftSiLiUp ; + + G4ThreeVector positionSiLi_RB_up = G4ThreeVector( 0.5 * SiLi_WidthX_Right - SiLi_ShiftX , + -0.5 * SiLi_HighY_Upper - SiLi_HighY_Center - 1.5 * interSiLi , + 0); + + positionSiLi_RB_up += ShiftSiLiUp ; + + G4ThreeVector positionSiLi_LC2_up = G4ThreeVector( -0.5 * SiLi_WidthX_Left - interSiLi - SiLi_ShiftX , + -0.5 * SiLi_HighY_Center - 0.5 * interSiLi, + 0); + + positionSiLi_LC2_up += ShiftSiLiUp ; + + G4ThreeVector positionSiLi_RC2_up = G4ThreeVector( 0.5 * SiLi_WidthX_Right - SiLi_ShiftX , + -0.5 * SiLi_HighY_Center - 0.5 * interSiLi , + 0); + + positionSiLi_RC2_up += ShiftSiLiUp ; + + + // Down + G4ThreeVector positionSiLi_LT_down = G4ThreeVector( -0.5 * SiLi_WidthX_Left - interSiLi - SiLi_ShiftX, + 0.5 * SiLi_HighY_Upper + SiLi_HighY_Center + 1.5 * interSiLi, + 0); + + positionSiLi_LT_down += ShiftSiLiDown ; + + G4ThreeVector positionSiLi_RT_down = G4ThreeVector( 0.5 * SiLi_WidthX_Right - SiLi_ShiftX, + 0.5 * SiLi_HighY_Upper + SiLi_HighY_Center + 1.5 * interSiLi, + 0); + + positionSiLi_RT_down += ShiftSiLiDown ; + + G4ThreeVector positionSiLi_LC1_down = G4ThreeVector( -0.5 * SiLi_WidthX_Left - interSiLi - SiLi_ShiftX, + 0.5 * SiLi_HighY_Center + 0.5 * interSiLi, + 0); + + positionSiLi_LC1_down += ShiftSiLiDown ; + + G4ThreeVector positionSiLi_RC1_down = G4ThreeVector( 0.5 * SiLi_WidthX_Right - SiLi_ShiftX, + 0.5 * SiLi_HighY_Center + 0.5 * interSiLi , + 0); + + positionSiLi_RC1_down += ShiftSiLiDown ; + + G4ThreeVector positionSiLi_LB_down = G4ThreeVector( -0.5 * SiLi_WidthX_Left - interSiLi - SiLi_ShiftX, + -0.5 * SiLi_HighY_Upper - SiLi_HighY_Center - 1.5 * interSiLi, + 0); + + positionSiLi_LB_down += ShiftSiLiDown ; + + G4ThreeVector positionSiLi_RB_down = G4ThreeVector( 0.5 * SiLi_WidthX_Right - SiLi_ShiftX, + -0.5 * SiLi_HighY_Upper - SiLi_HighY_Center - 1.5 * interSiLi, + 0); + + positionSiLi_RB_down += ShiftSiLiDown ; + + G4ThreeVector positionSiLi_LC2_down = G4ThreeVector( -0.5 * SiLi_WidthX_Left - interSiLi - SiLi_ShiftX, + -0.5 * SiLi_HighY_Center - 0.5 * interSiLi, + 0); + + positionSiLi_LC2_down += ShiftSiLiDown ; + + G4ThreeVector positionSiLi_RC2_down = G4ThreeVector( 0.5 * SiLi_WidthX_Right - SiLi_ShiftX, + -0.5 * SiLi_HighY_Center - 0.5 * interSiLi, + 0); + + positionSiLi_RC2_down += ShiftSiLiDown ; + + + // up + new G4PVPlacement(0 , positionSiLi_LT_up , logicSiLi_LT , Name + "_SiLi_Pad9" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RT_up , logicSiLi_RT , Name + "_SiLi_Pad10" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LC1_up , logicSiLi_LC1 , Name + "_SiLi_Pad11" , logicSiLi , false , 0); + new G4PVPlacement(0 , positionSiLi_RC1_up , logicSiLi_RC1 , Name + "_SiLi_Pad12" , logicSiLi , false , 0); + + new G4PVPlacement(0 , positionSiLi_LB_up , logicSiLi_LB , Name + "_SiLi_Pad16" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RB_up , logicSiLi_RB , Name + "_SiLi_Pad15" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LC2_up , logicSiLi_LC2 , Name + "_SiLi_Pad14" , logicSiLi , false , 0); + new G4PVPlacement(0 , positionSiLi_RC2_up , logicSiLi_RC2 , Name + "_SiLi_Pad13" , logicSiLi , false , 0); + + + // down + new G4PVPlacement(0 , positionSiLi_LT_down , logicSiLi_LT , Name + "_SiLi_Pad2" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RT_down , logicSiLi_RT , Name + "_SiLi_Pad1" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LC1_down , logicSiLi_LC1 , Name + "_SiLi_Pad4" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RC1_down , logicSiLi_RC1 , Name + "_SiLi_Pad3" , logicSiLi , false , 0) ; + + new G4PVPlacement(0 , positionSiLi_LB_down , logicSiLi_LB , Name + "_SiLi_Pad7" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RB_down , logicSiLi_RB , Name + "_SiLi_Pad8" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LC2_down , logicSiLi_LC2 , Name + "_SiLi_Pad5" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RC2_down , logicSiLi_RC2 , Name + "_SiLi_Pad6" , logicSiLi , false , 0) ; + + // Set SiLi sensible + logicSiLi_LT->SetSensitiveDetector(m_SiLiScorer); + logicSiLi_RT->SetSensitiveDetector(m_SiLiScorer); + logicSiLi_LC1->SetSensitiveDetector(m_SiLiScorer); + logicSiLi_RC1->SetSensitiveDetector(m_SiLiScorer); + + logicSiLi_LB->SetSensitiveDetector(m_SiLiScorer); + logicSiLi_RB->SetSensitiveDetector(m_SiLiScorer); + logicSiLi_LC2->SetSensitiveDetector(m_SiLiScorer); + logicSiLi_RC2->SetSensitiveDetector(m_SiLiScorer); + + // Mark blue a SiLi to see telescope orientation + + logicSiLi_LT->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_RT->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_LC1->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_RC1->SetVisAttributes(m_SiLiVisAtt); + + logicSiLi_LB->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_RB->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_LC2->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_RC2->SetVisAttributes(m_SiLiVisAtt); + + + delete rotSiLi; + } + + + + } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... @@ -146,7 +594,8 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, Number << NbrTelescopes ; DetectorNumber = Number.str(); - //////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////// ////////////// Starting Volume Definition ////////////////////// //////////////////////////////////////////////////////////////// G4Trd* solidMM = new G4Trd("MUST2Telescope" + DetectorNumber, 0.5*FaceFront, 0.5*FaceBack, 0.5*FaceFront, 0.5*FaceBack, 0.5*Length); @@ -165,49 +614,218 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, FrameVisAtt->SetForceWireframe(true); logicMM->SetVisAttributes(FrameVisAtt) ; } - else logicMM->SetVisAttributes(G4VisAttributes::Invisible) ; + + else logicMM->SetVisAttributes(G4VisAttributes::Invisible) ; G4ThreeVector positionVacBox = G4ThreeVector(0, 0, VacBox_PosZ); - G4Trd* solidVacBox = new G4Trd("solidVacBox", 0.5*SiliconFace, 0.5*CsIFaceFront, 0.5*SiliconFace, 0.5*CsIFaceFront, 0.5*VacBoxThickness); + G4Trd* solidVacBox = + new G4Trd("solidVacBox", 0.5*ActiveWaferSize, 0.5*CsIFaceFront, 0.5*ActiveWaferSize, 0.5*CsIFaceFront, 0.5*VacBoxThickness); + G4LogicalVolume* logicVacBox = new G4LogicalVolume(solidVacBox, m_MaterialVacuum, "logicVacBox", 0, 0, 0); new G4PVPlacement(0, positionVacBox, logicVacBox, Name + "_VacBox", logicMM, false, 0); logicVacBox->SetVisAttributes(G4VisAttributes::Invisible); - - G4VisAttributes* SiliconVisAtt = new G4VisAttributes(G4Colour(0.3, 0.3, 0.3)) ; + //////////////////////////////////////////////////////////////// /////////////////Si Strip Construction////////////////////////// //////////////////////////////////////////////////////////////// + // A no rotation matrix is always handy ;) + G4RotationMatrix* norotation = new G4RotationMatrix(); + + // Create the front support frame for Si and SiLi + vector<G4TwoVector> polygon; + for(unsigned int i = 0 ; i < 4 ; i++){ + G4TwoVector Point(PCBPointsX[i],PCBPointsY[i]); + polygon.push_back(Point); + } + + // The PCB lenth is used to rescale different part of the detector + G4double PCBlength = PCBPointsX[0] - PCBPointsX[1]; + + G4ExtrudedSolid* solidFrontFrameBase = new G4ExtrudedSolid("Must2 Front Frame", + polygon, + FrontFrameThickness*0.5, + G4TwoVector(0,0),FrontFrameFrontSize/PCBlength, + G4TwoVector(0,0),FrontFrameBackSize/PCBlength); + + G4ExtrudedSolid* solidCavityShape1 = new G4ExtrudedSolid("Cavity1", + polygon, + FrontFrameThickness*0.5+PCBThickness, + G4TwoVector(0,0),CavityShape1FrontSize/PCBlength, + G4TwoVector(0,0),CavityShape1BackSize/PCBlength); + + G4SubtractionSolid* solidFrontFrame1 = new G4SubtractionSolid("Frame1", + solidFrontFrameBase, + solidCavityShape1, + G4Transform3D(*norotation,G4ThreeVector(0,0,0))); + + G4Box* solidCavityShape2 = new G4Box("Cavity2", 0.5*CavityShape2Width, (0.5+0.5)*CavityShape2Width, 0.5*CavityShape2Thickness); + + G4SubtractionSolid* solidFrontFrame2 = new G4SubtractionSolid("Frame2", + solidFrontFrame1, + solidCavityShape2, + G4Transform3D(*norotation,G4ThreeVector(0,0.5*CavityShape2Width,CavityShape2Center))); + + G4ExtrudedSolid* solidCutOut = new G4ExtrudedSolid("Cutout", + polygon, + FrontFrameThickness*0.8, + G4TwoVector(0,0),1.1*FrontFrameBackSize/PCBlength, + G4TwoVector(0,0),1.1*FrontFrameBackSize/PCBlength); + + + G4SubtractionSolid* solidFrontFrame3 = new G4SubtractionSolid("Must2 Front Frame", + solidFrontFrame2, + solidCutOut, + G4Transform3D(*norotation,G4ThreeVector(0,FrontFrameBackSize*0.5*1.1+66*mm,0))); + + G4SubtractionSolid* solidFrontFrame = new G4SubtractionSolid("Must2 Front Frame", + solidFrontFrame3, + solidCutOut, + G4Transform3D(*norotation,G4ThreeVector(-FrontFrameBackSize*0.5*1.1-66*mm,0,0))); + + + G4LogicalVolume* logicFrontFrame = new G4LogicalVolume(solidFrontFrame,m_MaterialAluminium,"Must2 Front Frame", 0, 0, 0); + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,Silicon_PosZ+FrontFrameThickness*0.5+0.5*PCBThickness)), + logicFrontFrame, + "Must2 Front Fame", + logicMM, + false, + TelescopeNumber); + + + // Electronic bloc + G4Box* solidMUFEE = new G4Box("solidMUFEE", 0.5*MUFEESize, 0.5*MUFEESize, 0.5*MUFEEThickness); + G4Box* solidCooling = new G4Box("solidCooling", 0.5*MUFEESize, 0.5*MUFEESize, 0.5*CoolingThickness); + G4ExtrudedSolid* solidElecFrameShort = new G4ExtrudedSolid("SolidElecFrame", + polygon, + CoolingThickness*0.5, + G4TwoVector(0,0),FrontFrameBackSize/PCBlength, + G4TwoVector(0,0),FrontFrameBackSize/PCBlength); + + + G4LogicalVolume* logicMUFEE = new G4LogicalVolume(solidMUFEE,m_MaterialAluminium,"Must2 MUFEE", 0, 0, 0); + G4LogicalVolume* logicCooling = new G4LogicalVolume(solidCooling,m_MaterialAluminium,"Must2 Cooling", 0, 0, 0); + G4LogicalVolume* logicElecFrame = new G4LogicalVolume(solidElecFrameShort,m_MaterialAluminium,"Must2 Frame", 0, 0, 0); + + logicMUFEE->SetVisAttributes(m_PCBVisAtt); + logicCooling->SetVisAttributes(m_CoolingVisAtt); + + G4double CoolingPosition = FrontFrameThickness+Silicon_PosZ+0.5*CoolingThickness; + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,CoolingPosition)), + logicCooling, + "Must2 Cooling", + logicMM, + false, + TelescopeNumber); + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,CoolingPosition)), + logicElecFrame, + "Must2 Fame", + logicMM, + false, + TelescopeNumber); + + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,CoolingPosition-0.5*MUFEEThickness-0.5*CoolingThickness)), + logicMUFEE, + "Must2 Front Fame", + logicMM, + false, + TelescopeNumber); + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,CoolingPosition+0.5*MUFEEThickness+0.5*CoolingThickness)), + logicMUFEE, + "Must2 Front Fame", + logicMM, + false, + TelescopeNumber); + + + if (wSi) { - G4ThreeVector positionAluStripFront = G4ThreeVector(0, 0, AluStripFront_PosZ); - G4ThreeVector positionAluStripBack = G4ThreeVector(0, 0, AluStripBack_PosZ); - G4Box* solidAluStrip = new G4Box("AluBox", 0.5*SiliconFace, 0.5*SiliconFace, 0.5*AluStripThickness); + // Volume containing the Silicon detector + G4ExtrudedSolid* solidSilicon = new G4ExtrudedSolid(Name, + polygon, + PCBThickness*0.5, + G4TwoVector(0,0),1, + G4TwoVector(0,0),1); + + G4LogicalVolume* logicSilicon = new G4LogicalVolume(solidSilicon,m_MaterialVacuum, Name, 0, 0, 0); + + new G4PVPlacement(G4Transform3D(*norotation,G4ThreeVector(0,0,Silicon_PosZ)), + logicSilicon, + "Silicon", + logicMM, + false, + TelescopeNumber); + + logicSilicon->SetVisAttributes(G4VisAttributes::Invisible); + + // PCB Base + G4ExtrudedSolid* solidPCBBase = new G4ExtrudedSolid("PCBBase", + polygon, + PCBThickness*0.5, + G4TwoVector(0,0),1, + G4TwoVector(0,0),1); + + // Wafer Shape + G4Box* solidWaferShape = new G4Box("solidWaferShape", 0.5*WaferSize, 0.5*WaferSize, 0.6*PCBThickness); + + // PCB + + G4SubtractionSolid* solidPCB = new G4SubtractionSolid("PCB", + solidPCBBase, + solidWaferShape, + G4Transform3D(*norotation,G4ThreeVector(0,0,0))); + + G4LogicalVolume* logicPCB = new G4LogicalVolume(solidPCB, m_MaterialSilicon, "logicPCB", 0, 0, 0); + + new G4PVPlacement(0, G4ThreeVector(0,0,0), logicPCB, Name + "_Silicon", logicSilicon, false, 0); + + logicPCB->SetVisAttributes(m_PCBVisAtt); + + + // Wafer + G4Box* solidWafer = new G4Box("solidWaferShape", 0.5*WaferSize, 0.5*WaferSize, 0.5*WaferThickness); + G4LogicalVolume* logicWafer = new G4LogicalVolume(solidWafer, m_MaterialSilicon, "logicWafer", 0, 0, 0); + new G4PVPlacement(0, G4ThreeVector(0,0,0), logicWafer, Name + "_Silicon", logicSilicon, false, 0); + + + // Active Wafer + G4Box* solidActiveWafer = new G4Box("solidActiveWaferShape", 0.5*ActiveWaferSize, 0.5*ActiveWaferSize, 0.5*WaferThickness); + G4LogicalVolume* logicActiveWafer = new G4LogicalVolume(solidActiveWafer, m_MaterialSilicon, "logicActiveWafer", 0, 0, 0); + + new G4PVPlacement(0, G4ThreeVector(0,0,0), logicActiveWafer, Name + "_Silicon", logicSilicon, false, 0); + + G4ThreeVector positionAluStripFront = G4ThreeVector(0, 0, 0.5*WaferThickness+0.5*AluStripThickness); + G4ThreeVector positionAluStripBack = G4ThreeVector(0, 0, -0.5*WaferThickness-0.5*AluStripThickness); + + G4Box* solidAluStrip = new G4Box("AluBox", 0.5*ActiveWaferSize, 0.5*ActiveWaferSize, 0.5*AluStripThickness); G4LogicalVolume* logicAluStrip = new G4LogicalVolume(solidAluStrip, m_MaterialAluminium, "logicAluStrip", 0, 0, 0); - new G4PVPlacement(0, positionAluStripFront, logicAluStrip, Name + "_AluStripFront", logicMM, false, 0); - new G4PVPlacement(0, positionAluStripBack, logicAluStrip, Name + "_AluStripBack", logicMM, false, 0); + new G4PVPlacement(0, positionAluStripFront, logicAluStrip, "AluStripFront", logicSilicon, false, 0); + new G4PVPlacement(0, positionAluStripBack, logicAluStrip, "AluStripBack", logicSilicon, false, 0); logicAluStrip->SetVisAttributes(G4VisAttributes::Invisible); G4ThreeVector positionSilicon = G4ThreeVector(0, 0, Silicon_PosZ); - G4Box* solidSilicon = new G4Box("solidSilicon", 0.5*SiliconFace, 0.5*SiliconFace, 0.5*SiliconThickness); - G4LogicalVolume* logicSilicon = new G4LogicalVolume(solidSilicon, m_MaterialSilicon, "logicSilicon", 0, 0, 0); + new G4PVPlacement(0, G4ThreeVector(0, 0, Silicon_PosZ), logicSilicon, "Silicon", logicMM, false, 0); - new G4PVPlacement(0, positionSilicon, logicSilicon, Name + "_Silicon", logicMM, false, 0); + // Set Silicon strip sensible + logicActiveWafer->SetSensitiveDetector(m_StripScorer); - - ///Set Silicon strip sensible - logicSilicon->SetSensitiveDetector(m_StripScorer); - - ///Visualisation of Silicon Strip - logicSilicon->SetVisAttributes(SiliconVisAtt) ; + // Visualisation of Silicon Strip + logicWafer->SetVisAttributes(m_SiliconVisAtt); + logicActiveWafer->SetVisAttributes(m_SiliconVisAtt); } //////////////////////////////////////////////////////////////// @@ -217,7 +835,7 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, if (wSiLi) { G4double SiLiSpace = 8 * mm; G4RotationMatrix* rotSiLi = new G4RotationMatrix(0,0,0); - G4Box* solidSiLi = new G4Box("SiLi", 0.5*SiliconFace+0.5*SiLiSpace, 0.5*SiliconFace, 0.5*SiLiThickness); + G4Box* solidSiLi = new G4Box("SiLi", 0.5*ActiveWaferSize+0.5*SiLiSpace, 0.5*ActiveWaferSize, 0.5*SiLiThickness); G4LogicalVolume* logicSiLi = new G4LogicalVolume(solidSiLi, m_MaterialAluminium, Name + "_SiLi" , 0, 0, 0); logicSiLi->SetVisAttributes(G4VisAttributes::Invisible); @@ -238,8 +856,8 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4double SiLi_ShiftX = 0.775 * mm; // SiLi are organized by two group of 8 Up(9 to 15) and Down(1 to 8). - G4ThreeVector ShiftSiLiUp = G4ThreeVector(-0.25 * SiliconFace - 0.5 * SiLiSpace, 0, 0) ; - G4ThreeVector ShiftSiLiDown = G4ThreeVector(0.25 * SiliconFace + 0.5 * SiLiSpace, 0, 0) ; + G4ThreeVector ShiftSiLiUp = G4ThreeVector(-0.25 * ActiveWaferSize - 0.5 * SiLiSpace, 0, 0) ; + G4ThreeVector ShiftSiLiDown = G4ThreeVector(0.25 * ActiveWaferSize + 0.5 * SiLiSpace, 0, 0) ; // SiLi : left side of SiLi detector G4Box* solidSiLi_LT = new G4Box("SiLi_LT" , 0.5*SiLi_WidthX_Left , 0.5*SiLi_HighY_Upper , 0.5*SiLiThickness); @@ -397,17 +1015,16 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, logicSiLi_RC2->SetSensitiveDetector(m_SiLiScorer); // Mark blue a SiLi to see telescope orientation - G4VisAttributes* SiLiVisAtt = new G4VisAttributes(G4Colour(0.3, 1, 0.3)); - logicSiLi_LT->SetVisAttributes(SiLiVisAtt); - logicSiLi_RT->SetVisAttributes(SiLiVisAtt); - logicSiLi_LC1->SetVisAttributes(SiLiVisAtt); - logicSiLi_RC1->SetVisAttributes(SiLiVisAtt); + logicSiLi_LT->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_RT->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_LC1->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_RC1->SetVisAttributes(m_SiLiVisAtt); - logicSiLi_LB->SetVisAttributes(SiLiVisAtt); - logicSiLi_RB->SetVisAttributes(SiLiVisAtt); - logicSiLi_LC2->SetVisAttributes(SiLiVisAtt); - logicSiLi_RC2->SetVisAttributes(SiLiVisAtt); + logicSiLi_LB->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_RB->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_LC2->SetVisAttributes(m_SiLiVisAtt); + logicSiLi_RC2->SetVisAttributes(m_SiLiVisAtt); delete rotSiLi; @@ -532,15 +1149,14 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, logicCristal4s->SetSensitiveDetector(m_CsIScorer); //Mark blue a CsI corner crystal to see telescope orientation - G4VisAttributes* CsIVisAtt = new G4VisAttributes(G4Colour(1, 0.5, 0)); - logicCristal1 ->SetVisAttributes(CsIVisAtt); - logicCristal2 ->SetVisAttributes(CsIVisAtt); - logicCristal3 ->SetVisAttributes(CsIVisAtt); - logicCristal4 ->SetVisAttributes(CsIVisAtt); - logicCristal1s ->SetVisAttributes(CsIVisAtt); - logicCristal2s ->SetVisAttributes(CsIVisAtt); - logicCristal3s ->SetVisAttributes(CsIVisAtt); - logicCristal4s ->SetVisAttributes(CsIVisAtt); + logicCristal1 ->SetVisAttributes(m_CsIVisAtt); + logicCristal2 ->SetVisAttributes(m_CsIVisAtt); + logicCristal3 ->SetVisAttributes(m_CsIVisAtt); + logicCristal4 ->SetVisAttributes(m_CsIVisAtt); + logicCristal1s ->SetVisAttributes(m_CsIVisAtt); + logicCristal2s ->SetVisAttributes(m_CsIVisAtt); + logicCristal3s ->SetVisAttributes(m_CsIVisAtt); + logicCristal4s ->SetVisAttributes(m_CsIVisAtt); } } @@ -1274,8 +1890,8 @@ void MUST2Array::InitializeScorers() { G4VPrimitiveScorer* Energy = new OBSOLETEGENERALSCORERS::PSEnergy("StripEnergy","MUST2Telescope", 0); G4VPrimitiveScorer* TOF = new OBSOLETEGENERALSCORERS::PSTOF("StripTime","MUST2Telescope", 0); - G4VPrimitiveScorer* StripPositionX = new PSStripNumberX("StripNumberX", 0, SiliconFace, 128); - G4VPrimitiveScorer* StripPositionY = new PSStripNumberY("StripNumberY", 0, SiliconFace, 128); + G4VPrimitiveScorer* StripPositionX = new PSStripNumberX("StripNumberX", 0, ActiveWaferSize, 128); + G4VPrimitiveScorer* StripPositionY = new PSStripNumberY("StripNumberY", 0, ActiveWaferSize, 128); G4VPrimitiveScorer* InteractionCoordinatesX = new OBSOLETEGENERALSCORERS::PSInteractionCoordinatesX("InterCoordX","MUST2Telescope", 0); G4VPrimitiveScorer* InteractionCoordinatesY = new OBSOLETEGENERALSCORERS::PSInteractionCoordinatesY("InterCoordY","MUST2Telescope", 0); @@ -1332,12 +1948,7 @@ void MUST2Array::InitializeMaterial(){ G4Element* O = new G4Element("Oxigen" , symbol = "O" , z = 8 , a = 16.00 * g / mole); G4Element* I = new G4Element("Iode" , symbol = "I" , z = 53 , a = 126.9 * g / mole); G4Element* Cs = new G4Element("Cesium" , symbol = "Cs" , z = 55 , a = 132.9 * g / mole); - - G4Element* Co = new G4Element("Cobalt" , symbol = "Co" , z = 27 , a = 58.933 * g / mole); - G4Element* Cr = new G4Element("Cromium" , symbol = "Cr" , z = 24 , a = 51.996 * g / mole); - G4Element* Ni = new G4Element("Nickel" , symbol = "Ni" , z = 28 , a = 58.69 * g / mole); G4Element* Fe = new G4Element("Iron" , symbol = "Fe" , z = 26 , a = 55.847 * g / mole); - G4Element* W = new G4Element("Tungsten" , symbol = "W" , z = 74 , a = 183.5 * g / mole); //////////////////////////////////////////////////////////////// /////////////////Material Definition /////////////////////////// @@ -1377,13 +1988,6 @@ void MUST2Array::InitializeMaterial(){ m_MaterialMyl->AddElement(H, natoms = 8); m_MaterialMyl->AddElement(O, natoms = 4); - // Havar - m_MaterialHarvar = new G4Material("Havar", 8.3*g / cm3, 5); - m_MaterialHarvar->AddElement(Co , 42); - m_MaterialHarvar->AddElement(Cr , 20); - m_MaterialHarvar->AddElement(Ni , 13); - m_MaterialHarvar->AddElement(Fe , 19); - m_MaterialHarvar->AddElement(W , 1); } diff --git a/NPSimulation/MUST2/MUST2Array.hh b/NPSimulation/MUST2/MUST2Array.hh index 11b1868ca..e55837658 100644 --- a/NPSimulation/MUST2/MUST2Array.hh +++ b/NPSimulation/MUST2/MUST2Array.hh @@ -31,183 +31,224 @@ #include <vector> //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -namespace MUST2 -{ - // Resolution - const G4double ResoTimeMust = 0.212765957 ;// = 500ps // Unit is ns/2.35 - const G4double ResoSiLi = 0.055 ;// = 130 keV of resolution // Unit is MeV/2.35 - const G4double ResoCsI = 0.08 ;// = 188 kev of resolution // Unit is MeV/2.35 - const G4double ResoStrip = 0.022 ;// = 52keV of Resolution // Unit is MeV/2.35 - - // Geometry - const G4double FaceFront = 11.*cm ; - const G4double FaceBack = 16.5*cm ; - const G4double Length = 7.2*cm ; - - const G4double AluStripThickness = 0.4*micrometer ; - const G4double SiliconThickness = 300*micrometer ; - const G4double SiliconFace = 98*mm ; - const G4double VacBoxThickness = 3*cm ; - - const G4double SiLiThickness = 5.1*mm; // Must be checked - const G4double SiLiFaceX = 48.25*mm; - const G4double SiLiFaceY = 92*mm; - const G4double MylarCsIThickness = 3*micrometer; - const G4double CsIThickness = 4.*cm + 2*MylarCsIThickness ; - const G4double CsIFaceFront = 12.2*cm; - const G4double CsIFaceBack = 16*cm; - const G4double DistInterCsI = 0.2*mm; - - // Starting at the front and going to CsI - const G4double AluStripFront_PosZ = Length* -0.5 + 0.5*AluStripThickness; - const G4double Silicon_PosZ = AluStripFront_PosZ + 0.5*AluStripThickness + 0.5*SiliconThickness; - const G4double AluStripBack_PosZ = Silicon_PosZ + 0.5*SiliconThickness + 0.5*AluStripThickness; - const G4double VacBox_PosZ = AluStripBack_PosZ + 0.5*AluStripThickness + 0.5* VacBoxThickness; - const G4double CsI_PosZ = VacBox_PosZ + 0.5*VacBoxThickness + 0.5*CsIThickness; +namespace MUST2{ + // Resolution // + const G4double ResoTimeMust = 0.212765957 ;// = 500ps // Unit is ns/2.35 + const G4double ResoSiLi = 0.055 ;// = 130 keV of resolution // Unit is MeV/2.35 + const G4double ResoCsI = 0.08 ;// = 188 kev of resolution // Unit is MeV/2.35 + const G4double ResoStrip = 0.022 ;// = 52keV of Resolution // Unit is MeV/2.35 + + // Geometry // + + // Si + const G4double PCBPointsX[4]={52.25*mm,-61.75*mm,-61.75*mm,52.25*mm}; + const G4double PCBPointsY[4]={61.75*mm,61.75*mm,-52.25*mm,-52.25*mm}; + const G4double PCBThickness = 3.2*mm; + const G4double WaferSize = 100.6*mm ; + const G4double WaferThickness = 300*micrometer; + const G4double ActiveWaferSize = 100.5*mm ; + const G4double AluStripThickness = 0.4*micrometer ; + + // Supporting Front Frame + // The Si is screw on this frame + // The SiLi slide into it + // The front face of the frame is same size as the PCB + const G4double FrontFrameBackSize = 144*mm; + const G4double FrontFrameThickness = 27*mm; + const G4double FrontFrameFrontSize = 120*mm; + + const G4double CavityShape1FrontSize = 103*mm; + const G4double CavityShape1BackSize = 121*mm; + + const G4double CavityShape2Thickness = 18*mm; + const G4double CavityShape2Width = 115*mm; + const G4double CavityShape2Center = 4.25*mm; + // SiLi + + // CsI + + // Frame + + // Electronic and cooling + const G4double MUFEESize = 120*mm; + const G4double MUFEEThickness = 2*mm; + const G4double CoolingThickness = 20*mm; + const G4double CoolingDistanceShort = FrontFrameThickness; + const G4double CoolingDistanceLong = 113.5*mm; + + const G4double FaceFront = 11.*cm ; + const G4double FaceBack = 16.5*cm ; + const G4double Length = 7.2*cm ; + + const G4double VacBoxThickness = 3*cm ; + + const G4double SiLiThickness = 5.1*mm; + const G4double SiLiFaceX = 48.25*mm; + const G4double SiLiFaceY = 92*mm; + const G4double MylarCsIThickness = 3*micrometer; + const G4double CsIThickness = 4.*cm + 2*MylarCsIThickness ; + const G4double CsIFaceFront = 12.2*cm; + const G4double CsIFaceBack = 16*cm; + const G4double DistInterCsI = 0.2*mm; + + // Starting at the front and going to CsI + const G4double AluStripFront_PosZ = Length* -0.5 + 0.5*AluStripThickness; + const G4double Silicon_PosZ = AluStripFront_PosZ + 0.5*AluStripThickness + 0.5*WaferThickness; + const G4double AluStripBack_PosZ = Silicon_PosZ + 0.5*WaferThickness + 0.5*AluStripThickness; + const G4double VacBox_PosZ = AluStripBack_PosZ + 0.5*AluStripThickness + 0.5* VacBoxThickness; + const G4double CsI_PosZ = VacBox_PosZ + 0.5*VacBoxThickness + 0.5*CsIThickness; } -class MUST2Array : public VDetector -{ - //////////////////////////////////////////////////// - /////// Default Constructor and Destructor ///////// - //////////////////////////////////////////////////// -public: - MUST2Array() ; - virtual ~MUST2Array() ; - - //////////////////////////////////////////////////// - //////// Specific Function of this Class /////////// - //////////////////////////////////////////////////// -public: - // By Position Method - void AddTelescope( G4ThreeVector TL , - G4ThreeVector BL , - G4ThreeVector BR , - G4ThreeVector CT , - bool wSi , - bool wSiLi , - bool wCsI ); - // By Angle Method - void AddTelescope( G4double R , - G4double Theta , - G4double Phi , - G4double beta_u , - G4double beta_v , - G4double beta_w , - bool wSi , - bool wSiLi , - bool wCsI ); - - // Effectively construct Volume - // Avoid to have two time same code for Angle and Point definition - void VolumeMaker( G4int TelescopeNumber , - G4ThreeVector MMpos , - G4RotationMatrix* MMrot , - bool wSi , - bool wSiLi , - bool wCsI , - G4LogicalVolume* world ); - - - //////////////////////////////////////////////////// - ///////// Inherite from VDetector class /////////// - //////////////////////////////////////////////////// -public: - // Read stream at Configfile to pick-up parameters of detector (Position,...) - // Called in DetecorConstruction::ReadDetextorConfiguration Method - void ReadConfiguration(string Path); - - // Construct detector and inialise sensitive part. - // Called After DetecorConstruction::AddDetector Method - void ConstructDetector(G4LogicalVolume* world); - - // Add Detector branch to the EventTree. - // Called After DetecorConstruction::AddDetector Method - void InitializeRootOutput(); - - // Read sensitive part and fill the Root tree. - // Called at in the EventAction::EndOfEventAvtion - void ReadSensitive(const G4Event* event); - - - //////////////////////////////////////////////////// - ///////////Event class to store Data//////////////// - //////////////////////////////////////////////////// -private: - TMust2Data* m_Event; - - //////////////////////////////////////////////////// - ///////////////Private intern Data////////////////// - //////////////////////////////////////////////////// -private: - // True if Define by Position, False is Define by angle - vector<bool> m_DefinitionType ; - - // Used for "By Point Definition" - vector<G4ThreeVector> m_X1_Y1 ; // Top Left Corner Position Vector - vector<G4ThreeVector> m_X1_Y128 ; // Bottom Left Corner Position Vector - vector<G4ThreeVector> m_X128_Y1 ; // Bottom Right Corner Position Vector - vector<G4ThreeVector> m_X128_Y128 ; // Center Corner Position Vector - - // Used for "By Angle Definition" - vector<G4double> m_R ; // | - vector<G4double> m_Theta ; // > Spherical coordinate of Strips Silicium Plate - vector<G4double> m_Phi ; // | - - vector<G4double> m_beta_u ; // | - vector<G4double> m_beta_v ; // > Tilt angle of the Telescope - vector<G4double> m_beta_w ; // | - - // If Set to true if you want this stage on you telescope - vector<bool> m_wSi ; // Silicium Strip 300um 128*128 Strip - vector<bool> m_wSiLi ; // Si(Li) 2*4 Pad - vector<bool> m_wCsI ; // CsI 4*4 crystal - vector<bool> m_wAddSi ; // Additionnal Thin Silicium Strip - - // Set to true if you want to see Telescope Frame in your visualisation - bool m_non_sensitive_part_visiualisation ; - - - //////////////////////////////////////////////////// - ///////////////////// Scorer /////////////////////// - //////////////////////////////////////////////////// -private: - // Initialize all Scorer used by the MUST2Array - void InitializeScorers() ; - - // Silicon Associate Scorer - G4MultiFunctionalDetector* m_StripScorer ; - - - // SiLi Associate Scorer - G4MultiFunctionalDetector* m_SiLiScorer ; - +class MUST2Array : public VDetector{ + //////////////////////////////////////////////////// + /////// Default Constructor and Destructor ///////// + //////////////////////////////////////////////////// + public: + MUST2Array() ; + virtual ~MUST2Array() ; + + //////////////////////////////////////////////////// + //////// Specific Function of this Class /////////// + //////////////////////////////////////////////////// + public: + // By Position Method + void AddTelescope( G4ThreeVector TL , + G4ThreeVector BL , + G4ThreeVector BR , + G4ThreeVector CT , + bool wSi , + bool wSiLi , + bool wCsI ); + // By Angle Method + void AddTelescope( G4double R , + G4double Theta , + G4double Phi , + G4double beta_u , + G4double beta_v , + G4double beta_w , + bool wSi , + bool wSiLi , + bool wCsI ); + + // Effectively construct Volume + // Avoid to have two time same code for Angle and Point definition + void VolumeMaker( G4int TelescopeNumber , + G4ThreeVector MMpos , + G4RotationMatrix* MMrot , + bool wSi , + bool wSiLi , + bool wCsI , + G4LogicalVolume* world ); + + + // Return the logic volume associate to different MUST2 Geometry: + G4LogicalVolume* GetLogicalVolumeMUST2Short(); + G4LogicalVolume* GetLogicalVolumeMUST2NoSiLi(); + G4LogicalVolume* GetLogicalVolumeMUST2Full(); + + //////////////////////////////////////////////////// + ///////// Inherite from VDetector class /////////// + //////////////////////////////////////////////////// + public: + // Read stream at Configfile to pick-up parameters of detector (Position,...) + // Called in DetecorConstruction::ReadDetextorConfiguration Method + void ReadConfiguration(string Path); + + // Construct detector and inialise sensitive part. + // Called After DetecorConstruction::AddDetector Method + void ConstructDetector(G4LogicalVolume* world); + + // Add Detector branch to the EventTree. + // Called After DetecorConstruction::AddDetector Method + void InitializeRootOutput(); + + // Read sensitive part and fill the Root tree. + // Called at in the EventAction::EndOfEventAvtion + void ReadSensitive(const G4Event* event); + + + //////////////////////////////////////////////////// + ///////////Event class to store Data//////////////// + //////////////////////////////////////////////////// + private: + TMust2Data* m_Event; + + //////////////////////////////////////////////////// + ///////////////Private intern Data////////////////// + //////////////////////////////////////////////////// + private: + // True if Define by Position, False is Define by angle + vector<bool> m_DefinitionType ; + + // Used for "By Point Definition" + vector<G4ThreeVector> m_X1_Y1 ; // Top Left Corner Position Vector + vector<G4ThreeVector> m_X1_Y128 ; // Bottom Left Corner Position Vector + vector<G4ThreeVector> m_X128_Y1 ; // Bottom Right Corner Position Vector + vector<G4ThreeVector> m_X128_Y128 ; // Center Corner Position Vector + + // Used for "By Angle Definition" + vector<G4double> m_R ; // | + vector<G4double> m_Theta ; // > Spherical coordinate of Strips Silicium Plate + vector<G4double> m_Phi ; // | + + vector<G4double> m_beta_u ; // | + vector<G4double> m_beta_v ; // > Tilt angle of the Telescope + vector<G4double> m_beta_w ; // | + + // If Set to true if you want this stage on you telescope + vector<bool> m_wSi ; // Silicium Strip 300um 128*128 Strip + vector<bool> m_wSiLi ; // Si(Li) 2*4 Pad + vector<bool> m_wCsI ; // CsI 4*4 crystal + vector<bool> m_wAddSi ; // Additionnal Thin Silicium Strip + + // Set to true if you want to see Telescope Frame in your visualisation + bool m_non_sensitive_part_visiualisation ; + + //////////////////////////////////////////////////// + ///////////////////// Scorer /////////////////////// + //////////////////////////////////////////////////// + private: + // Initialize all Scorer used by the MUST2Array + void InitializeScorers() ; + + // Silicon Associate Scorer + G4MultiFunctionalDetector* m_StripScorer ; + + + // SiLi Associate Scorer + G4MultiFunctionalDetector* m_SiLiScorer ; + // CsI Associate Scorer G4MultiFunctionalDetector* m_CsIScorer ; - - - //////////////////////////////////////////////////// - //////////////////// Material ////////////////////// - //////////////////////////////////////////////////// -private: - // Declare all material used by the MUST2Array - void InitializeMaterial() ; - // Si - G4Material* m_MaterialSilicon; - // Al - G4Material* m_MaterialAluminium; - // Iron - G4Material* m_MaterialIron; - // CsI - G4Material* m_MaterialCsI; - // Vacuum - G4Material* m_MaterialVacuum ; - // Mylar - G4Material* m_MaterialMyl; - // Havar - G4Material* m_MaterialHarvar; + //////////////////////////////////////////////////// + //////////////////// Material ////////////////////// + //////////////////////////////////////////////////// + private: + // Declare all material used by the MUST2Array + void InitializeMaterial() ; + // Si + G4Material* m_MaterialSilicon; + // Al + G4Material* m_MaterialAluminium; + // Iron + G4Material* m_MaterialIron; + // CsI + G4Material* m_MaterialCsI; + // Vacuum + G4Material* m_MaterialVacuum ; + // Mylar + G4Material* m_MaterialMyl; + + //////////////////////////////////////////////////// + //////////////// Visual Attribute ////////////////// + //////////////////////////////////////////////////// + G4VisAttributes* m_PCBVisAtt; + G4VisAttributes* m_SiliconVisAtt; + G4VisAttributes* m_SiLiVisAtt; + G4VisAttributes* m_CsIVisAtt; + G4VisAttributes* m_CoolingVisAtt; }; diff --git a/NPSimulation/Makefile b/NPSimulation/Makefile index c837a7c22..e937069e0 100644 --- a/NPSimulation/Makefile +++ b/NPSimulation/Makefile @@ -4,7 +4,7 @@ NPSIM = NPSimulation all: $(DELFILES) $(COPYFILES) $(NPSIM) -DelIncSrcFiles: +DelIncSrcFiles: $(NPTOOL)/NPLib/liblist ./scripts/deletefiles.sh CopyIncSrcFiles: DelIncSrcFiles -- GitLab