LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::VisualParticleMonitoringAlgorithm Class Reference

VisualParticleMonitoringAlgorithm class. More...

#include "VisualParticleMonitoringAlgorithm.h"

Inheritance diagram for lar_content::VisualParticleMonitoringAlgorithm:

Public Member Functions

 VisualParticleMonitoringAlgorithm ()
 Default constructor. More...
 
virtual ~VisualParticleMonitoringAlgorithm ()
 

Private Member Functions

pandora::StatusCode Run ()
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

std::string m_caloHitListName
 Name of input calo hit list. More...
 
std::string m_pfoListName
 Name of input PFO list. More...
 
bool m_visualizeMC
 Whether or not to visualize MC particles. More...
 
bool m_visualizePfo
 Whether or not to visualize PFOs. More...
 
bool m_visualizeSlice
 Whether or not to visualize reconstructed slices. More...
 
bool m_groupMCByPdg
 Whether or not to group MC particles by particle id. More...
 
bool m_showPfoByPid
 Whether or not to colour PFOs by particle id. More...
 
bool m_showPfoMatchedMC
 Whether or not to display the best matched MC particle for a PFO. More...
 
bool m_isTestBeam
 Whether or not this is a test beam experiment. More...
 
float m_transparencyThresholdE
 Cell energy for which transparency is saturated (0%, fully opaque) More...
 
float m_energyScaleThresholdE
 Cell energy for which color is at top end of continous color palette. More...
 
float m_scalingFactor
 TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too) More...
 

Detailed Description

Constructor & Destructor Documentation

lar_content::VisualParticleMonitoringAlgorithm::VisualParticleMonitoringAlgorithm ( )

Default constructor.

Definition at line 22 of file VisualParticleMonitoringAlgorithm.cc.

References m_energyScaleThresholdE, m_scalingFactor, and m_transparencyThresholdE.

22  :
23  m_visualizeMC(false),
24  m_visualizePfo(false),
25  m_visualizeSlice(false),
26  m_groupMCByPdg(false),
27  m_showPfoByPid(false),
28  m_showPfoMatchedMC(false),
29  m_isTestBeam{false},
32  m_scalingFactor{1.f}
33 {
34 }
bool m_visualizeSlice
Whether or not to visualize reconstructed slices.
float m_transparencyThresholdE
Cell energy for which transparency is saturated (0%, fully opaque)
float m_energyScaleThresholdE
Cell energy for which color is at top end of continous color palette.
bool m_showPfoMatchedMC
Whether or not to display the best matched MC particle for a PFO.
bool m_showPfoByPid
Whether or not to colour PFOs by particle id.
bool m_isTestBeam
Whether or not this is a test beam experiment.
float m_scalingFactor
TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too) ...
bool m_groupMCByPdg
Whether or not to group MC particles by particle id.
bool m_visualizeMC
Whether or not to visualize MC particles.
lar_content::VisualParticleMonitoringAlgorithm::~VisualParticleMonitoringAlgorithm ( )
virtual

Definition at line 38 of file VisualParticleMonitoringAlgorithm.cc.

39 {
40 }

Member Function Documentation

StatusCode lar_content::VisualParticleMonitoringAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 474 of file VisualParticleMonitoringAlgorithm.cc.

References m_caloHitListName, m_energyScaleThresholdE, m_groupMCByPdg, m_isTestBeam, m_pfoListName, m_scalingFactor, m_showPfoByPid, m_showPfoMatchedMC, m_transparencyThresholdE, m_visualizeMC, m_visualizePfo, and m_visualizeSlice.

475 {
476  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "CaloHitListName", m_caloHitListName));
477  if (m_caloHitListName.empty())
478  m_caloHitListName = "CaloHitList2D";
479  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "PfoListName", m_pfoListName));
480  if (m_pfoListName.empty())
481  m_pfoListName = "RecreatedPfos";
482  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizeMC", m_visualizeMC));
483  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizePFO", m_visualizePfo));
484  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizeSlice", m_visualizeSlice));
485  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "GroupMCByPDG", m_groupMCByPdg));
486  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPFOByPID", m_showPfoByPid));
487  PANDORA_RETURN_RESULT_IF_AND_IF(
488  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPFOMatchedMC", m_showPfoMatchedMC));
489  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "IsTestBeam", m_isTestBeam));
490  PANDORA_RETURN_RESULT_IF_AND_IF(
491  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TransparencyThresholdE", m_transparencyThresholdE));
492  PANDORA_RETURN_RESULT_IF_AND_IF(
493  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "EnergyScaleThresholdE", m_energyScaleThresholdE));
494  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ScalingFactor", m_scalingFactor));
495 
496  return STATUS_CODE_SUCCESS;
497 }
bool m_visualizeSlice
Whether or not to visualize reconstructed slices.
float m_transparencyThresholdE
Cell energy for which transparency is saturated (0%, fully opaque)
float m_energyScaleThresholdE
Cell energy for which color is at top end of continous color palette.
bool m_showPfoMatchedMC
Whether or not to display the best matched MC particle for a PFO.
bool m_showPfoByPid
Whether or not to colour PFOs by particle id.
bool m_isTestBeam
Whether or not this is a test beam experiment.
float m_scalingFactor
TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too) ...
bool m_groupMCByPdg
Whether or not to group MC particles by particle id.
std::string m_caloHitListName
Name of input calo hit list.
bool m_visualizeMC
Whether or not to visualize MC particles.
StatusCode lar_content::VisualParticleMonitoringAlgorithm::Run ( )
private

Definition at line 44 of file VisualParticleMonitoringAlgorithm.cc.

References util::abs(), util::empty(), lar_content::LArPfoHelper::GetBreadthFirstHierarchyRepresentation(), lar_content::LArMCParticleHelper::GetBreadthFirstHierarchyRepresentation(), lar_content::LArPfoHelper::GetCaloHits(), lar_content::LArPfoHelper::GetIsolatedCaloHits(), lar_content::LArMCParticleHelper::GetMainMCParticle(), lar_content::LArMCParticleHelper::IsBeamNeutrinoFinalState(), lar_content::LArMCParticleHelper::IsBeamParticle(), lar_content::LArMCParticleHelper::IsCosmicRay(), lar_content::LArPfoHelper::IsTrack(), m_caloHitListName, m_energyScaleThresholdE, lar_content::LArMCParticleHelper::PrimaryParameters::m_foldBackHierarchy, m_groupMCByPdg, m_isTestBeam, lar_content::LArMCParticleHelper::PrimaryParameters::m_maxPhotonPropagation, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitsForGoodView, lar_content::LArMCParticleHelper::PrimaryParameters::m_minHitSharingFraction, lar_content::LArMCParticleHelper::PrimaryParameters::m_minPrimaryGoodHits, m_pfoListName, m_scalingFactor, m_showPfoByPid, m_showPfoMatchedMC, m_transparencyThresholdE, m_visualizeMC, m_visualizePfo, m_visualizeSlice, lar_content::LArMCParticleHelper::SelectReconstructableMCParticles(), util::to_string(), and value.

45 {
46 #ifdef MONITORING
47  LArMCParticleHelper::MCContributionMap targetMCParticleToHitsMap;
49  {
50  const CaloHitList *pCaloHitList(nullptr);
51  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_caloHitListName, pCaloHitList));
52  const MCParticleList *pMCParticleList(nullptr);
53  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*this, pMCParticleList));
54  this->MakeSelection(pMCParticleList, pCaloHitList, targetMCParticleToHitsMap);
55  }
56 
57  if (m_visualizeMC)
58  {
59  if (m_groupMCByPdg)
60  this->VisualizeMCByPdgCode(targetMCParticleToHitsMap);
61  else
62  this->VisualizeIndependentMC(targetMCParticleToHitsMap);
63  }
64  if (m_visualizePfo)
65  {
66  const PfoList *pPfoList(nullptr);
67  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_pfoListName, pPfoList));
68  if (m_showPfoByPid)
69  {
70  this->VisualizePfoByParticleId(*pPfoList);
71  }
72  else
73  {
75  this->VisualizeIndependentPfo(*pPfoList, targetMCParticleToHitsMap);
76  else
77  this->VisualizeIndependentPfo(*pPfoList);
78  }
79  }
80  if (m_visualizeSlice)
81  {
82  const PfoList *pPfoList(nullptr);
83  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_pfoListName, pPfoList));
84  this->VisualizeReconstructedSlice(*pPfoList);
85  }
86 #endif // MONITORING
87  return STATUS_CODE_SUCCESS;
88 }
std::unordered_map< const pandora::MCParticle *, pandora::CaloHitList > MCContributionMap
bool m_visualizeSlice
Whether or not to visualize reconstructed slices.
bool m_showPfoMatchedMC
Whether or not to display the best matched MC particle for a PFO.
bool m_showPfoByPid
Whether or not to colour PFOs by particle id.
bool m_groupMCByPdg
Whether or not to group MC particles by particle id.
std::string m_caloHitListName
Name of input calo hit list.
bool m_visualizeMC
Whether or not to visualize MC particles.

Member Data Documentation

std::string lar_content::VisualParticleMonitoringAlgorithm::m_caloHitListName
private

Name of input calo hit list.

Definition at line 102 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

float lar_content::VisualParticleMonitoringAlgorithm::m_energyScaleThresholdE
private

Cell energy for which color is at top end of continous color palette.

Definition at line 112 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), Run(), and VisualParticleMonitoringAlgorithm().

bool lar_content::VisualParticleMonitoringAlgorithm::m_groupMCByPdg
private

Whether or not to group MC particles by particle id.

Definition at line 107 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualParticleMonitoringAlgorithm::m_isTestBeam
private

Whether or not this is a test beam experiment.

Definition at line 110 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

std::string lar_content::VisualParticleMonitoringAlgorithm::m_pfoListName
private

Name of input PFO list.

Definition at line 103 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

float lar_content::VisualParticleMonitoringAlgorithm::m_scalingFactor
private

TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too)

Definition at line 113 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), Run(), and VisualParticleMonitoringAlgorithm().

bool lar_content::VisualParticleMonitoringAlgorithm::m_showPfoByPid
private

Whether or not to colour PFOs by particle id.

Definition at line 108 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualParticleMonitoringAlgorithm::m_showPfoMatchedMC
private

Whether or not to display the best matched MC particle for a PFO.

Definition at line 109 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

float lar_content::VisualParticleMonitoringAlgorithm::m_transparencyThresholdE
private

Cell energy for which transparency is saturated (0%, fully opaque)

Definition at line 111 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), Run(), and VisualParticleMonitoringAlgorithm().

bool lar_content::VisualParticleMonitoringAlgorithm::m_visualizeMC
private

Whether or not to visualize MC particles.

Definition at line 104 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualParticleMonitoringAlgorithm::m_visualizePfo
private

Whether or not to visualize PFOs.

Definition at line 105 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualParticleMonitoringAlgorithm::m_visualizeSlice
private

Whether or not to visualize reconstructed slices.

Definition at line 106 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().


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