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)
41 mcParticleList.push_back(mapEntry.first);
42 mcParticleList.sort(LArMCParticleHelper::SortByMomentum);
44 for (
const MCParticle *
const pMCParticle : mcParticleList)
46 const float weight(mcParticleWeightMap.at(pMCParticle));
50 pBestMCParticle = pMCParticle;
58 return ((PHOTON != pBestMCParticle->GetParticleId()) && (E_MINUS !=
std::abs(pBestMCParticle->GetParticleId())));
63 bool CheatingPfoCharacterisationAlgorithm::IsClearTrack(
const Cluster *
const )
const 65 throw StatusCodeException(STATUS_CODE_NOT_ALLOWED);
Header file for the pfo helper class.
constexpr auto abs(T v)
Returns the absolute value of the argument.
Header file for the cheating pfo characterisation algorithm class.
Header file for the lar monte carlo particle helper helper class.