Skip to content
Snippets Groups Projects
Commit ed038f1f authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

* Solving seg fault on Example4

        - missing initialisation of m_ReactionRegion in Actar.cc
parent b0fd4ba2
No related branches found
No related tags found
No related merge requests found
Pipeline #68221 passed
/run/beamOn 10
npsimulation -D Example4.detector -E Example4.reaction -O Example4 -B run.mac
...@@ -149,7 +149,7 @@ Actar::Actar(){ ...@@ -149,7 +149,7 @@ Actar::Actar(){
m_build_Silicon=1; m_build_Silicon=1;
m_build_Vamos_Silicon=0; m_build_Vamos_Silicon=0;
m_build_CsI=1; m_build_CsI=1;
m_ReactionRegion=NULL;
// Lookup table // // Lookup table //
// bool ReadingLookupTable = false; // bool ReadingLookupTable = false;
string LT_FileName = "./Detectors/Actar/LT.dat"; string LT_FileName = "./Detectors/Actar/LT.dat";
...@@ -573,6 +573,7 @@ void Actar::ReadConfiguration(NPL::InputParser parser){ ...@@ -573,6 +573,7 @@ void Actar::ReadConfiguration(NPL::InputParser parser){
// Construct detector and inialise sensitive part. // Construct detector and inialise sensitive part.
// Called After DetecorConstruction::AddDetector Method // Called After DetecorConstruction::AddDetector Method
void Actar::ConstructDetector(G4LogicalVolume* world){ void Actar::ConstructDetector(G4LogicalVolume* world){
std::cout << ">>>>>>>>>> DEBUG : " << 0 << std::endl;
for (unsigned short i = 0 ; i < m_R.size() ; i++) { for (unsigned short i = 0 ; i < m_R.size() ; i++) {
G4double wX = m_R[i] * sin(m_Theta[i] ) * cos(m_Phi[i] ) ; G4double wX = m_R[i] * sin(m_Theta[i] ) * cos(m_Phi[i] ) ;
...@@ -598,8 +599,9 @@ void Actar::ConstructDetector(G4LogicalVolume* world){ ...@@ -598,8 +599,9 @@ void Actar::ConstructDetector(G4LogicalVolume* world){
BuildDetector(), BuildDetector(),
"Actar",world,false,i+1); "Actar",world,false,i+1);
} }
std::cout << ">>>>>>>>>> DEBUG : " << 1 << std::endl;
if(!m_ReactionRegion){ if(!m_ReactionRegion){
std::cout << ">>>>>>>>>> DEBUG : " << 6 << std::endl;
G4ProductionCuts* ecut = new G4ProductionCuts(); G4ProductionCuts* ecut = new G4ProductionCuts();
ecut->SetProductionCut(1000,"e-"); ecut->SetProductionCut(1000,"e-");
...@@ -612,21 +614,21 @@ void Actar::ConstructDetector(G4LogicalVolume* world){ ...@@ -612,21 +614,21 @@ void Actar::ConstructDetector(G4LogicalVolume* world){
Region_cut->SetProductionCuts(ecut); Region_cut->SetProductionCuts(ecut);
Region_cut->AddRootLogicalVolume(m_SquareDetector); Region_cut->AddRootLogicalVolume(m_SquareDetector);
} }
std::cout << ">>>>>>>>>> DEBUG : " << 2 << std::endl;
G4FastSimulationManager* mng = m_ReactionRegion->GetFastSimulationManager(); G4FastSimulationManager* mng = m_ReactionRegion->GetFastSimulationManager();
std::cout << ">>>>>>>>>> DEBUG : " << 3 << std::endl;
unsigned int size = m_ReactionModel.size(); unsigned int size = m_ReactionModel.size();
for(unsigned int i = 0 ; i < size ; i++){ for(unsigned int i = 0 ; i < size ; i++){
mng->RemoveFastSimulationModel(m_ReactionModel[i]); mng->RemoveFastSimulationModel(m_ReactionModel[i]);
} }
std::cout << ">>>>>>>>>> DEBUG : " << 4 << std::endl;
m_ReactionModel.clear(); m_ReactionModel.clear();
G4VFastSimulationModel* fsm; G4VFastSimulationModel* fsm;
fsm = new NPS::BeamReaction("BeamReaction",m_ReactionRegion); fsm = new NPS::BeamReaction("BeamReaction",m_ReactionRegion);
m_ReactionModel.push_back(fsm); m_ReactionModel.push_back(fsm);
fsm = new NPS::Decay("Decay",m_ReactionRegion); fsm = new NPS::Decay("Decay",m_ReactionRegion);
m_ReactionModel.push_back(fsm); m_ReactionModel.push_back(fsm);
std::cout << ">>>>>>>>>> DEBUG : " << 5 << std::endl;
} }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Add Detector branch to the EventTree. // Add Detector branch to the EventTree.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment