From 861b2319928656a118668765a12427edaa98139a Mon Sep 17 00:00:00 2001 From: matta <matta@npt> Date: Fri, 15 Feb 2013 10:11:57 +0000 Subject: [PATCH] * Fixing warning in NPS Sharc.cc --- NPSimulation/src/Sharc.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/NPSimulation/src/Sharc.cc b/NPSimulation/src/Sharc.cc index 9cb81c978..386d9bc5a 100644 --- a/NPSimulation/src/Sharc.cc +++ b/NPSimulation/src/Sharc.cc @@ -119,6 +119,8 @@ void Sharc::ReadConfiguration(string Path){ string DataBuffer ; G4double R,Phi,Thickness1,Thickness2,Thickness3,Thickness4,ThicknessPAD1,ThicknessPAD2,ThicknessPAD3,ThicknessPAD4,Z; + R=Phi=Thickness1=Thickness2=Thickness3=Thickness4=ThicknessPAD1=ThicknessPAD2=ThicknessPAD3=ThicknessPAD4=Z=0; + G4ThreeVector Pos; bool check_R = false ; bool check_Phi = false ; @@ -357,14 +359,12 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ G4double BOX_PCB_Slot_Width; G4double BOX_PCB_Slot_Deepness; - G4double BOX_PCB_Slot_Border; G4double BOX_PCB_Slot_Position; G4double BOX_DetectorSpacing; if(m_ThicknessPAD[i][j]>0){ //PAD Case BOX_PCB_Slot_Width = BOX_PCB_Slot_Width2; BOX_PCB_Slot_Deepness = BOX_PCB_Slot_Deepness2; - BOX_PCB_Slot_Border = BOX_PCB_Slot_Border2; BOX_PCB_Slot_Position = BOX_PCB_Slot_Position2; BOX_DetectorSpacing = BOX_DetectorSpacing2; } @@ -372,7 +372,6 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ else{ // No Pad Case BOX_PCB_Slot_Width = BOX_PCB_Slot_Width1; BOX_PCB_Slot_Deepness = BOX_PCB_Slot_Deepness1; - BOX_PCB_Slot_Border = BOX_PCB_Slot_Border1; BOX_PCB_Slot_Position = BOX_PCB_Slot_Position1; BOX_DetectorSpacing = BOX_DetectorSpacing1 ; } @@ -418,7 +417,10 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ // create the PAD // Make a single detector geometry - G4LogicalVolume* logicPADDetector; + G4LogicalVolume* logicPADDetector= + new G4LogicalVolume(PADDetector,m_MaterialVacuum,"logicPADDetector", 0, 0, 0); + logicPADDetector->SetVisAttributes(G4VisAttributes::Invisible); + G4ThreeVector PAD_Wafer_Offset = G4ThreeVector(PAD_Wafer_Length_Offset, PAD_Wafer_Width_Offset,0 ); if(m_ThicknessPAD[i][j]>0){ @@ -471,6 +473,10 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ logicPADWafer,"PAD_Wafer",logicPADDetector,false,DetNbr); } + else{ + delete logicPADDetector; + } + /////////////////////////////////////////////////////////////////////////////////// // Place the detector in the world // Position of the center of the PCB -- GitLab