LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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...
 
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_showDetector(false),
27  m_detectorView("xz"),
28  m_showOnlyAvailable(false),
30  m_hitColors("iterate"),
31  m_thresholdEnergy(-1.f),
34  m_scalingFactor(1.f),
35  m_showPfoVertices(true),
36  m_showPfoHierarchy(true)
37 {
38 }
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 355 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_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.

356 {
357  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
358  "ShowCurrentMCParticles", m_showCurrentMCParticles));
359 
360  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
361  "MCParticleListNames", m_mcParticleListNames));
362 
363  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
364  "ShowCurrentCaloHits", m_showCurrentCaloHits));
365 
366  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
367  "CaloHitListNames", m_caloHitListNames));
368 
369  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
370  "ShowCurrentTracks", m_showCurrentTracks));
371 
372  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
373  "TrackListNames", m_trackListNames));
374 
375  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
376  "ShowCurrentClusters", m_showCurrentClusters));
377 
378  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
379  "ClusterListNames", m_clusterListNames));
380 
381  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
382  "ShowCurrentPfos", m_showCurrentPfos));
383 
384  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
385  "PfoListNames", m_pfoListNames));
386 
387  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
388  "ShowCurrentVertices", m_showCurrentVertices));
389 
390  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
391  "VertexListNames", m_vertexListNames));
392 
393  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
394  "DisplayEvent", m_displayEvent));
395 
396  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
397  "ShowDetector", m_showDetector));
398 
399  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
400  "DetectorView", m_detectorView));
401  std::transform(m_detectorView.begin(), m_detectorView.end(), m_detectorView.begin(), ::tolower);
402 
403  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
404  "ShowOnlyAvailable", m_showOnlyAvailable));
405 
406  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
407  "ShowAssociatedTracks", m_showAssociatedTracks));
408 
409  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
410  "HitColors", m_hitColors));
411  std::transform(m_hitColors.begin(), m_hitColors.end(), m_hitColors.begin(), ::tolower);
412 
413  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
414  "ThresholdEnergy", m_thresholdEnergy));
415 
416  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
417  "TransparencyThresholdE", m_transparencyThresholdE));
418 
419  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
420  "EnergyScaleThresholdE", m_energyScaleThresholdE));
421 
422  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
423  "ScalingFactor", m_scalingFactor));
424 
425  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
426  "ShowPfoVertices", m_showPfoVertices));
427 
428  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
429  "ShowPfoHierarchy", m_showPfoHierarchy));
430 
431  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
432  "SuppressMCParticles", m_suppressMCParticles));
433 
434  for (StringVector::iterator iter = m_suppressMCParticles.begin(), iterEnd = m_suppressMCParticles.end(); iter != iterEnd; ++iter)
435  {
436  const std::string pdgEnergy(*iter);
437  StringVector pdgEnergySeparated;
438  const std::string delimiter = ":";
439  XmlHelper::TokenizeString(pdgEnergy, pdgEnergySeparated, delimiter);
440 
441  if (pdgEnergySeparated.size() != 2)
442  return STATUS_CODE_INVALID_PARAMETER;
443 
444  int pdgCode(0);
445  float energy(0.f);
446 
447  if (!StringToType(pdgEnergySeparated.at(0), pdgCode) || !StringToType(pdgEnergySeparated.at(1), energy))
448  return STATUS_CODE_INVALID_PARAMETER;
449 
450  m_particleSuppressionMap.insert(PdgCodeToEnergyMap::value_type(pdgCode, energy));
451  }
452 
453  return STATUS_CODE_SUCCESS;
454 }
pandora::StringVector m_pfoListNames
Names of pfo lists to show.
pandora::StringVector m_caloHitListNames
Names of calo hit lists to show.
intermediate_table::iterator iterator
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 42 of file VisualMonitoringAlgorithm.cc.

References m_caloHitListNames, m_clusterListNames, m_detectorView, m_displayEvent, m_energyScaleThresholdE, m_mcParticleListNames, m_pfoListNames, 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().

43 {
44  PANDORA_MONITORING_API(SetEveDisplayParameters(this->GetPandora(), m_showDetector, (m_detectorView.find("xz") != std::string::npos) ? DETECTOR_VIEW_XZ :
45  (m_detectorView.find("xy") != std::string::npos) ? DETECTOR_VIEW_XY : DETECTOR_VIEW_DEFAULT, m_transparencyThresholdE, m_energyScaleThresholdE, m_scalingFactor));
46 
47  // Show current mc particles
49  {
50  this->VisualizeMCParticleList(std::string());
51  }
52 
53  // Show specified lists of mc particles
54  for (StringVector::const_iterator iter = m_mcParticleListNames.begin(), iterEnd = m_mcParticleListNames.end(); iter != iterEnd; ++iter)
55  {
56  this->VisualizeMCParticleList(*iter);
57  }
58 
59  // Show current calo hit list
61  {
62  this->VisualizeCaloHitList(std::string());
63  }
64 
65  // Show specified lists of calo hits
66  for (StringVector::const_iterator iter = m_caloHitListNames.begin(), iterEnd = m_caloHitListNames.end(); iter != iterEnd; ++iter)
67  {
68  this->VisualizeCaloHitList(*iter);
69  }
70 
71  // Show current cluster list
73  {
74  this->VisualizeClusterList(std::string());
75  }
76 
77  // Show specified lists of clusters
78  for (StringVector::const_iterator iter = m_clusterListNames.begin(), iterEnd = m_clusterListNames.end(); iter != iterEnd; ++iter)
79  {
80  this->VisualizeClusterList(*iter);
81  }
82 
83  // Show current track list
85  {
86  this->VisualizeTrackList(std::string());
87  }
88 
89  // Show specified lists of tracks
90  for (StringVector::const_iterator iter = m_trackListNames.begin(), iterEnd = m_trackListNames.end(); iter != iterEnd; ++iter)
91  {
92  this->VisualizeTrackList(*iter);
93  }
94 
95  // Show current particle flow objects
97  {
98  this->VisualizeParticleFlowList(std::string());
99  }
100 
101  // Show specified lists of pfo
102  for (StringVector::const_iterator iter = m_pfoListNames.begin(), iterEnd = m_pfoListNames.end(); iter != iterEnd; ++iter)
103  {
104  this->VisualizeParticleFlowList(*iter);
105  }
106 
107  // Show current vertex objects
109  {
110  this->VisualizeVertexList(std::string());
111  }
112 
113  // Show specified lists of vertices
114  for (StringVector::const_iterator iter = m_vertexListNames.begin(), iterEnd = m_vertexListNames.end(); iter != iterEnd; ++iter)
115  {
116  this->VisualizeVertexList(*iter);
117  }
118 
119  // Finally, display the event and pause application
120  if (m_displayEvent)
121  {
122  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
123  }
124 
125  return STATUS_CODE_SUCCESS;
126 }
pandora::StringVector m_pfoListNames
Names of pfo lists to show.
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.
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) ...
intermediate_table::const_iterator const_iterator
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 159 of file VisualMonitoringAlgorithm.cc.

References m_hitColors, m_showOnlyAvailable, and m_thresholdEnergy.

Referenced by Run().

160 {
161  const CaloHitList *pCaloHitList = NULL;
162 
163  if (listName.empty())
164  {
165  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pCaloHitList))
166  {
167  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
168  std::cout << "VisualMonitoringAlgorithm: current calo hit list unavailable." << std::endl;
169  return;
170  }
171  }
172  else
173  {
174  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pCaloHitList))
175  {
176  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
177  std::cout << "VisualMonitoringAlgorithm: calo hit list " << listName << " unavailable." << std::endl;
178  return;
179  }
180  }
181 
182  // Filter calo hit list
183  CaloHitList caloHitList;
184 
185  for (CaloHitList::const_iterator iter = pCaloHitList->begin(), iterEnd = pCaloHitList->end(); iter != iterEnd; ++iter)
186  {
187  const CaloHit *const pCaloHit = *iter;
188 
189  if ((pCaloHit->GetElectromagneticEnergy() > m_thresholdEnergy) &&
190  (!m_showOnlyAvailable || PandoraContentApi::IsAvailable(*this, pCaloHit)))
191  {
192  caloHitList.push_back(pCaloHit);
193  }
194  }
195 
196  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &caloHitList, listName.empty() ? "CurrentCaloHits" : listName.c_str(),
197  (m_hitColors.find("energy") != std::string::npos ? AUTOENERGY : GRAY)));
198 }
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 241 of file VisualMonitoringAlgorithm.cc.

References m_hitColors, m_showAssociatedTracks, and m_showOnlyAvailable.

Referenced by Run().

242 {
243  const ClusterList *pClusterList = NULL;
244 
245  if (listName.empty())
246  {
247  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pClusterList))
248  {
249  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
250  std::cout << "VisualMonitoringAlgorithm: current cluster list unavailable." << std::endl;
251  return;
252  }
253  }
254  else
255  {
256  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pClusterList))
257  {
258  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
259  std::cout << "VisualMonitoringAlgorithm: cluster list " << listName << " unavailable." << std::endl;
260  return;
261  }
262  }
263 
264  // Filter cluster list
265  ClusterList clusterList;
266 
267  for (ClusterList::const_iterator iter = pClusterList->begin(), iterEnd = pClusterList->end(); iter != iterEnd; ++iter)
268  {
269  const Cluster *const pCluster = *iter;
270 
271  if (!m_showOnlyAvailable || PandoraContentApi::IsAvailable(*this, pCluster))
272  clusterList.push_back(pCluster);
273  }
274 
275  PANDORA_MONITORING_API(VisualizeClusters(this->GetPandora(), &clusterList, listName.empty() ? "CurrentClusters" : listName.c_str(),
276  (m_hitColors.find("particleid") != std::string::npos) ? AUTOID :
277  (m_hitColors.find("iterate") != std::string::npos) ? AUTOITER :
278  (m_hitColors.find("energy") != std::string::npos) ? AUTOENERGY : AUTO,
280 }
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 130 of file VisualMonitoringAlgorithm.cc.

References m_particleSuppressionMap.

Referenced by Run().

131 {
132  const MCParticleList *pMCParticleList = NULL;
133 
134  if (listName.empty())
135  {
136  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pMCParticleList))
137  {
138  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
139  std::cout << "VisualMonitoringAlgorithm: mc particle list unavailable." << std::endl;
140  return;
141  }
142  }
143  else
144  {
145  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pMCParticleList))
146  {
147  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
148  std::cout << "VisualMonitoringAlgorithm: mc particle list unavailable." << std::endl;
149  return;
150  }
151  }
152 
153  PANDORA_MONITORING_API(VisualizeMCParticles(this->GetPandora(), pMCParticleList, listName.empty() ? "CurrentMCParticles" : listName.c_str(),
154  AUTO, &m_particleSuppressionMap));
155 }
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 284 of file VisualMonitoringAlgorithm.cc.

References m_hitColors, m_showPfoHierarchy, and m_showPfoVertices.

Referenced by Run().

285 {
286  const PfoList *pPfoList = NULL;
287 
288  if (listName.empty())
289  {
290  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pPfoList))
291  {
292  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
293  std::cout << "VisualMonitoringAlgorithm: current pfo list unavailable." << std::endl;
294  return;
295  }
296  }
297  else
298  {
299  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pPfoList))
300  {
301  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
302  std::cout << "VisualMonitoringAlgorithm: pfo list " << listName << " unavailable." << std::endl;
303  return;
304  }
305  }
306 
307  PANDORA_MONITORING_API(VisualizeParticleFlowObjects(this->GetPandora(), pPfoList, listName.empty() ? "CurrentPfos" : listName.c_str(),
308  (m_hitColors.find("particleid") != std::string::npos) ? AUTOID :
309  (m_hitColors.find("iterate") != std::string::npos ? AUTOITER :
310  (m_hitColors.find("energy") != std::string::npos ? AUTOENERGY :
312 }
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 202 of file VisualMonitoringAlgorithm.cc.

References m_showOnlyAvailable.

Referenced by Run().

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

Visualize a specified vertex list.

Parameters
listNamethe list name

Definition at line 316 of file VisualMonitoringAlgorithm.cc.

References m_showOnlyAvailable.

Referenced by Run().

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

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 95 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 102 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 99 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 109 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().

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 103 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 98 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 94 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 97 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 106 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings(), and VisualizeParticleFlowList().

bool lar_content::VisualMonitoringAlgorithm::m_showPfoVertices
private

Whether to display pfo vertices.

Definition at line 105 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 108 of file VisualMonitoringAlgorithm.h.

Referenced by ReadSettings().

float lar_content::VisualMonitoringAlgorithm::m_thresholdEnergy
private

Cell energy threshold for display (em scale)

Definition at line 100 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 101 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: