Commit 1264966b authored by Warren's avatar Warren
Browse files

Only the gas volume is now simulated. This removed the vertex position...

Only the gas volume is now simulated. This removed the vertex position distribution issue. WARNING: The mylar windows are not simulated now so the beam energyentering the gas volume should be the beam energy after the mylar window.
parent fb51e1f5
Pipeline #101259 passed with stages
in 16 minutes and 35 seconds
......@@ -26,6 +26,7 @@
//G4 Geometry object
#include "G4Tubs.hh"
#include "G4Box.hh"
#include "G4SubtractionSolid.hh"
//G4 sensitive
#include "G4SDManager.hh"
......@@ -157,22 +158,30 @@ G4LogicalVolume* TACTIC::BuildCylindricalDetector(){
cout << TACTIC_gas << endl;
G4Tubs* anode = new G4Tubs("anode",0,TACTIC_NS::anode_radius,TACTIC_NS::active_length*0.5,0,360*deg);
G4Tubs* gas_volume = new G4Tubs("gas_volume",0,TACTIC_NS::drift_radius,TACTIC_NS::active_length*0.5,0,360*deg);
//G4Tubs* gas_volume = new G4Tubs("gas_volume",0,TACTIC_NS::drift_radius,TACTIC_NS::active_length*0.5,0,360*deg);
G4Tubs* window = new G4Tubs("window",0,TACTIC_NS::window_radius,TACTIC_NS::window_width*0.5,0,360*deg);
G4Tubs* vacuum = new G4Tubs("vacuum",0,TACTIC_NS::window_radius,TACTIC_NS::vacuum_width*0.5,0,360*deg);
m_CylindricalDetector = new G4LogicalVolume(anode, Cu, "anode_log",0,0,0);
G4Tubs* gas_volume_temp = new G4Tubs("gas_volume_temp",0,TACTIC_NS::drift_radius,TACTIC_NS::active_length*0.5,0,360*deg);
G4VSolid* hole = new G4Tubs("hole",0,TACTIC_NS::window_radius,TACTIC_NS::vacuum_width*0.5,0,360*deg);
G4VSolid* gas_volume_temp2 = new G4SubtractionSolid("gas_volume_temp2",gas_volume_temp,hole,0,G4ThreeVector(0,0,TACTIC_NS::vacuum_pos));
G4VSolid* gas_volume = new G4SubtractionSolid("gas_volume",gas_volume_temp2,hole,0,G4ThreeVector(0,0,-TACTIC_NS::vacuum_pos));
m_CylindricalDetector = new G4LogicalVolume(gas_volume, TACTIC_gas, "anode_log",0,0,0);
gas_volume_log = new G4LogicalVolume(gas_volume, TACTIC_gas, "gas_volume_log",0,0,0);
window_log = new G4LogicalVolume(window, Mylar, "window_log",0,0,0);
//window_log = new G4LogicalVolume(window, TACTIC_gas, "window_log",0,0,0); //windows removed (effectively)
vacuum_log = new G4LogicalVolume(vacuum, Vacuum, "vacuum_log",0,0,0);
/*
new G4PVPlacement(0,G4ThreeVector(0,0,0),gas_volume_log,"gas_volume_phys",m_CylindricalDetector,false,0);
new G4PVPlacement(0,G4ThreeVector(0,0,TACTIC_NS::window_pos),window_log,"window_phys",gas_volume_log,false,0);
new G4PVPlacement(0,G4ThreeVector(0,0,-TACTIC_NS::window_pos),window_log,"window_phys",gas_volume_log,false,0);
new G4PVPlacement(0,G4ThreeVector(0,0,TACTIC_NS::vacuum_pos),vacuum_log,"vacuum_phys",gas_volume_log,false,0);
new G4PVPlacement(0,G4ThreeVector(0,0,-TACTIC_NS::vacuum_pos),vacuum_log,"vacuum_phys",gas_volume_log,false,0);
*/
gas_volume_log->SetVisAttributes(m_VisGas);
window_log->SetVisAttributes(m_VisWindows);
vacuum_log->SetVisAttributes(m_VisVacuum);
......@@ -181,9 +190,11 @@ G4LogicalVolume* TACTIC::BuildCylindricalDetector(){
G4UserLimits *gas_volume_step = new G4UserLimits();
G4double maxStep = 0.1*mm;
gas_volume_step->SetMaxAllowedStep(maxStep);
gas_volume_log->SetUserLimits(gas_volume_step);
gas_volume_log->SetSensitiveDetector(m_Scorer);
//gas_volume_log->SetUserLimits(gas_volume_step);
m_CylindricalDetector->SetUserLimits(gas_volume_step);
//gas_volume_log->SetSensitiveDetector(m_Scorer);
m_CylindricalDetector->SetSensitiveDetector(m_Scorer);
}
return m_CylindricalDetector;
}
......@@ -258,7 +269,8 @@ void TACTIC::ConstructDetector(G4LogicalVolume* world){
ecut->SetProductionCut(1000,"e-"); //I think lowest is 900 eV for delta electron production, this is 1000 MeV to cut all electrons produced this way
m_ReactionRegion= new G4Region("NPSimulationProcess");
m_ReactionRegion->SetProductionCuts(ecut);
m_ReactionRegion->AddRootLogicalVolume(gas_volume_log);
//m_ReactionRegion->AddRootLogicalVolume(gas_volume_log);
m_ReactionRegion->AddRootLogicalVolume(m_CylindricalDetector);
}
G4FastSimulationManager* mng = m_ReactionRegion->GetFastSimulationManager();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment