From ed038f1fa023db915811e64f863a90928badc959 Mon Sep 17 00:00:00 2001 From: Adrien Matta <matta@lpccaen.in2p3.fr> Date: Mon, 4 May 2020 15:05:42 +0200 Subject: [PATCH] * Solving seg fault on Example4 - missing initialisation of m_ReactionRegion in Actar.cc --- Examples/Example4/run.mac | 1 + Examples/Example4/sim.sh | 1 + NPSimulation/Detectors/Actar/Actar.cc | 14 ++++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 Examples/Example4/run.mac create mode 100755 Examples/Example4/sim.sh diff --git a/Examples/Example4/run.mac b/Examples/Example4/run.mac new file mode 100644 index 000000000..ced78f727 --- /dev/null +++ b/Examples/Example4/run.mac @@ -0,0 +1 @@ +/run/beamOn 10 diff --git a/Examples/Example4/sim.sh b/Examples/Example4/sim.sh new file mode 100755 index 000000000..f461643d7 --- /dev/null +++ b/Examples/Example4/sim.sh @@ -0,0 +1 @@ +npsimulation -D Example4.detector -E Example4.reaction -O Example4 -B run.mac diff --git a/NPSimulation/Detectors/Actar/Actar.cc b/NPSimulation/Detectors/Actar/Actar.cc index eb3ef311b..ab441692f 100644 --- a/NPSimulation/Detectors/Actar/Actar.cc +++ b/NPSimulation/Detectors/Actar/Actar.cc @@ -149,7 +149,7 @@ Actar::Actar(){ m_build_Silicon=1; m_build_Vamos_Silicon=0; m_build_CsI=1; - + m_ReactionRegion=NULL; // Lookup table // // bool ReadingLookupTable = false; string LT_FileName = "./Detectors/Actar/LT.dat"; @@ -573,6 +573,7 @@ void Actar::ReadConfiguration(NPL::InputParser parser){ // Construct detector and inialise sensitive part. // Called After DetecorConstruction::AddDetector Method void Actar::ConstructDetector(G4LogicalVolume* world){ + std::cout << ">>>>>>>>>> DEBUG : " << 0 << std::endl; for (unsigned short i = 0 ; i < m_R.size() ; i++) { G4double wX = m_R[i] * sin(m_Theta[i] ) * cos(m_Phi[i] ) ; @@ -598,8 +599,9 @@ void Actar::ConstructDetector(G4LogicalVolume* world){ BuildDetector(), "Actar",world,false,i+1); } - + std::cout << ">>>>>>>>>> DEBUG : " << 1 << std::endl; if(!m_ReactionRegion){ + std::cout << ">>>>>>>>>> DEBUG : " << 6 << std::endl; G4ProductionCuts* ecut = new G4ProductionCuts(); ecut->SetProductionCut(1000,"e-"); @@ -612,21 +614,21 @@ void Actar::ConstructDetector(G4LogicalVolume* world){ Region_cut->SetProductionCuts(ecut); Region_cut->AddRootLogicalVolume(m_SquareDetector); } - + std::cout << ">>>>>>>>>> DEBUG : " << 2 << std::endl; G4FastSimulationManager* mng = m_ReactionRegion->GetFastSimulationManager(); - + std::cout << ">>>>>>>>>> DEBUG : " << 3 << std::endl; unsigned int size = m_ReactionModel.size(); for(unsigned int i = 0 ; i < size ; i++){ mng->RemoveFastSimulationModel(m_ReactionModel[i]); } - + std::cout << ">>>>>>>>>> DEBUG : " << 4 << std::endl; m_ReactionModel.clear(); G4VFastSimulationModel* fsm; fsm = new NPS::BeamReaction("BeamReaction",m_ReactionRegion); m_ReactionModel.push_back(fsm); fsm = new NPS::Decay("Decay",m_ReactionRegion); m_ReactionModel.push_back(fsm); - + std::cout << ">>>>>>>>>> DEBUG : " << 5 << std::endl; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // Add Detector branch to the EventTree. -- GitLab