Skip to content
Snippets Groups Projects
Commit b7ae9c40 authored by Zach Marshall's avatar Zach Marshall
Browse files

Updates to R-Hadron simulation for stable particles

This is a couple of twweaks to double protect us when running stable
R-Hadron simulation. The idea is that people should be able to not set a
lifetime or set a lifetime to -1 or 0 and assume that the simulation
will guess they want stable particles. Explicitly setting doDecays=0
will also work. Also added a catch in the simulation to make sure that
the settings read in are consistent (e.g. if someone sets a lifetime,
they almost certainly want decays, and if they set a negative lifetime
they almost certainly don't).

Marking as a WIP until we can get some tests in.
parent daf77651
No related branches found
No related tags found
No related merge requests found
...@@ -113,11 +113,19 @@ G4ProcessHelper::G4ProcessHelper() ...@@ -113,11 +113,19 @@ G4ProcessHelper::G4ProcessHelper()
G4cout<<"Gamma = "<<gamma/CLHEP::GeV<<" GeV"<<G4endl; G4cout<<"Gamma = "<<gamma/CLHEP::GeV<<" GeV"<<G4endl;
G4cout<<"Amplitude = "<<amplitude/CLHEP::millibarn<<" millibarn"<<G4endl; G4cout<<"Amplitude = "<<amplitude/CLHEP::millibarn<<" millibarn"<<G4endl;
G4cout<<"ReggeSuppression = "<<100*suppressionfactor<<" %"<<G4endl; G4cout<<"ReggeSuppression = "<<100*suppressionfactor<<" %"<<G4endl;
G4cout<<"HadronLifeTime = "<<hadronlifetime; if (doDecays) G4cout<<" ns"<<G4endl; else G4cout<<" s"<<G4endl; G4cout<<"HadronLifeTime = "<<hadronlifetime;
if (doDecays) G4cout<<" ns"<<G4endl;
else G4cout<<" s"<<G4endl;
G4cout<<"ReggeModel = "<< reggemodel <<G4endl; G4cout<<"ReggeModel = "<< reggemodel <<G4endl;
G4cout<<"Mixing = "<< mixing*100 <<" %"<<G4endl; G4cout<<"Mixing = "<< mixing*100 <<" %"<<G4endl;
G4cout<<"DoDecays = "<< doDecays << G4endl; G4cout<<"DoDecays = "<< doDecays << G4endl;
if ((!doDecays && hadronlifetime>0.) ||
(doDecays && hadronlifetime<=0.) ){
G4cout << "WARNING: Inconsistent treatment of R-Hadron properties! Lifetime of " << hadronlifetime
<< " and doDecays= " << doDecays << G4endl;
}
checkfraction = 0; checkfraction = 0;
n_22 = 0; n_22 = 0;
n_23 = 0; n_23 = 0;
......
...@@ -174,16 +174,22 @@ load_files_for_rhadrons_scenario('SLHA_INPUT.DAT',spectrum) ...@@ -174,16 +174,22 @@ load_files_for_rhadrons_scenario('SLHA_INPUT.DAT',spectrum)
# Add any lines that were missing # Add any lines that were missing
# In case we want to use Pythia8 for decays during simulation # In case we want to use Pythia8 for decays during simulation
lifetime = float(simdict['LIFETIME']) if simdict.has_key("LIFETIME") else -1. lifetime = float(simdict['LIFETIME']) if simdict.has_key("LIFETIME") else -1.
if lifetime<1. and hasattr(runArgs,'outputEVNT_TRFile'): if lifetime>0.
rhlog.warning('Lifetime specified at <1ns, but you are writing stopped particle positions.') if lifetime<1. and hasattr(runArgs,'outputEVNT_TRFile'):
rhlog.warning('Assuming that you mean to use infinite lifetimes, and ignoring the setting') rhlog.warning('Lifetime specified at <1ns, but you are writing stopped particle positions.')
rhlog.warning('Assuming that you mean to use infinite lifetimes, and ignoring the setting')
else:
addLineToPhysicsConfiguration("DoDecays","1")
addLineToPhysicsConfiguration("HadronLifeTime", str(lifetime))
# If we reading particle records, and the lifetime is short, stop them as well
if lifetime<1. and hasattr(runArgs,'inputEVNT_TRFile'):
addLineToPhysicsConfiguration("DoDecays","1")
addLineToPhysicsConfiguration("HadronLifeTime", 0.000001)
else: else:
addLineToPhysicsConfiguration("DoDecays","1") # Stable case. Can be unset lifetime or lifetime=0 or lifetime=-1
addLineToPhysicsConfiguration("HadronLifeTime", str(lifetime)) addLineToPhysicsConfiguration("DoDecays","0")
# If we reading particle records, and the lifetime is short, stop them as well addLineToPhysicsConfiguration("HadronLifeTime", -1)
if lifetime<1. and hasattr(runArgs,'inputEVNT_TRFile'):
addLineToPhysicsConfiguration("DoDecays","1")
addLineToPhysicsConfiguration("HadronLifeTime", 0.000001)
# Capture Pythia8 commands # Capture Pythia8 commands
# Set up R-hadron masses in Pythia8 # Set up R-hadron masses in Pythia8
......
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