Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
PandoraContentApiImpl.cc
Go to the documentation of this file.
1
10
15#include "Managers/MCManager.h"
20
21#include "Objects/CaloHit.h"
22#include "Objects/Cluster.h"
24#include "Objects/Track.h"
25#include "Objects/Vertex.h"
26
27#include "Pandora/Algorithm.h"
30#include "Pandora/Pandora.h"
32
34
35namespace pandora
36{
37
38// Macros for type mappings to avoid repeated template specializations
39#define MANAGER_TYPE_LIST(d) \
40d(CaloHit, CaloHitManager, m_pCaloHitManager) \
41d(Track, TrackManager, m_pTrackManager) \
42d(MCParticle, MCManager, m_pMCManager) \
43d(Cluster, ClusterManager, m_pClusterManager) \
44d(ParticleFlowObject, ParticleFlowObjectManager, m_pPfoManager) \
45d(Vertex, VertexManager, m_pVertexManager) \
46d(CaloHitList, CaloHitManager, m_pCaloHitManager) \
47d(TrackList, TrackManager, m_pTrackManager) \
48d(MCParticleList, MCManager, m_pMCManager) \
49d(ClusterList, ClusterManager, m_pClusterManager) \
50d(PfoList, ParticleFlowObjectManager, m_pPfoManager) \
51d(VertexList, VertexManager, m_pVertexManager)
52
53#define MANAGER_TYPE_MAPPING(a, b, c) \
54template<> \
55struct PandoraContentApiImpl::ReturnType<a> \
56{ \
57 typedef b Type; \
58}; \
59 \
60template <> \
61inline b *PandoraContentApiImpl::GetManager<a>() const \
62{ \
63 return m_pPandora->c; \
64}
65
67
68//------------------------------------------------------------------------------------------------------------------------------------------
69
70template <>
72{
73 return this->GetManager<CaloHit>()->AlterMetadata(pObject, metadata);
74}
75
76template <>
78{
79 return this->GetManager<Cluster>()->AlterMetadata(pObject, metadata);
80}
81
82template <>
84{
85 return this->GetManager<ParticleFlowObject>()->AlterMetadata(pObject, metadata);
86}
87
88template <>
90{
91 return this->GetManager<Vertex>()->AlterMetadata(pObject, metadata);
92}
93
94template <typename OBJECT, typename METADATA>
95StatusCode PandoraContentApiImpl::AlterMetadata(const OBJECT *const /*pObject*/, const METADATA &/*metadata*/) const
96{
98}
99
100//------------------------------------------------------------------------------------------------------------------------------------------
101
102template <>
108
109template <>
115
116template <>
122
123template <>
129
130template <>
133{
134 if (!this->GetManager<CaloHit>()->IsAvailable(&parameters.m_caloHitList) ||
135 !this->GetManager<CaloHit>()->IsAvailable(&parameters.m_isolatedCaloHitList))
136 {
138 }
139
141 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<CaloHit>()->SetAvailability(&parameters.m_caloHitList, false));
142 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<CaloHit>()->SetAvailability(&parameters.m_isolatedCaloHitList, false));
143
144 return STATUS_CODE_SUCCESS;
145}
146
147template <>
150{
151 if (!this->GetManager<Cluster>()->IsAvailable(&pfoParameters.m_clusterList) ||
152 !this->GetManager<Track>()->IsAvailable(&pfoParameters.m_trackList) ||
153 !this->GetManager<Vertex>()->IsAvailable(&pfoParameters.m_vertexList))
154 {
156 }
157
159 this->GetManager<Cluster>()->SetAvailability(&pfoParameters.m_clusterList, false);
160 this->GetManager<Track>()->SetAvailability(&pfoParameters.m_trackList, false);
161 this->GetManager<Vertex>()->SetAvailability(&pfoParameters.m_vertexList, false);
162
163 return STATUS_CODE_SUCCESS;
164}
165
166template <typename PARAMETERS, typename OBJECT>
167StatusCode PandoraContentApiImpl::Create(const PARAMETERS &/*parameters*/, const OBJECT *&/*pObject*/, const pandora::ObjectFactory<PARAMETERS, OBJECT> &/*factory*/) const
168{
170}
171
172//------------------------------------------------------------------------------------------------------------------------------------------
173
178
179//------------------------------------------------------------------------------------------------------------------------------------------
180
185
186//------------------------------------------------------------------------------------------------------------------------------------------
187
192
193//------------------------------------------------------------------------------------------------------------------------------------------
194
199
200//------------------------------------------------------------------------------------------------------------------------------------------
201
206
207//------------------------------------------------------------------------------------------------------------------------------------------
208
213
214//------------------------------------------------------------------------------------------------------------------------------------------
215
216StatusCode PandoraContentApiImpl::RunAlgorithm(const std::string &algorithmName) const
217{
218 AlgorithmManager::AlgorithmMap::const_iterator iter = m_pPandora->m_pAlgorithmManager->m_algorithmMap.find(algorithmName);
219
222
224
225 try
226 {
228
230 {
231 for (unsigned int i = 1, iMax = this->GetManager<CaloHit>()->m_algorithmInfoMap.size(); i < iMax; ++i) std::cout << "----";
232 std::cout << "> Running Algorithm: " << iter->second->GetInstanceName() << ", " << iter->second->GetType() << std::endl;
233 }
234
236 }
237 catch (const StatusCodeException &exception)
238 {
239 std::cout << "Failure in algorithm " << iter->first << ", " << iter->second->GetType() << ", " << exception.ToString()
240 << exception.GetBackTrace() << std::endl;
241 }
243 {
244 std::cout << "Algorithm " << iter->first << ", " << iter->second->GetType() << " raised stop processing exception: "
245 << exception.GetDescription() << std::endl;
246 throw exception;
247 }
248 catch (...)
249 {
250 std::cout << "Failure in algorithm " << iter->first << ", " << iter->second->GetType() << ", unknown exception" << std::endl;
251 }
252
254
255 return STATUS_CODE_SUCCESS;
256}
257
258//------------------------------------------------------------------------------------------------------------------------------------------
259
260StatusCode PandoraContentApiImpl::RunClusteringAlgorithm(const Algorithm &algorithm, const std::string &clusteringAlgorithmName,
261 const ClusterList *&pNewClusterList, std::string &newClusterListName) const
262{
265 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RunAlgorithm(clusteringAlgorithmName));
267
268 return STATUS_CODE_SUCCESS;
269}
270
271//------------------------------------------------------------------------------------------------------------------------------------------
272
273template <typename T>
274StatusCode PandoraContentApiImpl::GetCurrentList(const T *&pT, std::string &listName) const
275{
276 return this->GetManager<T>()->GetCurrentList(pT, listName);
277}
278
279//------------------------------------------------------------------------------------------------------------------------------------------
280
281template <typename T>
283{
284 return this->GetManager<T>()->GetCurrentListName(listName);
285}
286
287//------------------------------------------------------------------------------------------------------------------------------------------
288
289template <typename T>
290StatusCode PandoraContentApiImpl::ReplaceCurrentList(const Algorithm &algorithm, const std::string &newListName) const
291{
292 return this->GetManager<T>()->ReplaceCurrentAndAlgorithmInputLists(&algorithm, newListName);
293}
294
295//------------------------------------------------------------------------------------------------------------------------------------------
296
297template <typename T>
299{
300 return this->GetManager<T>()->DropCurrentList(&algorithm);
301}
302
303//------------------------------------------------------------------------------------------------------------------------------------------
304
305template <typename T>
306StatusCode PandoraContentApiImpl::GetList(const std::string &listName, const T *&pT) const
307{
308 return this->GetManager<T>()->GetList(listName, pT);
309}
310
311//------------------------------------------------------------------------------------------------------------------------------------------
312
313template <typename T>
314StatusCode PandoraContentApiImpl::RenameList(const std::string &oldListName, const std::string &newListName) const
315{
316 return this->GetManager<T>()->RenameList(oldListName, newListName);
317}
318
319//------------------------------------------------------------------------------------------------------------------------------------------
320
321template <typename T>
322StatusCode PandoraContentApiImpl::SaveList(const T &t, const std::string &newListName) const
323{
324 return this->GetManager<T>()->SaveList(newListName, t);
325}
326
327//------------------------------------------------------------------------------------------------------------------------------------------
328
329template <typename T>
330StatusCode PandoraContentApiImpl::SaveList(const std::string &newListName) const
331{
332 std::string currentListName;
334 return this->GetManager<T>()->SaveObjects(newListName, currentListName);
335}
336
337//------------------------------------------------------------------------------------------------------------------------------------------
338
339template <typename T>
340StatusCode PandoraContentApiImpl::SaveList(const std::string &oldListName, const std::string &newListName) const
341{
342 return this->GetManager<T>()->SaveObjects(newListName, oldListName);
343}
344
345//------------------------------------------------------------------------------------------------------------------------------------------
346
347template <typename T>
348StatusCode PandoraContentApiImpl::SaveList(const std::string &newListName, const T &t) const
349{
350 std::string currentListName;
352 return this->GetManager<T>()->SaveObjects(newListName, currentListName, t);
353}
354
355//------------------------------------------------------------------------------------------------------------------------------------------
356
357template <typename T>
358StatusCode PandoraContentApiImpl::SaveList(const std::string &oldListName, const std::string &newListName, const T &t) const
359{
360 return this->GetManager<T>()->SaveObjects(newListName, oldListName, t);
361}
362
363//------------------------------------------------------------------------------------------------------------------------------------------
364
365template <typename T>
367{
368 return this->GetManager<T>()->TemporarilyReplaceCurrentList(newListName);
369}
370
371//------------------------------------------------------------------------------------------------------------------------------------------
372
373template <typename T>
374StatusCode PandoraContentApiImpl::CreateTemporaryListAndSetCurrent(const Algorithm &algorithm, const T *&pT, std::string &temporaryListName) const
375{
377 return this->GetManager<T>()->GetCurrentList(pT, temporaryListName);
378}
379
380//------------------------------------------------------------------------------------------------------------------------------------------
381
382template <typename T>
383bool PandoraContentApiImpl::IsAvailable(const T *const pT) const
384{
385 return this->GetManager<T>()->IsAvailable(pT);
386}
387
388//------------------------------------------------------------------------------------------------------------------------------------------
389
390template <>
391StatusCode PandoraContentApiImpl::AddToCluster(const Cluster *const pCluster, const CaloHitList *const pCaloHitList) const
392{
393 for (const CaloHit *const pCaloHit : *pCaloHitList)
394 {
395 if (!this->IsAddToClusterAllowed(pCluster, pCaloHit))
397 }
398
399 for (const CaloHit *const pCaloHit : *pCaloHitList)
400 {
402 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<CaloHit>()->SetAvailability(pCaloHit, false));
403 }
404
405 return STATUS_CODE_SUCCESS;
406}
407
408template <>
409StatusCode PandoraContentApiImpl::AddToCluster(const Cluster *const pCluster, const CaloHit *const pCaloHit) const
410{
412 return this->AddToCluster(pCluster, &caloHitList);
413}
414
415//------------------------------------------------------------------------------------------------------------------------------------------
416
417StatusCode PandoraContentApiImpl::RemoveFromCluster(const Cluster *const pCluster, const CaloHit *const pCaloHit) const
418{
419 if ((pCluster->GetNCaloHits() <= 1) && (pCluster->GetNIsolatedCaloHits() == 0))
421
423 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<CaloHit>()->SetAvailability(pCaloHit, true));
424
425 return STATUS_CODE_SUCCESS;
426}
427
428//------------------------------------------------------------------------------------------------------------------------------------------
429
430template <>
431StatusCode PandoraContentApiImpl::AddIsolatedToCluster(const Cluster *const pCluster, const CaloHitList *const pCaloHitList) const
432{
433 for (const CaloHit *const pCaloHit : *pCaloHitList)
434 {
435 if (!this->IsAddToClusterAllowed(pCluster, pCaloHit))
437 }
438
439 for (const CaloHit *const pCaloHit : *pCaloHitList)
440 {
442 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<CaloHit>()->SetAvailability(pCaloHit, false));
443 }
444
445 return STATUS_CODE_SUCCESS;
446}
447
448template <>
449StatusCode PandoraContentApiImpl::AddIsolatedToCluster(const Cluster *const pCluster, const CaloHit *const pCaloHit) const
450{
452 return this->AddIsolatedToCluster(pCluster, &caloHitList);
453}
454
455//------------------------------------------------------------------------------------------------------------------------------------------
456
457StatusCode PandoraContentApiImpl::RemoveIsolatedFromCluster(const Cluster *const pCluster, const CaloHit *const pCaloHit) const
458{
459 if ((pCluster->GetNCaloHits() == 0) && (pCluster->GetNIsolatedCaloHits() <= 1))
461
463 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<CaloHit>()->SetAvailability(pCaloHit, true));
464
465 return STATUS_CODE_SUCCESS;
466}
467
468//------------------------------------------------------------------------------------------------------------------------------------------
469
470StatusCode PandoraContentApiImpl::Fragment(const CaloHit *const pOriginalCaloHit, const float fraction1, const CaloHit *&pDaughterCaloHit1,
472{
473 return this->GetManager<CaloHit>()->FragmentCaloHit(pOriginalCaloHit, fraction1, pDaughterCaloHit1, pDaughterCaloHit2, factory);
474}
475
476//------------------------------------------------------------------------------------------------------------------------------------------
477
478StatusCode PandoraContentApiImpl::MergeFragments(const CaloHit *const pFragmentCaloHit1, const CaloHit *const pFragmentCaloHit2,
480{
481 return this->GetManager<CaloHit>()->MergeCaloHitFragments(pFragmentCaloHit1, pFragmentCaloHit2, pMergedCaloHit, factory);
482}
483
484//------------------------------------------------------------------------------------------------------------------------------------------
485
486StatusCode PandoraContentApiImpl::AddTrackClusterAssociation(const Track *const pTrack, const Cluster *const pCluster) const
487{
490
491 return STATUS_CODE_SUCCESS;
492}
493
494//------------------------------------------------------------------------------------------------------------------------------------------
495
496StatusCode PandoraContentApiImpl::RemoveTrackClusterAssociation(const Track *const pTrack, const Cluster *const pCluster) const
497{
498 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Track>()->RemoveAssociatedCluster(pTrack, pCluster));
500
501 return STATUS_CODE_SUCCESS;
502}
503
504//------------------------------------------------------------------------------------------------------------------------------------------
505
522
523//------------------------------------------------------------------------------------------------------------------------------------------
524
526{
527 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Track>()->RemoveAllClusterAssociations());
528 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Cluster>()->RemoveAllTrackAssociations());
529
530 return STATUS_CODE_SUCCESS;
531}
532
533//------------------------------------------------------------------------------------------------------------------------------------------
534
543
544//------------------------------------------------------------------------------------------------------------------------------------------
545
546StatusCode PandoraContentApiImpl::MergeAndDeleteClusters(const Cluster *const pClusterToEnlarge, const Cluster *const pClusterToDelete) const
547{
548 std::string currentListName;
551}
552
553//------------------------------------------------------------------------------------------------------------------------------------------
554
555StatusCode PandoraContentApiImpl::MergeAndDeleteClusters(const Cluster *const pClusterToEnlarge, const Cluster *const pClusterToDelete,
556 const std::string &enlargeListName, const std::string &deleteListName) const
557{
558 if ((pClusterToEnlarge == pClusterToDelete) || !this->GetManager<Cluster>()->IsAvailable(pClusterToDelete))
560
561 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Track>()->RemoveClusterAssociations(pClusterToDelete->GetAssociatedTrackList()));
564
565 return STATUS_CODE_SUCCESS;
566}
567
568//------------------------------------------------------------------------------------------------------------------------------------------
569
570template <typename T>
571StatusCode PandoraContentApiImpl::AddToPfo(const ParticleFlowObject *const pPfo, const T *const pT) const
572{
573 if (!this->GetManager<T>()->IsAvailable(pT))
575
577 this->GetManager<T>()->SetAvailability(pT, false);
578
579 return STATUS_CODE_SUCCESS;
580}
581
582//------------------------------------------------------------------------------------------------------------------------------------------
583
584template <typename T>
585StatusCode PandoraContentApiImpl::RemoveFromPfo(const ParticleFlowObject *const pPfo, const T *const pT) const
586{
588 this->GetManager<T>()->SetAvailability(pT, true);
589
590 return STATUS_CODE_SUCCESS;
591}
592
593//------------------------------------------------------------------------------------------------------------------------------------------
594
596{
597 return this->GetManager<ParticleFlowObject>()->SetParentDaughterAssociation(pParentPfo, pDaughterPfo);
598}
599
600//------------------------------------------------------------------------------------------------------------------------------------------
601
603{
604 return this->GetManager<ParticleFlowObject>()->RemoveParentDaughterAssociation(pParentPfo, pDaughterPfo);
605}
606
607//------------------------------------------------------------------------------------------------------------------------------------------
608
610 m_pPandora(pPandora)
611{
612}
613
614//------------------------------------------------------------------------------------------------------------------------------------------
615
616bool PandoraContentApiImpl::IsAddToClusterAllowed(const Cluster *const pCluster, const CaloHit *const pCaloHit) const
617{
618 if (!this->GetManager<CaloHit>()->IsAvailable(pCaloHit))
619 return false;
620
622 return true;
623
624 const CaloHit *pFirstCaloHit(nullptr);
625
626 if (!pCluster->GetOrderedCaloHitList().empty())
627 {
628 if (pCluster->GetOrderedCaloHitList().begin()->second->empty())
630
631 pFirstCaloHit = *(pCluster->GetOrderedCaloHitList().begin()->second->begin());
632 }
633 else if (!pCluster->GetIsolatedCaloHitList().empty())
634 {
635 pFirstCaloHit = *(pCluster->GetIsolatedCaloHitList().begin());
636 }
637
638 if (!pFirstCaloHit || (pFirstCaloHit->GetHitType() == pCaloHit->GetHitType()))
639 return true;
640
641 return false;
642}
643
644//------------------------------------------------------------------------------------------------------------------------------------------
645
646template <typename T>
648{
650 return this->PrepareForDeletion(&objectList);
651}
652
653template <>
655{
656 if (!this->GetManager<Cluster>()->IsAvailable(pClusterList))
658
661
662 for (const Cluster *const pCluster : *pClusterList)
663 {
664 pCluster->GetOrderedCaloHitList().FillCaloHitList(caloHitList);
665 caloHitList.insert(caloHitList.end(), pCluster->GetIsolatedCaloHitList().begin(), pCluster->GetIsolatedCaloHitList().end());
666 trackList.insert(trackList.end(), pCluster->GetAssociatedTrackList().begin(), pCluster->GetAssociatedTrackList().end());
667 }
668
670 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Track>()->RemoveClusterAssociations(trackList));
671
672 return STATUS_CODE_SUCCESS;
673}
674
675template <>
677{
678 for (const ParticleFlowObject *const pPfo : *pPfoList)
679 {
680 this->GetManager<Cluster>()->SetAvailability(&pPfo->GetClusterList(), true);
681 this->GetManager<Track>()->SetAvailability(&pPfo->GetTrackList(), true);
682 this->GetManager<Vertex>()->SetAvailability(&pPfo->GetVertexList(), true);
683
684 const PfoList parentList(pPfo->GetParentPfoList());
685 const PfoList daughterList(pPfo->GetDaughterPfoList());
686
687 for (const ParticleFlowObject *const pParentPfo : parentList)
689
690 for (const ParticleFlowObject *const pDaughterPfo : daughterList)
692 }
693
694 return STATUS_CODE_SUCCESS;
695}
696
697template <>
699{
700 if (!this->GetManager<Vertex>()->IsAvailable(pVertexList))
702
703 return STATUS_CODE_SUCCESS;
704}
705
706//------------------------------------------------------------------------------------------------------------------------------------------
707
708template <>
710{
711 if (!this->GetManager<Cluster>()->IsAvailable(pClusterList))
713
715
716 for (const Cluster *const pCluster : *pClusterList)
717 trackList.insert(trackList.end(), pCluster->GetAssociatedTrackList().begin(), pCluster->GetAssociatedTrackList().end());
718
719 return this->GetManager<Track>()->RemoveClusterAssociations(trackList);
720}
721
722//------------------------------------------------------------------------------------------------------------------------------------------
723
724template <typename T>
726{
727 std::string currentListName;
729 return this->Delete(pT, currentListName);
730}
731
732//------------------------------------------------------------------------------------------------------------------------------------------
733
734template <typename T>
735StatusCode PandoraContentApiImpl::Delete(const T *const pT, const std::string &listName) const
736{
738 return this->GetManager<T>()->DeleteObject(pT, listName);
739}
740
741template <>
742StatusCode PandoraContentApiImpl::Delete(const ClusterList *const pT, const std::string &listName) const
743{
745 return this->GetManager<ClusterList>()->DeleteObjects(*pT, listName);
746}
747
748template <>
749StatusCode PandoraContentApiImpl::Delete(const PfoList *const pT, const std::string &listName) const
750{
752 return this->GetManager<PfoList>()->DeleteObjects(*pT, listName);
753}
754
755template <>
756StatusCode PandoraContentApiImpl::Delete(const VertexList *const pT, const std::string &listName) const
757{
759 return this->GetManager<VertexList>()->DeleteObjects(*pT, listName);
760}
761
762//------------------------------------------------------------------------------------------------------------------------------------------
763
777
778//------------------------------------------------------------------------------------------------------------------------------------------
779
780StatusCode PandoraContentApiImpl::EndFragmentation(const Algorithm &algorithm, const std::string &clusterListToSaveName,
781 const std::string &clusterListToDeleteName) const
782{
783 std::string inputClusterListName;
784 const ClusterList *pClustersToBeDeleted(nullptr);
789
791 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Cluster>()->ResetCurrentListToAlgorithmInputList(&algorithm));
793 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<CaloHit>()->ResetCurrentListToAlgorithmInputList(&algorithm));
794
795 return STATUS_CODE_SUCCESS;
796}
797
798//------------------------------------------------------------------------------------------------------------------------------------------
799
812
813//------------------------------------------------------------------------------------------------------------------------------------------
814
832
833//------------------------------------------------------------------------------------------------------------------------------------------
834
846
847//------------------------------------------------------------------------------------------------------------------------------------------
848
850{
854
857 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->PrepareForDeletion(&clustersToBeDeleted));
858
861 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->PrepareForDeletion(&verticesToBeDeleted));
862
863 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<CaloHit>()->ResetAlgorithmInfo(pAlgorithm, true));
864 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Cluster>()->ResetAlgorithmInfo(pAlgorithm, true));
865 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<MCParticle>()->ResetAlgorithmInfo(pAlgorithm, true));
867 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Track>()->ResetAlgorithmInfo(pAlgorithm, true));
868 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->GetManager<Vertex>()->ResetAlgorithmInfo(pAlgorithm, true));
869
870 return STATUS_CODE_SUCCESS;
871}
872
873//------------------------------------------------------------------------------------------------------------------------------------------
874//------------------------------------------------------------------------------------------------------------------------------------------
875
883
889
891template StatusCode PandoraContentApiImpl::GetCurrentList<TrackList>(const TrackList *&, std::string &) const;
894template StatusCode PandoraContentApiImpl::GetCurrentList<PfoList>(const PfoList *&, std::string &) const;
895template StatusCode PandoraContentApiImpl::GetCurrentList<VertexList>(const VertexList *&, std::string &) const;
896
903
904template StatusCode PandoraContentApiImpl::ReplaceCurrentList<CaloHit>(const Algorithm &, const std::string &) const;
905template StatusCode PandoraContentApiImpl::ReplaceCurrentList<Track>(const Algorithm &, const std::string &) const;
906template StatusCode PandoraContentApiImpl::ReplaceCurrentList<MCParticle>(const Algorithm &, const std::string &) const;
907template StatusCode PandoraContentApiImpl::ReplaceCurrentList<Cluster>(const Algorithm &, const std::string &) const;
909template StatusCode PandoraContentApiImpl::ReplaceCurrentList<Vertex>(const Algorithm &, const std::string &) const;
910
917
918template StatusCode PandoraContentApiImpl::GetList<CaloHitList>(const std::string &, const CaloHitList *&) const;
919template StatusCode PandoraContentApiImpl::GetList<TrackList>(const std::string &, const TrackList *&) const;
920template StatusCode PandoraContentApiImpl::GetList<MCParticleList>(const std::string &, const MCParticleList *&) const;
921template StatusCode PandoraContentApiImpl::GetList<ClusterList>(const std::string &, const ClusterList *&) const;
922template StatusCode PandoraContentApiImpl::GetList<PfoList>(const std::string &, const PfoList *&) const;
923template StatusCode PandoraContentApiImpl::GetList<VertexList>(const std::string &, const VertexList *&) const;
924
925template StatusCode PandoraContentApiImpl::RenameList<CaloHitList>(const std::string &, const std::string &) const;
926template StatusCode PandoraContentApiImpl::RenameList<TrackList>(const std::string &, const std::string &) const;
927template StatusCode PandoraContentApiImpl::RenameList<MCParticleList>(const std::string &, const std::string &) const;
928template StatusCode PandoraContentApiImpl::RenameList<ClusterList>(const std::string &, const std::string &) const;
929template StatusCode PandoraContentApiImpl::RenameList<PfoList>(const std::string &, const std::string &) const;
930template StatusCode PandoraContentApiImpl::RenameList<VertexList>(const std::string &, const std::string &) const;
931
932template StatusCode PandoraContentApiImpl::SaveList<CaloHitList>(const CaloHitList &, const std::string &) const;
933template StatusCode PandoraContentApiImpl::SaveList<TrackList>(const TrackList &, const std::string &) const;
934template StatusCode PandoraContentApiImpl::SaveList<MCParticleList>(const MCParticleList &, const std::string &) const;
935
936template StatusCode PandoraContentApiImpl::SaveList<Cluster>(const std::string &) const;
937template StatusCode PandoraContentApiImpl::SaveList<ParticleFlowObject>(const std::string &) const;
938template StatusCode PandoraContentApiImpl::SaveList<Vertex>(const std::string &) const;
939
940template StatusCode PandoraContentApiImpl::SaveList<Cluster>(const std::string &, const std::string &) const;
941template StatusCode PandoraContentApiImpl::SaveList<ParticleFlowObject>(const std::string &, const std::string &) const;
942template StatusCode PandoraContentApiImpl::SaveList<Vertex>(const std::string &, const std::string &) const;
943
944template StatusCode PandoraContentApiImpl::SaveList<ClusterList>(const std::string &, const ClusterList &) const;
945template StatusCode PandoraContentApiImpl::SaveList<PfoList>(const std::string &, const PfoList &) const;
946template StatusCode PandoraContentApiImpl::SaveList<VertexList>(const std::string &, const VertexList &) const;
947
948template StatusCode PandoraContentApiImpl::SaveList<ClusterList>(const std::string &, const std::string &, const ClusterList &) const;
949template StatusCode PandoraContentApiImpl::SaveList<PfoList>(const std::string &, const std::string &, const PfoList &) const;
950template StatusCode PandoraContentApiImpl::SaveList<VertexList>(const std::string &, const std::string &, const VertexList &) const;
951
955
959
960template bool PandoraContentApiImpl::IsAvailable<CaloHit>(const CaloHit *) const;
961template bool PandoraContentApiImpl::IsAvailable<Track>(const Track *) const;
962template bool PandoraContentApiImpl::IsAvailable<Cluster>(const Cluster *) const;
963template bool PandoraContentApiImpl::IsAvailable<Vertex>(const Vertex *) const;
968
972
976
980
983template StatusCode PandoraContentApiImpl::Delete<Vertex>(const Vertex *const) const;
987
988template StatusCode PandoraContentApiImpl::Delete<Cluster>(const Cluster *const, const std::string &) const;
989template StatusCode PandoraContentApiImpl::Delete<ParticleFlowObject>(const ParticleFlowObject *const, const std::string &) const;
990template StatusCode PandoraContentApiImpl::Delete<Vertex>(const Vertex *const, const std::string &) const;
991
992} // namespace pandora
Header file for the algorithm class.
Header file for the algorithm manager class.
Header file for the algorithm tool class.
Header file for the calo hit class.
Header file for the calo hit manager class.
Header file for the cluster class.
Header file for the cluster manager class.
Header file for the geometry manager class.
Header file for the mc particle manager class.
Header file for the object factory class.
Header file for the pandora class.
#define MANAGER_TYPE_LIST(d)
#define MANAGER_TYPE_MAPPING(a, b, c)
Header file for the pandora content api implementation class.
Header file for the pandora settings class.
Header file for the particle flow object class.
Header file for the particle flow object manager class.
Header file for the pandora plugin manager class.
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
Definition StatusCodes.h:43
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Definition StatusCodes.h:19
Header file for the track class.
Header file for the track manager class.
Header file for the vertex class.
Header file for the vertex manager class.
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
Definition Algorithm.h:21
StatusCode CreateAlgorithmTool(TiXmlElement *const pXmlElement, AlgorithmTool *&pAlgorithmTool)
Create an algorithm tool, via one of the algorithm tool factories registered with pandora.
AlgorithmMap m_algorithmMap
The algorithm map.
StatusCode CreateAlgorithm(TiXmlElement *const pXmlElement, std::string &algorithmName)
Create an algorithm, via one of the algorithm factories registered with pandora.
AlgorithmTool class. Algorithm tools will tend to be tailored for specific parent algorithms,...
BoxGap class, associated with all 3D hit types.
CaloHit class.
Definition CaloHit.h:26
bool IsAvailable() const
Whether the calo hit is available to be added to a cluster (access this function via PandoraContentAP...
Definition CaloHit.h:539
Cluster class.
Definition Cluster.h:31
ConcentricGap class, associated with all 3D hit types.
GeometryManager class.
LArTPC class.
Definition LArTPC.h:26
LineGap class, associated only with 2D TPC hit types and applied only to the z coordinate when sampli...
Definition DetectorGap.h:50
MCParticle class.
Definition MCParticle.h:26
ObjectFactory class responsible for extended pandora object creation.
StatusCode EndReclustering(const Algorithm &algorithm, const std::string &selectedClusterListName) const
End reclustering operations on clusters in the algorithm input list.
StatusCode RunAlgorithm(const std::string &algorithmName) const
Run an algorithm registered with pandora.
StatusCode AddToPfo(const ParticleFlowObject *const pPfo, const T *const pT) const
Add a cluster to a particle flow object.
StatusCode RemoveCurrentTrackClusterAssociations() const
Remove all track-cluster associations from objects in the current track and cluster lists.
StatusCode AddIsolatedToCluster(const Cluster *const pCluster, const T *const pT) const
Add an isolated calo hit, or a list of isolated calo hits, to a cluster. An isolated calo hit is not ...
StatusCode EndFragmentation(const Algorithm &algorithm, const std::string &clusterListToSaveName, const std::string &clusterListToDeleteName) const
End cluster fragmentation operations on clusters in the algorithm input list.
StatusCode RemoveTrackClusterAssociation(const Track *const pTrack, const Cluster *const pCluster) const
Remove an association between a track and a cluster.
StatusCode MergeAndDeleteClusters(const Cluster *const pClusterToEnlarge, const Cluster *const pClusterToDelete) const
Merge two clusters in the current list, enlarging one cluster and deleting the second.
StatusCode PrepareForDeletion(const T *const pT) const
Prepare an object, or a list of objects, for deletion.
StatusCode SaveList(const T &t, const std::string &newListName) const
Save a provided input object list under a new name.
StatusCode DropCurrentList(const Algorithm &algorithm) const
Drop the current list, returning the current list to its default empty/null state.
StatusCode RenameList(const std::string &oldListName, const std::string &newListName) const
Rename a saved list, altering its saved name from a specified old list name to a specified new list n...
StatusCode PostRunAlgorithm(Algorithm *const pAlgorithm) const
Perform necessary operations after algorithm execution, e.g. preparing temporaries for deletion.
StatusCode RemovePfoParentDaughterRelationship(const ParticleFlowObject *const pParentPfo, const ParticleFlowObject *const pDaughterPfo) const
Remove parent-daughter particle flow object relationship.
const PandoraSettings * GetSettings() const
Get the pandora settings instance.
StatusCode Fragment(const CaloHit *const pOriginalCaloHit, const float fraction1, const CaloHit *&pDaughterCaloHit1, const CaloHit *&pDaughterCaloHit2, const ObjectFactory< object_creation::CaloHitFragment::Parameters, object_creation::CaloHitFragment::Object > &factory) const
Fragment a calo hit into two daughter calo hits, with a specified energy division.
StatusCode AlterMetadata(const OBJECT *const pObject, const METADATA &metadata) const
Alter the metadata information stored in an object.
StatusCode GetCurrentListName(std::string &listName) const
Get the current list name.
StatusCode CreateTemporaryListAndSetCurrent(const Algorithm &algorithm, const T *&pT, std::string &temporaryListName) const
Create a temporary list and set it to be the current list, enabling object creation.
StatusCode GetList(const std::string &listName, const T *&pT) const
Get a named list.
bool IsAddToClusterAllowed(const Cluster *const pCluster, const CaloHit *const pCaloHit) const
Whether a proposed addition to a cluster is allowed.
StatusCode RemoveAllMCParticleRelationships() const
Remove all mc particle relationships previously registered with the mc manager and linked to tracks/c...
StatusCode InitializeFragmentation(const Algorithm &algorithm, const ClusterList &inputClusterList, std::string &originalClustersListName, std::string &fragmentClustersListName) const
Initialize cluster fragmentation operations on clusters in the algorithm input list....
StatusCode RemoveFromPfo(const ParticleFlowObject *const pPfo, const T *const pT) const
Remove a cluster from a particle flow object. Note this function will not remove the final object (tr...
PandoraContentApiImpl(Pandora *const pPandora)
Constructor.
StatusCode Create(const PARAMETERS &parameters, const OBJECT *&pObject, const ObjectFactory< PARAMETERS, OBJECT > &factory) const
Create an object for pandora.
StatusCode RepeatEventPreparation() const
Repeat the event preparation stages, which are used to calculate properties of input objects for late...
StatusCode MergeFragments(const CaloHit *const pFragmentCaloHit1, const CaloHit *const pFragmentCaloHit2, const CaloHit *&pMergedCaloHit, const ObjectFactory< object_creation::CaloHitFragment::Parameters, object_creation::CaloHitFragment::Object > &factory) const
Merge two calo hit fragments, originally from the same parent hit, to form a new calo hit.
StatusCode InitializeReclustering(const Algorithm &algorithm, const TrackList &inputTrackList, const ClusterList &inputClusterList, std::string &originalClustersListName) const
Initialize reclustering operations on clusters in the algorithm input list. This allows hits in a lis...
StatusCode Delete(const T *const pT) const
Delete an object from the current list.
StatusCode SetPfoParentDaughterRelationship(const ParticleFlowObject *const pParentPfo, const ParticleFlowObject *const pDaughterPfo) const
Set parent-daughter particle flow object relationship.
const PluginManager * GetPlugins() const
Get the pandora plugin instance, providing access to user registered functions and calculators.
StatusCode AddTrackClusterAssociation(const Track *const pTrack, const Cluster *const pCluster) const
Add an association between a track and a cluster.
StatusCode AddToCluster(const Cluster *const pCluster, const T *const pT) const
Add a calo hit, or a list of calo hits, to a cluster.
Pandora * m_pPandora
The pandora object to provide an interface to.
StatusCode RemoveFromCluster(const Cluster *const pCluster, const CaloHit *const pCaloHit) const
Remove a calo hit from a cluster. Note this function will not remove the final calo hit from a cluste...
StatusCode PrepareForReclusteringDeletion(const T *const pT) const
Prepare an object, or a list of objects, (formed as recluster candidates) for deletion.
StatusCode CreateDaughterAlgorithm(TiXmlElement *const pXmlElement, std::string &daughterAlgorithmName) const
Create an algorithm instance, via one of the algorithm factories registered with pandora....
const GeometryManager * GetGeometry() const
Get the pandora geometry instance.
StatusCode RunClusteringAlgorithm(const Algorithm &algorithm, const std::string &clusteringAlgorithmName, const ClusterList *&pNewClusterList, std::string &newClusterListName) const
Run a clustering algorithm (an algorithm that will create new cluster objects)
StatusCode ReplaceCurrentList(const Algorithm &algorithm, const std::string &newListName) const
Replace the current list with a pre-saved list; use this new list as a permanent replacement for the ...
bool IsAvailable(const T *const pT) const
Is object, or a list of objects, available as a building block.
StatusCode CreateAlgorithmTool(TiXmlElement *const pXmlElement, AlgorithmTool *&pAlgorithmTool) const
Create an algorithm tool instance, via one of the algorithm tool factories registered with pandora....
StatusCode RemoveIsolatedFromCluster(const Cluster *const pCluster, const CaloHit *const pCaloHit) const
Remove an isolated calo hit from a cluster. Note this function will not remove the final calo hit fro...
StatusCode TemporarilyReplaceCurrentList(const std::string &newListName) const
Temporarily replace the current list with another list, which may only be a temporary list....
StatusCode RemoveAllTrackClusterAssociations() const
Remove all associations between tracks and clusters.
StatusCode GetCurrentList(const T *&pT, std::string &listName) const
Get the current list.
StatusCode PreRunAlgorithm(Algorithm *const pAlgorithm) const
Perform necessary operations prior to algorithm execution, e.g. algorithm to manager handshakes.
Pandora class.
Definition Pandora.h:40
AlgorithmManager * m_pAlgorithmManager
The algorithm manager.
Definition Pandora.h:119
const PandoraSettings * GetSettings() const
Get the pandora settings instance.
Definition Pandora.cc:182
StatusCode PrepareEvent()
Prepare event, calculating properties of input objects for later use in algorithms.
Definition Pandora.cc:100
const GeometryManager * GetGeometry() const
Get the pandora geometry instance.
Definition Pandora.cc:189
const PluginManager * GetPlugins() const
Get the pandora plugin instance, providing access to user registered functions and calculators.
Definition Pandora.cc:196
PandoraSettings class.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
bool SingleHitTypeClusteringMode() const
Whether to allow only single hit types in individual clusters.
ParticleFlowObject class.
PluginManager class.
StatusCodeException class.
Stop processing exception class.
Definition PandoraIO.h:97
SubDetector class.
Definition SubDetector.h:26
Track class.
Definition Track.h:26
bool IsAvailable() const
Whether the track is available to be added to a particle flow object.
Definition Track.h:442
Vertex class.
Definition Vertex.h:26
bool IsAvailable() const
Whether the vertex is available to be added to a particle flow object.
Definition Vertex.h:131
MANAGED_CONTAINER< const MCParticle * > MCParticleList
MANAGED_CONTAINER< const Cluster * > ClusterList
MANAGED_CONTAINER< const CaloHit * > CaloHitList
MANAGED_CONTAINER< const Track * > TrackList
std::unordered_map< const Track *, const Cluster * > TrackToClusterMap
MANAGED_CONTAINER< const Vertex * > VertexList
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList