diff --git a/Inputs/DetectorConfiguration/gaspardTestSpheric.detector b/Inputs/DetectorConfiguration/gaspardTestSpheric.detector index 5465fea0426fe14a09e3bedd7c97de63b6382e72..0b46aa52e28136c98ca6f08579ed95bd42818ac6 100644 --- a/Inputs/DetectorConfiguration/gaspardTestSpheric.detector +++ b/Inputs/DetectorConfiguration/gaspardTestSpheric.detector @@ -9,7 +9,8 @@ GeneralTarget %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Target - THICKNESS= 0.0001 + THICKNESS= 9.7 + ANGLE= 0 RADIUS= 12 MATERIAL= CD2 X= 0 diff --git a/Inputs/EventGenerator/132Sndp.reaction b/Inputs/EventGenerator/132Sndp.reaction index 5bdb077e4d6f9240fe93c625687c05caedc0baf3..0ff5e1462fc0390a7e3c5e73f62dc6c39c91404f 100644 --- a/Inputs/EventGenerator/132Sndp.reaction +++ b/Inputs/EventGenerator/132Sndp.reaction @@ -10,8 +10,8 @@ Transfert ExcitationEnergy= 0.0 BeamEnergy= 1320 BeamEnergySpread= 0 - SigmaX= 2 - SigmaY= 2 + SigmaX= 0.851 + SigmaY= 0.851 SigmaThetaX= 0 SigmaPhiY= 0 CrossSectionPath= sn132dp_gs_10AMeV.txt diff --git a/NPLib/GASPARD/GaspardTracker.cxx b/NPLib/GASPARD/GaspardTracker.cxx index c6afac495de05ac57b9fd2a2dc6e1f795bac21c0..32874e9e3ea4f80e697d04737eb4733bbd68110e 100644 --- a/NPLib/GASPARD/GaspardTracker.cxx +++ b/NPLib/GASPARD/GaspardTracker.cxx @@ -796,7 +796,7 @@ void GaspardTracker::AddModuleDummyShape(double theta, V.Rotate( beta_w * Pi/180. , W ) ; double Face = 50; // mm - double NumberOfStrip = 128; + double NumberOfStrip = 25; double StripPitch = Face/NumberOfStrip; // mm vector<double> lineX; diff --git a/NPSimulation/include/DetectorConstruction.hh b/NPSimulation/include/DetectorConstruction.hh index 6fb3c6ef427101a1fddf8dcefcb38dcf6817570b..ef3d2e067d24e38322621b2a4d1b125f713f94f6 100644 --- a/NPSimulation/include/DetectorConstruction.hh +++ b/NPSimulation/include/DetectorConstruction.hh @@ -15,9 +15,9 @@ *---------------------------------------------------------------------------* * Decription: * * This Class manage the virtual detector and call their method. * - * Every time a new detector is added to the project, a few line in the * - * ReadConfigurationFile method are needed in order to detect the associate * - * token. * + * Every time a new detector is added to the project, a few line in the * + * ReadConfigurationFile method are needed in order to detect the associate * + * token. * *---------------------------------------------------------------------------* * Comment: * * * @@ -26,11 +26,19 @@ class G4LogicalVolume; class G4VPhysicalVolume; +// C++ headers +#include <vector> +#include <cmath> + +// G4 headers #include "G4VUserDetectorConstruction.hh" +#include "G4Event.hh" + +// NPTool headers #include "VDetector.hh" + +// ROOT headers #include "TTree.h" -#include "G4Event.hh" -#include <vector> class DetectorConstruction : public G4VUserDetectorConstruction { @@ -68,21 +76,11 @@ private: // Data about the target G4double m_TargetZ ; public: // Getter and Setter - G4double GetTargetThickness() { - return m_TargetThickness ; - } - G4double GetTargetRadius() { - return m_TargetRadius ; - } - G4double GetTargetX() { - return m_TargetX ; - } - G4double GetTargetY() { - return m_TargetY ; - } - G4double GetTargetZ() { - return m_TargetZ ; - } + G4double GetTargetThickness() {return m_TargetThickness;} + G4double GetTargetRadius() {return m_TargetRadius;} + G4double GetTargetX() {return m_TargetX;} + G4double GetTargetY() {return m_TargetY;} + G4double GetTargetZ() {return m_TargetZ;} }; #endif diff --git a/NPSimulation/include/GaspardTrackerDummyShape.hh b/NPSimulation/include/GaspardTrackerDummyShape.hh index d567d9c1e65e66762dacc876069b1c2de6c16f0b..8285639eb29a9718eab3378eab2d23694e3d83f6 100644 --- a/NPSimulation/include/GaspardTrackerDummyShape.hh +++ b/NPSimulation/include/GaspardTrackerDummyShape.hh @@ -165,7 +165,7 @@ namespace GPDDUMMYSHAPE // for testing the excitation energy reconstruction const G4double FirstStageThickness = 1.3*cm; // const G4int NumberOfStrips = 128; - const G4int NumberOfStrips = 20; + const G4int NumberOfStrips = 25; // Second stage const G4double SecondStageFace = FirstStageFace; diff --git a/NPSimulation/include/Target.hh b/NPSimulation/include/Target.hh index 3e88dde62c0f8ea4bd2ad1ebb6e36e846ba9e414..05225d5e789f7db2a129074238979103102b0a11 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 : * + * Last update : 16/09/2009 * *---------------------------------------------------------------------------* * Decription: * * This class describe Cryogenic and standard Target. Derived from VDetector* @@ -19,9 +19,14 @@ *---------------------------------------------------------------------------* * Comment: * * Some improvment need to be done in material dealing * + * * + * + 16/09/2009: Add support for positioning the target with an angle with * + * respect to the beam (N. de Sereville) * + * * *****************************************************************************/ // C++ headers #include <string> +#include <cmath> // G4 header defining G4 types #include "globals.hh" @@ -41,24 +46,24 @@ using namespace std; class Target : public VDetector { public: - Target() ; + Target(); public: // Read stream at Configfile to pick-up parameters of detector (Position,...) // Called in DetecorConstruction::ReadDetextorConfiguration Method - void ReadConfiguration(string Path) ; + void ReadConfiguration(string Path); // Construct detector and inialise sensitive part. // Called After DetecorConstruction::AddDetector Method - void ConstructDetector(G4LogicalVolume* world) ; + void ConstructDetector(G4LogicalVolume* world); // Add Detector branch to the EventTree. // Called After DetecorConstruction::AddDetector Method - void InitializeRootOutput() ; + void InitializeRootOutput(); // Read sensitive part and fill the Root tree. // Called at in the EventAction::EndOfEventAvtion - void ReadSensitive(const G4Event* event) ; + void ReadSensitive(const G4Event* event); public: @@ -69,38 +74,29 @@ private: bool m_TargetType ; // Standard parameter - G4double m_TargetThickness ; - G4double m_TargetRadius ; - G4Material* m_TargetMaterial ; + G4double m_TargetThickness; + G4double m_TargetRadius; + G4double m_TargetAngle; + G4Material* m_TargetMaterial; // For Cryo Target - G4double m_WindowsThickness ; - G4Material* m_WindowsMaterial ; - G4double m_TargetTemperature ; - G4double m_TargetPressure ; + G4double m_WindowsThickness; + G4double m_TargetTemperature; + G4double m_TargetPressure; + G4Material* m_WindowsMaterial; // Positioning - G4double m_TargetX ; - G4double m_TargetY ; - G4double m_TargetZ ; + G4double m_TargetX; + G4double m_TargetY; + G4double m_TargetZ; public: - G4double GetTargetThickness() { - return m_TargetThickness ; - } - G4double GetTargetRadius() { - return m_TargetRadius ; - } - G4double GetTargetX() { - return m_TargetX ; - } - G4double GetTargetY() { - return m_TargetY ; - } - G4double GetTargetZ() { - return m_TargetZ ; - } - + G4double GetTargetThickness() {return m_TargetThickness / cos(m_TargetAngle/rad);} + G4double GetTargetRadius() {return m_TargetRadius;} + G4double GetTargetAngle() {return m_TargetAngle;} + G4double GetTargetX() {return m_TargetX;} + G4double GetTargetY() {return m_TargetY;} + G4double GetTargetZ() {return m_TargetZ;} }; #endif diff --git a/NPSimulation/src/DetectorConstruction.cc b/NPSimulation/src/DetectorConstruction.cc index 40f19eadb7511b1c660fe7e035f46dc7bad007da..a2ed78c79723337d20fcb6cbdc501bd749cfa674 100644 --- a/NPSimulation/src/DetectorConstruction.cc +++ b/NPSimulation/src/DetectorConstruction.cc @@ -13,9 +13,9 @@ *---------------------------------------------------------------------------* * Decription: * * This Class manage the virtual detector and call their method. * - * Every time a new detector is added to the project, a few line in the * - * ReadConfigurationFile method are needed in order to detect the associate * - * token. * + * Every time a new detector is added to the project, a few line in the * + * ReadConfigurationFile method are needed in order to detect the associate * + * token. * *---------------------------------------------------------------------------* * Comment: * * * diff --git a/NPSimulation/src/Target.cc b/NPSimulation/src/Target.cc index 1d88eda135602fbe0a7030bb319ba20d8d17e830..589f643d40f9e7cac751064cb0bfc545715ca984 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 : * + * Last update : 16/09/2009 * *---------------------------------------------------------------------------* * Decription: * * This class describe Cryogenic and standard Target. Derived from VDetector* @@ -17,6 +17,11 @@ *---------------------------------------------------------------------------* * Comment: * * Some improvment need to be done in material dealing * + * * + * + 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) * + * * *****************************************************************************/ // C++ header #include <fstream> @@ -45,12 +50,13 @@ using namespace std; // Specific Method of this class Target::Target() { - m_TargetType = true ; - m_TargetThickness = 0 ; - m_TargetRadius = 0 ; + m_TargetType = true; + m_TargetThickness = 0 ; + m_TargetAngle = 0 ; + m_TargetRadius = 0 ; m_WindowsThickness = 0 ; m_TargetTemperature = 0 ; - m_TargetPressure = 0 ; + m_TargetPressure = 0 ; } G4Material* Target::GetMaterialFromLibrary(G4String MaterialName, G4double Temperature, G4double Pressure) @@ -157,6 +163,16 @@ G4Material* Target::GetMaterialFromLibrary(G4String MaterialName, G4double Tempe return myMaterial; } + else if (MaterialName == "CH2") { + G4Element* C = new G4Element("Carbon" , "C" , 6. , 12.011*g / mole); + G4Element* H = new G4Element("Hydrogen", "H" , 1. , 1.01 *g / mole); + + G4Material* myMaterial = new G4Material("CH2", 0.9*g / cm3, 2); + myMaterial->AddElement(C , 1); + myMaterial->AddElement(H , 2); + return myMaterial; + } + else { G4cout << "No Matching Material in the Target Library Default is Vacuum" << G4endl; G4Element* N = new G4Element("Nitrogen", "N", 7., 14.01*g / mole); @@ -178,46 +194,42 @@ G4Material* Target::GetMaterialFromLibrary(G4String MaterialName, G4double Tempe // Called in DetecorConstruction::ReadDetextorConfiguration Method void Target::ReadConfiguration(string Path) { - ifstream ConfigFile ; - ConfigFile.open(Path.c_str()) ; - string LineBuffer ; - string DataBuffer ; - + ifstream ConfigFile; + ConfigFile.open(Path.c_str()); + string LineBuffer; + string DataBuffer; - bool ReadingStatusTarget = false ; - bool ReadingStatusCryoTarget = false ; - - bool check_Thickness = false ; - bool check_Radius = false ; - bool check_Material = false ; - bool check_X = false ; - bool check_Y = false ; - bool check_Z = false ; - - bool check_Temperature = false ; - bool check_Pressure = false ; - bool check_WinThickness = false ; - bool check_WinMaterial = false ; + bool ReadingStatusTarget = false ; + bool ReadingStatusCryoTarget = false ; + + bool check_Thickness = false ; + bool check_Radius = false ; + bool check_Angle = false ; + bool check_Material = false ; + bool check_X = false ; + bool check_Y = false ; + bool check_Z = false ; + + bool check_Temperature = false ; + bool check_Pressure = false ; + bool check_WinThickness = false ; + bool check_WinMaterial = false ; while (!ConfigFile.eof()) { - - getline(ConfigFile, LineBuffer); if (LineBuffer.compare(0, 6, "Target") == 0) { cout << "Target Found" << endl; m_TargetType = true ; ReadingStatusTarget = true ; - } - + } else if (LineBuffer.compare(0, 10, "CryoTarget") == 0) { cout << "Cryogenic Target Found" << endl; m_TargetType = false ; ReadingStatusCryoTarget = true ; - } - - while(ReadingStatusTarget){ - - ConfigFile >> DataBuffer; + } + + while (ReadingStatusTarget) { + ConfigFile >> DataBuffer; //Search for comment Symbol % if (DataBuffer.compare(0, 1, "%") == 0) {/*Do Nothing*/;} @@ -229,6 +241,13 @@ void Target::ReadConfiguration(string Path) cout << "Target Thickness: " << m_TargetThickness << endl ; } + else if (DataBuffer.compare(0, 6, "ANGLE=") == 0) { + check_Angle = true ; + ConfigFile >> DataBuffer; + m_TargetAngle = atof(DataBuffer.c_str()) * deg; + cout << "Target Angle: " << m_TargetAngle << endl ; + } + else if (DataBuffer.compare(0, 7, "RADIUS=") == 0) { check_Radius = true ; ConfigFile >> DataBuffer; @@ -377,20 +396,25 @@ void Target::ConstructDetector(G4LogicalVolume* world) // If don't you will have a Warning unused variable 'myPVP' G4VPhysicalVolume* PVPBuffer ; - if (m_TargetType) { + if (m_TargetType) { // case of standard target 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"); + + // rotation of target + G4RotationMatrix *rotation = new G4RotationMatrix(); + rotation->rotateY(m_TargetAngle); + PVPBuffer = - new G4PVPlacement(0, G4ThreeVector(m_TargetX, m_TargetY, m_TargetZ), logicTarget, "Target", world, false, 0); + new G4PVPlacement(rotation, G4ThreeVector(m_TargetX, m_TargetY, m_TargetZ), logicTarget, "Target", world, false, 0); G4VisAttributes* TargetVisAtt = new G4VisAttributes(G4Colour(0., 0., 1.));//Blue logicTarget->SetVisAttributes(TargetVisAtt); } } - else { + else { // case of cryogenic target if (m_TargetThickness > 0) { G4Tubs* solidTarget = new G4Tubs("solidTarget", 0, m_TargetRadius, 0.5*m_TargetThickness, 0*deg, 360*deg);