Skip to content
Snippets Groups Projects
Commit 29165e24 authored by deserevi's avatar deserevi
Browse files

* Fix minor bugs for next stable release

parent 045fe788
No related branches found
No related tags found
No related merge requests found
...@@ -105,8 +105,8 @@ namespace ENERGYLOSS ...@@ -105,8 +105,8 @@ namespace ENERGYLOSS
{ {
// Declare your Energy loss here // Declare your Energy loss here
// EnergyLoss LightTargetCD2 = EnergyLoss("proton_cd2.txt", 100, 1, 1); // LISE++ // EnergyLoss LightTargetCD2 = EnergyLoss("proton_cd2.txt", 100, 1, 1); // LISE++
EnergyLoss LightTarget = EnergyLoss("proton_CD2.G4table", 100); // G4 EnergyLoss LightTarget = EnergyLoss("proton_CD2.G4table", "G4Table", 1000); // G4
// EnergyLoss BeamTarget = EnergyLoss("proton_CD2.G4table", 100); // G4 EnergyLoss BeamTarget = EnergyLoss("Sn132[0.0]_CD2.G4table", "G4Table", 1000); // G4
} }
using namespace ENERGYLOSS ; using namespace ENERGYLOSS ;
......
...@@ -26,13 +26,19 @@ int main(int argc,char** argv) ...@@ -26,13 +26,19 @@ int main(int argc,char** argv)
NPL::Reaction* myReaction = new Reaction(); NPL::Reaction* myReaction = new Reaction();
myReaction->ReadConfigurationFile(reactionfileName); myReaction->ReadConfigurationFile(reactionfileName);
// set energy beam at target middle
myReaction->SetBeamEnergy(1292);
// Initialize the detector // Initialize the detector
NPA::DetectorManager* myDetector = new DetectorManager; NPA::DetectorManager* myDetector = new DetectorManager;
myDetector->ReadConfigurationFile(detectorfileName); myDetector->ReadConfigurationFile(detectorfileName);
// nominal beam energy
Double_t BeamEnergyNominal = myReaction->GetBeamEnergy() * MeV;
cout << BeamEnergyNominal << endl;
// slow beam at target middle
Double_t BeamEnergy = BeamEnergyNominal - BeamTarget.Slow(BeamEnergyNominal, myDetector->GetTargetThickness()/2 * micrometer, 0);
cout << BeamEnergy << endl;
// set energy beam at target middle
myReaction->SetBeamEnergy(BeamEnergy);
// Print target thickness // Print target thickness
cout << myDetector->GetTargetThickness() << endl; cout << myDetector->GetTargetThickness() << endl;
...@@ -84,7 +90,8 @@ int main(int argc,char** argv) ...@@ -84,7 +90,8 @@ int main(int argc,char** argv)
ThetaStrip = ThetaCalculation (A ,TVector3(0,0,1)); ThetaStrip = ThetaCalculation (A ,TVector3(0,0,1));
// Correct for energy loss in the target // Correct for energy loss in the target
E = LightTarget.EvaluateInitialEnergy(E, 5.15*micrometer, ThetaStrip); // E = LightTarget.EvaluateInitialEnergy(E, 5.15*micrometer, ThetaStrip);
E = LightTarget.EvaluateInitialEnergy(E, myDetector->GetTargetThickness()/2 * micrometer, ThetaStrip);
// Calculate excitation energy // Calculate excitation energy
if (Theta/deg > 90) { if (Theta/deg > 90) {
......
...@@ -425,6 +425,7 @@ endif ...@@ -425,6 +425,7 @@ endif
make distclean -C ./InteractionCoordinates make distclean -C ./InteractionCoordinates
make distclean -C ./InitialConditions make distclean -C ./InitialConditions
make distclean -C ./DummyDetector make distclean -C ./DummyDetector
make distclean -C ./Plastic
.SUFFIXES: .$(SrcSuf) .SUFFIXES: .$(SrcSuf)
### ###
......
...@@ -64,7 +64,7 @@ Target::Target() ...@@ -64,7 +64,7 @@ Target::Target()
m_WindowsThickness = 0 ; m_WindowsThickness = 0 ;
m_TargetTemperature = 0 ; m_TargetTemperature = 0 ;
m_TargetPressure = 0 ; m_TargetPressure = 0 ;
m_TargetNbLayers = 50; // Number of steps by default m_TargetNbLayers = 50; // Number of steps by default
} }
G4Material* Target::GetMaterialFromLibrary(G4String MaterialName, G4double Temperature, G4double Pressure) G4Material* Target::GetMaterialFromLibrary(G4String MaterialName, G4double Temperature, G4double Pressure)
...@@ -292,7 +292,7 @@ void Target::ReadConfiguration(string Path) ...@@ -292,7 +292,7 @@ void Target::ReadConfiguration(string Path)
cout << m_TargetZ / mm << " )" << endl ; cout << m_TargetZ / mm << " )" << endl ;
} }
else if (DataBuffer.compare(0, 9, "NbLayers=") == 0) { else if (DataBuffer.compare(0, 9, "NBLAYERS=") == 0) {
check_m_TargetNbLayers = true ; check_m_TargetNbLayers = true ;
ConfigFile >> DataBuffer; ConfigFile >> DataBuffer;
m_TargetNbLayers = atoi(DataBuffer.c_str()); m_TargetNbLayers = atoi(DataBuffer.c_str());
...@@ -386,7 +386,7 @@ void Target::ReadConfiguration(string Path) ...@@ -386,7 +386,7 @@ void Target::ReadConfiguration(string Path)
cout << m_TargetZ / mm << " )" << endl ; cout << m_TargetZ / mm << " )" << endl ;
} }
else if (DataBuffer.compare(0, 9, "m_TargetNbLayers=") == 0) { else if (DataBuffer.compare(0, 9, "NBLAYERS=") == 0) {
check_m_TargetNbLayers = true ; check_m_TargetNbLayers = true ;
ConfigFile >> DataBuffer; ConfigFile >> DataBuffer;
m_TargetNbLayers = atoi(DataBuffer.c_str()); m_TargetNbLayers = atoi(DataBuffer.c_str());
......
1.0 1.2
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