#include "RunAction.hh" #include "Run.hh" #include "G4RunManager.hh" #include "G4LogicalVolumeStore.hh" #include "G4LogicalVolume.hh" #include "G4UnitsTable.hh" #include "G4SystemOfUnits.hh" #include "G4Material.hh" #include "HistoManager.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... RunAction::RunAction() : G4UserRunAction() { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... RunAction::~RunAction() {} //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4Run* RunAction::GenerateRun() { return new Run; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void RunAction::BeginOfRunAction(const G4Run*) { G4cout << *(G4Material::GetMaterialTable()) << G4endl; //inform the runManager to save random number seed G4RunManager::GetRunManager()->SetRandomNumberStore(false); if (IsMaster()){ HistoManager* histoManager = HistoManager::GetHistoManager(); if(histoManager) { histoManager->SetHisto2D("primaryCopyVsZ","",100, 500, 700, 16, 0, 15); histoManager->SetHisto2D("secondaryCopyVsZ","",100, 500, 700, 16, 0, 15); histoManager->SetHisto("CMOSEdep","",25, -0.5, 24.5); histoManager->SetHisto("CMOSEdepLayer0","",100,0,1000); histoManager->SetHisto("CMOSEdepFinalLayer","",100,0,1000); histoManager->SetHisto("CMOSEdepSumLayers","",100,0,1000); histoManager->SetHisto("CMOSFinalLayer","",25, -0.5, 24.5); histoManager->SetTree("jonMonitor", "Test tree"); histoManager->SetTree("Phantom", "phantom parameters"); histoManager->SetTree("PhantomCompensator", "phantom compensator parameters"); histoManager->SetTree("TruthPlane_I", "phantom parameters"); histoManager->SetTree("TruthPlane_O", "phantom parameters"); histoManager->SetTree("RT_TruthPlane", "truth parameters of all particles entering the RT"); histoManager->SetTree("RT_Ereco", "Ereco of RT, most fields are blank as this is a dummy"); histoManager->SetTree("radioactiveDecay", "properties of radioactive decays"); histoManager->SetTree("radioactiveDecay_ddEpi1", "properties of hits in ddEpi1 arising from radioactiveDecays"); histoManager->SetTree("radioactiveDecay_ddEpi1_Vertex", "properties of hits in ddEpi1 arising from radioactiveDecays"); histoManager->SetTree("radioactiveDecay_ddEpi2", "properties of hits in ddEpi2 arising from radioactiveDecays"); histoManager->SetTree("radioactiveDecay_ddEpi2_Vertex", "properties of hits in ddEpi2 arising from radioactiveDecays"); histoManager->SetTree("ddEpi1", "properties of hits in ddEpi1"); histoManager->SetTree("Decay", "properties of decays"); histoManager->SetProfile("letscan", "properties of the let scan", 600,0,60); G4String strip_names[12] = {"ASICs_x1", "ASICs_u1", "ASICs_v1", "ASICs_x2", "ASICs_u2", "ASICs_v2","ASICs_x3", "ASICs_u3", "ASICs_v3","ASICs_x4", "ASICs_u4", "ASICs_v4"}; G4int stLayers = 12; for(int l(0); lSetTree("DummySi_RT"+G4UIcommand::ConvertToString(l), "Steps into the Dummy silicon around the RT in layer "+G4UIcommand::ConvertToString(l));*/ histoManager->SetHisto(strip_names[l]+"_kineticEnergy", "kinetic Energy of all incident particles into the Dummy Si", 100, 0, 200, "MeV"); histoManager->SetHisto2D(strip_names[l]+"_1MeVNeutronEquivalent", "1 MeV neutron equivalence as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D(strip_names[l]+"_Inelastic", "Inelastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D(strip_names[l]+"_Elastic", "Elastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D(strip_names[l]+"_Edep", "Energy deposited in the Dummy Si (Z axis = MeV)", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto(strip_names[l]+"_kineticEnergy_proton", "kinetic Energy of all incident particles into the Dummy Si", 100, 0, 200, "MeV"); histoManager->SetHisto2D(strip_names[l]+"_1MeVNeutronEquivalent_proton", "1 MeV neutron equivalence as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D(strip_names[l]+"_Inelastic_proton", "Inelastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D(strip_names[l]+"_Elastic_proton", "Elastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D(strip_names[l]+"_Edep_proton", "Energy deposited in the Dummy Si (Z axis = MeV)", 201, -100, 100, 201, -100, 100, "mm", "mm"); } G4int rtLayers = 24; for(int l(0); lSetTree("DummySi_RT"+G4UIcommand::ConvertToString(l), "Steps into the Dummy silicon around the RT in layer "+G4UIcommand::ConvertToString(l));*/ histoManager->SetHisto("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_kineticEnergy", "kinetic Energy of all incident particles into the Dummy Si", 100, 0, 200, "MeV"); histoManager->SetHisto2D("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_1MeVNeutronEquivalent", "1 MeV neutron equivalence as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_Inelastic", "Inelastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_Elastic", "Elastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_Edep", "Energy deposited in the Dummy Si (Z axis = MeV)", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_kineticEnergy_proton", "kinetic Energy of all incident particles into the Dummy Si", 100, 0, 200, "MeV"); histoManager->SetHisto2D("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_1MeVNeutronEquivalent_proton", "1 MeV neutron equivalence as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_Inelastic_proton", "Inelastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_Elastic_proton", "Elastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("DummySi_RT"+G4UIcommand::ConvertToString(l)+"_Edep_proton", "Energy deposited in the Dummy Si (Z axis = MeV)", 201, -100, 100, 201, -100, 100, "mm", "mm"); // histoManager->SetHisto("Components_RT"+G4UIcommand::ConvertToString(l)+"_kineticEnergy", "kinetic Energy of all incident particles into the Dummy Si", 100, 0, 200, "MeV"); histoManager->SetHisto2D("Components_RT"+G4UIcommand::ConvertToString(l)+"_1MeVNeutronEquivalent", "1 MeV neutron equivalence as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("Components_RT"+G4UIcommand::ConvertToString(l)+"_Inelastic", "Inelastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("Components_RT"+G4UIcommand::ConvertToString(l)+"_Elastic", "Elastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("Components_RT"+G4UIcommand::ConvertToString(l)+"_Edep", "Energy deposited in the Dummy Si (Z axis = MeV)", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto("Components_RT"+G4UIcommand::ConvertToString(l)+"_kineticEnergy_proton", "kinetic Energy of all incident particles into the Dummy Si", 100, 0, 200, "MeV"); histoManager->SetHisto2D("Components_RT"+G4UIcommand::ConvertToString(l)+"_1MeVNeutronEquivalent_proton", "1 MeV neutron equivalence as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("Components_RT"+G4UIcommand::ConvertToString(l)+"_Inelastic_proton", "Inelastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("Components_RT"+G4UIcommand::ConvertToString(l)+"_Elastic_proton", "Elastic events as function of position", 201, -100, 100, 201, -100, 100, "mm", "mm"); histoManager->SetHisto2D("Components_RT"+G4UIcommand::ConvertToString(l)+"_Edep_proton", "Energy deposited in the Dummy Si (Z axis = MeV)", 201, -100, 100, 201, -100, 100, "mm", "mm"); } histoManager->book(); histoManager->CreateTrackerTree("tracker", 16, 1024); histoManager->CreateRTTree("rangetel"); histoManager->CreateStripRTTree("stripRT"); } } } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #include #include #include #include "TrackerGeometry.hh" void RunAction::EndOfRunAction(const G4Run* run) { G4int nofEvents = run->GetNumberOfEvent(); if (nofEvents == 0) return; // Print // if (IsMaster()) { ///HistoManager::GetHistoManager()->save(); G4cout << "\n--------------------End of Global Run-----------------------" << G4endl; HistoManager* histoManager = HistoManager::GetHistoManager(); if(histoManager) { // for now hack the geometry tree in //TrackerGeometry* tracker = new TrackerGeometry("TrackerGeometry.mac"); //tracker->WriteParameters(); //geom->Write(); histoManager->save(); } // saver.CloseTree(); } else { G4cout << "\n--------------------End of Local Run------------------------" << G4endl; } } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......