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

* Changing NPEnergyLoss so it can also find table away fron the standard directory

parent 5121c18a
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@ EnergyLoss::EnergyLoss(string Path , string Source, int NumberOfSlice=100 , int
fNumberOfMass = NumberOfMass ;
string globalPath = getenv("NPTOOL");
Path = globalPath + "/Inputs/EnergyLoss/" + Path;
string StandardPath = globalPath + "/Inputs/EnergyLoss/" + Path;
cout << "///////////////////////////////// " << endl ;
cout << "Initialising an EnergyLoss object " << endl ;
......@@ -72,11 +72,19 @@ EnergyLoss::EnergyLoss(string Path , string Source, int NumberOfSlice=100 , int
TableFile.open(Path.c_str()) ;
// Opening dE/dX file
if(!TableFile) cout << "ERROR: TABLE FILE NOT FOUND" << endl;
if(TableFile.is_open()) cout << "Reading Energy Loss 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
{
TableFile.open( Path.c_str() );
if(TableFile.is_open()) { cout << "Reading Energy Loss File: " << Path << endl ;}
else { cout << "ERROR: TABLE FILE NOT FOUND" << endl; return; }
}
if (Source == "G4Table")
{
cout << "Reading Energy Loss File: " << Path << endl ;
// Reading Data
double energy, total;
string dummy;
......
......@@ -164,11 +164,11 @@ void MUST2Array::VolumeMaker(G4int TelescopeNumber ,
PVPBuffer = new G4PVPlacement( G4Transform3D(*MMrot, MMpos) ,
logicMM ,
Name ,
world ,
false ,
0);
logicMM ,
Name ,
world ,
false ,
0 );
......
......@@ -216,6 +216,16 @@ G4Material* Target::GetMaterialFromLibrary(G4String MaterialName, G4double Tempe
return myMaterial;
}
else if (MaterialName == "Si") {
G4Material* myMaterial = new G4Material("Si", 14., 28.0855 * g / mole, 2.321 * g / cm3);
return myMaterial;
}
else if (MaterialName == "Al") {
G4Material* myMaterial = new G4Material("Aluminium", 13., 26.98 * g / mole, 2.702 * g / cm3);
return myMaterial;
}
else {
G4cout << "No Matching Material in the Target Library Default is Vacuum" << G4endl;
G4Element* N = new G4Element("Nitrogen", "N", 7., 14.01*g / mole);
......
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