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)
53#define MANAGER_TYPE_MAPPING(a, b, c) \
55struct PandoraContentApiImpl::ReturnType<a> \
61inline b *PandoraContentApiImpl::GetManager<a>() const \
63 return m_pPandora->c; \
94template <
typename OBJECT,
typename METADATA>
166template <
typename PARAMETERS,
typename OBJECT>
232 std::cout <<
"> Running Algorithm: " <<
iter->second->GetInstanceName() <<
", " <<
iter->second->GetType() << std::endl;
239 std::cout <<
"Failure in algorithm " <<
iter->first <<
", " <<
iter->second->GetType() <<
", " <<
exception.ToString()
240 <<
exception.GetBackTrace() << std::endl;
244 std::cout <<
"Algorithm " <<
iter->first <<
", " <<
iter->second->GetType() <<
" raised stop processing exception: "
245 <<
exception.GetDescription() << std::endl;
250 std::cout <<
"Failure in algorithm " <<
iter->first <<
", " <<
iter->second->GetType() <<
", unknown exception" << std::endl;
261 const ClusterList *&pNewClusterList, std::string &newClusterListName)
const
368 return this->
GetManager<T>()->TemporarilyReplaceCurrentList(newListName);
419 if ((
pCluster->GetNCaloHits() <= 1) && (
pCluster->GetNIsolatedCaloHits() == 0))
459 if ((
pCluster->GetNCaloHits() == 0) && (
pCluster->GetNIsolatedCaloHits() <= 1))
556 const std::string &enlargeListName,
const std::string &deleteListName)
const
626 if (!
pCluster->GetOrderedCaloHitList().empty())
628 if (
pCluster->GetOrderedCaloHitList().begin()->second->empty())
633 else if (!
pCluster->GetIsolatedCaloHitList().empty())
765 std::string &originalClustersListName, std::string &fragmentClustersListName)
const
781 const std::string &clusterListToDeleteName)
const
801 const ClusterList &inputClusterList, std::string &originalClustersListName)
const
Header file for the algorithm class.
Header file for the algorithm manager 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)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
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...
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.
BoxGap class, associated with all 3D hit types.
bool IsAvailable() const
Whether the calo hit is available to be added to a cluster (access this function via PandoraContentAP...
ConcentricGap class, associated with all 3D hit types.
LineGap class, associated only with 2D TPC hit types and applied only to the z coordinate when sampli...
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 ¶meters, 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.
AlgorithmManager * m_pAlgorithmManager
The algorithm manager.
const PandoraSettings * GetSettings() const
Get the pandora settings instance.
StatusCode PrepareEvent()
Prepare event, calculating properties of input objects for later use in algorithms.
const GeometryManager * GetGeometry() const
Get the pandora geometry instance.
const PluginManager * GetPlugins() const
Get the pandora plugin instance, providing access to user registered functions and calculators.
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.
StatusCodeException class.
Stop processing exception class.
bool IsAvailable() const
Whether the track is available to be added to a particle flow object.
bool IsAvailable() const
Whether the vertex is available to be added to a particle flow object.
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