diff --git a/Inputs/DetectorConfiguration/sharc.detector b/Inputs/DetectorConfiguration/sharc.detector index eef1595668ec276c3bd1aed358399921699342a7..74afb1bee67d19bf8f510b0f9b23ed39ecaff328 100644 --- a/Inputs/DetectorConfiguration/sharc.detector +++ b/Inputs/DetectorConfiguration/sharc.detector @@ -48,7 +48,7 @@ Sharc ThicknessPAD4= 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Down Stream Box - SharcBOX + % SharcBOX Z= 40 ThicknessDector1= 100 ThicknessDector2= 100 diff --git a/NPLib/VDetector/DetectorManager.cxx b/NPLib/VDetector/DetectorManager.cxx index f518a3b7f2a882c8771fd2d4473d366b32fc196a..aedf8cc7fff4d68cbec6c6590a8fa0d962057bb9 100644 --- a/NPLib/VDetector/DetectorManager.cxx +++ b/NPLib/VDetector/DetectorManager.cxx @@ -472,7 +472,7 @@ void DetectorManager::ReadConfigurationFile(string Path) ConfigFile >> DataBuffer; // Search for comment Symbol % - if (DataBuffer.compare(0, 1, "%") == 0) {/*Do Nothing*/;} + if (DataBuffer.compare(0, 1, "%") == 0) {ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );} else if (DataBuffer.compare(0, 10, "THICKNESS=") == 0) { check_Thickness = true ; diff --git a/NPSimulation/include/Sharc.hh b/NPSimulation/include/Sharc.hh index 03e84caf925b1887a04cf793c90c07d6dce92626..661de5ab58b28bf4ddcbf6c5b9c56d7480e3900f 100644 --- a/NPSimulation/include/Sharc.hh +++ b/NPSimulation/include/Sharc.hh @@ -60,7 +60,7 @@ namespace SHARC // Single stage box case (DSSD only) const G4double BOX_PCB_Slot1_Width = BOX_PCB_Thickness; const G4double BOX_PCB_Slot1_Border = 4*mm; - const G4double BOX_PCB_Slot1_Deepness = 0.8*mm; + const G4double BOX_PCB_Slot1_Deepness = BOX_PCB_Border_ShortSide; // BOX Wafer const G4double BOX_Wafer_Width = 52.20*mm; @@ -75,8 +75,9 @@ namespace SHARC BOX_PCB_Width/2. - BOX_PCB_Border_LongSide - BOX_Wafer_Width/2.; const G4double BOX_Wafer_Length_Offset = BOX_PCB_Length/2. - BOX_PCB_Border_ShortSide - BOX_Wafer_Length/2.; - const G4double BOX_PCB_Slot1_Position =-(BOX_Wafer_Length_Offset-BOX_Wafer_Length/2.-BOX_PCB_Slot1_Border - BOX_PCB_Slot1_Width/2.); + const G4double BOX_PCB_Slot1_Position =-(BOX_Wafer_Length_Offset-BOX_Wafer_Length/2.-BOX_PCB_Slot1_Border - BOX_PCB_Slot1_Width/2.); + //const G4double BOX_PCB_Slot1_Position = BOX_PCB_Width*0.5-(BOX_PCB_Width - (BOX_Wafer_Length+BOX_PCB_Border_ShortSide+BOX_PCB_Slot1_Border+BOX_PCB_Slot1_Width*0.5))-BOX_PCB_Slot1_Width*0.5; // PAD // // PAD PCB @@ -99,7 +100,7 @@ namespace SHARC // Double stage box case (DSSD+PAD) const G4double BOX_PCB_Slot2_Width = BOX_PCB_Thickness+PAD_PCB_Thickness; const G4double BOX_PCB_Slot2_Border = 2.7*mm; - const G4double BOX_PCB_Slot2_Deepness = 0.8*mm; + const G4double BOX_PCB_Slot2_Deepness = BOX_PCB_Border_ShortSide; const G4double BOX_PCB_Slot2_Position =(BOX_Wafer_Length/2.-BOX_Wafer_Length_Offset) + BOX_PCB_Slot2_Border + BOX_PCB_Slot2_Width/2.; // QQQ // diff --git a/NPSimulation/src/Sharc.cc b/NPSimulation/src/Sharc.cc index d3956b0b6e7af7a31a84462d24f6df172c4cca4b..a5d2468a7f3e84efbab8d34b70b3f6c4c347884b 100644 --- a/NPSimulation/src/Sharc.cc +++ b/NPSimulation/src/Sharc.cc @@ -58,8 +58,6 @@ using namespace SHARC; using namespace std; using namespace CLHEP; -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // Sharc Specific Method Sharc::Sharc(){ @@ -110,12 +108,8 @@ void Sharc::AddQQQDetector(G4ThreeVector Pos){ m_Pos.push_back(Pos); } -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // Virtual Method of VDetector class - - // Read stream at Configfile to pick-up parameters of detector (Position,...) // Called in DetecorConstruction::ReadDetextorConfiguration Method void Sharc::ReadConfiguration(string Path){ @@ -327,13 +321,15 @@ void Sharc::ReadConfiguration(string Path){ } } +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // Construct detector and inialise sensitive part. // Called After DetecorConstruction::AddDetector Method void Sharc::ConstructDetector(G4LogicalVolume* world){ ConstructBOXDetector(world); ConstructQQQDetector(world); } -/////////////////////////////////////////////////// + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ for(unsigned int i = 0 ; i < m_Z.size() ; i++){ for (unsigned int j = 0 ; j < 4; j++) { @@ -412,8 +408,7 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ logicWafer,"Box_Wafer",logicBoxDetector,false,i*4+j+1); // create the PAD - - // Make the a single detector geometry + // Make a single detector geometry G4LogicalVolume* logicPADDetector; G4ThreeVector PAD_Wafer_Offset = G4ThreeVector(PAD_Wafer_Length_Offset, PAD_Wafer_Width_Offset,0 ); @@ -469,25 +464,17 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ /////////////////////////////////////////////////////////////////////////////////// // Place the detector in the world // Position of the center of the PCB - G4double Exposed_Length= BOX_PCB_Border_ShortSide - BOX_PCB_Slot_Deepness - + BOX_Wafer_Length - + BOX_PCB_Slot_Border + BOX_PCB_Slot_Width*0.5; + G4double Exposed_Length= BOX_Wafer_Length + BOX_PCB_Slot_Border + BOX_PCB_Slot_Width; G4double DetectorOffset= -0.5*(BOX_PCB_Length-Exposed_Length); + /*FIXME*/////////////////////////////////////////// G4ThreeVector DetectorPosition = - G4ThreeVector(DetectorOffset,-Box_Wafer_Offset.y(),0); - - - cout << "PCB Length " << BOX_PCB_Length << endl; - cout << " Sum " << BOX_Wafer_Length+BOX_PCB_Border_ShortSide+BOX_PCB_Slot_Border+BOX_PCB_Slot_Width << endl; - //-Box_Wafer_Offset+G4ThreeVector(DetectorOffset,0,0); - //-Box_Wafer_Offset+G4ThreeVector(BOX_PCB_Slot_Border + 0.5*BOX_PCB_Slot_Width +(BOX_PCB_Border_ShortSide - BOX_PCB_Slot_Deepness),0,0); - + G4ThreeVector(DetectorOffset+0.25*mm,Box_Wafer_Offset.y(),0); + // Distance of the PCB to the target G4ThreeVector DetectorSpacing = -G4ThreeVector(0, 0,0.5*Exposed_Length); - // -G4ThreeVector(0, 0,0.5*(BOX_Wafer_Length+(BOX_PCB_Border_ShortSide- BOX_PCB_Slot_Deepness)+BOX_PCB_Slot_Border+0.5*BOX_PCB_Slot_Width)); - + // If a PAD is present, DSSD is not in the center of the Slot: G4ThreeVector PAD_OFFSET=-G4ThreeVector(0.5*PAD_PCB_Thickness,0,0); if(m_ThicknessPAD[i][j]>0) DetectorPosition+=PAD_OFFSET; @@ -532,13 +519,15 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ new G4PVPlacement(G4Transform3D(*DetectorRotation,DetectorPosition), logicBoxDetector,"Box",world,false,i*4+j+1); - if(logicPADDetector!=NULL) + if(m_ThicknessPAD[i][j]>0){ new G4PVPlacement(G4Transform3D(*DetectorRotation, PADDetectorPosition), logicPADDetector,"PAD",world,false,i*4+j+1); + } } } } -/////////////////////////////////////////////////// + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void Sharc::ConstructQQQDetector(G4LogicalVolume* world){ // create the QQQ @@ -605,6 +594,7 @@ void Sharc::ConstructQQQDetector(G4LogicalVolume* world){ } } +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // Add Detector branch to the EventTree. // Called After DetecorConstruction::AddDetector Method void Sharc::InitializeRootOutput(){ @@ -613,6 +603,7 @@ void Sharc::InitializeRootOutput(){ pTree->Branch("SSSD", "TSSSDData", &m_Event) ;*/ } +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // Read sensitive part and fill the Root tree. // Called at in the EventAction::EndOfEventAvtion void Sharc::ReadSensitive(const G4Event* event){ @@ -723,6 +714,7 @@ void Sharc::ReadSensitive(const G4Event* event){ } +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void Sharc::InitializeScorers(){ /* // Silicon Associate Scorer @@ -744,6 +736,7 @@ void Sharc::InitializeScorers(){ G4SDManager::GetSDMpointer()->AddNewDetector(m_StripScorer) ;*/ } +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //////////////////////////////////////////////////////////////// /////////////////Material Definition /////////////////////////// ////////////////////////////////////////////////////////////////