9 #include "Pandora/AlgorithmHeaders.h" 21 bool CheatingPfoCharacterisationAlgorithm::IsClearTrack(
const ParticleFlowObject *
const pPfo)
const 23 CaloHitList caloHitList;
24 LArPfoHelper::GetCaloHits(pPfo, TPC_VIEW_U, caloHitList);
25 LArPfoHelper::GetCaloHits(pPfo, TPC_VIEW_V, caloHitList);
26 LArPfoHelper::GetCaloHits(pPfo, TPC_VIEW_W, caloHitList);
28 MCParticleWeightMap mcParticleWeightMap;
30 for (
const CaloHit *
const pCaloHit : caloHitList)
32 for (
const MCParticleWeightMap::value_type &mapEntry : pCaloHit->GetMCParticleWeightMap())
33 mcParticleWeightMap[mapEntry.first] += mapEntry.second;
36 float bestWeight(0.
f);
37 const MCParticle *pBestMCParticle(
nullptr);
39 MCParticleList mcParticleList;
40 for (
const auto &mapEntry : mcParticleWeightMap) mcParticleList.push_back(mapEntry.first);
41 mcParticleList.sort(LArMCParticleHelper::SortByMomentum);
43 for (
const MCParticle *
const pMCParticle : mcParticleList)
45 const float weight(mcParticleWeightMap.at(pMCParticle));
49 pBestMCParticle = pMCParticle;
57 return ((PHOTON != pBestMCParticle->GetParticleId()) && (E_MINUS != std::abs(pBestMCParticle->GetParticleId())));
62 bool CheatingPfoCharacterisationAlgorithm::IsClearTrack(
const Cluster *
const )
const 64 throw StatusCodeException(STATUS_CODE_NOT_ALLOWED);
Header file for the pfo helper class.
Header file for the cheating pfo characterisation algorithm class.
Header file for the lar monte carlo particle helper helper class.