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

* fixing issue in decay of 1H 2H and alphas in excited state

        - name convention in geant4 is different for g.s and excited
        state
parent 21007d9b
No related branches found
No related tags found
No related merge requests found
Pipeline #73643 passed
/run/beamOn 1000 /run/beamOn 10000
...@@ -279,7 +279,7 @@ namespace NPL{ ...@@ -279,7 +279,7 @@ namespace NPL{
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
string ChangeNameToG4Standard(string OriginalName){ string ChangeNameToG4Standard(string OriginalName,bool excited){
string NumberOfMass ; string NumberOfMass ;
string Nucleid; string Nucleid;
...@@ -354,6 +354,8 @@ namespace NPL{ ...@@ -354,6 +354,8 @@ namespace NPL{
// Special case for light particles // Special case for light particles
string FinalName=Nucleid+NumberOfMass; string FinalName=Nucleid+NumberOfMass;
if(!excited){
if (FinalName=="H1") FinalName="proton"; if (FinalName=="H1") FinalName="proton";
else if (FinalName=="H2") FinalName="deuteron"; else if (FinalName=="H2") FinalName="deuteron";
else if (FinalName=="H3") FinalName="triton"; else if (FinalName=="H3") FinalName="triton";
...@@ -363,6 +365,7 @@ namespace NPL{ ...@@ -363,6 +365,7 @@ namespace NPL{
else if (FinalName=="t") FinalName="triton"; else if (FinalName=="t") FinalName="triton";
else if (FinalName=="a") FinalName="alpha"; else if (FinalName=="a") FinalName="alpha";
else if (FinalName=="n") FinalName="neutron"; else if (FinalName=="n") FinalName="neutron";
}
return(FinalName); return(FinalName);
} }
...@@ -440,8 +443,8 @@ namespace NPL{ ...@@ -440,8 +443,8 @@ namespace NPL{
else if (character.str()=="z") Nucleid+="z"; else if (character.str()=="z") Nucleid+="z";
} }
// Special case for light particles
string FinalName=NumberOfMass+Nucleid; string FinalName=NumberOfMass+Nucleid;
// Special case for light particles
if (FinalName=="H1") FinalName="proton"; if (FinalName=="H1") FinalName="proton";
else if (FinalName=="H2") FinalName="deuteron"; else if (FinalName=="H2") FinalName="deuteron";
else if (FinalName=="H3") FinalName="triton"; else if (FinalName=="H3") FinalName="triton";
......
...@@ -58,7 +58,7 @@ namespace NPL{ ...@@ -58,7 +58,7 @@ namespace NPL{
void RandomGaussian2D(double MeanX, double MeanY, double SigmaX, double SigmaY, double &X, double &Y); void RandomGaussian2D(double MeanX, double MeanY, double SigmaX, double SigmaY, double &X, double &Y);
// Change nucleus name from G4 standard to Physics standard (11Li vs Li11) // Change nucleus name from G4 standard to Physics standard (11Li vs Li11)
string ChangeNameToG4Standard(string name); string ChangeNameToG4Standard(string name,bool excited=false);
string ChangeNameFromG4Standard(string name); string ChangeNameFromG4Standard(string name);
// Hyperbolic shape generator for cryogenic target deformation // Hyperbolic shape generator for cryogenic target deformation
......
...@@ -69,10 +69,10 @@ void RunAction::EndOfRunAction(const G4Run* aRun){ ...@@ -69,10 +69,10 @@ void RunAction::EndOfRunAction(const G4Run* aRun){
for(unsigned int e = 0 ; e < sizeE ; e++){ for(unsigned int e = 0 ; e < sizeE ; e++){
TrajectoryVector* traj = (*events)[e]->GetTrajectoryContainer()->GetVector(); TrajectoryVector* traj = (*events)[e]->GetTrajectoryContainer()->GetVector();
unsigned int size = traj->size(); unsigned int size = traj->size();
for(unsigned int i = 0 ; i < size ; i++) for(unsigned int i = 0 ; i < size ; i++)
Particles.insert( (*traj)[i]->GetParticleName()); Particles.insert( (*traj)[i]->GetParticleName());
} }
MaterialManager::getInstance()->WriteDEDXTable(Particles,0,10*GeV); MaterialManager::getInstance()->WriteDEDXTable(Particles,0,10*GeV);
MaterialManager::getInstance()->WriteCrossSectionTable(Particles,0,20*MeV); MaterialManager::getInstance()->WriteCrossSectionTable(Particles,0,20*MeV);
} }
......
...@@ -72,7 +72,7 @@ namespace Mugast_NS{ ...@@ -72,7 +72,7 @@ namespace Mugast_NS{
// Geometry // Geometry
//const G4double AluStripThickness = 0.4*micrometer ; //const G4double AluStripThickness = 0.4*micrometer ;
const G4double SiliconThickness = 3000*micrometer ; const G4double SiliconThickness = 300*micrometer ;
// Square // Square
...@@ -230,6 +230,7 @@ G4LogicalVolume* Mugast::BuildTrapezoidDetector(){ ...@@ -230,6 +230,7 @@ G4LogicalVolume* Mugast::BuildTrapezoidDetector(){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LogicalVolume* Mugast::BuildAnnularDetector(){ G4LogicalVolume* Mugast::BuildAnnularDetector(){
if(!m_AnnularDetector){ if(!m_AnnularDetector){
G4Material* Silicon = MaterialManager::getInstance()->GetMaterialFromLibrary("Si"); G4Material* Silicon = MaterialManager::getInstance()->GetMaterialFromLibrary("Si");
G4Material* Vacuum = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum"); G4Material* Vacuum = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum");
...@@ -382,7 +383,6 @@ G4LogicalVolume* Mugast::BuildAnnularDetector(){ ...@@ -382,7 +383,6 @@ G4LogicalVolume* Mugast::BuildAnnularDetector(){
// Set Silicon strip sensible // Set Silicon strip sensible
logicActiveWafer->SetSensitiveDetector(m_AnnularScorer); logicActiveWafer->SetSensitiveDetector(m_AnnularScorer);
} }
return m_AnnularDetector; return m_AnnularDetector;
} }
......
...@@ -61,8 +61,12 @@ void Decay::ReadConfiguration(){ ...@@ -61,8 +61,12 @@ void Decay::ReadConfiguration(){
m_Decay.ReadConfiguration(input); m_Decay.ReadConfiguration(input);
std::set<std::string> Mother = m_Decay.GetAllMotherName(); std::set<std::string> Mother = m_Decay.GetAllMotherName();
std::set<std::string>::iterator it ; std::set<std::string>::iterator it ;
for(it = Mother.begin() ; it != Mother.end() ; it++) for(it = Mother.begin() ; it != Mother.end() ; it++){
// ground state name, e.g. deuteron
m_MotherName.insert(NPL::ChangeNameToG4Standard(*it)); m_MotherName.insert(NPL::ChangeNameToG4Standard(*it));
// excited state name e.g. H2
m_MotherName.insert(NPL::ChangeNameToG4Standard(*it,true));
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -130,6 +134,7 @@ void Decay::DoIt(const G4FastTrack& fastTrack,G4FastStep& fastStep){ ...@@ -130,6 +134,7 @@ void Decay::DoIt(const G4FastTrack& fastTrack,G4FastStep& fastStep){
G4ParticleDefinition* DaughterDef; G4ParticleDefinition* DaughterDef;
unsigned int size = Daughter.size(); unsigned int size = Daughter.size();
if(size == 0) if(size == 0)
return; return;
for(unsigned int i = 0 ; i < size ; i++){ for(unsigned int i = 0 ; i < size ; i++){
......
...@@ -155,7 +155,7 @@ int main(int argc, char** argv){ ...@@ -155,7 +155,7 @@ int main(int argc, char** argv){
#endif #endif
} }
else{// if batch mode do not accumulate any track else{// if batch mode do not accumulate any track
UImanager->ApplyCommand("/vis/scene/endOfEventAction accumulate 0"); UImanager->ApplyCommand("/vis/scene/endOfEventAction accumulate 0");
} }
// Execute user macro // Execute user macro
if(!OptionManager->IsDefault("G4MacroPath")){ if(!OptionManager->IsDefault("G4MacroPath")){
......
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