26 float bestWeight(0.f);
31 for (
const MCParticleWeightMap::value_type &mapEntry : hitMCParticleWeightMap) mcParticleVector.push_back(mapEntry.first);
34 for (
const MCParticle *
const pMCParticle : mcParticleVector)
36 const float weight(hitMCParticleWeightMap.at(pMCParticle));
38 if (weight > bestWeight)
41 pBestMCParticle = pMCParticle;
48 return pBestMCParticle;
56 for (
const CaloHit *
const pCaloHit : *pCaloHitList)
61 for (
const MCParticleWeightMap::value_type &mapEntry : hitMCParticleWeightMap) mcParticleVector.push_back(mapEntry.first);
64 for (
const MCParticle *
const pMCParticle : mcParticleVector)
66 const float weight(hitMCParticleWeightMap.at(pMCParticle));
67 mcParticleWeightMap[pMCParticle] += weight;
71 float bestWeight(0.f);
75 for (
const MCParticleWeightMap::value_type &mapEntry : mcParticleWeightMap) mcParticleVector.push_back(mapEntry.first);
78 for (
const MCParticle *
const pCurrentMCParticle : mcParticleVector)
80 const float currentWeight(mcParticleWeightMap.at(pCurrentMCParticle));
82 if (currentWeight > bestWeight)
84 pBestMCParticle = pCurrentMCParticle;
85 bestWeight = currentWeight;
92 return pBestMCParticle;
Header file for the mc particle class.
Header file for the mc particle helper class.
static const MCParticle * GetMainMCParticle(const T *const pT)
Find the mc particle making the largest contribution to a specified calo hit, track or cluster.