9 #include "Pandora/AlgorithmHeaders.h" 18 VisualMonitoringAlgorithm::VisualMonitoringAlgorithm() :
19 m_showCurrentMCParticles(false),
20 m_showCurrentCaloHits(false),
21 m_showCurrentTracks(false),
22 m_showCurrentClusters(false),
23 m_showCurrentPfos(false),
24 m_showCurrentVertices(false),
26 m_showDetector(false),
28 m_showOnlyAvailable(false),
29 m_showAssociatedTracks(false),
30 m_hitColors(
"iterate"),
31 m_thresholdEnergy(-1.
f),
32 m_transparencyThresholdE(-1.
f),
33 m_energyScaleThresholdE(1.
f),
35 m_showPfoVertices(true),
36 m_showPfoHierarchy(true)
44 PANDORA_MONITORING_API(SetEveDisplayParameters(this->GetPandora(),
m_showDetector, (
m_detectorView.find(
"xz") != std::string::npos) ? DETECTOR_VIEW_XZ :
122 PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
125 return STATUS_CODE_SUCCESS;
132 const MCParticleList *pMCParticleList = NULL;
134 if (listName.empty())
136 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*
this, pMCParticleList))
138 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
139 std::cout <<
"VisualMonitoringAlgorithm: mc particle list unavailable." << std::endl;
145 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*
this, listName, pMCParticleList))
147 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
148 std::cout <<
"VisualMonitoringAlgorithm: mc particle list unavailable." << std::endl;
153 PANDORA_MONITORING_API(VisualizeMCParticles(this->GetPandora(), pMCParticleList, listName.empty() ?
"CurrentMCParticles" : listName.c_str(),
161 const CaloHitList *pCaloHitList = NULL;
163 if (listName.empty())
165 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*
this, pCaloHitList))
167 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
168 std::cout <<
"VisualMonitoringAlgorithm: current calo hit list unavailable." << std::endl;
174 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*
this, listName, pCaloHitList))
176 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
177 std::cout <<
"VisualMonitoringAlgorithm: calo hit list " << listName <<
" unavailable." << std::endl;
183 CaloHitList caloHitList;
187 const CaloHit *
const pCaloHit = *iter;
192 caloHitList.push_back(pCaloHit);
196 PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &caloHitList, listName.empty() ?
"CurrentCaloHits" : listName.c_str(),
197 (
m_hitColors.find(
"energy") != std::string::npos ? AUTOENERGY : GRAY)));
204 const TrackList *pTrackList = NULL;
206 if (listName.empty())
208 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*
this, pTrackList))
210 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
211 std::cout <<
"VisualMonitoringAlgorithm: current track list unavailable." << std::endl;
217 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*
this, listName, pTrackList))
219 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
220 std::cout <<
"VisualMonitoringAlgorithm: track list " << listName <<
" unavailable." << std::endl;
230 const Track *
const pTrack = *iter;
233 trackList.push_back(pTrack);
236 PANDORA_MONITORING_API(VisualizeTracks(this->GetPandora(), &trackList, listName.empty() ?
"CurrentTracks" : listName.c_str(), GRAY));
243 const ClusterList *pClusterList = NULL;
245 if (listName.empty())
247 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*
this, pClusterList))
249 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
250 std::cout <<
"VisualMonitoringAlgorithm: current cluster list unavailable." << std::endl;
256 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*
this, listName, pClusterList))
258 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
259 std::cout <<
"VisualMonitoringAlgorithm: cluster list " << listName <<
" unavailable." << std::endl;
265 ClusterList clusterList;
269 const Cluster *
const pCluster = *iter;
272 clusterList.push_back(pCluster);
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,
286 const PfoList *pPfoList = NULL;
288 if (listName.empty())
290 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*
this, pPfoList))
292 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
293 std::cout <<
"VisualMonitoringAlgorithm: current pfo list unavailable." << std::endl;
299 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*
this, listName, pPfoList))
301 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
302 std::cout <<
"VisualMonitoringAlgorithm: pfo list " << listName <<
" unavailable." << std::endl;
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 :
320 if (listName.empty())
322 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetCurrentList(*
this, pVertexList))
324 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
325 std::cout <<
"VisualMonitoringAlgorithm: current vertex list unavailable." << std::endl;
331 if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*
this, listName, pVertexList))
333 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
334 std::cout <<
"VisualMonitoringAlgorithm: vertex list " << listName <<
" unavailable." << std::endl;
344 const Vertex *
const pVertex = *iter;
347 vertexList.push_back(pVertex);
350 PANDORA_MONITORING_API(VisualizeVertices(this->GetPandora(), &vertexList, listName.empty() ?
"CurrentVertices" : listName.c_str(), AUTO));
357 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
360 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
363 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
366 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
369 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
372 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
375 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
378 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
381 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
384 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
387 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
390 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
393 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
396 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
399 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
403 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
406 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
409 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
413 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
416 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
419 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
422 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
425 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
428 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
431 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
436 const std::string pdgEnergy(*iter);
437 StringVector pdgEnergySeparated;
438 const std::string delimiter =
":";
439 XmlHelper::TokenizeString(pdgEnergy, pdgEnergySeparated, delimiter);
441 if (pdgEnergySeparated.size() != 2)
442 return STATUS_CODE_INVALID_PARAMETER;
447 if (!StringToType(pdgEnergySeparated.at(0), pdgCode) || !StringToType(pdgEnergySeparated.at(1),
energy))
448 return STATUS_CODE_INVALID_PARAMETER;
453 return STATUS_CODE_SUCCESS;
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)
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
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.
pandora::StatusCode Run()
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.
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.
Header file for the visual monitoring algorithm class.
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.
std::list< Vertex > VertexList
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)