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