From 87f8d1bc79e403b4e5904461971f97f131c0266c Mon Sep 17 00:00:00 2001 From: Andrew Hart Date: Tue, 26 May 2015 14:22:29 -0400 Subject: [PATCH] Treat status 104, used for metastable R-hadrons in Pythia8, the same as status 2 so that their interactions are also simulated. --- SimG4Core/Generators/src/Generator.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SimG4Core/Generators/src/Generator.cc b/SimG4Core/Generators/src/Generator.cc index 53bcf484d3687..1529137b17f3e 100644 --- a/SimG4Core/Generators/src/Generator.cc +++ b/SimG4Core/Generators/src/Generator.cc @@ -153,7 +153,8 @@ void Generator::HepMC2G4(const HepMC::GenEvent * evt_orig, G4Event * g4evt) // The selection is made considering if the partcile with status = 2 // have the end_vertex with a radius greater than the radius of beampipe // cilinder (no requirement on the Z of the vertex is applyed). - else if (2 == (*pitr)->status()) { + // Status 104 (metastable R-hadrons in Pythia8) is treated the same way. + else if (2 == (*pitr)->status() || 104 == (*pitr)->status()) { if ( (*pitr)->end_vertex() != 0 ) { double xx = (*pitr)->end_vertex()->position().x(); @@ -210,6 +211,10 @@ void Generator::HepMC2G4(const HepMC::GenEvent * evt_orig, G4Event * g4evt) double decay_length = 0.0; int status = (*pitr)->status(); + // treat status 104 (metastable R-hadrons in Pythia8) the same as status 2 + if (104 == status) + status = 2; + // check the status, 2 has end point with decay defined by generator if (1 == status || 2 == status) {