Classes | Public Types | Static Public Member Functions | Private Types | Static Private Member Functions | List of all members
lar_content::LArHierarchyHelper Class Reference

LArHierarchyHelper class. More...

#include <LArHierarchyHelper.h>

Classes

class  FoldingParameters
 FoldingParameters class. More...
 
class  MatchInfo
 MatcheInfo class. More...
 
class  MCHierarchy
 MCHierarchy class. More...
 
class  MCMatches
 MCMatches class. More...
 
class  QualityCuts
 QualityCuts class. More...
 
class  RecoHierarchy
 RecoHierarchy class. More...
 

Public Types

typedef std::vector< MCMatchesMCMatchesVector
 

Static Public Member Functions

static void FillMCHierarchy (const pandora::MCParticleList &mcParticleList, const pandora::CaloHitList &caloHitList, const FoldingParameters &foldParameters, MCHierarchy &hierarchy)
 Fill an MC hierarchy based on the specified folding criteria (see MCHierarchy::FillHierarchy for details) More...
 
static void FillRecoHierarchy (const pandora::PfoList &pfoList, const FoldingParameters &foldParameters, RecoHierarchy &hierarchy)
 Fill a reconstructed hierarchy based on the specified folding criteria (see RecoHierarchy::FillHierarchy for details) More...
 
static void MatchHierarchies (const MCHierarchy &mcHierarchy, const RecoHierarchy &recoHierarchy, MatchInfo &matchInfo)
 Finds the matches between reconstructed and MC hierarchies. More...
 

Private Types

typedef std::set< const pandora::MCParticle * > MCParticleSet
 
typedef std::set< const pandora::ParticleFlowObject * > PfoSet
 

Static Private Member Functions

static const pandora::MCParticle * GetMCPrimaries (const pandora::MCParticleList &mcParticleList, MCParticleSet &primaries)
 Retrieves the primary MC particles from a list and returns the root (neutrino) for hierarchy, if it exists. More...
 
static const pandora::ParticleFlowObject * GetRecoPrimaries (const pandora::PfoList &pfoList, PfoSet &primaries)
 Retrieves the primary PFOs from a list and returns the root (neutrino) for hierarchy, if it exists. More...
 

Detailed Description

LArHierarchyHelper class.

Definition at line 24 of file LArHierarchyHelper.h.

Member Typedef Documentation

Definition at line 717 of file LArHierarchyHelper.h.

typedef std::set<const pandora::MCParticle *> lar_content::LArHierarchyHelper::MCParticleSet
private

Definition at line 857 of file LArHierarchyHelper.h.

typedef std::set<const pandora::ParticleFlowObject *> lar_content::LArHierarchyHelper::PfoSet
private

Definition at line 858 of file LArHierarchyHelper.h.

Member Function Documentation

void lar_content::LArHierarchyHelper::FillMCHierarchy ( const pandora::MCParticleList &  mcParticleList,
const pandora::CaloHitList &  caloHitList,
const FoldingParameters foldParameters,
MCHierarchy hierarchy 
)
static

Fill an MC hierarchy based on the specified folding criteria (see MCHierarchy::FillHierarchy for details)

Parameters
mcParticleListThe MCParticle list to use to fill this hierarchy
caloHitListThe list of CaloHits to use to fill this hierarchy
foldParametersThe folding parameters to use for the hierarchy
hierarchyThe output MC hierarchy

Definition at line 1401 of file LArHierarchyHelper.cc.

1403 {
1404  hierarchy.FillHierarchy(mcParticleList, caloHitList, foldParameters);
1405 }
void lar_content::LArHierarchyHelper::FillRecoHierarchy ( const pandora::PfoList &  pfoList,
const FoldingParameters foldParameters,
RecoHierarchy hierarchy 
)
static

Fill a reconstructed hierarchy based on the specified folding criteria (see RecoHierarchy::FillHierarchy for details)

Parameters
pfoListThe ParticleFlowObject list to use to fill this hierarchy
foldParametersThe folding parameters to use for the hierarchy
hierarchyThe output reconstructed hierarchy

Definition at line 1409 of file LArHierarchyHelper.cc.

1410 {
1411  hierarchy.FillHierarchy(pfoList, foldParameters);
1412 }
const MCParticle * lar_content::LArHierarchyHelper::GetMCPrimaries ( const pandora::MCParticleList &  mcParticleList,
MCParticleSet primaries 
)
staticprivate

Retrieves the primary MC particles from a list and returns the root (neutrino) for hierarchy, if it exists.

Parameters
mcParticleListThe input list of MC particles
primariesThe output set of primary MC particles
Returns
The root neutrino, if it exists, or nullptr

Definition at line 1424 of file LArHierarchyHelper.cc.

1425 {
1426  const MCParticle *pRoot{nullptr};
1427  for (const MCParticle *pMCParticle : mcParticleList)
1428  {
1429  try
1430  {
1431  const MCParticle *const pPrimary{LArMCParticleHelper::GetPrimaryMCParticle(pMCParticle)};
1433  primaries.insert(pPrimary);
1434  else
1435  primaries.insert(pPrimary);
1436  }
1437  catch (const StatusCodeException &)
1438  {
1439  if (LArMCParticleHelper::IsNeutrino(pMCParticle))
1440  pRoot = pMCParticle;
1441  else if (pMCParticle->GetParticleId() != 111 && pMCParticle->GetParticleId() < 1e9)
1442  std::cout << "LArHierarchyHelper::MCHierarchy::FillHierarchy: MC particle with PDG code " << pMCParticle->GetParticleId()
1443  << " at address " << pMCParticle << " has no associated primary particle" << std::endl;
1444  }
1445  }
1446 
1447  return pRoot;
1448 }
static const pandora::MCParticle * GetPrimaryMCParticle(const pandora::MCParticle *const pMCParticle)
Get the primary parent mc particle.
static bool IsTriggeredBeamParticle(const pandora::MCParticle *const pMCParticle)
Returns true if passed a primary triggered beam MCParticle.
static bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.
QTextStream & endl(QTextStream &s)
const ParticleFlowObject * lar_content::LArHierarchyHelper::GetRecoPrimaries ( const pandora::PfoList &  pfoList,
PfoSet primaries 
)
staticprivate

Retrieves the primary PFOs from a list and returns the root (neutrino) for hierarchy, if it exists.

Parameters
pfoListThe input list of PFOs
primariesThe output set of primary PFOs
Returns
The root neutrino, if it exists, or nullptr

Definition at line 1450 of file LArHierarchyHelper.cc.

1451 {
1452  const ParticleFlowObject *pRoot{nullptr};
1453  PfoSet cosmicPfos;
1454  for (const ParticleFlowObject *pPfo : pfoList)
1455  {
1456  if (LArPfoHelper::IsNeutrino(pPfo))
1457  {
1458  pRoot = pPfo;
1459  break;
1460  }
1461  else
1462  {
1463  const ParticleFlowObject *const pParent{LArPfoHelper::GetParentPfo(pPfo)};
1464  if (pParent && LArPfoHelper::IsNeutrino(pParent))
1465  {
1466  pRoot = pParent;
1467  break;
1468  }
1469  else
1470  {
1471  // Should be in a test beam scenario
1472  const int tier{LArPfoHelper::GetHierarchyTier(pPfo)};
1473  if (tier == 0 && LArPfoHelper::IsTestBeam(pPfo))
1474  {
1475  // Triggered beam particle
1476  primaries.insert(pPfo);
1477  continue;
1478  }
1479  if (tier > 1)
1480  continue;
1481  if (!LArPfoHelper::IsTestBeam(pPfo))
1482  {
1483  // Cosmic induced
1484  cosmicPfos.insert(pPfo);
1485  }
1486  }
1487  }
1488  }
1489  if (pRoot && LArPfoHelper::IsNeutrino(pRoot))
1490  {
1491  const PfoList &children{pRoot->GetDaughterPfoList()};
1492  for (const ParticleFlowObject *pPrimary : children)
1493  primaries.insert(pPrimary);
1494  }
1495  else
1496  {
1497  for (const ParticleFlowObject *pPfo : cosmicPfos)
1498  primaries.insert(pPfo);
1499  }
1500 
1501  return pRoot;
1502 }
static int GetHierarchyTier(const pandora::ParticleFlowObject *const pPfo)
Determine the position in the hierarchy for the MCParticle.
static bool IsTestBeam(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a test beam particle.
static const pandora::ParticleFlowObject * GetParentPfo(const pandora::ParticleFlowObject *const pPfo)
Get the primary parent pfo.
static bool IsNeutrino(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a neutrino or (antineutrino)
std::set< const pandora::ParticleFlowObject * > PfoSet
void lar_content::LArHierarchyHelper::MatchHierarchies ( const MCHierarchy mcHierarchy,
const RecoHierarchy recoHierarchy,
MatchInfo matchInfo 
)
static

Finds the matches between reconstructed and MC hierarchies.

Parameters
mcHierarchyThe MC hiearchy
recoHierarchyThe reconstructed hierarchy
matchInfoThe output match information

Definition at line 1416 of file LArHierarchyHelper.cc.

1417 {
1418  matchInfo.Match(mcHierarchy, recoHierarchy);
1419 }

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