Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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.
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 361 of file VisualMonitoringAlgorithm.cc.

362 {
363  PANDORA_RETURN_RESULT_IF_AND_IF(
364  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentMCParticles", m_showCurrentMCParticles));
365 
366  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
367  XmlHelper::ReadVectorOfValues(xmlHandle, "MCParticleListNames", m_mcParticleListNames));
368 
369  PANDORA_RETURN_RESULT_IF_AND_IF(
370  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentCaloHits", m_showCurrentCaloHits));
371 
372  PANDORA_RETURN_RESULT_IF_AND_IF(
373  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "CaloHitListNames", m_caloHitListNames));
374 
375  PANDORA_RETURN_RESULT_IF_AND_IF(
376  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentTracks", m_showCurrentTracks));
377 
378  PANDORA_RETURN_RESULT_IF_AND_IF(
379  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "TrackListNames", m_trackListNames));
380 
381  PANDORA_RETURN_RESULT_IF_AND_IF(
382  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentClusters", m_showCurrentClusters));
383 
384  PANDORA_RETURN_RESULT_IF_AND_IF(
385  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "ClusterListNames", m_clusterListNames));
386 
387  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentPfos", m_showCurrentPfos));
388 
389  PANDORA_RETURN_RESULT_IF_AND_IF(
390  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "PfoListNames", m_pfoListNames));
391 
392  PANDORA_RETURN_RESULT_IF_AND_IF(
393  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowCurrentVertices", m_showCurrentVertices));
394 
395  PANDORA_RETURN_RESULT_IF_AND_IF(
396  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "VertexListNames", m_vertexListNames));
397 
398  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DisplayEvent", m_displayEvent));
399 
400  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SaveEventPath", m_saveEventPath));
401 
402  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowDetector", m_showDetector));
403 
404  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "DetectorView", m_detectorView));
405  std::transform(m_detectorView.begin(), m_detectorView.end(), m_detectorView.begin(), ::tolower);
406 
407  PANDORA_RETURN_RESULT_IF_AND_IF(
408  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowOnlyAvailable", m_showOnlyAvailable));
409 
410  PANDORA_RETURN_RESULT_IF_AND_IF(
411  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowAssociatedTracks", m_showAssociatedTracks));
412 
413  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "HitColors", m_hitColors));
414  std::transform(m_hitColors.begin(), m_hitColors.end(), m_hitColors.begin(), ::tolower);
415 
416  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ThresholdEnergy", m_thresholdEnergy));
417 
418  PANDORA_RETURN_RESULT_IF_AND_IF(
419  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TransparencyThresholdE", m_transparencyThresholdE));
420 
421  PANDORA_RETURN_RESULT_IF_AND_IF(
422  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "EnergyScaleThresholdE", m_energyScaleThresholdE));
423 
424  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ScalingFactor", m_scalingFactor));
425 
426  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPfoVertices", m_showPfoVertices));
427 
428  PANDORA_RETURN_RESULT_IF_AND_IF(
429  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPfoHierarchy", m_showPfoHierarchy));
430 
431  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
432  XmlHelper::ReadVectorOfValues(xmlHandle, "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.
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)
std::string string
Definition: nybbler.cc:12
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.
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.
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.
std::vector< string > StringVector
Definition: fcldump.cxx:29
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.

44 {
45  PANDORA_MONITORING_API(SetEveDisplayParameters(this->GetPandora(), m_showDetector,
46  (m_detectorView.find("xz") != std::string::npos) ? DETECTOR_VIEW_XZ : (m_detectorView.find("xy") != std::string::npos) ? DETECTOR_VIEW_XY : DETECTOR_VIEW_DEFAULT,
48 
49  // Show current mc particles
51  {
53  }
54 
55  // Show specified lists of mc particles
56  for (StringVector::const_iterator iter = m_mcParticleListNames.begin(), iterEnd = m_mcParticleListNames.end(); iter != iterEnd; ++iter)
57  {
58  this->VisualizeMCParticleList(*iter);
59  }
60 
61  // Show current calo hit list
63  {
65  }
66 
67  // Show specified lists of calo hits
68  for (StringVector::const_iterator iter = m_caloHitListNames.begin(), iterEnd = m_caloHitListNames.end(); iter != iterEnd; ++iter)
69  {
70  this->VisualizeCaloHitList(*iter);
71  }
72 
73  // Show current cluster list
75  {
77  }
78 
79  // Show specified lists of clusters
80  for (StringVector::const_iterator iter = m_clusterListNames.begin(), iterEnd = m_clusterListNames.end(); iter != iterEnd; ++iter)
81  {
82  this->VisualizeClusterList(*iter);
83  }
84 
85  // Show current track list
87  {
89  }
90 
91  // Show specified lists of tracks
92  for (StringVector::const_iterator iter = m_trackListNames.begin(), iterEnd = m_trackListNames.end(); iter != iterEnd; ++iter)
93  {
94  this->VisualizeTrackList(*iter);
95  }
96 
97  // Show current particle flow objects
99  {
101  }
102 
103  // Show specified lists of pfo
104  for (StringVector::const_iterator iter = m_pfoListNames.begin(), iterEnd = m_pfoListNames.end(); iter != iterEnd; ++iter)
105  {
106  this->VisualizeParticleFlowList(*iter);
107  }
108 
109  // Show current vertex objects
111  {
113  }
114 
115  // Show specified lists of vertices
116  for (StringVector::const_iterator iter = m_vertexListNames.begin(), iterEnd = m_vertexListNames.end(); iter != iterEnd; ++iter)
117  {
118  this->VisualizeVertexList(*iter);
119  }
120 
121  // Finally, display the event and pause application
122  // Save the event displays of the event if given a path to save to.
123  if (m_displayEvent && m_saveEventPath != "")
124  {
125  PANDORA_MONITORING_API(SaveAndViewEvent(this->GetPandora(), m_saveEventPath));
126  }
127  else if (m_displayEvent)
128  {
129  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
130  }
131 
132  return STATUS_CODE_SUCCESS;
133 }
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)
std::string string
Definition: nybbler.cc:12
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 166 of file VisualMonitoringAlgorithm.cc.

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

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

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

291 {
292  const PfoList *pPfoList = NULL;
293 
294  if (listName.empty())
295  {
296  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pPfoList))
297  {
298  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
299  std::cout << "VisualMonitoringAlgorithm: current pfo list unavailable." << std::endl;
300  return;
301  }
302  }
303  else
304  {
305  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pPfoList))
306  {
307  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
308  std::cout << "VisualMonitoringAlgorithm: pfo list " << listName << " unavailable." << std::endl;
309  return;
310  }
311  }
312 
313  PANDORA_MONITORING_API(VisualizeParticleFlowObjects(this->GetPandora(), pPfoList, listName.empty() ? "CurrentPfos" : listName.c_str(),
314  (m_hitColors.find("particleid") != std::string::npos)
315  ? AUTOID
316  : (m_hitColors.find("iterate") != std::string::npos ? AUTOITER : (m_hitColors.find("energy") != std::string::npos ? AUTOENERGY : AUTO)),
318 }
bool m_showPfoHierarchy
Whether to display daughter pfos only under parent pfo elements.
bool m_showPfoVertices
Whether to display pfo vertices.
QTextStream & endl(QTextStream &s)
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 208 of file VisualMonitoringAlgorithm.cc.

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

Visualize a specified vertex list.

Parameters
listNamethe list name

Definition at line 322 of file VisualMonitoringAlgorithm.cc.

323 {
324  const VertexList *pVertexList = NULL;
325 
326  if (listName.empty())
327  {
328  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*this, pVertexList))
329  {
330  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
331  std::cout << "VisualMonitoringAlgorithm: current vertex list unavailable." << std::endl;
332  return;
333  }
334  }
335  else
336  {
337  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, listName, pVertexList))
338  {
339  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
340  std::cout << "VisualMonitoringAlgorithm: vertex list " << listName << " unavailable." << std::endl;
341  return;
342  }
343  }
344 
345  // Filter vertex list
346  VertexList vertexList;
347 
348  for (VertexList::const_iterator iter = pVertexList->begin(), iterEnd = pVertexList->end(); iter != iterEnd; ++iter)
349  {
350  const Vertex *const pVertex = *iter;
351 
352  if (!m_showOnlyAvailable || pVertex->IsAvailable())
353  vertexList.push_back(pVertex);
354  }
355 
356  PANDORA_MONITORING_API(VisualizeVertices(this->GetPandora(), &vertexList, listName.empty() ? "CurrentVertices" : listName.c_str(), AUTO));
357 }
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:182
QTextStream & endl(QTextStream &s)

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.

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

Names of cluster lists to show.

Definition at line 85 of file VisualMonitoringAlgorithm.h.

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

The detector view, default, xy or xz.

Definition at line 96 of file VisualMonitoringAlgorithm.h.

bool lar_content::VisualMonitoringAlgorithm::m_displayEvent
private

Whether to display the event.

Definition at line 93 of file VisualMonitoringAlgorithm.h.

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.

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.

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

Names of mc particles lists to show.

Definition at line 76 of file VisualMonitoringAlgorithm.h.

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.

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

Names of pfo lists to show.

Definition at line 88 of file VisualMonitoringAlgorithm.h.

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.

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.

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.

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentCaloHits
private

Whether to show current calohitlist.

Definition at line 78 of file VisualMonitoringAlgorithm.h.

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentClusters
private

Whether to show current clusters.

Definition at line 84 of file VisualMonitoringAlgorithm.h.

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentMCParticles
private

Whether to show current mc particles.

Definition at line 75 of file VisualMonitoringAlgorithm.h.

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentPfos
private

Whether to show current particle flow object list.

Definition at line 87 of file VisualMonitoringAlgorithm.h.

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentTracks
private

Whether to show current tracks.

Definition at line 81 of file VisualMonitoringAlgorithm.h.

bool lar_content::VisualMonitoringAlgorithm::m_showCurrentVertices
private

Whether to show current vertex list.

Definition at line 90 of file VisualMonitoringAlgorithm.h.

bool lar_content::VisualMonitoringAlgorithm::m_showDetector
private

Whether to display the detector geometry.

Definition at line 95 of file VisualMonitoringAlgorithm.h.

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.

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.

bool lar_content::VisualMonitoringAlgorithm::m_showPfoVertices
private

Whether to display pfo vertices.

Definition at line 106 of file VisualMonitoringAlgorithm.h.

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.

float lar_content::VisualMonitoringAlgorithm::m_thresholdEnergy
private

Cell energy threshold for display (em scale)

Definition at line 101 of file VisualMonitoringAlgorithm.h.

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

Names of track lists to show.

Definition at line 82 of file VisualMonitoringAlgorithm.h.

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.

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

Names of vertex lists to show.

Definition at line 91 of file VisualMonitoringAlgorithm.h.


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