All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Private Member Functions | List of all members
lar_content::CheatingPfoCharacterisationAlgorithm Class Reference

CheatingPfoCharacterisationAlgorithm class. More...

#include <CheatingPfoCharacterisationAlgorithm.h>

Inheritance diagram for lar_content::CheatingPfoCharacterisationAlgorithm:
lar_content::PfoCharacterisationBaseAlgorithm

Private Member Functions

bool IsClearTrack (const pandora::ParticleFlowObject *const pPfo) const
 Whether pfo is identified as a clear track. More...
 
bool IsClearTrack (const pandora::Cluster *const pCluster) const
 Whether cluster is identified as a clear track. More...
 

Additional Inherited Members

- Public Member Functions inherited from lar_content::PfoCharacterisationBaseAlgorithm
 PfoCharacterisationBaseAlgorithm ()
 Default constructor. More...
 
virtual ~PfoCharacterisationBaseAlgorithm ()
 Destructor. More...
 
- Protected Member Functions inherited from lar_content::PfoCharacterisationBaseAlgorithm
pandora::StatusCode Run ()
 
virtual bool IsClearTrack3x2D (const pandora::ParticleFlowObject *const pPfo) const
 Whether pfo is identified as a clear track using its three clusters. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
- Protected Attributes inherited from lar_content::PfoCharacterisationBaseAlgorithm
std::string m_trackPfoListName
 The track pfo list name. More...
 
std::string m_showerPfoListName
 The shower pfo list name. More...
 
pandora::StringVector m_inputPfoListNames
 The names of the input pfo lists. More...
 
bool m_updateClusterIds
 Whether to update daughter cluster particle id labels to match pfo id. More...
 
bool m_postBranchAddition
 Whether to use configuration for shower clusters post branch addition. More...
 
bool m_useThreeDInformation
 Whether to use PFO and 3D information or clusters for characterisation. More...
 
unsigned int m_minTrackLikeViews
 The minimum number of track-like views to declare a pfo as track-like. More...
 

Detailed Description

CheatingPfoCharacterisationAlgorithm class.

Definition at line 19 of file CheatingPfoCharacterisationAlgorithm.h.

Member Function Documentation

bool lar_content::CheatingPfoCharacterisationAlgorithm::IsClearTrack ( const pandora::ParticleFlowObject *const  pPfo) const
privatevirtual

Whether pfo is identified as a clear track.

Parameters
pPfoaddress of the relevant pfo
Returns
boolean

Implements lar_content::PfoCharacterisationBaseAlgorithm.

Definition at line 21 of file CheatingPfoCharacterisationAlgorithm.cc.

22 {
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);
27 
28  MCParticleWeightMap mcParticleWeightMap;
29 
30  for (const CaloHit *const pCaloHit : caloHitList)
31  {
32  for (const MCParticleWeightMap::value_type &mapEntry : pCaloHit->GetMCParticleWeightMap())
33  mcParticleWeightMap[mapEntry.first] += mapEntry.second;
34  }
35 
36  float bestWeight(0.f);
37  const MCParticle *pBestMCParticle(nullptr);
38 
39  MCParticleList mcParticleList;
40  for (const auto &mapEntry : mcParticleWeightMap)
41  mcParticleList.push_back(mapEntry.first);
42  mcParticleList.sort(LArMCParticleHelper::SortByMomentum);
43 
44  for (const MCParticle *const pMCParticle : mcParticleList)
45  {
46  const float weight(mcParticleWeightMap.at(pMCParticle));
47 
48  if (weight > bestWeight)
49  {
50  pBestMCParticle = pMCParticle;
51  bestWeight = weight;
52  }
53  }
54 
55  if (!pBestMCParticle)
56  return false;
57 
58  return ((PHOTON != pBestMCParticle->GetParticleId()) && (E_MINUS != std::abs(pBestMCParticle->GetParticleId())));
59 }
static bool SortByMomentum(const pandora::MCParticle *const pLhs, const pandora::MCParticle *const pRhs)
Sort mc particles by their momentum.
T abs(T value)
static void GetCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of calo hits of a particular hit type from a list of pfos.
bool lar_content::CheatingPfoCharacterisationAlgorithm::IsClearTrack ( const pandora::Cluster *const  pCluster) const
privatevirtual

Whether cluster is identified as a clear track.

Parameters
pClusteraddress of the relevant cluster
Returns
boolean

Implements lar_content::PfoCharacterisationBaseAlgorithm.


The documentation for this class was generated from the following files: