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

VisualMonitoringAlgorithm class. More...

#include "VisualMonitoringAlgorithm.h"

Inheritance diagram for lar_content::VisualMonitoringAlgorithm:

Public Member Functions

 VisualMonitoringAlgorithm ()
 Default constructor. More...
 

Private Types

typedef std::map< int, float > PdgCodeToEnergyMap
 

Private Member Functions

pandora::StatusCode Run ()
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
void VisualizeMCParticleList (const std::string &listName) const
 Visualize mc particle list. More...
 
void VisualizeCaloHitList (const std::string &listName) const
 Visualize a specified calo hit list. More...
 
void VisualizeTrackList (const std::string &listName) const
 Visualize a specified track list. More...
 
void VisualizeClusterList (const std::string &listName) const
 Visualize a specified calo hit list. More...
 
void VisualizeParticleFlowList (const std::string &listName) const
 Visualize a specified pfo list. More...
 
void VisualizeVertexList (const std::string &listName) const
 Visualize a specified vertex list. More...
 

Private Attributes

bool m_showCurrentMCParticles
 Whether to show current mc particles. More...
 
pandora::StringVector m_mcParticleListNames
 Names of mc particles lists to show. More...
 
bool m_showCurrentCaloHits
 Whether to show current calohitlist. More...
 
pandora::StringVector m_caloHitListNames
 Names of calo hit lists to show. More...
 
bool m_showCurrentTracks
 Whether to show current tracks. More...
 
pandora::StringVector m_trackListNames
 Names of track lists to show. More...
 
bool m_showCurrentClusters
 Whether to show current clusters. More...
 
pandora::StringVector m_clusterListNames
 Names of cluster lists to show. More...
 
bool m_showCurrentPfos
 Whether to show current particle flow object list. More...
 
pandora::StringVector m_pfoListNames
 Names of pfo lists to show. More...
 
bool m_showCurrentVertices
 Whether to show current vertex list. More...
 
pandora::StringVector m_vertexListNames
 Names of vertex lists to show. More...
 
bool m_displayEvent
 Whether to display the event. More...
 
std::string m_saveEventPath
 The path to save event displays to. m_displayEvent must also be set. More...
 
bool m_showDetector
 Whether to display the detector geometry. More...
 
std::string m_detectorView
 The detector view, default, xy or xz. More...
 
bool m_showOnlyAvailable
 Whether to show only available (i.e. non-clustered) calohits and tracks. More...
 
bool m_showAssociatedTracks
 Whether to display tracks associated to clusters when viewing cluster lists. More...
 
std::string m_hitColors
 Define the hit coloring scheme (default: pfo, choices: pfo, particleid) More...
 
float m_thresholdEnergy
 Cell energy threshold for display (em scale) 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...
 
bool m_showPfoVertices
 Whether to display pfo vertices. More...
 
bool m_showPfoHierarchy
 Whether to display daughter pfos only under parent pfo elements. More...
 
pandora::StringVector m_suppressMCParticles
 List of PDG numbers and energies for MC particles to be suppressed (e.g. " 22:0.1 2112:1.0 ") More...
 
PdgCodeToEnergyMap m_particleSuppressionMap
 Map from pdg-codes to energy for suppression of particles types below specific energies. More...
 

Detailed Description

VisualMonitoringAlgorithm class.

Definition at line 19 of file VisualMonitoringAlgorithm.h.

Member Typedef Documentation

typedef std::map<int, float> lar_content::VisualMonitoringAlgorithm::PdgCodeToEnergyMap
private

Definition at line 73 of file VisualMonitoringAlgorithm.h.

Constructor & Destructor Documentation

lar_content::VisualMonitoringAlgorithm::VisualMonitoringAlgorithm ( )

Default constructor.

Definition at line 18 of file VisualMonitoringAlgorithm.cc.

18  :
20  m_showCurrentCaloHits(false),
21  m_showCurrentTracks(false),
22  m_showCurrentClusters(false),
23  m_showCurrentPfos(false),
24  m_showCurrentVertices(false),
25  m_displayEvent(true),
26  m_saveEventPath(""),
27  m_showDetector(false),
28  m_detectorView("xz"),
29  m_showOnlyAvailable(false),
31  m_hitColors("iterate"),
32  m_thresholdEnergy(-1.f),
35  m_scalingFactor(1.f),
36  m_showPfoVertices(true),
37  m_showPfoHierarchy(true)
38 {
39 }
std::string m_saveEventPath
The path to save event displays to. m_displayEvent must also be set.
float m_transparencyThresholdE
Cell energy for which transparency is saturated (0%, fully opaque)
bool m_showCurrentVertices
Whether to show current vertex list.
bool m_showCurrentCaloHits
Whether to show current calohitlist.
bool m_showCurrentPfos
Whether to show current particle flow object list.
TFile f
Definition: plotHisto.C:6
bool m_showDetector
Whether to display the detector geometry.
bool m_showCurrentMCParticles
Whether to show current mc particles.
float m_scalingFactor
TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too) ...
bool m_showPfoHierarchy
Whether to display daughter pfos only under parent pfo elements.
float m_thresholdEnergy
Cell energy threshold for display (em scale)
bool m_showAssociatedTracks
Whether to display tracks associated to clusters when viewing cluster lists.
bool m_showOnlyAvailable
Whether to show only available (i.e. non-clustered) calohits and tracks.
bool m_showCurrentClusters
Whether to show current clusters.
bool m_showPfoVertices
Whether to display pfo vertices.
float m_energyScaleThresholdE
Cell energy for which color is at top end of continous color palette.
bool m_showCurrentTracks
Whether to show current tracks.
std::string m_detectorView
The detector view, default, xy or xz.
bool m_displayEvent
Whether to display the event.
std::string m_hitColors
Define the hit coloring scheme (default: pfo, choices: pfo, particleid)

Member Function Documentation

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

Definition at line 364 of file VisualMonitoringAlgorithm.cc.

References energy, f, m_caloHitListNames, m_clusterListNames, m_detectorView, m_displayEvent, m_energyScaleThresholdE, m_hitColors, m_mcParticleListNames, m_particleSuppressionMap, m_pfoListNames, m_saveEventPath, m_scalingFactor, m_showAssociatedTracks, m_showCurrentCaloHits, m_showCurrentClusters, m_showCurrentMCParticles, m_showCurrentPfos, m_showCurrentTracks, m_showCurrentVertices, m_showDetector, m_showOnlyAvailable, m_showPfoHierarchy, m_showPfoVertices, m_suppressMCParticles, m_thresholdEnergy, m_trackListNames, m_transparencyThresholdE, and m_vertexListNames.

365 {
366  PANDORA_RETURN_RESULT_IF_AND_IF(
367  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentMCParticles", m_showCurrentMCParticles));
368 
369  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
370  XmlHelper::ReadVectorOfValues(xmlHandle, "MCParticleListNames", m_mcParticleListNames));
371 
372  PANDORA_RETURN_RESULT_IF_AND_IF(
373  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentCaloHits", m_showCurrentCaloHits));
374 
375  PANDORA_RETURN_RESULT_IF_AND_IF(
376  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "CaloHitListNames", m_caloHitListNames));
377 
378  PANDORA_RETURN_RESULT_IF_AND_IF(
379  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentTracks", m_showCurrentTracks));
380 
381  PANDORA_RETURN_RESULT_IF_AND_IF(
382  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "TrackListNames", m_trackListNames));
383 
384  PANDORA_RETURN_RESULT_IF_AND_IF(
385  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentClusters", m_showCurrentClusters));
386 
387  PANDORA_RETURN_RESULT_IF_AND_IF(
388  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "ClusterListNames", m_clusterListNames));
389 
390  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentPfos", m_showCurrentPfos));
391 
392  PANDORA_RETURN_RESULT_IF_AND_IF(
393  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "PfoListNames", m_pfoListNames));
394 
395  PANDORA_RETURN_RESULT_IF_AND_IF(
396  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentVertices", m_showCurrentVertices));
397 
398  PANDORA_RETURN_RESULT_IF_AND_IF(
399  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "VertexListNames", m_vertexListNames));
400 
401  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DisplayEvent", m_displayEvent));
402 
403  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SaveEventPath", m_saveEventPath));
404 
405  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowDetector", m_showDetector));
406 
407  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DetectorView", m_detectorView));
408  std::transform(m_detectorView.begin(), m_detectorView.end(), m_detectorView.begin(), ::tolower);
409 
410  PANDORA_RETURN_RESULT_IF_AND_IF(
411  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowOnlyAvailable", m_showOnlyAvailable));
412 
413  PANDORA_RETURN_RESULT_IF_AND_IF(
414  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowAssociatedTracks", m_showAssociatedTracks));
415 
416  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "HitColors", m_hitColors));
417  std::transform(m_hitColors.begin(), m_hitColors.end(), m_hitColors.begin(), ::tolower);
418 
419  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ThresholdEnergy", m_thresholdEnergy));
420 
421  PANDORA_RETURN_RESULT_IF_AND_IF(
422  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TransparencyThresholdE", m_transparencyThresholdE));
423 
424  PANDORA_RETURN_RESULT_IF_AND_IF(
425  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "EnergyScaleThresholdE", m_energyScaleThresholdE));
426 
427  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ScalingFactor", m_scalingFactor));
428 
429  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPfoVertices", m_showPfoVertices));
430 
431  PANDORA_RETURN_RESULT_IF_AND_IF(
432  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPfoHierarchy", m_showPfoHierarchy));
433 
434  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
435  XmlHelper::ReadVectorOfValues(xmlHandle, "SuppressMCParticles", m_suppressMCParticles));
436 
437  for (StringVector::iterator iter = m_suppressMCParticles.begin(), iterEnd = m_suppressMCParticles.end(); iter != iterEnd; ++iter)
438  {
439  const std::string pdgEnergy(*iter);
440  StringVector pdgEnergySeparated;
441  const std::string delimiter = ":";
442  XmlHelper::TokenizeString(pdgEnergy, pdgEnergySeparated, delimiter);
443 
444  if (pdgEnergySeparated.size() != 2)
445  return STATUS_CODE_INVALID_PARAMETER;
446 
447  int pdgCode(0);
448  float energy(0.f);
449 
450  if (!StringToType(pdgEnergySeparated.at(0), pdgCode) || !StringToType(pdgEnergySeparated.at(1), energy))
451  return STATUS_CODE_INVALID_PARAMETER;
452 
453  m_particleSuppressionMap.insert(PdgCodeToEnergyMap::value_type(pdgCode, energy));
454  }
455 
456  return STATUS_CODE_SUCCESS;
457 }
pandora::StringVector m_pfoListNames
Names of pfo lists to show.
intermediate_table::iterator iterator
std::string m_saveEventPath
The path to save event displays to. m_displayEvent must also be set.
pandora::StringVector m_caloHitListNames
Names of calo hit lists to show.
float m_transparencyThresholdE
Cell energy for which transparency is saturated (0%, fully opaque)
bool m_showCurrentVertices
Whether to show current vertex list.
pandora::StringVector m_vertexListNames
Names of vertex lists to show.
bool m_showCurrentCaloHits
Whether to show current calohitlist.
bool m_showCurrentPfos
Whether to show current particle flow object list.
TFile f
Definition: plotHisto.C:6
bool m_showDetector
Whether to display the detector geometry.
bool m_showCurrentMCParticles
Whether to show current mc particles.
float m_scalingFactor
TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too) ...
bool m_showPfoHierarchy
Whether to display daughter pfos only under parent pfo elements.
float m_thresholdEnergy
Cell energy threshold for display (em scale)
bool m_showAssociatedTracks
Whether to display tracks associated to clusters when viewing cluster lists.
double energy
Definition: plottest35.C:25
bool m_showOnlyAvailable
Whether to show only available (i.e. non-clustered) calohits and tracks.
pandora::StringVector m_suppressMCParticles
List of PDG numbers and energies for MC particles to be suppressed (e.g. " 22:0.1 2112:1...
bool m_showCurrentClusters
Whether to show current clusters.
pandora::StringVector m_mcParticleListNames
Names of mc particles lists to show.
bool m_showPfoVertices
Whether to display pfo vertices.
float m_energyScaleThresholdE
Cell energy for which color is at top end of continous color palette.
bool m_showCurrentTracks
Whether to show current tracks.
std::string m_detectorView
The detector view, default, xy or xz.
pandora::StringVector m_clusterListNames
Names of cluster lists to show.
bool m_displayEvent
Whether to display the event.
pandora::StringVector m_trackListNames
Names of track lists to show.
PdgCodeToEnergyMap m_particleSuppressionMap
Map from pdg-codes to energy for suppression of particles types below specific energies.
std::string m_hitColors
Define the hit coloring scheme (default: pfo, choices: pfo, particleid)
StatusCode lar_content::VisualMonitoringAlgorithm::Run ( )
private

Definition at line 43 of file VisualMonitoringAlgorithm.cc.

References m_caloHitListNames, m_clusterListNames, m_detectorView, m_displayEvent, m_energyScaleThresholdE, m_mcParticleListNames, m_pfoListNames, m_saveEventPath, m_scalingFactor, m_showCurrentCaloHits, m_showCurrentClusters, m_showCurrentMCParticles, m_showCurrentPfos, m_showCurrentTracks, m_showCurrentVertices, m_showDetector, m_trackListNames, m_transparencyThresholdE, m_vertexListNames, VisualizeCaloHitList(), VisualizeClusterList(), VisualizeMCParticleList(), VisualizeParticleFlowList(), VisualizeTrackList(), and VisualizeVertexList().

44 {
45  PANDORA_MONITORING_API(SetEveDisplayParameters(this->GetPandora(), m_showDetector,
46  (m_detectorView.find("xz") != std::string::npos) ? DETECTOR_VIEW_XZ
47  : (m_detectorView.find("xy") != std::string::npos) ? DETECTOR_VIEW_XY
48  : DETECTOR_VIEW_DEFAULT,
50 
51  // Show current mc particles
53  {
54  this->VisualizeMCParticleList(std::string());
55  }
56 
57  // Show specified lists of mc particles
58  for (StringVector::const_iterator iter = m_mcParticleListNames.begin(), iterEnd = m_mcParticleListNames.end(); iter != iterEnd; ++iter)
59  {
60  this->VisualizeMCParticleList(*iter);
61  }
62 
63  // Show current calo hit list
65  {
66  this->VisualizeCaloHitList(std::string());
67  }
68 
69  // Show specified lists of calo hits
70  for (StringVector::const_iterator iter = m_caloHitListNames.begin(), iterEnd = m_caloHitListNames.end(); iter != iterEnd; ++iter)
71  {
72  this->VisualizeCaloHitList(*iter);
73  }
74 
75  // Show current cluster list
77  {
78  this->VisualizeClusterList(std::string());
79  }
80 
81  // Show specified lists of clusters
82  for (StringVector::const_iterator iter = m_clusterListNames.begin(), iterEnd = m_clusterListNames.end(); iter != iterEnd; ++iter)
83  {
84  this->VisualizeClusterList(*iter);
85  }
86 
87  // Show current track list
89  {
90  this->VisualizeTrackList(std::string());
91  }
92 
93  // Show specified lists of tracks
94  for (StringVector::const_iterator iter = m_trackListNames.begin(), iterEnd = m_trackListNames.end(); iter != iterEnd; ++iter)
95  {
96  this->VisualizeTrackList(*iter);
97  }
98 
99  // Show current particle flow objects
100  if (m_showCurrentPfos)
101  {
102  this->VisualizeParticleFlowList(std::string());
103  }
104 
105  // Show specified lists of pfo
106  for (StringVector::const_iterator iter = m_pfoListNames.begin(), iterEnd = m_pfoListNames.end(); iter != iterEnd; ++iter)
107  {
108  this->VisualizeParticleFlowList(*iter);
109  }
110 
111  // Show current vertex objects
113  {
114  this->VisualizeVertexList(std::string());
115  }
116 
117  // Show specified lists of vertices
118  for (StringVector::const_iterator iter = m_vertexListNames.begin(), iterEnd = m_vertexListNames.end(); iter != iterEnd; ++iter)
119  {
120  this->VisualizeVertexList(*iter);
121  }
122 
123  // Finally, display the event and pause application
124  // Save the event displays of the event if given a path to save to.
125  if (m_displayEvent && m_saveEventPath != "")
126  {
127  PANDORA_MONITORING_API(SaveAndViewEvent(this->GetPandora(), m_saveEventPath));
128  }
129  else if (m_displayEvent)
130  {
131  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
132  }
133 
134  return STATUS_CODE_SUCCESS;
135 }
pandora::StringVector m_pfoListNames
Names of pfo lists to show.
std::string m_saveEventPath
The path to save event displays to. m_displayEvent must also be set.
pandora::StringVector m_caloHitListNames
Names of calo hit lists to show.
void VisualizeCaloHitList(const std::string &listName) const
Visualize a specified calo hit list.
float m_transparencyThresholdE
Cell energy for which transparency is saturated (0%, fully opaque)
bool m_showCurrentVertices
Whether to show current vertex list.
void VisualizeParticleFlowList(const std::string &listName) const
Visualize a specified pfo list.
pandora::StringVector m_vertexListNames
Names of vertex lists to show.
bool m_showCurrentCaloHits
Whether to show current calohitlist.
bool m_showCurrentPfos
Whether to show current particle flow object list.
intermediate_table::const_iterator const_iterator
void VisualizeTrackList(const std::string &listName) const
Visualize a specified track list.
bool m_showDetector
Whether to display the detector geometry.
bool m_showCurrentMCParticles
Whether to show current mc particles.
float m_scalingFactor
TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too) ...
bool m_showCurrentClusters
Whether to show current clusters.
pandora::StringVector m_mcParticleListNames
Names of mc particles lists to show.
void VisualizeMCParticleList(const std::string &listName) const
Visualize mc particle list.
void VisualizeVertexList(const std::string &listName) const
Visualize a specified vertex list.
void VisualizeClusterList(const std::string &listName) const
Visualize a specified calo hit list.
float m_energyScaleThresholdE
Cell energy for which color is at top end of continous color palette.
bool m_showCurrentTracks
Whether to show current tracks.
std::string m_detectorView
The detector view, default, xy or xz.
pandora::StringVector m_clusterListNames
Names of cluster lists to show.
bool m_displayEvent
Whether to display the event.
pandora::StringVector m_trackListNames
Names of track lists to show.
void lar_content::VisualMonitoringAlgorithm::VisualizeCaloHitList ( const std::string &  listName) const
private

Visualize a specified calo hit list.

Parameters
listNamethe list name

Definition at line 168 of file VisualMonitoringAlgorithm.cc.

References m_hitColors, m_showOnlyAvailable, and m_thresholdEnergy.

Referenced by Run().

169 {
170  const CaloHitList *pCaloHitList = NULL;
171 
172  if (listName.empty())
173  {
174  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pCaloHitList))
175  {
176  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
177  std::cout << "VisualMonitoringAlgorithm: current calo hit list unavailable." << std::endl;
178  return;
179  }
180  }
181  else
182  {
183  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pCaloHitList))
184  {
185  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
186  std::cout << "VisualMonitoringAlgorithm: calo hit list " << listName << " unavailable." << std::endl;
187  return;
188  }
189  }
190 
191  // Filter calo hit list
192  CaloHitList caloHitList;
193 
194  for (CaloHitList::const_iterator iter = pCaloHitList->begin(), iterEnd = pCaloHitList->end(); iter != iterEnd; ++iter)
195  {
196  const CaloHit *const pCaloHit = *iter;
197 
198  if ((pCaloHit->GetElectromagneticEnergy() > m_thresholdEnergy) && (!m_showOnlyAvailable || PandoraContentApi::IsAvailable(*this, pCaloHit)))
199  {
200  caloHitList.push_back(pCaloHit);
201  }
202  }
203 
204  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &caloHitList, listName.empty() ? "CurrentCaloHits" : listName.c_str(),
205  (m_hitColors.find("energy") != std::string::npos ? AUTOENERGY : GRAY)));
206 }
intermediate_table::const_iterator const_iterator
float m_thresholdEnergy
Cell energy threshold for display (em scale)
bool m_showOnlyAvailable
Whether to show only available (i.e. non-clustered) calohits and tracks.
std::string m_hitColors
Define the hit coloring scheme (default: pfo, choices: pfo, particleid)
void lar_content::VisualMonitoringAlgorithm::VisualizeClusterList ( const std::string &  listName) const
private

Visualize a specified calo hit list.

Parameters
listNamethe list name

Definition at line 249 of file VisualMonitoringAlgorithm.cc.

References m_hitColors, m_showAssociatedTracks, and m_showOnlyAvailable.

Referenced by Run().

250 {
251  const ClusterList *pClusterList = NULL;
252 
253  if (listName.empty())
254  {
255  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pClusterList))
256  {
257  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
258  std::cout << "VisualMonitoringAlgorithm: current cluster list unavailable." << std::endl;
259  return;
260  }
261  }
262  else
263  {
264  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pClusterList))
265  {
266  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
267  std::cout << "VisualMonitoringAlgorithm: cluster list " << listName << " unavailable." << std::endl;
268  return;
269  }
270  }
271 
272  // Filter cluster list
273  ClusterList clusterList;
274 
275  for (ClusterList::const_iterator iter = pClusterList->begin(), iterEnd = pClusterList->end(); iter != iterEnd; ++iter)
276  {
277  const Cluster *const pCluster = *iter;
278 
279  if (!m_showOnlyAvailable || PandoraContentApi::IsAvailable(*this, pCluster))
280  clusterList.push_back(pCluster);
281  }
282 
283  PANDORA_MONITORING_API(VisualizeClusters(this->GetPandora(), &clusterList, listName.empty() ? "CurrentClusters" : listName.c_str(),
284  (m_hitColors.find("particleid") != std::string::npos) ? AUTOID
285  : (m_hitColors.find("iterate") != std::string::npos) ? AUTOITER
286  : (m_hitColors.find("energy") != std::string::npos) ? AUTOENERGY
287  : AUTO,
289 }
intermediate_table::const_iterator const_iterator
bool m_showAssociatedTracks
Whether to display tracks associated to clusters when viewing cluster lists.
bool m_showOnlyAvailable
Whether to show only available (i.e. non-clustered) calohits and tracks.
std::string m_hitColors
Define the hit coloring scheme (default: pfo, choices: pfo, particleid)
void lar_content::VisualMonitoringAlgorithm::VisualizeMCParticleList ( const std::string &  listName) const
private

Visualize mc particle list.

Parameters
listNamethe list name

Definition at line 139 of file VisualMonitoringAlgorithm.cc.

References m_particleSuppressionMap.

Referenced by Run().

140 {
141  const MCParticleList *pMCParticleList = NULL;
142 
143  if (listName.empty())
144  {
145  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pMCParticleList))
146  {
147  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
148  std::cout << "VisualMonitoringAlgorithm: mc particle list unavailable." << std::endl;
149  return;
150  }
151  }
152  else
153  {
154  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pMCParticleList))
155  {
156  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
157  std::cout << "VisualMonitoringAlgorithm: mc particle list unavailable." << std::endl;
158  return;
159  }
160  }
161 
162  PANDORA_MONITORING_API(VisualizeMCParticles(
163  this->GetPandora(), pMCParticleList, listName.empty() ? "CurrentMCParticles" : listName.c_str(), AUTO, &m_particleSuppressionMap));
164 }
PdgCodeToEnergyMap m_particleSuppressionMap
Map from pdg-codes to energy for suppression of particles types below specific energies.
void lar_content::VisualMonitoringAlgorithm::VisualizeParticleFlowList ( const std::string &  listName) const
private

Visualize a specified pfo list.

Parameters
listNamethe list name

Definition at line 293 of file VisualMonitoringAlgorithm.cc.

References m_hitColors, m_showPfoHierarchy, and m_showPfoVertices.

Referenced by Run().

294 {
295  const PfoList *pPfoList = NULL;
296 
297  if (listName.empty())
298  {
299  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pPfoList))
300  {
301  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
302  std::cout << "VisualMonitoringAlgorithm: current pfo list unavailable." << std::endl;
303  return;
304  }
305  }
306  else
307  {
308  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pPfoList))
309  {
310  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
311  std::cout << "VisualMonitoringAlgorithm: pfo list " << listName << " unavailable." << std::endl;
312  return;
313  }
314  }
315 
316  PANDORA_MONITORING_API(VisualizeParticleFlowObjects(this->GetPandora(), pPfoList, listName.empty() ? "CurrentPfos" : listName.c_str(),
317  (m_hitColors.find("particleid") != std::string::npos)
318  ? AUTOID
319  : (m_hitColors.find("iterate") != std::string::npos ? AUTOITER : (m_hitColors.find("energy") != std::string::npos ? AUTOENERGY : AUTO)),
321 }
bool m_showPfoHierarchy
Whether to display daughter pfos only under parent pfo elements.
bool m_showPfoVertices
Whether to display pfo vertices.
std::string m_hitColors
Define the hit coloring scheme (default: pfo, choices: pfo, particleid)
void lar_content::VisualMonitoringAlgorithm::VisualizeTrackList ( const std::string &  listName) const
private

Visualize a specified track list.

Parameters
listNamethe list name

Definition at line 210 of file VisualMonitoringAlgorithm.cc.

References m_showOnlyAvailable.

Referenced by Run().

211 {
212  const TrackList *pTrackList = NULL;
213 
214  if (listName.empty())
215  {
216  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pTrackList))
217  {
218  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
219  std::cout << "VisualMonitoringAlgorithm: current track list unavailable." << std::endl;
220  return;
221  }
222  }
223  else
224  {
225  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pTrackList))
226  {
227  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
228  std::cout << "VisualMonitoringAlgorithm: track list " << listName << " unavailable." << std::endl;
229  return;
230  }
231  }
232 
233  // Filter track list
234  TrackList trackList;
235 
236  for (TrackList::const_iterator iter = pTrackList->begin(), iterEnd = pTrackList->end(); iter != iterEnd; ++iter)
237  {
238  const Track *const pTrack = *iter;
239 
240  if (!m_showOnlyAvailable || pTrack->IsAvailable())
241  trackList.push_back(pTrack);
242  }
243 
244  PANDORA_MONITORING_API(VisualizeTracks(this->GetPandora(), &trackList, listName.empty() ? "CurrentTracks" : listName.c_str(), GRAY));
245 }
intermediate_table::const_iterator const_iterator
bool m_showOnlyAvailable
Whether to show only available (i.e. non-clustered) calohits and tracks.
Definition: Track.hh:42
void lar_content::VisualMonitoringAlgorithm::VisualizeVertexList ( const std::string &  listName) const
private

Visualize a specified vertex list.

Parameters
listNamethe list name

Definition at line 325 of file VisualMonitoringAlgorithm.cc.

References m_showOnlyAvailable.

Referenced by Run().

326 {
327  const VertexList *pVertexList = NULL;
328 
329  if (listName.empty())
330  {
331  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pVertexList))
332  {
333  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
334  std::cout << "VisualMonitoringAlgorithm: current vertex list unavailable." << std::endl;
335  return;
336  }
337  }
338  else
339  {
340  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pVertexList))
341  {
342  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
343  std::cout << "VisualMonitoringAlgorithm: vertex list " << listName << " unavailable." << std::endl;
344  return;
345  }
346  }
347 
348  // Filter vertex list
349  VertexList vertexList;
350 
351  for (VertexList::const_iterator iter = pVertexList->begin(), iterEnd = pVertexList->end(); iter != iterEnd; ++iter)
352  {
353  const Vertex *const pVertex = *iter;
354 
355  if (!m_showOnlyAvailable || pVertex->IsAvailable())
356  vertexList.push_back(pVertex);
357  }
358 
359  PANDORA_MONITORING_API(VisualizeVertices(this->GetPandora(), &vertexList, listName.empty() ? "CurrentVertices" : listName.c_str(), AUTO));
360 }
intermediate_table::const_iterator const_iterator
bool m_showOnlyAvailable
Whether to show only available (i.e. non-clustered) calohits and tracks.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
std::list< Vertex > VertexList
Definition: DCEL.h:169

Member Data Documentation

pandora::StringVector lar_content::VisualMonitoringAlgorithm::m_caloHitListNames
private

Names of calo hit lists to show.

Definition at line 79 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

pandora::StringVector lar_content::VisualMonitoringAlgorithm::m_clusterListNames
private

Names of cluster lists to show.

Definition at line 85 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

std::string lar_content::VisualMonitoringAlgorithm::m_detectorView
private

The detector view, default, xy or xz.

Definition at line 96 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_displayEvent
private

Whether to display the event.

Definition at line 93 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

float lar_content::VisualMonitoringAlgorithm::m_energyScaleThresholdE
private

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

Definition at line 103 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

std::string lar_content::VisualMonitoringAlgorithm::m_hitColors
private

Define the hit coloring scheme (default: pfo, choices: pfo, particleid)

Definition at line 100 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), VisualizeCaloHitList(), VisualizeClusterList(), and VisualizeParticleFlowList().

pandora::StringVector lar_content::VisualMonitoringAlgorithm::m_mcParticleListNames
private

Names of mc particles lists to show.

Definition at line 76 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

PdgCodeToEnergyMap lar_content::VisualMonitoringAlgorithm::m_particleSuppressionMap
private

Map from pdg-codes to energy for suppression of particles types below specific energies.

Definition at line 110 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and VisualizeMCParticleList().

pandora::StringVector lar_content::VisualMonitoringAlgorithm::m_pfoListNames
private

Names of pfo lists to show.

Definition at line 88 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

std::string lar_content::VisualMonitoringAlgorithm::m_saveEventPath
private

The path to save event displays to. m_displayEvent must also be set.

Definition at line 94 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

float lar_content::VisualMonitoringAlgorithm::m_scalingFactor
private

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

Definition at line 104 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_showAssociatedTracks
private

Whether to display tracks associated to clusters when viewing cluster lists.

Definition at line 99 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and VisualizeClusterList().

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentCaloHits
private

Whether to show current calohitlist.

Definition at line 78 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentClusters
private

Whether to show current clusters.

Definition at line 84 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentMCParticles
private

Whether to show current mc particles.

Definition at line 75 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentPfos
private

Whether to show current particle flow object list.

Definition at line 87 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentTracks
private

Whether to show current tracks.

Definition at line 81 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentVertices
private

Whether to show current vertex list.

Definition at line 90 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_showDetector
private

Whether to display the detector geometry.

Definition at line 95 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::VisualMonitoringAlgorithm::m_showOnlyAvailable
private

Whether to show only available (i.e. non-clustered) calohits and tracks.

Definition at line 98 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), VisualizeCaloHitList(), VisualizeClusterList(), VisualizeTrackList(), and VisualizeVertexList().

bool lar_content::VisualMonitoringAlgorithm::m_showPfoHierarchy
private

Whether to display daughter pfos only under parent pfo elements.

Definition at line 107 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and VisualizeParticleFlowList().

bool lar_content::VisualMonitoringAlgorithm::m_showPfoVertices
private

Whether to display pfo vertices.

Definition at line 106 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and VisualizeParticleFlowList().

pandora::StringVector lar_content::VisualMonitoringAlgorithm::m_suppressMCParticles
private

List of PDG numbers and energies for MC particles to be suppressed (e.g. " 22:0.1 2112:1.0 ")

Definition at line 109 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings().

float lar_content::VisualMonitoringAlgorithm::m_thresholdEnergy
private

Cell energy threshold for display (em scale)

Definition at line 101 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and VisualizeCaloHitList().

pandora::StringVector lar_content::VisualMonitoringAlgorithm::m_trackListNames
private

Names of track lists to show.

Definition at line 82 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

float lar_content::VisualMonitoringAlgorithm::m_transparencyThresholdE
private

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

Definition at line 102 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().

pandora::StringVector lar_content::VisualMonitoringAlgorithm::m_vertexListNames
private

Names of vertex lists to show.

Definition at line 91 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and Run().


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