Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
VisualParticleMonitoringAlgorithm.cc
Go to the documentation of this file.
1
10
12
16
17using namespace pandora;
18
19namespace lar_content
20{
21
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},
30 m_transparencyThresholdE{-1.f},
31 m_energyScaleThresholdE{1.f},
32 m_scalingFactor{1.f}
33{
34}
35
36//------------------------------------------------------------------------------------------------------------------------------------------
37
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 {
60 this->VisualizeMCByPdgCode(targetMCParticleToHitsMap);
61 else
62 this->VisualizeIndependentMC(targetMCParticleToHitsMap);
63 }
65 {
66 const PfoList *pPfoList(nullptr);
67 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_pfoListName, pPfoList));
69 {
70 this->VisualizePfoByParticleId(*pPfoList);
71 }
72 else
73 {
75 this->VisualizeIndependentPfo(*pPfoList, targetMCParticleToHitsMap);
76 else
77 this->VisualizeIndependentPfo(*pPfoList);
78 }
79 }
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
94void 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
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
152void 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
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
232void 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
241void 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
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;
284 {
285 try
286 {
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
326void 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
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
374void VisualParticleMonitoringAlgorithm::VisualizePfoByParticleId(const PfoList &pfoList) const
375{
376 PfoList linearisedPfo;
377 if (pfoList.empty())
378 return;
379
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
448void 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
452 LArMCParticleHelper::PrimaryParameters parameters;
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
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));
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));
491 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TransparencyThresholdE", m_transparencyThresholdE));
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
Grouping of header files for many classes of use in particle flow algorithms.
#define PANDORA_MONITORING_API(command)
Header file for the lar calo hit class.
Header file for the lar mc particle class.
Header file for the pfo helper class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Definition StatusCodes.h:31
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Definition StatusCodes.h:19
Header file for the particle visualisation algorithm.
static pandora::StatusCode GetCurrentList(const pandora::Algorithm &algorithm, const T *&pT)
Get the current list.
static pandora::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
static bool IsCosmicRay(const pandora::MCParticle *const pMCParticle)
Return true if passed a primary cosmic ray MCParticle.
static bool IsBeamParticle(const pandora::MCParticle *const pMCParticle)
Returns true if passed a primary beam 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.
std::unordered_map< const pandora::MCParticle *, pandora::CaloHitList > MCContributionMap
static void GetBreadthFirstHierarchyRepresentation(const pandora::MCParticle *const pMCParticle, pandora::MCParticleList &mcParticleList)
Retrieve a linearised representation of the MC particle hierarchy in breadth first order....
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.
static bool IsBeamNeutrinoFinalState(const pandora::MCParticle *const pMCParticle)
Returns true if passed a primary neutrino final state MCParticle.
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
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 ...
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.
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.
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.
bool m_showPfoByPid
Whether or not to colour PFOs by particle id.
bool m_showPfoMatchedMC
Whether or not to display the best matched MC particle for a PFO.
bool m_visualizeSlice
Whether or not to visualize reconstructed slices.
bool m_isTestBeam
Whether or not this is a test beam experiment.
bool m_groupMCByPdg
Whether or not to group MC particles by particle id.
bool m_visualizeMC
Whether or not to visualize MC particles.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
float m_scalingFactor
TEve works with [cm], Pandora usually works with [mm] (but LArContent went with cm too)
CaloHit class.
Definition CaloHit.h:26
MCParticle class.
Definition MCParticle.h:26
ParticleFlowObject class.
const Pandora & GetPandora() const
Get the associated pandora instance.
Definition Process.h:116
StatusCodeException class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
Definition XmlHelper.h:136
HitType
Calorimeter hit type enum.
MANAGED_CONTAINER< const MCParticle * > MCParticleList
MANAGED_CONTAINER< const CaloHit * > CaloHitList
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList