Skip to content
Snippets Groups Projects

Draft: Fix truth matching bug for long tracks

Closed Izaac Sanderswood requested to merge isanders-truth-matching-fix into 2024-patches
1 file
+ 35
35
Compare changes
  • Side-by-side
  • Inline
@@ -94,44 +94,44 @@ namespace {
}
}
// If the Track has total # Velo hits > 2 AND total # T hits > 2, cumul mother and daughter
if ( ( 2 < total.nVelo ) && ( 2 < total.nT ) ) {
for ( auto& counter1 : truthCounters ) {
if ( counter1.nT == 0 ) continue;
const LHCb::MCVertex* vOrigin = counter1.particle->originVertex();
if ( 0 != vOrigin ) {
const LHCb::MCParticle* mother = vOrigin->mother();
if ( 0 == mother ) continue; // no ancestor;
for ( auto& counter2 : truthCounters ) {
if ( mother == counter2.particle ) {
if ( counter2.nVelo == 0 ) continue;
// // If the Track has total # Velo hits > 2 AND total # T hits > 2, cumul mother and daughter
// if ( ( 2 < total.nVelo ) && ( 2 < total.nT ) ) {
// for ( auto& counter1 : truthCounters ) {
// if ( counter1.nT == 0 ) continue;
// const LHCb::MCVertex* vOrigin = counter1.particle->originVertex();
// if ( 0 != vOrigin ) {
// const LHCb::MCParticle* mother = vOrigin->mother();
// if ( 0 == mother ) continue; // no ancestor;
// for ( auto& counter2 : truthCounters ) {
// if ( mother == counter2.particle ) {
// if ( counter2.nVelo == 0 ) continue;
// if ( msgLevel( MSG::DEBUG ) )
// debug() << " *** Particle " << counter1.particle->key() << "[" <<
// counter1.particle->particleID().pid()
// << "] (" << counter1.nVelo << "," << counter1.nTT << "," << counter1.nT << ")"
// << " is daughter of " << counter2.particle->key() << "["
// << counter2.particle->particleID().pid() << "] (" << counter2.nVelo << "," << counter2.nTT
// << "," << counter2.nT << ")"
// << " type " << vOrigin->type() << ". Merge hits to tag both." << endmsg;
// // if ( msgLevel( MSG::DEBUG ) )
// // debug() << " *** Particle " << counter1.particle->key() << "[" <<
// // counter1.particle->particleID().pid()
// // << "] (" << counter1.nVelo << "," << counter1.nTT << "," << counter1.nT << ")"
// // << " is daughter of " << counter2.particle->key() << "["
// // << counter2.particle->particleID().pid() << "] (" << counter2.nVelo << "," << counter2.nTT
// // << "," << counter2.nT << ")"
// // << " type " << vOrigin->type() << ". Merge hits to tag both." << endmsg;
//== Daughter hits are added to mother.
counter2.nVelo += counter1.nVelo;
counter2.nTT += counter1.nTT;
counter2.nT += counter1.nT;
if ( counter2.nVelo > total.nVelo ) counter2.nVelo = total.nVelo;
if ( counter2.nTT > total.nTT ) counter2.nTT = total.nTT;
if ( counter2.nT > total.nT ) counter2.nT = total.nT;
// //== Daughter hits are added to mother.
// counter2.nVelo += counter1.nVelo;
// counter2.nTT += counter1.nTT;
// counter2.nT += counter1.nT;
// if ( counter2.nVelo > total.nVelo ) counter2.nVelo = total.nVelo;
// if ( counter2.nTT > total.nTT ) counter2.nTT = total.nTT;
// if ( counter2.nT > total.nT ) counter2.nT = total.nT;
//== Mother hits overwrite Daughter hits
counter1.nVelo = counter2.nVelo;
counter1.nTT = counter2.nTT;
counter1.nT = counter2.nT;
}
}
}
}
}
// //== Mother hits overwrite Daughter hits
// counter1.nVelo = counter2.nVelo;
// counter1.nTT = counter2.nTT;
// counter1.nT = counter2.nT;
// }
// }
// }
// }
// }
return {total, truthCounters};
}
Loading