LArSoft  v10_04_05
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 23 of file VisualParticleMonitoringAlgorithm.cc.

References m_energyScaleThresholdE, m_scalingFactor, and m_transparencyThresholdE.

23  :
24  m_visualizeMC(false),
25  m_visualizePfo(false),
26  m_visualizeSlice(false),
27  m_groupMCByPdg(false),
28  m_showPfoByPid(false),
29  m_showPfoMatchedMC(false),
30  m_isTestBeam{false},
33  m_scalingFactor{1.f}
34 {
35 }
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 39 of file VisualParticleMonitoringAlgorithm.cc.

40 {
41 }

Member Function Documentation

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

Definition at line 472 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.

473 {
474  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "CaloHitListName", m_caloHitListName));
475  if (m_caloHitListName.empty())
476  m_caloHitListName = "CaloHitList2D";
477  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "PfoListName", m_pfoListName));
478  if (m_pfoListName.empty())
479  m_pfoListName = "RecreatedPfos";
480  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizeMC", m_visualizeMC));
481  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizePFO", m_visualizePfo));
482  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizeSlice", m_visualizeSlice));
483  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "GroupMCByPDG", m_groupMCByPdg));
484  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPFOByPID", m_showPfoByPid));
485  PANDORA_RETURN_RESULT_IF_AND_IF(
486  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPFOMatchedMC", m_showPfoMatchedMC));
487  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "IsTestBeam", m_isTestBeam));
488  PANDORA_RETURN_RESULT_IF_AND_IF(
489  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TransparencyThresholdE", m_transparencyThresholdE));
490  PANDORA_RETURN_RESULT_IF_AND_IF(
491  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "EnergyScaleThresholdE", m_energyScaleThresholdE));
492  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ScalingFactor", m_scalingFactor));
493 
494  return STATUS_CODE_SUCCESS;
495 }
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 45 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::GetParentMCParticle(), lar_content::LArMCParticleHelper::IsNeutrino(), lar_content::LArPfoHelper::IsTrack(), m_caloHitListName, m_energyScaleThresholdE, m_groupMCByPdg, m_pfoListName, m_scalingFactor, m_showPfoByPid, m_showPfoMatchedMC, m_transparencyThresholdE, m_visualizeMC, m_visualizePfo, m_visualizeSlice, util::to_string(), and value.

46 {
47 #ifdef MONITORING
48  LArMCParticleHelper::MCContributionMap targetMCParticleToHitsMap;
50  {
51  const CaloHitList *pCaloHitList(nullptr);
52  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_caloHitListName, pCaloHitList));
53  const MCParticleList *pMCParticleList(nullptr);
54  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*this, pMCParticleList));
55  this->MakeSelection(pCaloHitList, targetMCParticleToHitsMap);
56  }
57 
58  if (m_visualizeMC)
59  {
60  if (m_groupMCByPdg)
61  this->VisualizeMCByPdgCode(targetMCParticleToHitsMap);
62  else
63  this->VisualizeIndependentMC(targetMCParticleToHitsMap);
64  }
65  if (m_visualizePfo)
66  {
67  const PfoList *pPfoList(nullptr);
68  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_pfoListName, pPfoList));
69  if (m_showPfoByPid)
70  {
71  this->VisualizePfoByParticleId(*pPfoList);
72  }
73  else
74  {
76  this->VisualizeIndependentPfo(*pPfoList, targetMCParticleToHitsMap);
77  else
78  this->VisualizeIndependentPfo(*pPfoList);
79  }
80  }
81  if (m_visualizeSlice)
82  {
83  const PfoList *pPfoList(nullptr);
84  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_pfoListName, pPfoList));
85  this->VisualizeReconstructedSlice(*pPfoList);
86  }
87 #endif // MONITORING
88  return STATUS_CODE_SUCCESS;
89 }
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 101 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 111 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 106 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 109 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings().

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

Name of input PFO list.

Definition at line 102 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 112 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 107 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 108 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 110 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 103 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 104 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 105 of file VisualParticleMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().


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