W1 Simulation Crash
Created by: padsley
I'm adding this mainly so that I have a reference for myself. Sorry for clogging up your inboxes.
I'm trying to use the W1s using npsimulation, mainly to check to see whether my calculated W1 positions for n-si-90 are correct.
Running the command:
npsimulation -D W1nsi90.detector -E alpha.source -O SPcoincW1_19F_test
where W1nsi90.detector is my modified input file (as I hate to break the original one), then I get this output:
/////////////////////////////////////////
//// Adding Detector W1
///
W1 element found:
Theta: 113
Phi: 0
R: 110
Beta: 0 0 0
///
W1 element found:
Theta: 113
Phi: 0
R: 150
Beta: 0 0 0
///
W1 element found:
Theta: 156
Phi: 0
R: 150
Beta: 0 0 0
///
W1 element found:
Theta: 156
Phi: 0
R: 150
Beta: 0 0 0
///
W1 element found:
Theta: -135
Phi: 0
R: 150
Beta: 0 0 0
///
W1 element found:
Theta: -135
Phi: 0
R: 150
Beta: 0 0 0
/////////////////////////////////////////
L226test
L231test
L233test
L231test
*** Break *** segmentation violation
where the cout statements are shown below...
else{
std::stringstream oss(LineBuffer);
std::string token;
oss >> token ;
NPS::VDetector* detector = theFactory->Construct(token);
if(detector!=NULL && check.find(token)==check.end()){
cout << "/////////////////////////////////////////" << endl;
cout << "//// Adding Detector " << token << endl;
detector->ReadConfiguration(Path);
cout << "/////////////////////////////////////////" << endl;
// Add array to the VDetector Vector
AddDetector(detector);
check.insert(token);cout << "L226test" << endl;
}
else{
if(detector!=NULL)
{
cout << "L231test" << endl;
delete detector;
cout << "L233test" << endl;
}
}
}
}
cout << "L234test" << endl;
ConfigFile.close();
cout << "\033[0m" ;
Stack trace is:
===========================================================
#5 0x00007f4f0753ec78 in main_arena () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x00007f4ef822cbe0 in W1::~W1() () from /home/padsley/codes/nptool/NPSimulation/lib/libNPSW1.so
#7 0x00007f4ef822ccd9 in W1::~W1() () from /home/padsley/codes/nptool/NPSimulation/lib/libNPSW1.so
#8 0x00007f4f0a1a8809 in DetectorConstruction::ReadConfigurationFile() () from /home/padsley/codes/nptool/NPSimulation/lib/libNPSCore.so
#9 0x00007f4f0875da2c in G4RunManager::InitializeGeometry (this=0x25e5320) at /home/padsley/codes/geant4/geant4.10.02.p02/source/run/src/G4RunManager.cc:581
#10 0x00007f4f0875db21 in G4RunManager::Initialize (this=0x25e5320) at /home/padsley/codes/geant4/geant4.10.02.p02/source/run/src/G4RunManager.cc:565
#11 0x0000000000404628 in main ()
===========================================================
I think that this suggests that the code is trying to delete something that it can't at delete detector;
.
Not sure what that is at the moment, though.