diff --git a/Inputs/DetectorConfiguration/gaspardTestSpheric.detector b/Inputs/DetectorConfiguration/gaspardTestSpheric.detector index 96fcce7a49649281bcc3ad0769cc202a409c46f3..91d535366e794c964708febb232c9fa41ad4ed2c 100644 --- a/Inputs/DetectorConfiguration/gaspardTestSpheric.detector +++ b/Inputs/DetectorConfiguration/gaspardTestSpheric.detector @@ -13,6 +13,7 @@ Target ANGLE= 0 RADIUS= 12 MATERIAL= CD2 + NBLAYERS= 50 X= 0 Y= 0 Z= 0 diff --git a/NPSimulation/include/Target.hh b/NPSimulation/include/Target.hh index 92da2be70c450cd297b0229bee4eb68050db72f3..f34c7677edbbc6f80f9e559df2bbddbb751a601d 100644 --- a/NPSimulation/include/Target.hh +++ b/NPSimulation/include/Target.hh @@ -11,7 +11,7 @@ * Original Author: Adrien MATTA contact address: matta@ipno.in2p3.fr * * * * Creation Date : January 2009 * - * Last update : 16/09/2009 * + * Last update : 06/11/2009 * *---------------------------------------------------------------------------* * Decription: * * This class describe Cryogenic and standard Target. Derived from VDetector* @@ -22,6 +22,8 @@ * * * + 16/09/2009: Add support for positioning the target with an angle with * * respect to the beam (N. de Sereville) * + * + 06/11/2009: Add new Token NBLAYERS defining the number of steps used * + * to slow down the beam in the target (N. de Sereville) * * * *****************************************************************************/ // C++ headers @@ -86,6 +88,7 @@ public: G4double GetTargetX() {return m_TargetX;} G4double GetTargetY() {return m_TargetY;} G4double GetTargetZ() {return m_TargetZ;} + G4int GetTargetNbLayers() {return m_TargetNbLayers;} private: @@ -97,6 +100,7 @@ private: G4double m_TargetRadius; G4double m_TargetAngle; G4Material* m_TargetMaterial; + G4int m_TargetNbLayers; // For Cryo Target G4double m_TargetTemperature; diff --git a/NPSimulation/src/EventGeneratorTransfert.cc b/NPSimulation/src/EventGeneratorTransfert.cc index 19de24764c26b9b507f39a4f369e9296a43a91ca..0f7e15c940327f73853af90bdb07805a50d4573f 100644 --- a/NPSimulation/src/EventGeneratorTransfert.cc +++ b/NPSimulation/src/EventGeneratorTransfert.cc @@ -396,7 +396,7 @@ void EventGeneratorTransfert::GenerateEvent(G4Event* anEvent , G4ParticleGun* pa G4double IncidentBeamEnergy = RandGauss::shoot(NominalBeamEnergy, m_BeamEnergySpread / 2.35); // Slowing down the beam to the interaction layer in the target // Number of Layers - const G4int NbLayers = 50; + G4int NbLayers = m_Target->GetTargetNbLayers(); G4EmCalculator emCalculator; for (G4int i = 0; i < NbLayers; i++) { // G4double dedx = emCalculator.GetDEDX(IncidentBeamEnergy, BeamName, m_Target->GetTargetMaterial()); diff --git a/NPSimulation/src/Target.cc b/NPSimulation/src/Target.cc index e176eae06111165479ac91c3dc1ccff7fc5db651..798c028ee25b53870270c24fe87220536efaa477 100644 --- a/NPSimulation/src/Target.cc +++ b/NPSimulation/src/Target.cc @@ -9,7 +9,7 @@ * Original Author: Adrien MATTA contact address: matta@ipno.in2p3.fr * * * * Creation Date : January 2009 * - * Last update : 16/09/2009 * + * Last update : 06/11/2009 * *---------------------------------------------------------------------------* * Decription: * * This class describe Cryogenic and standard Target. Derived from VDetector* @@ -21,6 +21,8 @@ * + 16/09/2009: Add support for positioning the target with an angle with * * respect to the beam (N. de Sereville) * * + 16/09/2009: Add CH2 material for targets (N. de Sereville) * + * + 06/11/2009: Add new Token NBLAYERS defining the number of steps used * + * to slow down the beam in the target (N. de Sereville) * * * *****************************************************************************/ // C++ header @@ -57,6 +59,7 @@ Target::Target() m_WindowsThickness = 0 ; m_TargetTemperature = 0 ; m_TargetPressure = 0 ; + m_TargetNbLayers = 50; // Number of steps by default } G4Material* Target::GetMaterialFromLibrary(G4String MaterialName, G4double Temperature, G4double Pressure) @@ -209,6 +212,7 @@ void Target::ReadConfiguration(string Path) bool check_X = false ; bool check_Y = false ; bool check_Z = false ; + bool check_NbLayers = false; bool check_Temperature = false ; bool check_Pressure = false ; @@ -283,6 +287,13 @@ void Target::ReadConfiguration(string Path) cout << m_TargetZ / mm << " )" << endl ; } + else if (DataBuffer.compare(0, 9, "NBLAYERS=") == 0) { + check_NbLayers = true ; + ConfigFile >> DataBuffer; + m_TargetNbLayers = atoi(DataBuffer.c_str()); + cout << "Number of steps for slowing down the beam in target: " << m_TargetNbLayers << endl; + } + /////////////////////////////////////////////////// // If no Beam Token and no comment, toggle out else @@ -370,6 +381,13 @@ void Target::ReadConfiguration(string Path) cout << m_TargetZ / mm << " )" << endl ; } + else if (DataBuffer.compare(0, 9, "NBLAYERS=") == 0) { + check_NbLayers = true ; + ConfigFile >> DataBuffer; + m_TargetNbLayers = atoi(DataBuffer.c_str()); + cout << "Number of steps for slowing down the beam in target: " << m_TargetNbLayers << endl; + } + /////////////////////////////////////////////////// // If no Beam Token and no comment, toggle out else