Skip to content
Snippets Groups Projects
Commit 0e34f364 authored by Theodore Efremov's avatar Theodore Efremov :hibiscus:
Browse files

Merge branch 'NPTool.2.dev' of https://gitlab.in2p3.fr/np/nptool into NPTool.2.dev

parents 5dda4eef e64dc968
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #372170 passed
...@@ -59,42 +59,52 @@ using namespace CLHEP; ...@@ -59,42 +59,52 @@ using namespace CLHEP;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace Vamos_NS { namespace Vamos_NS {
// Energy,time and position Resolution // Energy,time and position Resolution
const G4double EnergyThreshold = -10 * MeV; const G4double EnergyThreshold = -10 * MeV;
const G4double ResoTime = 4.5 * ns; const G4double ResoTime = 4.5 * ns;
const G4double ResoEnergy = 0.0001 * MeV; const G4double ResoEnergy = 0.0001 * MeV;
const G4double ResoDriftTime = 0.0001 * ns; const G4double ResoDriftTime = 0.0001 * ns;
const G4double ResoPosX = 0.0001 * mm; const G4double ResoPosX = 0.0001 * mm;
// Drift features // Drift features
const G4double DriftSpeed = 1 * cm / microsecond; const G4double DriftSpeed = 1 * cm / microsecond;
const G4ThreeVector DriftDir = G4ThreeVector(0, 1, 0); const G4ThreeVector DriftDir = G4ThreeVector(0, 1, 0);
// Geometry // Geometry
const G4double E_DCWidth = 600 * mm; // Entrance_DriftChamber const G4double E_DCWidth = 600 * mm; // Entrance_DriftChamber
const G4double E_DCLength = 150 * mm; const G4double E_DCLength = 150 * mm;
const G4double E_DCThickness = 60 * mm; const G4double E_DCThickness = 60 * mm;
const G4double MagnetWidth = 1000 * mm; const G4double MagnetWidth = 1000 * mm;
const G4double MagnetLenght = 150 * mm; const G4double MagnetLenght = 150 * mm;
const G4double MagnetThickness = 200 * mm; const G4double MagnetThickness = 200 * mm;
const G4double DipolThickness = 600 * mm; const G4double DipolThickness = 600 * mm;
const G4double ChamberWidth = 1000 * mm; const G4double ChamberWidth = 1000 * mm;
const G4double ChamberLength = 150 * mm; const G4double ChamberLength = 150 * mm;
const G4double ChamberThickness = 120 * mm; const G4double ChamberThickness = 120 * mm;
// Mother Volume of Vamos // Mother Volume of Vamos
const G4double Phi = 0 * deg; const G4double Phi = 0 * deg;
const G4double VamosVolumeWidth = 4500 * mm; const G4double VamosVolumeWidth = 4500 * mm;
const G4double VamosVolumeLength = 1000 * mm; const G4double VamosVolumeLength = 1000 * mm;
const G4double VamosVolumeThickness = 5000 * mm; const G4double VamosVolumeThickness = 5000 * mm;
// SubVolume of detection // SubVolume of detection
const G4double DetectionVolumeThickness = 1300 * mm; const G4double DetectionVolumeThickness = 1300 * mm;
const G4double DetectionVolumeWidth = 1000 * mm; const G4double DetectionVolumeWidth = 1000 * mm;
const G4double DetectionVolumeLength = 1000 * mm; const G4double DetectionVolumeLength = 1000 * mm;
const G4double Det_Theta = 45 * deg; const G4double Det_Theta = 45 * deg;
// TMW1-2
const G4double TMW1_Width = 40 * mm;
const G4double TMW1_Length = 61 * mm;
const G4double TMW1_Thickness = 5 * mm;
const G4double TMW2_Width = 65 * mm;
const G4double TMW2_Length = 93 * mm;
const G4double TMW2_Thickness = 5 * mm;
} }
...@@ -105,28 +115,31 @@ namespace Vamos_NS { ...@@ -105,28 +115,31 @@ namespace Vamos_NS {
// Vamos Specific Method // Vamos Specific Method
Vamos::Vamos() { Vamos::Vamos() {
m_Event = new TVamosData(); m_Event = new TVamosData();
m_CalorimeterScorer = 0; m_CalorimeterScorer = 0;
m_DCScorer = 0; m_DCScorer = 0;
m_Quad1 = 0; m_TMW1Scorer = 0;
m_Quad2 = 0; m_Quad1 = 0;
m_Dipol = 0; m_Quad2 = 0;
m_BeamCatcher = 0; m_Dipol = 0;
m_MWPPAC = 0; m_BeamCatcher = 0;
m_DC3 = 0; m_TMW1 = 0;
m_DC4 = 0; m_TMW2 = 0;
m_DC1 = 0; m_MWPPAC = 0;
m_DC2 = 0; m_DC3 = 0;
m_DC4 = 0;
ICcounter = 0; m_DC1 = 0;
m_DC2 = 0;
// RGB Color + Transparency
m_VisQuad = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0)); ICcounter = 0;
m_VisVolumeVamos = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0, 0.1));
m_VisDC = new G4VisAttributes(G4Colour(0.0, 1.0, 0.0, 0.2)); // RGB Color + Transparency
m_VisCatcher = new G4VisAttributes(G4Colour(0.0, 0.0, 1.0)); m_VisQuad = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0));
m_VisGasC4H10 = new G4VisAttributes(G4Colour(0.0, 1.0, 0.0, 0.2)); m_VisVolumeVamos = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0, 0.1));
m_VisGasCF4 = new G4VisAttributes(G4Colour(0.0, 0.0, 1.0, 0.2)); m_VisDC = new G4VisAttributes(G4Colour(0.0, 1.0, 0.0, 0.2));
m_VisCatcher = new G4VisAttributes(G4Colour(0.0, 0.0, 1.0));
m_VisGasC4H10 = new G4VisAttributes(G4Colour(0.0, 1.0, 0.0, 0.2));
m_VisGasCF4 = new G4VisAttributes(G4Colour(0.0, 0.0, 1.0, 0.2));
} }
Vamos::~Vamos() {} Vamos::~Vamos() {}
...@@ -135,200 +148,250 @@ Vamos::~Vamos() {} ...@@ -135,200 +148,250 @@ Vamos::~Vamos() {}
using namespace Vamos_NS; using namespace Vamos_NS;
/////////////////////////////////////////////////////////////////////
void Vamos::AddVamos(G4double R, double Theta) { void Vamos::AddVamos(G4double R, double Theta) {
m_R = R; m_R = R;
m_Theta = Theta; m_Theta = Theta;
} }
/////////////////////////////////////////////////////////////////////
void Vamos::AddBeamCatcher(string Material, G4double Width, double Length, void Vamos::AddBeamCatcher(string Material, G4double Width, double Length,
double Thickness, G4ThreeVector Pos) { double Thickness, G4ThreeVector Pos) {
CatcherMaterial = Material; CatcherMaterial = Material;
CatcherWidth = Width; CatcherWidth = Width;
CatcherLength = Length; CatcherLength = Length;
CatcherThickness = Thickness; CatcherThickness = Thickness;
R_Catcher = Pos[2]; R_Catcher = Pos[2];
Pos[2] = -DetectionVolumeThickness * 0.5 + CatcherThickness * 0.5; Pos[2] = -DetectionVolumeThickness * 0.5 + CatcherThickness * 0.5;
m_PosCatcher = Pos; m_PosCatcher = Pos;
} }
// To add DriftChambers and the MWPPAC // To add DriftChambers and the MWPPAC
/////////////////////////////////////////////////////////////////////
void Vamos::AddDetector(G4double Z, string Gas, double Pressure, void Vamos::AddDetector(G4double Z, string Gas, double Pressure,
double Temperature) { double Temperature) {
m_Z.push_back(Z); m_Z.push_back(Z);
m_Gas.push_back(Gas); m_Gas.push_back(Gas);
m_Pressure.push_back(Pressure); m_Pressure.push_back(Pressure);
m_Temperature.push_back(Temperature); m_Temperature.push_back(Temperature);
} }
/////////////////////////////////////////////////////////////////////
void Vamos::AddIC(G4double Z, double Thickness, string Gas, double Pressure, void Vamos::AddIC(G4double Z, double Thickness, string Gas, double Pressure,
double Temperature) { double Temperature) {
m_ZIC.push_back(Z); m_ZIC.push_back(Z);
m_ThicknessIC.push_back(Thickness); m_ThicknessIC.push_back(Thickness);
m_GasIC.push_back(Gas); m_GasIC.push_back(Gas);
m_PressureIC.push_back(Pressure); m_PressureIC.push_back(Pressure);
m_TemperatureIC.push_back(Temperature); m_TemperatureIC.push_back(Temperature);
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// The two entry DriftChambers // The two entry DriftChambers
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildDC1() { G4LogicalVolume* Vamos::BuildDC1() {
if (!m_DC1) { if (!m_DC1) {
G4Box* box = new G4Box("Vamos_DC1", E_DCWidth * 0.5, E_DCLength * 0.5, G4Box* box = new G4Box("Vamos_DC1", E_DCWidth * 0.5, E_DCLength * 0.5,
E_DCThickness * 0.5); E_DCThickness * 0.5);
G4Material* DetectorMaterial G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetGasFromLibrary( = MaterialManager::getInstance()->GetGasFromLibrary(
m_Gas[0], m_Pressure[0], m_Temperature[0]); m_Gas[0], m_Pressure[0], m_Temperature[0]);
m_DC1 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_DC1", 0, 0, m_DC1 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_DC1", 0, 0,
0); 0);
m_DC1->SetVisAttributes(m_VisGasC4H10); m_DC1->SetVisAttributes(m_VisGasC4H10);
m_DC1->SetSensitiveDetector(m_DCScorer); m_DC1->SetSensitiveDetector(m_DCScorer);
} }
return m_DC1; return m_DC1;
} }
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildDC2() { G4LogicalVolume* Vamos::BuildDC2() {
if (!m_DC2) { if (!m_DC2) {
G4Box* box = new G4Box("Vamos_DC2", E_DCWidth * 0.5, E_DCLength * 0.5, G4Box* box = new G4Box("Vamos_DC2", E_DCWidth * 0.5, E_DCLength * 0.5,
E_DCThickness * 0.5); E_DCThickness * 0.5);
G4Material* DetectorMaterial G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetGasFromLibrary( = MaterialManager::getInstance()->GetGasFromLibrary(
m_Gas[1], m_Pressure[1], m_Temperature[1]); m_Gas[1], m_Pressure[1], m_Temperature[1]);
m_DC2 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_DC2", 0, 0, m_DC2 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_DC2", 0, 0,
0); 0);
m_DC2->SetVisAttributes(m_VisGasC4H10); m_DC2->SetVisAttributes(m_VisGasC4H10);
m_DC2->SetSensitiveDetector(m_DCScorer); m_DC2->SetSensitiveDetector(m_DCScorer);
} }
return m_DC2; return m_DC2;
} }
// Quadruples and Dipole just to make the visualisation nice // Quadruples and Dipole just to make the visualisation nice
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildQuad1() { G4LogicalVolume* Vamos::BuildQuad1() {
if (!m_Quad1) { if (!m_Quad1) {
G4Box* box = new G4Box("Vamos_Box", Vamos_NS::MagnetWidth * 0.5, G4Box* box = new G4Box("Vamos_Box", Vamos_NS::MagnetWidth * 0.5,
Vamos_NS::MagnetLenght * 0.5, Vamos_NS::MagnetLenght * 0.5,
Vamos_NS::MagnetThickness * 0.5); Vamos_NS::MagnetThickness * 0.5);
G4Material* VamosMaterial G4Material* VamosMaterial
= MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum"); = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum");
m_Quad1 = new G4LogicalVolume(box, VamosMaterial, "logic_Quad1", 0, 0, 0); m_Quad1 = new G4LogicalVolume(box, VamosMaterial, "logic_Quad1", 0, 0, 0);
m_Quad1->SetVisAttributes(m_VisQuad); m_Quad1->SetVisAttributes(m_VisQuad);
} }
return m_Quad1; return m_Quad1;
} }
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildQuad2() { G4LogicalVolume* Vamos::BuildQuad2() {
if (!m_Quad2) { if (!m_Quad2) {
G4Box* box = new G4Box("Vamos_Quad2", Vamos_NS::MagnetWidth * 0.5, G4Box* box = new G4Box("Vamos_Quad2", Vamos_NS::MagnetWidth * 0.5,
Vamos_NS::MagnetLenght * 0.5, Vamos_NS::MagnetLenght * 0.5,
Vamos_NS::MagnetThickness * 0.5); Vamos_NS::MagnetThickness * 0.5);
G4Material* VamosMaterial G4Material* VamosMaterial
= MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum"); = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum");
m_Quad1 = new G4LogicalVolume(box, VamosMaterial, "logic_Quad1", 0, 0, 0); m_Quad1 = new G4LogicalVolume(box, VamosMaterial, "logic_Quad1", 0, 0, 0);
m_Quad1->SetVisAttributes(m_VisQuad); m_Quad1->SetVisAttributes(m_VisQuad);
} }
return m_Quad1; return m_Quad1;
} }
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildDipol() { G4LogicalVolume* Vamos::BuildDipol() {
if (!m_Dipol) { if (!m_Dipol) {
G4Box* box = new G4Box("Vamos_Dipol", Vamos_NS::MagnetWidth * 0.5, G4Box* box = new G4Box("Vamos_Dipol", Vamos_NS::MagnetWidth * 0.5,
Vamos_NS::MagnetLenght * 0.5, Vamos_NS::MagnetLenght * 0.5,
Vamos_NS::DipolThickness * 0.5); Vamos_NS::DipolThickness * 0.5);
G4Material* VamosMaterial G4Material* VamosMaterial
= MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum"); = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum");
m_Dipol = new G4LogicalVolume(box, VamosMaterial, "logic_Dipol", 0, 0, 0); m_Dipol = new G4LogicalVolume(box, VamosMaterial, "logic_Dipol", 0, 0, 0);
m_Dipol->SetVisAttributes(m_VisQuad); m_Dipol->SetVisAttributes(m_VisQuad);
} }
return m_Dipol; return m_Dipol;
} }
// Detection at the end of Vamos // Detection at the end of Vamos
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildBeamCatcher() { G4LogicalVolume* Vamos::BuildBeamCatcher() {
if (!m_BeamCatcher) { if (!m_BeamCatcher) {
G4Box* box = new G4Box("Vamos_Catcher", CatcherWidth * 0.5, G4Box* box = new G4Box("Vamos_Catcher", CatcherWidth * 0.5,
CatcherLength * 0.5, CatcherThickness * 0.5); CatcherLength * 0.5, CatcherThickness * 0.5);
G4Material* Material G4Material* Material
= MaterialManager::getInstance()->GetMaterialFromLibrary( = MaterialManager::getInstance()->GetMaterialFromLibrary(
CatcherMaterial); CatcherMaterial);
m_BeamCatcher m_BeamCatcher
= new G4LogicalVolume(box, Material, "logic_Vamos_Catcher", 0, 0, 0); = new G4LogicalVolume(box, Material, "logic_Vamos_Catcher", 0, 0, 0);
m_BeamCatcher->SetVisAttributes(m_VisCatcher); m_BeamCatcher->SetVisAttributes(m_VisCatcher);
m_BeamCatcher->SetSensitiveDetector(m_CalorimeterScorer); m_BeamCatcher->SetSensitiveDetector(m_CalorimeterScorer);
} }
return m_BeamCatcher; return m_BeamCatcher;
} }
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildTMW1() {
if (!m_TMW1) {
G4Box* box = new G4Box("Vamos_TMW1", TMW1_Width * 0.5,
TMW1_Length * 0.5, TMW1_Thickness * 0.5);
G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetGasFromLibrary(
m_Gas_TMW1, m_Pressure_TMW1, 295 * kelvin);
m_TMW1 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_TMW1",
0, 0, 0);
m_TMW1->SetVisAttributes(m_VisGasC4H10);
m_TMW1->SetSensitiveDetector(m_TMW1Scorer);
}
return m_TMW1;
}
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildTMW2() {
if (!m_TMW2) {
G4Box* box = new G4Box("Vamos_TMW2", TMW2_Width * 0.5,
TMW2_Length * 0.5, TMW2_Thickness * 0.5);
G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetGasFromLibrary(
m_Gas_TMW2, m_Pressure_TMW2, 295 * kelvin);
m_TMW2 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_TMW2",
0, 0, 0);
m_TMW2->SetVisAttributes(m_VisGasC4H10);
}
return m_TMW2;
}
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildMWPPAC() { G4LogicalVolume* Vamos::BuildMWPPAC() {
if (!m_MWPPAC) { if (!m_MWPPAC) {
G4Box* box = new G4Box("Vamos_MWPPAC", ChamberWidth * 0.5, G4Box* box = new G4Box("Vamos_MWPPAC", ChamberWidth * 0.5,
ChamberLength * 0.5, ChamberThickness * 0.5); ChamberLength * 0.5, ChamberThickness * 0.5);
G4Material* DetectorMaterial G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetGasFromLibrary( = MaterialManager::getInstance()->GetGasFromLibrary(
m_Gas[2], m_Pressure[2], m_Temperature[2]); m_Gas[0], m_Pressure[0], m_Temperature[0]);
m_MWPPAC = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_MWPPAC", m_MWPPAC = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_MWPPAC",
0, 0, 0); 0, 0, 0);
m_MWPPAC->SetVisAttributes(m_VisGasC4H10); m_MWPPAC->SetVisAttributes(m_VisGasC4H10);
} }
return m_MWPPAC; return m_MWPPAC;
} }
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildDC3() { G4LogicalVolume* Vamos::BuildDC3() {
if (!m_DC3) { if (!m_DC3) {
G4Box* box = new G4Box("Vamos_DC3", ChamberWidth * 0.5, ChamberLength * 0.5, G4Box* box = new G4Box("Vamos_DC3", ChamberWidth * 0.5, ChamberLength * 0.5,
ChamberThickness * 0.5); ChamberThickness * 0.5);
G4Material* DetectorMaterial G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetGasFromLibrary( = MaterialManager::getInstance()->GetGasFromLibrary(
m_Gas[3], m_Pressure[3], m_Temperature[3]); m_Gas[3], m_Pressure[3], m_Temperature[3]);
m_DC3 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_DC3", 0, 0, m_DC3 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_DC3", 0, 0,
0); 0);
m_DC3->SetVisAttributes(m_VisGasC4H10); m_DC3->SetVisAttributes(m_VisGasC4H10);
m_DC3->SetSensitiveDetector(m_DCScorer); m_DC3->SetSensitiveDetector(m_DCScorer);
} }
return m_DC3; return m_DC3;
} }
/////////////////////////////////////////////////////////////////////
G4LogicalVolume* Vamos::BuildDC4() { G4LogicalVolume* Vamos::BuildDC4() {
if (!m_DC4) { if (!m_DC4) {
G4Box* box = new G4Box("Vamos_DC4", ChamberWidth * 0.5, ChamberLength * 0.5, G4Box* box = new G4Box("Vamos_DC4", ChamberWidth * 0.5, ChamberLength * 0.5,
ChamberThickness * 0.5); ChamberThickness * 0.5);
G4Material* DetectorMaterial G4Material* DetectorMaterial
= MaterialManager::getInstance()->GetGasFromLibrary( = MaterialManager::getInstance()->GetGasFromLibrary(
m_Gas[4], m_Pressure[4], m_Temperature[4]); m_Gas[4], m_Pressure[4], m_Temperature[4]);
m_DC4 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_DC4", 0, 0, m_DC4 = new G4LogicalVolume(box, DetectorMaterial, "logic_Vamos_DC4", 0, 0,
0); 0);
m_DC4->SetVisAttributes(m_VisGasC4H10); m_DC4->SetVisAttributes(m_VisGasC4H10);
m_DC4->SetSensitiveDetector(m_DCScorer); m_DC4->SetSensitiveDetector(m_DCScorer);
} }
return m_DC4; return m_DC4;
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// In anticipation of use a macro // In anticipation of use a macro
void Vamos::ClearGeometry(){ void Vamos::ClearGeometry(){
m_Z.clear(); m_Z.clear();
m_Gas.clear(); m_Gas.clear();
m_Pressure.clear(); m_Pressure.clear();
m_Temperature.clear(); m_Temperature.clear();
m_ZIC.clear(); m_ZIC.clear();
m_ThicknessIC.clear(); m_ThicknessIC.clear();
m_PressureIC.clear(); m_PressureIC.clear();
m_TemperatureIC.clear(); m_TemperatureIC.clear();
m_GasIC.clear(); m_GasIC.clear();
} }
...@@ -338,202 +401,237 @@ void Vamos::ClearGeometry(){ ...@@ -338,202 +401,237 @@ void Vamos::ClearGeometry(){
// Read stream at Configfile to pick-up parameters of detector (Position,...) // Read stream at Configfile to pick-up parameters of detector (Position,...)
// Called in DetecorConstruction::ReadDetectorConfiguration Method // Called in DetecorConstruction::ReadDetectorConfiguration Method
/////////////////////////////////////////////////////////////////////
void Vamos::ReadConfiguration(NPL::InputParser parser) { void Vamos::ReadConfiguration(NPL::InputParser parser) {
vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("Vamos"); vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("Vamos");
if (NPOptionManager::getInstance()->GetVerboseLevel()) if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << "//// " << blocks.size() << " detectors found " << endl; cout << "//// " << blocks.size() << " detectors found " << endl;
vector<string> TokenBeamCatcher vector<string> TokenBeamCatcher
= {"Material", "Width", "Length", "Thickness", "Pos"}; = {"Material", "Width", "Length", "Thickness", "Pos"};
vector<string> sphe = {"R", "Theta"}; vector<string> sphe = {"R", "Theta"};
vector<string> TokenMWPPAC = {"Z", "Gas", "Pressure", "Temperature"}; vector<string> TokenMWPPAC = {"Z", "Gas", "Pressure", "Temperature"};
vector<string> TokenDC = {"Z", "Gas", "Pressure", "Temperature"}; vector<string> TokenTMW = {"Z", "Gas", "Pressure"};
vector<string> TokenIC = {"Z", "Thickness", "Gas", "Pressure", "Temperature"}; vector<string> TokenDC = {"Z", "Gas", "Pressure", "Temperature"};
vector<string> TokenIC = {"Z", "Thickness", "Gas", "Pressure", "Temperature"};
for (unsigned int i = 0; i < blocks.size(); i++) {
if (blocks[i]->HasTokenList(sphe)) { for (unsigned int i = 0; i < blocks.size(); i++) {
if (NPOptionManager::getInstance()->GetVerboseLevel()) if (blocks[i]->HasTokenList(sphe)) {
cout << endl << "//// Vamos " << i + 1 << endl; if (NPOptionManager::getInstance()->GetVerboseLevel())
G4double R = blocks[i]->GetDouble("R", "mm"); cout << endl << "//// Vamos " << i + 1 << endl;
G4double Theta = blocks[i]->GetDouble("Theta", "deg"); G4double R = blocks[i]->GetDouble("R", "mm");
AddVamos(R, Theta); G4double Theta = blocks[i]->GetDouble("Theta", "deg");
} AddVamos(R, Theta);
}
else if (blocks[i]->GetMainValue() == "BeamCatcher"
&& blocks[i]->HasTokenList(TokenBeamCatcher)) {
if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// BeamCatcher" << i + 1 << endl;
string Material = blocks[i]->GetString("Material");
G4double Width = blocks[i]->GetDouble("Width", "mm");
G4double Length = blocks[i]->GetDouble("Length", "mm");
G4double Thickness = blocks[i]->GetDouble("Thickness", "mm");
G4ThreeVector Pos
= NPS::ConvertVector(blocks[i]->GetTVector3("Pos", "mm"));
AddBeamCatcher(Material, Width, Length, Thickness, Pos);
}
else if (blocks[i]->GetMainValue() == "MWPPAC"
&& blocks[i]->HasTokenList(TokenMWPPAC)) {
if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// MWPPAC" << i + 1 << endl;
G4double Z = blocks[i]->GetDouble("Z", "mm");
string Gas = blocks[i]->GetString("Gas");
G4double Pressure = blocks[i]->GetDouble("Pressure", "bar");
G4double Temperature = blocks[i]->GetDouble("Temperature", "kelvin");
AddDetector(Z, Gas, Pressure, Temperature);
}
else if (blocks[i]->GetMainValue() == "DC"
&& blocks[i]->HasTokenList(TokenDC)) {
if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// DC" << i + 1 << endl;
G4double Z = blocks[i]->GetDouble("Z", "mm");
string Gas = blocks[i]->GetString("Gas");
G4double Pressure = blocks[i]->GetDouble("Pressure", "bar");
G4double Temperature = blocks[i]->GetDouble("Temperature", "kelvin");
AddDetector(Z, Gas, Pressure, Temperature);
}
else if (blocks[i]->GetMainValue() == "IC"
&& blocks[i]->HasTokenList(TokenIC)) {
if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// IC" << ICcounter+1 << endl;
G4double Z = blocks[i]->GetDouble("Z", "mm");
G4double Thickness = blocks[i]->GetDouble("Thickness", "mm");
string Gas = blocks[i]->GetString("Gas");
G4double Pressure = blocks[i]->GetDouble("Pressure", "bar");
G4double Temperature = blocks[i]->GetDouble("Temperature", "kelvin");
AddIC(Z, Thickness, Gas, Pressure, Temperature);
ICcounter++;
}
else {
cout << "ERROR: check your input file formatting " << endl;
exit(1);
}
else if (blocks[i]->GetMainValue() == "BeamCatcher"
&& blocks[i]->HasTokenList(TokenBeamCatcher)) {
if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// BeamCatcher" << i + 1 << endl;
string Material = blocks[i]->GetString("Material");
G4double Width = blocks[i]->GetDouble("Width", "mm");
G4double Length = blocks[i]->GetDouble("Length", "mm");
G4double Thickness = blocks[i]->GetDouble("Thickness", "mm");
G4ThreeVector Pos
= NPS::ConvertVector(blocks[i]->GetTVector3("Pos", "mm"));
AddBeamCatcher(Material, Width, Length, Thickness, Pos);
} }
}
// Construct detector and inialise sensitive part. else if (blocks[i]->GetMainValue() == "MWPPAC"
// Called After DetecorConstruction::AddDetector Method && blocks[i]->HasTokenList(TokenMWPPAC)) {
void Vamos::ConstructDetector(G4LogicalVolume* world) { if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// MWPPAC" << i + 1 << endl;
G4double Z = blocks[i]->GetDouble("Z", "mm");
string Gas = blocks[i]->GetString("Gas");
G4double Pressure = blocks[i]->GetDouble("Pressure", "bar");
G4double Temperature = blocks[i]->GetDouble("Temperature", "kelvin");
AddDetector(Z, Gas, Pressure, Temperature);
}
// Mother Volume of Vamos else if (blocks[i]->GetMainValue() == "TMW1"
G4double R = m_R + VamosVolumeThickness * 0.5; && blocks[i]->HasTokenList(TokenTMW)) {
if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// TMW1" << endl;
m_Z_TMW1 = blocks[i]->GetDouble("Z", "mm");
m_Gas_TMW1 = blocks[i]->GetString("Gas");
m_Pressure_TMW1 = blocks[i]->GetDouble("Pressure", "bar");
//AddDetector(Z, Gas, Pressure, Temperature);
}
G4double X = R * sin(m_Theta) * cos(Phi); else if (blocks[i]->GetMainValue() == "TMW2"
G4double Y = R * sin(m_Theta) * sin(Phi); && blocks[i]->HasTokenList(TokenTMW)) {
G4double Z = R * cos(m_Theta); if (NPOptionManager::getInstance()->GetVerboseLevel())
G4ThreeVector Det_pos = G4ThreeVector(X, Y, Z); cout << endl << "//// TMW2" << endl;
m_Z_TMW2 = blocks[i]->GetDouble("Z", "mm");
m_Gas_TMW2 = blocks[i]->GetString("Gas");
m_Pressure_TMW2 = blocks[i]->GetDouble("Pressure", "bar");
//AddDetector(Z, Gas, Pressure, Temperature);
}
G4RotationMatrix* Rot1 = new G4RotationMatrix();
Rot1->rotateY(m_Theta);
G4Box* MotherSolid
= new G4Box("MotherVolume", VamosVolumeWidth * 0.5,
VamosVolumeLength * 0.5, VamosVolumeThickness * 0.5);
G4Material* VolumeMaterial else if (blocks[i]->GetMainValue() == "DC"
= MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum"); && blocks[i]->HasTokenList(TokenDC)) {
G4LogicalVolume* MotherVolume = new G4LogicalVolume( if (NPOptionManager::getInstance()->GetVerboseLevel())
MotherSolid, VolumeMaterial, "MotherVolume", 0, 0, 0); cout << endl << "//// DC" << i + 1 << endl;
G4double Z = blocks[i]->GetDouble("Z", "mm");
string Gas = blocks[i]->GetString("Gas");
G4double Pressure = blocks[i]->GetDouble("Pressure", "bar");
G4double Temperature = blocks[i]->GetDouble("Temperature", "kelvin");
AddDetector(Z, Gas, Pressure, Temperature);
}
new G4PVPlacement(G4Transform3D(*Rot1, Det_pos), MotherVolume, "MotherVolume", else if (blocks[i]->GetMainValue() == "IC"
world, false, 0); && blocks[i]->HasTokenList(TokenIC)) {
MotherVolume->SetVisAttributes(m_VisVolumeVamos); if (NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// IC" << ICcounter+1 << endl;
G4double Z = blocks[i]->GetDouble("Z", "mm");
G4double Thickness = blocks[i]->GetDouble("Thickness", "mm");
string Gas = blocks[i]->GetString("Gas");
G4double Pressure = blocks[i]->GetDouble("Pressure", "bar");
G4double Temperature = blocks[i]->GetDouble("Temperature", "kelvin");
AddIC(Z, Thickness, Gas, Pressure, Temperature);
ICcounter++;
}
// SubVolume of Detection at the end of Vamos else {
// The position of the subvolume is defined by the position of the BeamCatcher cout << "ERROR: check your input file formatting " << endl;
G4double R2 exit(1);
= R_Catcher - CatcherThickness * 0.5 + DetectionVolumeThickness * 0.5; }
G4double X2 = R2 * sin(Det_Theta) * cos(0); }
G4double Z2 = R2 * cos(Det_Theta); }
G4ThreeVector Det_pos2 = G4ThreeVector(X2, 0, Z2);
G4RotationMatrix* Rot2 = new G4RotationMatrix(); // Construct detector and inialise sensitive part.
Rot2->rotateY(Det_Theta); // Called After DetecorConstruction::AddDetector Method
void Vamos::ConstructDetector(G4LogicalVolume* world) {
G4Box* MotherDetectorSolid // Mother Volume of Vamos
= new G4Box("MotherDetector", DetectionVolumeWidth * 0.5, G4double R = m_R + VamosVolumeThickness * 0.5;
DetectionVolumeLength * 0.5, DetectionVolumeThickness * 0.5);
G4LogicalVolume* MotherDetector = new G4LogicalVolume( G4double X = R * sin(m_Theta) * cos(Phi);
MotherDetectorSolid, VolumeMaterial, "MotherDetector", 0, 0, 0); G4double Y = R * sin(m_Theta) * sin(Phi);
G4double Z = R * cos(m_Theta);
G4ThreeVector Det_pos = G4ThreeVector(X, Y, Z);
new G4PVPlacement(G4Transform3D(*Rot2, Det_pos2), MotherDetector, G4RotationMatrix* Rot1 = new G4RotationMatrix();
"MotherDetector", MotherVolume, false, 0); Rot1->rotateY(m_Theta);
MotherDetector->SetVisAttributes(m_VisVolumeVamos);
G4Box* MotherSolid
= new G4Box("MotherVolume", VamosVolumeWidth * 0.5,
VamosVolumeLength * 0.5, VamosVolumeThickness * 0.5);
// Position the entry DCs and the magnets in the MotherVolume G4Material* VolumeMaterial
new G4PVPlacement(0, G4ThreeVector(0, 0, -VamosVolumeThickness * 0.5 + m_Z[0]), = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum");
BuildDC1(), "Entrance_DC1", MotherVolume, false, 1); G4LogicalVolume* MotherVolume = new G4LogicalVolume(
MotherSolid, VolumeMaterial, "MotherVolume", 0, 0, 0);
new G4PVPlacement(0, G4ThreeVector(0, 0, -VamosVolumeThickness * 0.5 + m_Z[1]), new G4PVPlacement(G4Transform3D(*Rot1, Det_pos), MotherVolume, "MotherVolume",
BuildDC2(), "Entrance_DC2", MotherVolume, false, 2); world, false, 0);
MotherVolume->SetVisAttributes(m_VisVolumeVamos);
new G4PVPlacement( // SubVolume of Detection at the end of Vamos
0, // The position of the subvolume is defined by the position of the BeamCatcher
G4ThreeVector(0, 0, (-VamosVolumeThickness + MagnetThickness) * 0.5 + 400), G4double R2
BuildQuad1(), "Vamos", MotherVolume, false, 0); = R_Catcher - CatcherThickness * 0.5 + DetectionVolumeThickness * 0.5;
new G4PVPlacement( G4double X2 = R2 * sin(Det_Theta) * cos(0);
0, G4double Z2 = R2 * cos(Det_Theta);
G4ThreeVector(0, 0, G4ThreeVector Det_pos2 = G4ThreeVector(X2, 0, Z2);
(-VamosVolumeThickness + MagnetThickness) * 0.5 + 700 * mm),
BuildQuad2(), "Vamos", MotherVolume, false, 0);
new G4PVPlacement( G4RotationMatrix* Rot2 = new G4RotationMatrix();
0, Rot2->rotateY(Det_Theta);
G4ThreeVector(0, 0,
(-VamosVolumeThickness + MagnetThickness) * 0.5 + 1500 * mm),
BuildDipol(), "Vamos", MotherVolume, false, 0);
// Position the system of detection at the end of Vamos in the sub Volume G4Box* MotherDetectorSolid
new G4PVPlacement(0, m_PosCatcher, BuildBeamCatcher(), "BeamCatcher", = new G4Box("MotherDetector", DetectionVolumeWidth * 0.5,
MotherDetector, false, 3); DetectionVolumeLength * 0.5, DetectionVolumeThickness * 0.5);
new G4PVPlacement( G4LogicalVolume* MotherDetector = new G4LogicalVolume(
0, MotherDetectorSolid, VolumeMaterial, "MotherDetector", 0, 0, 0);
G4ThreeVector(0, 0,
-DetectionVolumeThickness * 0.5
+ (m_Z[2] - R_Catcher + CatcherThickness * 0.5)),
BuildMWPPAC(), "MWPPAC", MotherDetector, false, 4);
new G4PVPlacement( new G4PVPlacement(G4Transform3D(*Rot2, Det_pos2), MotherDetector,
0, "MotherDetector", MotherVolume, false, 0);
G4ThreeVector(0, 0, MotherDetector->SetVisAttributes(m_VisVolumeVamos);
-DetectionVolumeThickness * 0.5
+ (m_Z[3] - R_Catcher + CatcherThickness * 0.5)),
BuildDC3(), "DC", MotherDetector, false, 5); // Position the entry DCs and the magnets in the MotherVolume
/*new G4PVPlacement(0, G4ThreeVector(0, 0, -VamosVolumeThickness * 0.5 + m_Z[0]),
BuildDC1(), "Entrance_DC1", MotherVolume, false, 1);
new G4PVPlacement(0, G4ThreeVector(0, 0, -VamosVolumeThickness * 0.5 + m_Z[1]),
BuildDC2(), "Entrance_DC2", MotherVolume, false, 2);*/
new G4PVPlacement(
0,
G4ThreeVector(0, 0, (-VamosVolumeThickness + MagnetThickness) * 0.5 + 400),
BuildQuad1(), "Vamos", MotherVolume, false, 0);
new G4PVPlacement(
0,
G4ThreeVector(0, 0,
(-VamosVolumeThickness + MagnetThickness) * 0.5 + 700 * mm),
BuildQuad2(), "Vamos", MotherVolume, false, 0);
new G4PVPlacement(
0,
G4ThreeVector(0, 0,
(-VamosVolumeThickness + MagnetThickness) * 0.5 + 1500 * mm),
BuildDipol(), "Vamos", MotherVolume, false, 0);
// Position the system of detection at the end of Vamos in the sub Volume
/*new G4PVPlacement(0, m_PosCatcher, BuildBeamCatcher(), "BeamCatcher",
MotherDetector, false, 3);*/
new G4PVPlacement(
0,
G4ThreeVector(0, 0, -VamosVolumeThickness * 0.5 + TMW1_Thickness * 0.5),
BuildTMW1(), "TMW1", MotherVolume, false, 0);
new G4PVPlacement(
0,
G4ThreeVector(0, 0, -VamosVolumeThickness * 0.5 + TMW2_Thickness * 0.5 + m_Z_TMW2),
BuildTMW2(), "TMW2", MotherVolume, false, 0);
/* new G4PVPlacement(
0,
G4ThreeVector(0, 0,
-DetectionVolumeThickness * 0.5
+ (m_Z[0] - R_Catcher + CatcherThickness * 0.5)),
BuildMWPPAC(), "MWPPAC", MotherDetector, false, 1);
*/
/* new G4PVPlacement(
0,
G4ThreeVector(0, 0,
-DetectionVolumeThickness * 0.5
+ (m_Z[3] - R_Catcher + CatcherThickness * 0.5)),
BuildDC3(), "DC", MotherDetector, false, 5);
new G4PVPlacement(
0,
G4ThreeVector(0, 0,
-DetectionVolumeThickness * 0.5
+ (m_Z[4] - R_Catcher + CatcherThickness * 0.5)),
BuildDC4(), "DC", MotherDetector, false, 6);
// Construct and position the Ionisations Chambers
for (int i = 0; i < ICcounter; i++) {
G4Box* box = new G4Box("Vamos_IC", ChamberWidth * 0.5, ChamberLength * 0.5,
m_ThicknessIC[i] * 0.5);
G4Material* GasIC = MaterialManager::getInstance()->GetGasFromLibrary(
m_GasIC[i], m_PressureIC[i], m_TemperatureIC[i]);
G4LogicalVolume* IC
= new G4LogicalVolume(box, GasIC, "logic_Vamos_IC", 0, 0, 0);
IC->SetVisAttributes(m_VisGasCF4);
IC->SetSensitiveDetector(m_CalorimeterScorer);
new G4PVPlacement( new G4PVPlacement(
0, 0,
G4ThreeVector(0, 0, G4ThreeVector(0, 0,
-DetectionVolumeThickness * 0.5 -DetectionVolumeThickness * 0.5
+ (m_ZIC[i] - R_Catcher + CatcherThickness * 0.5)), + (m_Z[4] - R_Catcher + CatcherThickness * 0.5)),
IC, "IC", MotherDetector, false, i + 7); BuildDC4(), "DC", MotherDetector, false, 6);*/
}
// Construct and position the Ionisations Chambers
/*for (int i = 0; i < ICcounter; i++) {
G4Box* box = new G4Box("Vamos_IC", ChamberWidth * 0.5, ChamberLength * 0.5,
m_ThicknessIC[i] * 0.5);
G4Material* GasIC = MaterialManager::getInstance()->GetGasFromLibrary(
m_GasIC[i], m_PressureIC[i], m_TemperatureIC[i]);
G4LogicalVolume* IC
= new G4LogicalVolume(box, GasIC, "logic_Vamos_IC", 0, 0, 0);
IC->SetVisAttributes(m_VisGasCF4);
IC->SetSensitiveDetector(m_CalorimeterScorer);
new G4PVPlacement(
0,
G4ThreeVector(0, 0,
-DetectionVolumeThickness * 0.5
+ (m_ZIC[i] - R_Catcher + CatcherThickness * 0.5)),
IC, "IC", MotherDetector, false, i + 7);
}*/
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...@@ -541,12 +639,12 @@ void Vamos::ConstructDetector(G4LogicalVolume* world) { ...@@ -541,12 +639,12 @@ void Vamos::ConstructDetector(G4LogicalVolume* world) {
// Called After DetecorConstruction::AddDetector Method // Called After DetecorConstruction::AddDetector Method
void Vamos::InitializeRootOutput() { void Vamos::InitializeRootOutput() {
RootOutput* pAnalysis = RootOutput::getInstance(); RootOutput* pAnalysis = RootOutput::getInstance();
TTree* pTree = pAnalysis->GetTree(); TTree* pTree = pAnalysis->GetTree();
if (!pTree->FindBranch("Vamos")) { if (!pTree->FindBranch("Vamos")) {
pTree->Branch("Vamos", "TVamosData", &m_Event); pTree->Branch("Vamos", "TVamosData", &m_Event);
} }
pTree->SetBranchAddress("Vamos", &m_Event); pTree->SetBranchAddress("Vamos", &m_Event);
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...@@ -554,67 +652,71 @@ void Vamos::InitializeRootOutput() { ...@@ -554,67 +652,71 @@ void Vamos::InitializeRootOutput() {
// Called at in the EventAction::EndOfEventAvtion // Called at in the EventAction::EndOfEventAvtion
void Vamos::ReadSensitive(const G4Event*) { void Vamos::ReadSensitive(const G4Event*) {
m_Event->Clear(); m_Event->Clear();
/////////// ///////////
// Calorimeter scorer // Calorimeter scorer
CalorimeterScorers::PS_Calorimeter* Scorer CalorimeterScorers::PS_Calorimeter* Scorer
= (CalorimeterScorers::PS_Calorimeter*)m_CalorimeterScorer->GetPrimitive( = (CalorimeterScorers::PS_Calorimeter*)m_CalorimeterScorer->GetPrimitive(0);
0); unsigned int size = Scorer->GetMult();
unsigned int size = Scorer->GetMult(); for (unsigned int i = 0; i < size; i++) {
for (unsigned int i = 0; i < size; i++) { vector<unsigned int> level = Scorer->GetLevel(i);
vector<unsigned int> level = Scorer->GetLevel(i); G4double Energy
G4double Energy = RandGauss::shoot(Scorer->GetEnergy(i), Vamos_NS::ResoEnergy);
= RandGauss::shoot(Scorer->GetEnergy(i), Vamos_NS::ResoEnergy); if (Energy > Vamos_NS::EnergyThreshold) {
if (Energy > Vamos_NS::EnergyThreshold) { G4double Time = RandGauss::shoot(Scorer->GetTime(i), Vamos_NS::ResoTime);
G4double Time = RandGauss::shoot(Scorer->GetTime(i), Vamos_NS::ResoTime); int DetectorNbr = level[0];
int DetectorNbr = level[0]; m_Event->SetEnergy(DetectorNbr, Energy);
m_Event->SetEnergy(DetectorNbr, Energy); m_Event->SetTime(DetectorNbr, Time);
m_Event->SetTime(DetectorNbr, Time);
}
}
///////////
// DriftChamber scorer
DriftChamberScorers::PS_DriftChamber* Scorer2
= (DriftChamberScorers::PS_DriftChamber*)m_DCScorer->GetPrimitive(0);
unsigned int size2 = Scorer2->GetMult();
for (unsigned int i = 0; i < size2; i++) {
vector<unsigned int> level = Scorer2->GetLevel(i);
G4double DriftTime
= RandGauss::shoot(Scorer2->GetDriftTime(i)/Scorer2->GetCounter(i), Vamos_NS::ResoDriftTime);
G4double X
= RandGauss::shoot(Scorer2->GetX(i)/Scorer2->GetCounter(i), ResoPosX);
int DetectorNbr = level[0];
m_Event->SetDrift(DetectorNbr, DriftTime, X);
} }
}
///////////
// DriftChamber scorer
DriftChamberScorers::PS_DriftChamber* Scorer2
= (DriftChamberScorers::PS_DriftChamber*)m_DCScorer->GetPrimitive(0);
unsigned int size2 = Scorer2->GetMult();
for (unsigned int i = 0; i < size2; i++) {
vector<unsigned int> level = Scorer2->GetLevel(i);
G4double DriftTime
= RandGauss::shoot(Scorer2->GetDriftTime(i)/Scorer2->GetCounter(i), Vamos_NS::ResoDriftTime);
G4double X
= RandGauss::shoot(Scorer2->GetX(i)/Scorer2->GetCounter(i), ResoPosX);
int DetectorNbr = level[0];
m_Event->SetDrift(DetectorNbr, DriftTime, X);
}
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
void Vamos::InitializeScorers() { void Vamos::InitializeScorers() {
// This check is necessary in case the geometry is reloaded // This check is necessary in case the geometry is reloaded
bool already_exist = false; bool already_exist = false;
m_DCScorer = CheckScorer("DCScorer", already_exist); m_DCScorer = CheckScorer("DCScorer", already_exist);
m_CalorimeterScorer = CheckScorer("VamosScorer", already_exist); m_CalorimeterScorer = CheckScorer("VamosScorer", already_exist);
if (already_exist) m_TMW1Scorer = CheckScorer("TMW1Scorer", already_exist);
return; if (already_exist)
return;
// Otherwise the scorer is initialised
vector<int> level; // Otherwise the scorer is initialised
level.push_back(0); vector<int> level;
level.push_back(0);
G4VPrimitiveScorer* Calorimeter
= new CalorimeterScorers::PS_Calorimeter("Calorimeter", level, 0); G4VPrimitiveScorer* Calorimeter
m_CalorimeterScorer->RegisterPrimitive(Calorimeter); = new CalorimeterScorers::PS_Calorimeter("Calorimeter", level, 0);
m_CalorimeterScorer->RegisterPrimitive(Calorimeter);
G4VPrimitiveScorer* Drift = new DriftChamberScorers::PS_DriftChamber(
"Drift", level, DriftDir, DriftSpeed, 0); G4VPrimitiveScorer* Drift = new DriftChamberScorers::PS_DriftChamber(
m_DCScorer->RegisterPrimitive(Drift); "Drift", level, DriftDir, DriftSpeed, 0);
m_DCScorer->RegisterPrimitive(Drift);
// and register it to the multifunctionnal detector
G4SDManager::GetSDMpointer()->AddNewDetector(m_DCScorer); G4VPrimitiveScorer* InteractionTMW1 = new InteractionScorers::PS_Interactions("InteractionTMW1",ms_InterCoord,0);
G4SDManager::GetSDMpointer()->AddNewDetector(m_CalorimeterScorer); m_TMW1Scorer->RegisterPrimitive(InteractionTMW1);
// and register it to the multifunctionnal detector
G4SDManager::GetSDMpointer()->AddNewDetector(m_DCScorer);
G4SDManager::GetSDMpointer()->AddNewDetector(m_CalorimeterScorer);
G4SDManager::GetSDMpointer()->AddNewDetector(m_TMW1Scorer);
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...@@ -628,13 +730,13 @@ NPS::VDetector* Vamos::Construct() { return (NPS::VDetector*)new Vamos(); } ...@@ -628,13 +730,13 @@ NPS::VDetector* Vamos::Construct() { return (NPS::VDetector*)new Vamos(); }
// Registering the construct method to the factory // // Registering the construct method to the factory //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
extern "C" { extern "C" {
class proxy_nps_Vamos { class proxy_nps_Vamos {
public: public:
proxy_nps_Vamos() { proxy_nps_Vamos() {
NPS::DetectorFactory::getInstance()->AddToken("Vamos", "Vamos"); NPS::DetectorFactory::getInstance()->AddToken("Vamos", "Vamos");
NPS::DetectorFactory::getInstance()->AddDetector("Vamos", Vamos::Construct); NPS::DetectorFactory::getInstance()->AddDetector("Vamos", Vamos::Construct);
} }
}; };
proxy_nps_Vamos p_nps_Vamos; proxy_nps_Vamos p_nps_Vamos;
} }
...@@ -39,134 +39,147 @@ using namespace std; ...@@ -39,134 +39,147 @@ using namespace std;
#include "NPInputParser.h" #include "NPInputParser.h"
class Vamos : public NPS::VDetector{ class Vamos : public NPS::VDetector{
////////////////////////////////////////////////////
/////// Default Constructor and Destructor /////////
////////////////////////////////////////////////////
public:
Vamos() ;
virtual ~Vamos() ;
////////////////////////////////////////////////////
/////// Specific Function of this Class ///////////
////////////////////////////////////////////////////
public:
void AddVamos(G4double R,double Theta);
void AddBeamCatcher(string Material, G4double Width, double Length, double Thickness, G4ThreeVector Pos);
void AddDetector(G4double Z, string Gas, double Pressure, double Temperature);
void AddIC(G4double Z, double Thickness, string Gas, double Pressure, double Temperature);
G4LogicalVolume* BuildDC1();
G4LogicalVolume* BuildDC2();
G4LogicalVolume* BuildQuad1();
G4LogicalVolume* BuildQuad2();
G4LogicalVolume* BuildDipol();
G4LogicalVolume* BuildBeamCatcher();
G4LogicalVolume* BuildMWPPAC();
G4LogicalVolume* BuildDC3();
G4LogicalVolume* BuildDC4();
G4LogicalVolume* BuildIC();
G4LogicalVolume* BuildTMW1();
G4LogicalVolume* BuildTMW2();
private:
G4LogicalVolume* m_DC1;
G4LogicalVolume* m_DC2;
G4LogicalVolume* m_Quad1;
G4LogicalVolume* m_Quad2;
G4LogicalVolume* m_Dipol;
G4LogicalVolume* m_BeamCatcher;
G4LogicalVolume* m_MWPPAC;
G4LogicalVolume* m_DC3;
G4LogicalVolume* m_DC4;
G4LogicalVolume* m_IC;
G4LogicalVolume* m_TMW1;
G4LogicalVolume* m_TMW2;
G4double ICcounter;
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
/////// Default Constructor and Destructor ///////// ////// Inherite from NPS::VDetector class /////////
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
public: public:
Vamos() ; // Read stream at Configfile to pick-up parameters of detector (Position,...)
virtual ~Vamos() ;
void ClearGeometry();
// Called in DetecorConstruction::ReadDetextorConfiguration Method
void ReadConfiguration(NPL::InputParser) ;
//////////////////////////////////////////////////// // Construct detector and inialise sensitive part.
/////// Specific Function of this Class /////////// // Called After DetecorConstruction::AddDetector Method
//////////////////////////////////////////////////// void ConstructDetector(G4LogicalVolume* world) ;
public:
void AddVamos(G4double R,double Theta); // Add Detector branch to the EventTree.
void AddBeamCatcher(string Material, G4double Width, double Length, double Thickness, G4ThreeVector Pos); // Called After DetecorConstruction::AddDetector Method
void AddDetector(G4double Z, string Gas, double Pressure, double Temperature); void InitializeRootOutput() ;
void AddIC(G4double Z, double Thickness, string Gas, double Pressure, double Temperature);
G4LogicalVolume* BuildDC1(); // Read sensitive part and fill the Root tree.
G4LogicalVolume* BuildDC2(); // Called at in the EventAction::EndOfEventAvtion
void ReadSensitive(const G4Event* event) ;
G4LogicalVolume* BuildQuad1(); public:
G4LogicalVolume* BuildQuad2(); // Scorer
G4LogicalVolume* BuildDipol(); // Initialize all Scorer used by Vamos
void InitializeScorers() ;
G4LogicalVolume* BuildBeamCatcher();
G4LogicalVolume* BuildMWPPAC();
G4LogicalVolume* BuildDC3();
G4LogicalVolume* BuildDC4();
G4LogicalVolume* BuildIC();
private:
G4LogicalVolume* m_DC1;
G4LogicalVolume* m_DC2;
G4LogicalVolume* m_Quad1;
G4LogicalVolume* m_Quad2;
G4LogicalVolume* m_Dipol;
G4LogicalVolume* m_BeamCatcher;
G4LogicalVolume* m_MWPPAC;
G4LogicalVolume* m_DC3;
G4LogicalVolume* m_DC4;
G4LogicalVolume* m_IC;
G4double ICcounter;
////////////////////////////////////////////////////
////// Inherite from NPS::VDetector class /////////
////////////////////////////////////////////////////
public:
// Read stream at Configfile to pick-up parameters of detector (Position,...)
void ClearGeometry();
// Called in DetecorConstruction::ReadDetextorConfiguration Method
void ReadConfiguration(NPL::InputParser) ;
// Construct detector and inialise sensitive part.
// Called After DetecorConstruction::AddDetector Method
void ConstructDetector(G4LogicalVolume* world) ;
// Add Detector branch to the EventTree.
// Called After DetecorConstruction::AddDetector Method
void InitializeRootOutput() ;
// Read sensitive part and fill the Root tree.
// Called at in the EventAction::EndOfEventAvtion
void ReadSensitive(const G4Event* event) ;
public:
// Scorer
// Initialize all Scorer used by Vamos
void InitializeScorers() ;
// Associated Scorer
G4MultiFunctionalDetector* m_CalorimeterScorer ;
G4MultiFunctionalDetector* m_DCScorer ;
////////////////////////////////////////////////////
///////////Event class to store Data////////////////
////////////////////////////////////////////////////
private:
TVamosData* m_Event ;
////////////////////////////////////////////////////
///////////////Private intern Data//////////////////
////////////////////////////////////////////////////
private:
// Geometry
G4double R_Catcher = 0;
G4double CatcherWidth = 0;
G4double CatcherLength = 0;
G4double CatcherThickness = 0;
G4double m_R = 0; // distance Target- Entrance of the Mother Volume
G4double m_Theta = 0;
// Detector Coordinate
string CatcherMaterial;
G4ThreeVector m_PosCatcher;
vector<G4double> m_Z ;
vector<string> m_Gas;
vector<G4double> m_Pressure;
vector<G4double> m_Temperature;
vector<G4double> m_ZIC; // Associated Scorer
vector<G4double> m_ThicknessIC; G4MultiFunctionalDetector* m_CalorimeterScorer ;
vector<G4double> m_PressureIC; G4MultiFunctionalDetector* m_DCScorer ;
vector<G4double> m_TemperatureIC; G4MultiFunctionalDetector* m_TMW1Scorer ;
vector<string> m_GasIC;
// Shape type ////////////////////////////////////////////////////
///////////Event class to store Data////////////////
////////////////////////////////////////////////////
private:
TVamosData* m_Event ;
// Visualisation Attribute ////////////////////////////////////////////////////
G4VisAttributes* m_VisQuad; ///////////////Private intern Data//////////////////
G4VisAttributes* m_VisDC; ////////////////////////////////////////////////////
G4VisAttributes* m_VisVolumeVamos;
G4VisAttributes* m_VisCatcher;
G4VisAttributes* m_VisGasC4H10;
G4VisAttributes* m_VisGasCF4;
public: private:
static NPS::VDetector* Construct();
// Geometry
G4double R_Catcher = 0;
G4double CatcherWidth = 0;
G4double CatcherLength = 0;
G4double CatcherThickness = 0;
G4double m_R = 0; // distance Target- Entrance of the Mother Volume
G4double m_Theta = 0;
// Detector Coordinate
string CatcherMaterial;
G4ThreeVector m_PosCatcher;
vector<G4double> m_Z ;
vector<string> m_Gas;
vector<G4double> m_Pressure;
vector<G4double> m_Temperature;
vector<G4double> m_ZIC;
vector<G4double> m_ThicknessIC;
vector<G4double> m_PressureIC;
vector<G4double> m_TemperatureIC;
vector<string> m_GasIC;
// TMW1-2
double m_Z_TMW1;
double m_Z_TMW2;
string m_Gas_TMW1;
string m_Gas_TMW2;
double m_Pressure_TMW1;
double m_Pressure_TMW2;
// Shape type
// Visualisation Attribute
G4VisAttributes* m_VisQuad;
G4VisAttributes* m_VisDC;
G4VisAttributes* m_VisVolumeVamos;
G4VisAttributes* m_VisCatcher;
G4VisAttributes* m_VisGasC4H10;
G4VisAttributes* m_VisGasCF4;
public:
static NPS::VDetector* Construct();
}; };
#endif #endif
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% An Isotropic Source to be used as EventGenerator %%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Energy are given in MeV , Position in mm %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GEFReader
GEFversion= 2023.33
InputDataFile= /home/sofia/Physics/Codes/GEF_2024.3.3/out/240Pu_8MeV.lmd
x0= 0
y0= 0
z0= 0 mm
TwoBodyReaction= 238U(12C,10Be)240Pu@1428
FissioningSystem= 240Pu
SigmaX= 0 mm
SigmaY= 0 mm
Particle= fragments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Supported particle type: proton, neutron, gamma, fragments.
% If you want to see all particles of the file, you may give no argument.
% KineticEnergy_FS gives additional kinetic energy along Z and boosts fragments
% and evaporated particles accordingly. To be refined to various angles.
%%%%%%%%%%%%%%%%%%%%
Target
THICKNESS= 0.44 micrometer
RADIUS= 5 mm
MATERIAL= C
ANGLE= 0 deg
X= 0 mm
Y= 0 mm
Z= 0 mm
%%%%%%%%%%%%%%%%%%%%
Vamos
R= 162.7 mm
Theta= 20 deg
Vamos TMW1
Z = 0 mm
Gas= iC4H10
Pressure= 0.01 bar
Vamos TMW2
Z = 109.3 mm
Gas= iC4H10
Pressure= 0.01 bar
%%%%%%%%%%%%%%%%%%%%
PISTA
VERSION= 1
POS_A= 36.71 96.1 50.7
POS_B= -35.92 95.8 51.3
POS_C= -19.35 56.5 93.4
POS_D= 20.8 56.6 93.1
%%%%%%%%%%%%%%%%%%%%
PISTA
VERSION= 1
POS_A= -42.15 93.1 51.1
POS_B= -93.62 41.8 51.6
POS_C= -54.12 25.3 93.6
POS_D= -25.66 53.6 93.4
%%%%%%%%%%%%%%%%%%%%
PISTA
VERSION= 1
POS_A= -95.98 35.6 51.3
POS_B= -95.63 -37.1 51.5
POS_C= -56.22 -20.7 93.7
POS_D= -56.39 19.5 93.6
%%%%%%%%%%%%%%%%%%%%
PISTA
VERSION= 1
POS_A= -93.34 -43.5 50.9
POS_B= -41.88 -94.8 51.3
POS_C= -25.41 -55.2 93.2
POS_D= -53.84 -26.8 93.0
%%%%%%%%%%%%%%%%%%%%
PISTA
VERSION= 1
POS_A= -35.66 -97.1 51.3
POS_B= 36.98 -96.9 51.1
POS_C= 20.9 -57.4 93.4
POS_D= -19.24 -57.6 93.5
%%%%%%%%%%%%%%%%%%%%
PISTA
VERSION= 1
POS_A= 43.66 -94.4 50.9
POS_B= 95.19 -43.3 50.8
POS_C= 56.03 -26.6 93.1
POS_D= 27.54 -54.9 93.2
%%%%%%%%%%%%%%%%%%%%
PISTA
VERSION= 1
POS_A= 96.87 -36.8 50.3
POS_B= 97.41 35.8 50.4
POS_C= 57.83 20.0 92.6
POS_D= 57.52 -20.1 92.6
%%%%%%%%%%%%%%%%%%%%
PISTA
VERSION= 1
POS_A= 94.39 42.0 50.8
POS_B= 42.94 93.3 50.7
POS_C= 26.47 54.1 93.0
POS_D= 54.9 25.7 93.1
Project pista
AnalysisOutput= ./root/analysis
SimulationOutput= ./root/simulation
EnergyLoss= ./EnergyLossTable
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment