From 8f2ac4a6d2ef2ad5905026d5ab06d6a4547c8e7a Mon Sep 17 00:00:00 2001
From: matta <matta@npt>
Date: Tue, 5 Feb 2013 12:28:09 +0000
Subject: [PATCH] * Wfer is now place at the surface of the PCB in the sharc
 box

---
 Inputs/DetectorConfiguration/Sharc.detector | 2 +-
 NPSimulation/src/Sharc.cc                   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Inputs/DetectorConfiguration/Sharc.detector b/Inputs/DetectorConfiguration/Sharc.detector
index f06e6ea82..74afb1bee 100644
--- a/Inputs/DetectorConfiguration/Sharc.detector
+++ b/Inputs/DetectorConfiguration/Sharc.detector
@@ -37,7 +37,7 @@ Sharc
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %Upstream Box
   SharcBOX
-    Z= 0
+    Z= -40
     ThicknessDector1= 100
     ThicknessDector2= 100
     ThicknessDector3= 100
diff --git a/NPSimulation/src/Sharc.cc b/NPSimulation/src/Sharc.cc
index 08bd34d6c..03eaca7e3 100644
--- a/NPSimulation/src/Sharc.cc
+++ b/NPSimulation/src/Sharc.cc
@@ -404,7 +404,7 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){
       
       if(m_ThicknessBOX[i][j]>0)
         new G4PVPlacement(new G4RotationMatrix(0,0,0),
-                          Box_Wafer_Offset,
+                          Box_Wafer_Offset+G4ThreeVector(0,0,0.5*BOX_PCB_Thickness-0.5*m_ThicknessBOX[i][j]),
                           logicWafer,"Box_Wafer",logicBoxDetector,false,i*4+j+1);
       
       // create the PAD
@@ -505,7 +505,7 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){
         DetectorRotation->rotateZ(-90*deg);
       }
       
-      if(m_Z[i]>0) DetectorRotation->rotateY(180*deg);
+      if(m_Z[i]<0) DetectorRotation->rotateY(180*deg);
       
       DetectorPosition.transform(*DetectorRotation);
       DetectorPosition+=G4ThreeVector(0,0,m_Z[i]);
-- 
GitLab