diff --git a/Examples/Example1/run.mac b/Examples/Example1/run.mac index 8eec34f7c0cc1911bbafaa6e92961e0836d874ba..b379ed9bcf78d80c4a29d004189059437aaa84d3 100644 --- a/Examples/Example1/run.mac +++ b/Examples/Example1/run.mac @@ -1 +1 @@ -/run/beamOn 1000 +/run/beamOn 10000 diff --git a/NPLib/Physics/NPFunction.cxx b/NPLib/Physics/NPFunction.cxx index 053fd0f7d2381bc121912bd8019ebd6327c32657..9de2b666211aa8facae9ba279fafad1734c3437d 100644 --- a/NPLib/Physics/NPFunction.cxx +++ b/NPLib/Physics/NPFunction.cxx @@ -279,7 +279,7 @@ namespace NPL{ //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - string ChangeNameToG4Standard(string OriginalName){ + string ChangeNameToG4Standard(string OriginalName,bool excited){ string NumberOfMass ; string Nucleid; @@ -354,6 +354,8 @@ namespace NPL{ // Special case for light particles string FinalName=Nucleid+NumberOfMass; + + if(!excited){ if (FinalName=="H1") FinalName="proton"; else if (FinalName=="H2") FinalName="deuteron"; else if (FinalName=="H3") FinalName="triton"; @@ -363,6 +365,7 @@ namespace NPL{ else if (FinalName=="t") FinalName="triton"; else if (FinalName=="a") FinalName="alpha"; else if (FinalName=="n") FinalName="neutron"; + } return(FinalName); } @@ -440,8 +443,8 @@ namespace NPL{ else if (character.str()=="z") Nucleid+="z"; } - // Special case for light particles string FinalName=NumberOfMass+Nucleid; + // Special case for light particles if (FinalName=="H1") FinalName="proton"; else if (FinalName=="H2") FinalName="deuteron"; else if (FinalName=="H3") FinalName="triton"; diff --git a/NPLib/Physics/NPFunction.h b/NPLib/Physics/NPFunction.h index b6373860d8c04d2559877846e4b025ac0fbc1099..8150a644e5c321bb6c80aa2eee3bc893d993b851 100644 --- a/NPLib/Physics/NPFunction.h +++ b/NPLib/Physics/NPFunction.h @@ -58,7 +58,7 @@ namespace NPL{ 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) - string ChangeNameToG4Standard(string name); + string ChangeNameToG4Standard(string name,bool excited=false); string ChangeNameFromG4Standard(string name); // Hyperbolic shape generator for cryogenic target deformation diff --git a/NPSimulation/Core/RunAction.cc b/NPSimulation/Core/RunAction.cc index 16289ab7205602cccac24e1ad58c033c98ac843f..a3a503e00f645f7c1815f708a40a676ee75553b1 100644 --- a/NPSimulation/Core/RunAction.cc +++ b/NPSimulation/Core/RunAction.cc @@ -69,10 +69,10 @@ void RunAction::EndOfRunAction(const G4Run* aRun){ for(unsigned int e = 0 ; e < sizeE ; e++){ TrajectoryVector* traj = (*events)[e]->GetTrajectoryContainer()->GetVector(); unsigned int size = traj->size(); + for(unsigned int i = 0 ; i < size ; i++) Particles.insert( (*traj)[i]->GetParticleName()); } - MaterialManager::getInstance()->WriteDEDXTable(Particles,0,10*GeV); MaterialManager::getInstance()->WriteCrossSectionTable(Particles,0,20*MeV); } diff --git a/NPSimulation/Detectors/Mugast/Mugast.cc b/NPSimulation/Detectors/Mugast/Mugast.cc index ac90486a5a5c7528eae92fa59c26b0db4a4f5945..2b6f7895627fb8ff9e83df0ab30c8ce4942e8f81 100644 --- a/NPSimulation/Detectors/Mugast/Mugast.cc +++ b/NPSimulation/Detectors/Mugast/Mugast.cc @@ -72,7 +72,7 @@ namespace Mugast_NS{ // Geometry //const G4double AluStripThickness = 0.4*micrometer ; - const G4double SiliconThickness = 3000*micrometer ; + const G4double SiliconThickness = 300*micrometer ; // Square @@ -230,6 +230,7 @@ G4LogicalVolume* Mugast::BuildTrapezoidDetector(){ //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4LogicalVolume* Mugast::BuildAnnularDetector(){ + if(!m_AnnularDetector){ G4Material* Silicon = MaterialManager::getInstance()->GetMaterialFromLibrary("Si"); G4Material* Vacuum = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum"); @@ -382,7 +383,6 @@ G4LogicalVolume* Mugast::BuildAnnularDetector(){ // Set Silicon strip sensible logicActiveWafer->SetSensitiveDetector(m_AnnularScorer); } - return m_AnnularDetector; } diff --git a/NPSimulation/Process/Decay.cc b/NPSimulation/Process/Decay.cc index 442d98b6819d69154e36a921163f64e6dd17ff8a..30c82cdd4cfc5a142ba3456f28abc6608a4567b1 100644 --- a/NPSimulation/Process/Decay.cc +++ b/NPSimulation/Process/Decay.cc @@ -61,8 +61,12 @@ void Decay::ReadConfiguration(){ m_Decay.ReadConfiguration(input); std::set<std::string> Mother = m_Decay.GetAllMotherName(); 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)); + // 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){ G4ParticleDefinition* DaughterDef; unsigned int size = Daughter.size(); + if(size == 0) return; for(unsigned int i = 0 ; i < size ; i++){ diff --git a/NPSimulation/Simulation.cc b/NPSimulation/Simulation.cc index ed862a21df62f611f1149d2c3d1cc51f136af25e..a8e1345365f59cfdb3e3f88efdc0b6b669e1fd4f 100644 --- a/NPSimulation/Simulation.cc +++ b/NPSimulation/Simulation.cc @@ -155,7 +155,7 @@ int main(int argc, char** argv){ #endif } 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 if(!OptionManager->IsDefault("G4MacroPath")){