Skip to content
Snippets Groups Projects
Commit afb48dbc authored by Andrii Verbytskyi's avatar Andrii Verbytskyi Committed by Frank Winklmeier
Browse files

Drop isStableOrSimDecayedv2

Drop isStableOrSimDecayedv2
parent c257dc25
No related branches found
No related tags found
No related merge requests found
......@@ -42,17 +42,13 @@ namespace MC
template <class T> inline bool isSimInteracting(const T& p) { return isGenStable<T>(p) && isInteracting<T>(p);}
/// @brief Identify if particle is satble or decayed in simulation. + a pathological case of decayed particle w/o end vertex.
/// The decayed particles w/o end vertex might occur in case of simulation of long lived particles in Geant stripped off the decay products.
/// I.e. those particles should be re-decayed later.
template <class T> inline bool isStableOrSimDecayed(const T& p) {
const auto vertex = p->end_vertex();
return ( isStable<T>(p) || (isDecayed<T>(p) && (!vertex || HepMC::is_simulation_vertex(vertex))));
}
/// @brief Identify if particle is satble or decayed in simulation. w/o a pathological case of decayed particle w/o end vertex.
template <class T> inline bool isStableOrSimDecayedv2(const T& p) {
const auto vertex = p->end_vertex();
return ( isStable<T>(p) || (isDecayed<T>(p) && vertex && HepMC::is_simulation_vertex(vertex)));
}
/// @brief Identify a photon with zero energy. Probably a workaround for a generator bug.
template <class T> inline bool isZeroEnergyPhoton(const T& p) { return isPhoton<T>(p) && p->e() == 0;}
......
......@@ -231,18 +231,18 @@ bool JetTruthParticleSelectorTool::selector(const xAOD::TruthParticle* truthPart
switch( m_selectionMode) { // For now only 4 modes used in practice for jets...
// a switch statement is probably not optimal here...
case StableNoMuonNoNu:
result =( MC::isStableOrSimDecayedv2(truthPart) && !HepMC::is_simulation_particle(truthPart) && !MC::isZeroEnergyPhoton(truthPart) &&
result =( MC::isStableOrSimDecayed(truthPart) && !HepMC::is_simulation_particle(truthPart) && !MC::isZeroEnergyPhoton(truthPart) &&
passKinematics(truthPart) && !MC::isMuon(truthPart) && (!( MC::isStable(truthPart) && MC::isSpecialNonInteracting(truthPart))));
break;
case NuOnly:
result= ( MC::isStableOrSimDecayedv2(truthPart) && !HepMC::is_simulation_particle(truthPart) && !MC::isZeroEnergyPhoton(truthPart) &&
result= ( MC::isStableOrSimDecayed(truthPart) && !HepMC::is_simulation_particle(truthPart) && !MC::isZeroEnergyPhoton(truthPart) &&
passKinematics(truthPart) && MC::isStable(truthPart) && MC::isSpecialNonInteracting(truthPart));
break;
case MuonOnly:
result = MC::isMuon(truthPart);
break;
case NoWZDecay:
result = (MC::isStableOrSimDecayedv2(truthPart) && !HepMC::is_simulation_particle(truthPart) && !MC::isZeroEnergyPhoton(truthPart) &&
result = (MC::isStableOrSimDecayed(truthPart) && !HepMC::is_simulation_particle(truthPart) && !MC::isZeroEnergyPhoton(truthPart) &&
passKinematics(truthPart) &&
!isWZDecay(truthPart, m_wzLeptons, m_wzPhotonCone*m_wzPhotonCone) &&
!isLeptonFromTau(truthPart) );
......
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