diff --git a/NPLib/VDetector/DetectorManager.cxx b/NPLib/VDetector/DetectorManager.cxx index 7d4cde3dae7350ef75d1cf0e3cc3a453f14f5e21..3bc772a6fcce5927e0e7e04270a7d6e244fa2786 100644 --- a/NPLib/VDetector/DetectorManager.cxx +++ b/NPLib/VDetector/DetectorManager.cxx @@ -37,6 +37,7 @@ #include "TChateauCristalPhysics.h" #include "GaspardTracker.h" #include "HydeTracker.h" +#include "Hyde2Tracker.h" #include "Paris.h" #include "TW1Physics.h" #include "Shield.h" @@ -88,6 +89,7 @@ void DetectorManager::ReadConfigurationFile(string Path) Bool_t GeneralTarget = false; Bool_t GPDTracker = false; Bool_t HYDTracker = false; + Bool_t HYD2Tracker = false; Bool_t ParisDet = false; Bool_t ShieldDet = false; Bool_t W1 = false; @@ -164,6 +166,26 @@ void DetectorManager::ReadConfigurationFile(string Path) // Add array to the VDetector Vector AddDetector("HYDE", myDetector); +#endif + } + //////////////////////////////////////////// + //////////// Search for Hyde //////////// + //////////////////////////////////////////// + else if (LineBuffer.compare(0, 12, "Hyde2Tracker") == 0 && HYD2Tracker == false) { +#ifdef INC_HYDE2 + HYD2Tracker = true ; + cout << "//////// Hyde2 Tracker ////////" << endl; + + // Instantiate the new array as a VDetector Object + VDetector* myDetector = new Hyde2Tracker(); + + // Read Position of Telescope + ConfigFile.close(); + myDetector->ReadConfiguration(Path); + ConfigFile.open(Path.c_str()); + + // Add array to the VDetector Vector + AddDetector("HYDE2", myDetector); #endif } //////////////////////////////////////////// diff --git a/NPSimulation/src/HydeTrackerAnnular.cc b/NPSimulation/src/HydeTrackerAnnular.cc index b5902dd7f7d404e3aec6e8c4ffe01bc14e440ab4..a67b86f0bec2a297c04ab17d195174c52896bddc 100644 --- a/NPSimulation/src/HydeTrackerAnnular.cc +++ b/NPSimulation/src/HydeTrackerAnnular.cc @@ -177,10 +177,6 @@ void HydeTrackerAnnular::VolumeMaker(G4int TelescopeNumber , //////////////////////////////////////////////////////////////// ////////////// Starting Volume Definition ////////////////////// //////////////////////////////////////////////////////////////// - // Little trick to avoid warning in compilation: Use a PVPlacement "buffer". - // If don't you will have a Warning unused variable 'myPVP' - G4PVPlacement* PVPBuffer ; - // Name of the module G4String Name = "HYDAnnular" + DetectorNumber; @@ -195,7 +191,7 @@ void HydeTrackerAnnular::VolumeMaker(G4int TelescopeNumber , // G4LogicalVolume* logicMM = new G4LogicalVolume(solidMM, Iron, Name, 0, 0, 0); G4LogicalVolume* logicMM = new G4LogicalVolume(solidMM, Vacuum, Name, 0, 0, 0); - PVPBuffer = new G4PVPlacement(G4Transform3D(*MMrot, MMpos) , + new G4PVPlacement(G4Transform3D(*MMrot, MMpos) , logicMM , Name , world , @@ -217,7 +213,7 @@ void HydeTrackerAnnular::VolumeMaker(G4int TelescopeNumber , G4LogicalVolume* logicVacBox = new G4LogicalVolume(solidVacBox, Vacuum, "logicVacBox", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionVacBox, logicVacBox, "G" + DetectorNumber + "VacBox", logicMM, false, 0); + new G4PVPlacement(0, positionVacBox, logicVacBox, "G" + DetectorNumber + "VacBox", logicMM, false, 0); logicVacBox->SetVisAttributes(G4VisAttributes::Invisible); @@ -269,8 +265,8 @@ void HydeTrackerAnnular::VolumeMaker(G4int TelescopeNumber , // G4LogicalVolume* logicAluStrip = new G4LogicalVolume(solidAluStrip, Aluminium, "logicAluStrip", 0, 0, 0); G4LogicalVolume* logicAluStrip = new G4LogicalVolume(solidAluStrip, Vacuum, "logicAluStrip", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionAluStripFront, logicAluStrip, "G" + DetectorNumber + "AluStripFront", logicMM, false, 0); - PVPBuffer = new G4PVPlacement(0, positionAluStripBack, logicAluStrip, "G" + DetectorNumber + "AluStripBack", logicMM, false, 0); + new G4PVPlacement(0, positionAluStripFront, logicAluStrip, "G" + DetectorNumber + "AluStripFront", logicMM, false, 0); + new G4PVPlacement(0, positionAluStripBack, logicAluStrip, "G" + DetectorNumber + "AluStripBack", logicMM, false, 0); logicAluStrip->SetVisAttributes(G4VisAttributes::Invisible); @@ -285,7 +281,7 @@ void HydeTrackerAnnular::VolumeMaker(G4int TelescopeNumber , 360*deg); G4LogicalVolume* logicSilicon = new G4LogicalVolume(solidSilicon, Silicon, "logicSilicon", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionSilicon, logicSilicon, Name + "_Silicon", logicMM, false, 0); + new G4PVPlacement(0, positionSilicon, logicSilicon, Name + "_Silicon", logicMM, false, 0); // Set First Stage sensible logicSilicon->SetSensitiveDetector(m_FirstStageScorer); @@ -318,7 +314,7 @@ void HydeTrackerAnnular::VolumeMaker(G4int TelescopeNumber , G4LogicalVolume* logicThirdStage = new G4LogicalVolume(solidThirdStage, Silicon, "logicThirdStage", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionThirdStage, logicThirdStage, Name + "_ThirdStage", logicMM, false, 0); + new G4PVPlacement(0, positionThirdStage, logicThirdStage, Name + "_ThirdStage", logicMM, false, 0); ///Visualisation of Third Stage G4VisAttributes* ThirdStageVisAtt = new G4VisAttributes(G4Colour(0.0, 0.9, 0.)) ; diff --git a/NPSimulation/src/Target.cc b/NPSimulation/src/Target.cc index 05460179331207b8ae2f53c1200794481f1541d9..1122c38c5c3250266e265f4ba06c5be3954044cf 100644 --- a/NPSimulation/src/Target.cc +++ b/NPSimulation/src/Target.cc @@ -260,12 +260,12 @@ void Target::ReadConfiguration(string Path) bool check_Thickness = false ; bool check_Radius = false ; - bool check_Angle = false ; +// bool check_Angle = false ; bool check_Material = false ; bool check_X = false ; bool check_Y = false ; bool check_Z = false ; - bool check_m_TargetNbLayers = false; +// bool check_m_TargetNbLayers = false; bool check_Temperature = false ; bool check_Pressure = false ; @@ -301,7 +301,7 @@ void Target::ReadConfiguration(string Path) } else if (DataBuffer.compare(0, 6, "ANGLE=") == 0) { - check_Angle = true ; +// check_Angle = true ; ConfigFile >> DataBuffer; m_TargetAngle = atof(DataBuffer.c_str()) * deg; if(VerboseLevel==1) cout << "Target Angle: " << m_TargetAngle / deg << endl ; @@ -343,7 +343,7 @@ void Target::ReadConfiguration(string Path) } else if (DataBuffer.compare(0, 9, "NBLAYERS=") == 0) { - check_m_TargetNbLayers = true ; +// check_m_TargetNbLayers = true ; ConfigFile >> DataBuffer; m_TargetNbLayers = atoi(DataBuffer.c_str()); if(VerboseLevel==1) cout << "Number of steps for slowing down the beam in target: " << m_TargetNbLayers << endl; @@ -438,7 +438,7 @@ void Target::ReadConfiguration(string Path) } else if (DataBuffer.compare(0, 9, "NBLAYERS=") == 0) { - check_m_TargetNbLayers = true ; +// check_m_TargetNbLayers = true ; ConfigFile >> DataBuffer; m_TargetNbLayers = atoi(DataBuffer.c_str()); if(VerboseLevel==1) cout << "Number of steps for slowing down the beam in target: " << m_TargetNbLayers << endl; @@ -468,11 +468,6 @@ void Target::ReadConfiguration(string Path) // Called After DetecorConstruction::AddDetector Method void Target::ConstructDetector(G4LogicalVolume* world) { - - // Little trick to avoid warning in compilation: Use a PVPlacement "buffer". - // If don't you will have a Warning unused variable 'myPVP' - G4VPhysicalVolume* PVPBuffer ; - if (m_TargetType) { // case of standard target if (m_TargetThickness > 0) { @@ -483,7 +478,6 @@ void Target::ConstructDetector(G4LogicalVolume* world) G4RotationMatrix *rotation = new G4RotationMatrix(); rotation->rotateY(m_TargetAngle); - PVPBuffer = new G4PVPlacement(rotation, G4ThreeVector(m_TargetX, m_TargetY, m_TargetZ), logicTarget, "Target", world, false, 0); G4VisAttributes* TargetVisAtt = new G4VisAttributes(G4Colour(0., 0., 1.));//Blue @@ -496,7 +490,6 @@ void Target::ConstructDetector(G4LogicalVolume* world) if (m_TargetThickness > 0) { G4Tubs* solidTarget = new G4Tubs("solidTarget", 0, m_TargetRadius, 0.5*m_TargetThickness, 0*deg, 360*deg); G4LogicalVolume* logicTarget = new G4LogicalVolume(solidTarget, m_TargetMaterial, "logicTarget"); - PVPBuffer = new G4PVPlacement(0, G4ThreeVector(m_TargetX, m_TargetY, m_TargetZ), logicTarget, "Target", world, false, 0); G4VisAttributes* TargetVisAtt = new G4VisAttributes(G4Colour(0., 0., 1.));//Blue @@ -515,7 +508,6 @@ void Target::ConstructDetector(G4LogicalVolume* world) new G4Tubs("solidTargetWindowsB", 0, m_TargetRadius, 0.5*m_WindowsThickness, 0*deg, 360*deg); G4LogicalVolume* logicWindowsB = new G4LogicalVolume(solidWindowsB, m_WindowsMaterial, "logicTargetWindowsB"); - PVPBuffer = new G4PVPlacement( 0 , TargetPos + G4ThreeVector(0., 0., 0.5*(m_TargetThickness + m_WindowsThickness)) , logicWindowsF , @@ -523,7 +515,6 @@ void Target::ConstructDetector(G4LogicalVolume* world) world , false, 0 ); - PVPBuffer = new G4PVPlacement( 0 , TargetPos + G4ThreeVector(0., 0., -0.5*(m_TargetThickness + m_WindowsThickness)) , logicWindowsB , diff --git a/NPSimulation/src/ThinSi.cc b/NPSimulation/src/ThinSi.cc index e8a4490e2ec0dec06d2503e4f84e868b431d5280..d97c587b9995f291d50e48aaaef27b7b845f1251 100644 --- a/NPSimulation/src/ThinSi.cc +++ b/NPSimulation/src/ThinSi.cc @@ -135,11 +135,6 @@ void ThinSi::VolumeMaker( G4int DetNumber , //////////////////////////////////////////////////////////////// /////////General Geometry Parameter Definition ///////////////// //////////////////////////////////////////////////////////////// - -// Little trick to avoid warning in compilation: Use a PVPlacement "buffer". -// If don't you will have a Warning unused variable 'myPVP' - G4PVPlacement* PVPBuffer ; - /////// Starting Volume Definition /////// G4String Name = "ThinSi" + DetectorNumber; @@ -148,7 +143,7 @@ void ThinSi::VolumeMaker( G4int DetNumber , G4LogicalVolume* logicThinSi = new G4LogicalVolume(solidThinSi, m_MaterialVacuum, Name, 0, 0); - PVPBuffer = new G4PVPlacement( G4Transform3D(*Det_rot, Det_pos) , + G4PVPlacement( G4Transform3D(*Det_rot, Det_pos) , logicThinSi , Name , world , @@ -169,7 +164,7 @@ void ThinSi::VolumeMaker( G4int DetNumber , G4ThreeVector FrameRightPosition = G4ThreeVector(-0.5 * SiliconSize - 0.5 * (DetectorSize - SiliconSize) / 2 , 0 , 0) ; - PVPBuffer = new G4PVPlacement( 0, + new G4PVPlacement( 0, FrameTopPosition, logicFrameHorizontal, Name + "_Frame", @@ -177,7 +172,7 @@ void ThinSi::VolumeMaker( G4int DetNumber , false, 0); - PVPBuffer = new G4PVPlacement( 0, + new G4PVPlacement( 0, FrameBottomPosition, logicFrameHorizontal, Name + "_Frame", @@ -185,7 +180,7 @@ void ThinSi::VolumeMaker( G4int DetNumber , false, 0); - PVPBuffer = new G4PVPlacement( 0, + new G4PVPlacement( 0, FrameLeftPosition, logicFrameVertical, Name + "_Frame", @@ -193,7 +188,7 @@ void ThinSi::VolumeMaker( G4int DetNumber , false, 0); - PVPBuffer = new G4PVPlacement( 0, + new G4PVPlacement( 0, FrameRightPosition, logicFrameVertical, Name + "_Frame", @@ -212,10 +207,8 @@ void ThinSi::VolumeMaker( G4int DetNumber , G4LogicalVolume* logicAlu = new G4LogicalVolume(solidAlu, m_MaterialAl, "logicAlu", 0, 0, 0) ; - PVPBuffer = new G4PVPlacement(0 , posAluFront , logicAlu , Name + "_AluFront" , logicThinSi , true, 0) ; - PVPBuffer = new G4PVPlacement(0 , posAluBack , logicAlu , Name + "_AluBack" , logicThinSi , true, 0) ; @@ -225,7 +218,6 @@ void ThinSi::VolumeMaker( G4int DetNumber , G4LogicalVolume* logicSi = new G4LogicalVolume(solidSi, m_MaterialSilicon, "logicSi", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, posSi, logicSi, Name + "_Si", logicThinSi, true, 0); //attach it to the Silicon plate