LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
VisualParticleMonitoringAlgorithm.cc
Go to the documentation of this file.
1 
9 #include "Pandora/AlgorithmHeaders.h"
10 
12 
17 
18 using namespace pandora;
19 
20 namespace lar_content
21 {
22 
23 VisualParticleMonitoringAlgorithm::VisualParticleMonitoringAlgorithm() :
24  m_visualizeMC(false),
25  m_visualizePfo(false),
26  m_visualizeSlice(false),
27  m_groupMCByPdg(false),
28  m_showPfoByPid(false),
29  m_showPfoMatchedMC(false),
30  m_isTestBeam{false},
33  m_scalingFactor{1.f}
34 {
35 }
36 
37 //------------------------------------------------------------------------------------------------------------------------------------------
38 
40 {
41 }
42 
43 //------------------------------------------------------------------------------------------------------------------------------------------
44 
46 {
47 #ifdef MONITORING
48  LArMCParticleHelper::MCContributionMap targetMCParticleToHitsMap;
50  {
51  const CaloHitList *pCaloHitList(nullptr);
52  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_caloHitListName, pCaloHitList));
53  const MCParticleList *pMCParticleList(nullptr);
54  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*this, pMCParticleList));
55  this->MakeSelection(pCaloHitList, targetMCParticleToHitsMap);
56  }
57 
58  if (m_visualizeMC)
59  {
60  if (m_groupMCByPdg)
61  this->VisualizeMCByPdgCode(targetMCParticleToHitsMap);
62  else
63  this->VisualizeIndependentMC(targetMCParticleToHitsMap);
64  }
65  if (m_visualizePfo)
66  {
67  const PfoList *pPfoList(nullptr);
68  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_pfoListName, pPfoList));
69  if (m_showPfoByPid)
70  {
71  this->VisualizePfoByParticleId(*pPfoList);
72  }
73  else
74  {
76  this->VisualizeIndependentPfo(*pPfoList, targetMCParticleToHitsMap);
77  else
78  this->VisualizeIndependentPfo(*pPfoList);
79  }
80  }
81  if (m_visualizeSlice)
82  {
83  const PfoList *pPfoList(nullptr);
84  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_pfoListName, pPfoList));
85  this->VisualizeReconstructedSlice(*pPfoList);
86  }
87 #endif // MONITORING
88  return STATUS_CODE_SUCCESS;
89 }
90 
91 //------------------------------------------------------------------------------------------------------------------------------------------
92 
93 #ifdef MONITORING
94 
95 void VisualParticleMonitoringAlgorithm::VisualizeIndependentMC(const LArMCParticleHelper::MCContributionMap &mcMap) const
96 {
97  const std::map<int, const std::string> keys = {{13, "mu"}, {11, "e"}, {22, "gamma"}, {321, "kaon"}, {211, "pi"}, {2212, "p"}};
98  const std::map<int, Color> colors = {{0, RED}, {1, BLACK}, {2, BLUE}, {3, CYAN}, {4, MAGENTA}, {5, GREEN}, {6, ORANGE}, {7, GRAY}};
99  MCParticleList linearisedMC;
100  if (mcMap.empty())
101  return;
102 
103  PANDORA_MONITORING_API(
104  SetEveDisplayParameters(this->GetPandora(), true, DETECTOR_VIEW_XZ, m_transparencyThresholdE, m_energyScaleThresholdE, m_scalingFactor));
105  LArMCParticleHelper::GetBreadthFirstHierarchyRepresentation(mcMap.begin()->first, linearisedMC);
106 
107  size_t colorIdx{0};
108  int mcIdx{0};
109  for (const MCParticle *pMC : linearisedMC)
110  {
111  const auto iter{mcMap.find(pMC)};
112  if (iter == mcMap.end())
113  continue;
114  std::string key("other");
115  try
116  {
117  const int pdg{std::abs(pMC->GetParticleId())};
118  if (keys.find(pdg) != keys.end())
119  key = keys.at(pdg);
120  }
121  catch (const StatusCodeException &)
122  {
123  key = "unknown";
124  }
125 
126  CaloHitList uHits, vHits, wHits;
127  for (const CaloHit *pCaloHit : iter->second)
128  {
129  const HitType view{pCaloHit->GetHitType()};
130  if (view == HitType::TPC_VIEW_U)
131  uHits.emplace_back(pCaloHit);
132  else if (view == HitType::TPC_VIEW_V)
133  vHits.emplace_back(pCaloHit);
134  else
135  wHits.emplace_back(pCaloHit);
136  }
137  std::string suffix{std::to_string(mcIdx) + "_" + key};
138  if (!uHits.empty())
139  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uHits, "u_" + suffix, colors.at(colorIdx)));
140  if (!vHits.empty())
141  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &vHits, "v_" + suffix, colors.at(colorIdx)));
142  if (!wHits.empty())
143  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &wHits, "w_" + suffix, colors.at(colorIdx)));
144  colorIdx = (colorIdx + 1) >= colors.size() ? 0 : colorIdx + 1;
145  ++mcIdx;
146  }
147 
148  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
149 }
150 
151 //------------------------------------------------------------------------------------------------------------------------------------------
152 
153 void VisualParticleMonitoringAlgorithm::VisualizeMCByPdgCode(const LArMCParticleHelper::MCContributionMap &mcMap) const
154 {
155  const std::map<int, const std::string> keys = {{13, "mu"}, {11, "e"}, {22, "gamma"}, {321, "kaon"}, {211, "pi"}, {2212, "p"}};
156  const std::map<std::string, Color> colors = {
157  {"mu", MAGENTA}, {"e", RED}, {"gamma", ORANGE}, {"kaon", BLACK}, {"pi", GREEN}, {"p", BLUE}, {"other", GRAY}};
158 
159  std::map<std::string, CaloHitList> uHits, vHits, wHits;
160  for (const auto &[key, value] : keys)
161  {
162  (void)key; // GCC 7 support, 8+ doesn't need this
163  uHits[value] = CaloHitList();
164  vHits[value] = CaloHitList();
165  wHits[value] = CaloHitList();
166  }
167  uHits["other"] = CaloHitList();
168  vHits["other"] = CaloHitList();
169  wHits["other"] = CaloHitList();
170 
171  for (const auto &[pMC, pCaloHits] : mcMap)
172  {
173  for (const CaloHit *pCaloHit : pCaloHits)
174  {
175  const HitType view{pCaloHit->GetHitType()};
176 
177  try
178  {
179  const int pdg{std::abs(pMC->GetParticleId())};
180  std::string key("other");
181  if (keys.find(pdg) != keys.end())
182  key = keys.at(pdg);
183 
184  if (view == HitType::TPC_VIEW_U)
185  uHits[key].emplace_back(pCaloHit);
186  else if (view == HitType::TPC_VIEW_V)
187  vHits[key].emplace_back(pCaloHit);
188  else
189  wHits[key].emplace_back(pCaloHit);
190  }
191  catch (const StatusCodeException &)
192  {
193  continue;
194  }
195  }
196  }
197 
198  PANDORA_MONITORING_API(
199  SetEveDisplayParameters(this->GetPandora(), true, DETECTOR_VIEW_XZ, m_transparencyThresholdE, m_energyScaleThresholdE, m_scalingFactor));
200 
201  for (const auto &[key, value] : keys)
202  {
203  (void)key; // GCC 7 support, 8+ doesn't need this
204  if (!uHits[value].empty())
205  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uHits[value], "u_" + value, colors.at(value)));
206  }
207  if (!uHits["other"].empty())
208  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uHits["other"], "u_other", colors.at("other")));
209 
210  for (const auto &[key, value] : keys)
211  {
212  (void)key; // GCC 7 support, 8+ doesn't need this
213  if (!vHits[value].empty())
214  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &vHits[value], "v_" + value, colors.at(value)));
215  }
216  if (!vHits["other"].empty())
217  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uHits["other"], "v_other", colors.at("other")));
218 
219  for (const auto &[key, value] : keys)
220  {
221  (void)key; // GCC 7 support, 8+ doesn't need this
222  if (!wHits[value].empty())
223  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &wHits[value], "w_" + value, colors.at(value)));
224  }
225  if (!wHits["other"].empty())
226  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uHits["other"], "w_other", colors.at("other")));
227 
228  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
229 }
230 
231 //------------------------------------------------------------------------------------------------------------------------------------------
232 
233 void VisualParticleMonitoringAlgorithm::VisualizeIndependentPfo(const PfoList &pfoList) const
234 {
235  // ATTN - If we aren't showing matched MC, just pass in an empty MC to hits map
237  this->VisualizeIndependentPfo(pfoList, mcMap);
238 }
239 
240 //------------------------------------------------------------------------------------------------------------------------------------------
241 
242 void VisualParticleMonitoringAlgorithm::VisualizeIndependentPfo(const PfoList &pfoList, const LArMCParticleHelper::MCContributionMap &mcMap) const
243 {
244  const std::map<int, Color> colors = {{0, RED}, {1, BLACK}, {2, BLUE}, {3, CYAN}, {4, MAGENTA}, {5, GREEN}, {6, ORANGE}, {7, GRAY}};
245  PfoList linearisedPfo;
246  if (pfoList.empty())
247  return;
248 
249  PANDORA_MONITORING_API(
250  SetEveDisplayParameters(this->GetPandora(), true, DETECTOR_VIEW_XZ, m_transparencyThresholdE, m_energyScaleThresholdE, m_scalingFactor));
251  LArPfoHelper::GetBreadthFirstHierarchyRepresentation(pfoList.front(), linearisedPfo);
252 
253  size_t colorIdx{0};
254  int pfoIdx{0};
255  for (const ParticleFlowObject *pPfo : linearisedPfo)
256  {
257  CaloHitList uHits, vHits, wHits;
258  const bool isTrack{LArPfoHelper::IsTrack(pPfo)};
259  CaloHitList caloHits;
260  for (const auto view : {HitType::TPC_VIEW_U, HitType::TPC_VIEW_V, HitType::TPC_VIEW_W})
261  {
262  LArPfoHelper::GetCaloHits(pPfo, view, caloHits);
263  LArPfoHelper::GetIsolatedCaloHits(pPfo, view, caloHits);
264  }
265  for (const CaloHit *pCaloHit : caloHits)
266  {
267  const HitType view{pCaloHit->GetHitType()};
268  if (view == HitType::TPC_VIEW_U)
269  uHits.emplace_back(pCaloHit);
270  else if (view == HitType::TPC_VIEW_V)
271  vHits.emplace_back(pCaloHit);
272  else if (view == HitType::TPC_VIEW_W)
273  wHits.emplace_back(pCaloHit);
274  }
275  std::string suffix{std::to_string(pfoIdx)};
276  suffix += isTrack ? "_T" : "_S";
277  if (!uHits.empty())
278  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uHits, "u_" + suffix, colors.at(colorIdx)));
279  if (!vHits.empty())
280  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &vHits, "v_" + suffix, colors.at(colorIdx)));
281  if (!wHits.empty())
282  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &wHits, "w_" + suffix, colors.at(colorIdx)));
283  colorIdx = (colorIdx + 1) >= colors.size() ? 0 : colorIdx + 1;
284  if (m_showPfoMatchedMC)
285  {
286  try
287  {
288  const MCParticle *pMC{LArMCParticleHelper::GetMainMCParticle(pPfo)};
289  if (pMC)
290  {
291  const auto iter{mcMap.find(pMC)};
292  if (iter != mcMap.end())
293  {
294  CaloHitList uHitsMC, vHitsMC, wHitsMC;
295  for (const CaloHit *pCaloHit : iter->second)
296  {
297  const HitType view{pCaloHit->GetHitType()};
298  if (view == HitType::TPC_VIEW_U)
299  uHitsMC.emplace_back(pCaloHit);
300  else if (view == HitType::TPC_VIEW_V)
301  vHitsMC.emplace_back(pCaloHit);
302  else if (view == HitType::TPC_VIEW_W)
303  wHitsMC.emplace_back(pCaloHit);
304  }
305  std::string mcSuffix(suffix + "_MC");
306  if (!uHitsMC.empty())
307  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uHitsMC, "u_" + mcSuffix, colors.at(colorIdx)));
308  if (!vHitsMC.empty())
309  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &vHitsMC, "v_" + mcSuffix, colors.at(colorIdx)));
310  if (!wHitsMC.empty())
311  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &wHitsMC, "w_" + mcSuffix, colors.at(colorIdx)));
312  }
313  }
314  }
315  catch (const StatusCodeException &)
316  { // No matched MC, move on
317  }
318  }
319  ++pfoIdx;
320  }
321 
322  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
323 }
324 
325 //------------------------------------------------------------------------------------------------------------------------------------------
326 
327 void VisualParticleMonitoringAlgorithm::VisualizeReconstructedSlice(const PfoList &pfoList) const
328 {
329  const std::map<int, Color> colors = {{0, RED}, {1, BLACK}, {2, BLUE}, {3, CYAN}, {4, MAGENTA}, {5, GREEN}, {6, ORANGE}, {7, GRAY}};
330  if (pfoList.empty())
331  return;
332 
333  PANDORA_MONITORING_API(
334  SetEveDisplayParameters(this->GetPandora(), true, DETECTOR_VIEW_XZ, m_transparencyThresholdE, m_energyScaleThresholdE, m_scalingFactor));
335 
336  size_t colorIdx{0};
337  int pfoIdx{0};
338  for (const ParticleFlowObject *pPfo : pfoList)
339  {
340  CaloHitList uHits, vHits, wHits;
341  const bool isTrack{LArPfoHelper::IsTrack(pPfo)};
342  CaloHitList caloHits;
343  for (const auto view : {HitType::TPC_VIEW_U, HitType::TPC_VIEW_V, HitType::TPC_VIEW_W})
344  {
345  LArPfoHelper::GetCaloHits(pPfo, view, caloHits);
346  LArPfoHelper::GetIsolatedCaloHits(pPfo, view, caloHits);
347  }
348  for (const CaloHit *pCaloHit : caloHits)
349  {
350  const HitType view{pCaloHit->GetHitType()};
351  if (view == HitType::TPC_VIEW_U)
352  uHits.emplace_back(pCaloHit);
353  else if (view == HitType::TPC_VIEW_V)
354  vHits.emplace_back(pCaloHit);
355  else if (view == HitType::TPC_VIEW_W)
356  wHits.emplace_back(pCaloHit);
357  }
358  std::string suffix{std::to_string(pfoIdx)};
359  suffix += isTrack ? "_T" : "_S";
360  if (!uHits.empty())
361  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uHits, "u_" + suffix, colors.at(colorIdx)));
362  if (!vHits.empty())
363  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &vHits, "v_" + suffix, colors.at(colorIdx)));
364  if (!wHits.empty())
365  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &wHits, "w_" + suffix, colors.at(colorIdx)));
366  colorIdx = (colorIdx + 1) >= colors.size() ? 0 : colorIdx + 1;
367  ++pfoIdx;
368  }
369 
370  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
371 }
372 
373 //------------------------------------------------------------------------------------------------------------------------------------------
374 
375 void VisualParticleMonitoringAlgorithm::VisualizePfoByParticleId(const PfoList &pfoList) const
376 {
377  PfoList linearisedPfo;
378  if (pfoList.empty())
379  return;
380 
381  PANDORA_MONITORING_API(
382  SetEveDisplayParameters(this->GetPandora(), true, DETECTOR_VIEW_XZ, m_transparencyThresholdE, m_energyScaleThresholdE, m_scalingFactor));
383  LArPfoHelper::GetBreadthFirstHierarchyRepresentation(pfoList.front(), linearisedPfo);
384 
385  int pfoIdx{0};
386  for (const ParticleFlowObject *pPfo : linearisedPfo)
387  {
388  CaloHitList uTrackHits, vTrackHits, wTrackHits, uShowerHits, vShowerHits, wShowerHits;
389  const bool isTrack{LArPfoHelper::IsTrack(pPfo)};
390  CaloHitList caloHits;
391  for (const auto view : {HitType::TPC_VIEW_U, HitType::TPC_VIEW_V, HitType::TPC_VIEW_W})
392  {
393  LArPfoHelper::GetCaloHits(pPfo, view, caloHits);
394  LArPfoHelper::GetIsolatedCaloHits(pPfo, view, caloHits);
395  }
396  for (const CaloHit *pCaloHit : caloHits)
397  {
398  const HitType view{pCaloHit->GetHitType()};
399  if (view == HitType::TPC_VIEW_U)
400  {
401  if (isTrack)
402  uTrackHits.emplace_back(pCaloHit);
403  else
404  uShowerHits.emplace_back(pCaloHit);
405  }
406  else if (view == HitType::TPC_VIEW_V)
407  {
408  if (isTrack)
409  vTrackHits.emplace_back(pCaloHit);
410  else
411  vShowerHits.emplace_back(pCaloHit);
412  }
413  else
414  {
415  if (isTrack)
416  wTrackHits.emplace_back(pCaloHit);
417  else
418  wShowerHits.emplace_back(pCaloHit);
419  }
420  }
421  if (isTrack)
422  {
423  std::string suffix{std::to_string(pfoIdx) + "_T"};
424  if (!uTrackHits.empty())
425  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uTrackHits, "u_" + suffix, BLUE));
426  if (!vTrackHits.empty())
427  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &vTrackHits, "v_" + suffix, BLUE));
428  if (!wTrackHits.empty())
429  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &wTrackHits, "w_" + suffix, BLUE));
430  }
431  else
432  {
433  std::string suffix{std::to_string(pfoIdx) + "_S"};
434  if (!uShowerHits.empty())
435  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &uShowerHits, "u_" + suffix, RED));
436  if (!vShowerHits.empty())
437  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &vShowerHits, "v_" + suffix, RED));
438  if (!wShowerHits.empty())
439  PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &wShowerHits, "w_" + suffix, RED));
440  }
441  ++pfoIdx;
442  }
443 
444  PANDORA_MONITORING_API(ViewEvent(this->GetPandora()));
445 }
446 
447 //------------------------------------------------------------------------------------------------------------------------------------------
448 
449 void VisualParticleMonitoringAlgorithm::MakeSelection(const CaloHitList *pCaloHitList, LArMCParticleHelper::MCContributionMap &mcMap) const
450 {
451 
452  for (const CaloHit *pCaloHit : *pCaloHitList)
453  {
454  try
455  {
456  const MCParticle *pMC{MCParticleHelper::GetMainMCParticle(pCaloHit)};
457  const MCParticle *const pParentMCParticle(LArMCParticleHelper::GetParentMCParticle(pMC));
458  if (LArMCParticleHelper::IsNeutrino(pParentMCParticle))
459  {
460  mcMap[pMC].emplace_back(pCaloHit);
461  }
462  }
463  catch (const StatusCodeException &)
464  {
465  }
466  }
467 }
468 #endif // MONITORING
469 
470 //------------------------------------------------------------------------------------------------------------------------------------------
471 
472 StatusCode VisualParticleMonitoringAlgorithm::ReadSettings(const TiXmlHandle xmlHandle)
473 {
474  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "CaloHitListName", m_caloHitListName));
475  if (m_caloHitListName.empty())
476  m_caloHitListName = "CaloHitList2D";
477  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "PfoListName", m_pfoListName));
478  if (m_pfoListName.empty())
479  m_pfoListName = "RecreatedPfos";
480  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizeMC", m_visualizeMC));
481  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizePFO", m_visualizePfo));
482  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VisualizeSlice", m_visualizeSlice));
483  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "GroupMCByPDG", m_groupMCByPdg));
484  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPFOByPID", m_showPfoByPid));
485  PANDORA_RETURN_RESULT_IF_AND_IF(
486  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ShowPFOMatchedMC", m_showPfoMatchedMC));
487  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "IsTestBeam", m_isTestBeam));
488  PANDORA_RETURN_RESULT_IF_AND_IF(
489  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TransparencyThresholdE", m_transparencyThresholdE));
490  PANDORA_RETURN_RESULT_IF_AND_IF(
491  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "EnergyScaleThresholdE", m_energyScaleThresholdE));
492  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ScalingFactor", m_scalingFactor));
493 
494  return STATUS_CODE_SUCCESS;
495 }
496 
497 } // namespace lar_content
Header file for the pfo helper class.
std::unordered_map< const pandora::MCParticle *, pandora::CaloHitList > MCContributionMap
Header file for the lar calo hit class.
constexpr auto abs(T v)
Returns the absolute value of the argument.
bool m_visualizeSlice
Whether or not to visualize reconstructed slices.
float m_transparencyThresholdE
Cell energy for which transparency is saturated (0%, fully opaque)
float m_energyScaleThresholdE
Cell energy for which color is at top end of continous color palette.
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
static const pandora::MCParticle * GetMainMCParticle(const pandora::ParticleFlowObject *const pPfo)
Find the mc particle making the largest contribution to 2D clusters in a specified pfo...
bool m_showPfoMatchedMC
Whether or not to display the best matched MC particle for a PFO.
bool m_showPfoByPid
Whether or not to colour PFOs by particle id.
Header file for the lar monte carlo particle helper helper class.
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
Header file for the particle visualisation algorithm.
static const pandora::MCParticle * GetParentMCParticle(const pandora::MCParticle *const pMCParticle)
Get the parent mc particle.
Header file for the lar mc particle class.
double value
Definition: spectrum.C:18
static void GetBreadthFirstHierarchyRepresentation(const pandora::ParticleFlowObject *const pPfo, pandora::PfoList &pfoList)
Retrieve a linearised representation of the PFO hierarchy in breadth first order. This iterates over ...
bool m_isTestBeam
Whether or not this is a test beam experiment.
float m_scalingFactor
TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too) ...
HitType
Definition: HitType.h:12
static void GetIsolatedCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of isolated calo hits of a particular hit type from a list of pfos.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
bool m_groupMCByPdg
Whether or not to group MC particles by particle id.
static void GetCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of calo hits of a particular hit type from a list of pfos.
static void GetBreadthFirstHierarchyRepresentation(const pandora::MCParticle *const pMCParticle, pandora::MCParticleList &mcParticleList)
Retrieve a linearised representation of the MC particle hierarchy in breadth first order...
std::string m_caloHitListName
Name of input calo hit list.
static bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.
bool m_visualizeMC
Whether or not to visualize MC particles.
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109