Skip to content
Snippets Groups Projects
Commit 7c3331d7 authored by matta's avatar matta
Browse files

merge of '754ce46894a8a4775cf68dca9e5c2ce099666af1'

     and 'fe23b05b135b6c97ff64d2ab12fc48fce90b56fb'
parents 890229bd 269775b7
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,6 @@ void Beam::ReadConfigurationFile(string Path){ ...@@ -89,7 +89,6 @@ void Beam::ReadConfigurationFile(string Path){
string DataBuffer; string DataBuffer;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
ifstream ReactionFile; ifstream ReactionFile;
ReactionFile.open(Path.c_str());
bool ReadingStatus = false ; bool ReadingStatus = false ;
bool check_BeamName = false ; bool check_BeamName = false ;
...@@ -111,11 +110,21 @@ void Beam::ReadConfigurationFile(string Path){ ...@@ -111,11 +110,21 @@ void Beam::ReadConfigurationFile(string Path){
bool check_AllEnergy = false; bool check_AllEnergy = false;
bool check_AllEmittance = false; bool check_AllEmittance = false;
if (!ReactionFile.is_open()) { ifstream ReactionFile;
cout << "Error: File " << Path << " not found" << endl ; string GlobalPath = getenv("NPTOOL");
exit(1); string StandardPath = GlobalPath + "/Inputs/EventGenerator/" + Path;
ReactionFile.open(StandardPath.c_str());
if (ReactionFile.is_open()) {cout << "Reading Reaction File " << Path << endl ;}
// In case the file is not found in the standard path, the programm try to interpret the file name as an absolute or relative file path.
else{
ReactionFile.open( Path.c_str() );
if(ReactionFile.is_open()) { if(fVerboseLevel==1) cout << "Reading Reaction File " << Path << endl;}
else {cout << "Reaction File " << Path << " not found" << endl;exit(1);}
} }
while (!ReactionFile.eof()) { while (!ReactionFile.eof()) {
//Pick-up next line //Pick-up next line
getline(ReactionFile, LineBuffer); getline(ReactionFile, LineBuffer);
......
...@@ -464,16 +464,15 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){ ...@@ -464,16 +464,15 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Place the detector in the world // Place the detector in the world
// Position of the center of the PCB // Position of the center of the PCB
G4double Exposed_Length= BOX_Wafer_Length + BOX_PCB_Slot_Border + BOX_PCB_Slot_Width; // G4double Exposed_Length= BOX_Wafer_Length + BOX_PCB_Slot_Border + BOX_PCB_Slot_Width;
G4double DetectorOffset= -0.5*(BOX_PCB_Length-Exposed_Length); // G4double DetectorOffset= -0.5*(BOX_PCB_Length-Exposed_Length);
/*FIXME*/////////////////////////////////////////// /*FIXME*///////////////////////////////////////////
G4ThreeVector DetectorPosition = G4ThreeVector DetectorPosition =
G4ThreeVector(DetectorOffset+0.25*mm,Box_Wafer_Offset.y(),0); G4ThreeVector(0,Box_Wafer_Offset.y(),0);
// Distance of the PCB to the target // Distance of the PCB to the target
G4ThreeVector DetectorSpacing = G4ThreeVector DetectorSpacing =
-G4ThreeVector(0, 0,0.5*Exposed_Length); -G4ThreeVector(0, 0,Box_Wafer_Offset.y()+BOX_PCB_Slot_Position );
// If a PAD is present, DSSD is not in the center of the Slot: // If a PAD is present, DSSD is not in the center of the Slot:
G4ThreeVector PAD_OFFSET=-G4ThreeVector(0.5*PAD_PCB_Thickness,0,0); G4ThreeVector PAD_OFFSET=-G4ThreeVector(0.5*PAD_PCB_Thickness,0,0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment