diff --git a/Simulation/G4Extensions/RHadrons/src/G4ProcessHelper.cxx b/Simulation/G4Extensions/RHadrons/src/G4ProcessHelper.cxx index aa4f056c7e347e3065bfcbd907cac123db223f5a..f7884a06a3ca6b9f2c468a987eedd49f153138ec 100644 --- a/Simulation/G4Extensions/RHadrons/src/G4ProcessHelper.cxx +++ b/Simulation/G4Extensions/RHadrons/src/G4ProcessHelper.cxx @@ -113,11 +113,19 @@ G4ProcessHelper::G4ProcessHelper() G4cout<<"Gamma = "<<gamma/CLHEP::GeV<<" GeV"<<G4endl; G4cout<<"Amplitude = "<<amplitude/CLHEP::millibarn<<" millibarn"<<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<<"Mixing = "<< mixing*100 <<" %"<<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; n_22 = 0; n_23 = 0; diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.RHadronsPythia8.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.RHadronsPythia8.py index 6e562dfcabcf8580c8e93c9a03faa19cc3b3faee..6ccb318b5cbb7f16820a8f13367a00418aaf9339 100644 --- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.RHadronsPythia8.py +++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.RHadronsPythia8.py @@ -174,16 +174,22 @@ load_files_for_rhadrons_scenario('SLHA_INPUT.DAT',spectrum) # Add any lines that were missing # In case we want to use Pythia8 for decays during simulation lifetime = float(simdict['LIFETIME']) if simdict.has_key("LIFETIME") else -1. -if lifetime<1. and hasattr(runArgs,'outputEVNT_TRFile'): - 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') +if lifetime>0. + if lifetime<1. and hasattr(runArgs,'outputEVNT_TRFile'): + 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: - 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) + # Stable case. Can be unset lifetime or lifetime=0 or lifetime=-1 + addLineToPhysicsConfiguration("DoDecays","0") + addLineToPhysicsConfiguration("HadronLifeTime", -1) + # Capture Pythia8 commands # Set up R-hadron masses in Pythia8