Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
pandora::AlgorithmObjectManager< T > Class Template Reference

AlgorithmObjectManager class. More...

#include "AlgorithmObjectManager.h"

Inheritance diagram for pandora::AlgorithmObjectManager< T >:
Collaboration diagram for pandora::AlgorithmObjectManager< T >:

Public Member Functions

 AlgorithmObjectManager (const Pandora *const pPandora)
 Constructor.
 
virtual ~AlgorithmObjectManager ()
 Destructor.
 

Protected Types

typedef Manager< T >::ObjectList ObjectList
 
typedef std::map< std::string, ObjectList * > NameToListMap
 
typedef std::unordered_map< const Algorithm *, AlgorithmInfoAlgorithmInfoMap
 

Protected Member Functions

virtual StatusCode CreateTemporaryListAndSetCurrent (const Algorithm *const pAlgorithm, std::string &temporaryListName)
 Make a temporary list and set it to be the current list.
 
virtual StatusCode MoveObjectsToTemporaryListAndSetCurrent (const Algorithm *const pAlgorithm, const std::string &originalListName, std::string &temporaryListName, const ObjectList &objectsToMove)
 Move objects to a new temporary object list and set it to be the current object list.
 
virtual StatusCode SaveObjects (const std::string &targetListName, const std::string &sourceListName)
 Save a list of objects.
 
virtual StatusCode SaveObjects (const std::string &targetListName, const std::string &sourceListName, const ObjectList &objectsToSave)
 Save a list of objects.
 
virtual StatusCode MoveObjectsBetweenLists (const std::string &targetListName, const std::string &sourceListName, const ObjectList *pObjectSubset=nullptr)
 Move (a subset of) objects between two lists.
 
virtual StatusCode TemporarilyReplaceCurrentList (const std::string &listName)
 Temporarily replace the current list with another list, which may only be a temporary list. This switch will persist only for the duration of the algorithm and its daughters; unless otherwise specified, the list will revert to the algorithm input list upon algorithm completion.
 
virtual StatusCode DeleteObject (const T *const pT, const std::string &listName)
 Delete an object from a specified list.
 
virtual StatusCode DeleteObjects (const ObjectList &objectList, const std::string &listName)
 Delete a list of objects from a specified list.
 
virtual StatusCode DeleteTemporaryObjects (const Algorithm *const pAlgorithm, const std::string &temporaryListName)
 Delete the contents of a temporary list.
 
virtual StatusCode GetResetDeletionObjects (const Algorithm *const pAlgorithm, ObjectList &objectList) const
 Get the list of objects that will be deleted when the algorithm info is reset.
 
virtual StatusCode ResetCurrentListToAlgorithmInputList (const Algorithm *const pAlgorithm)
 Reset the current list to the algorithm input list.
 
virtual StatusCode ReplaceCurrentAndAlgorithmInputLists (const Algorithm *const pAlgorithm, const std::string &listName)
 Replace the current and algorithm input lists with a pre-existing list.
 
virtual StatusCode DropCurrentList (const Algorithm *const pAlgorithm)
 Drop the current list, returning the current list to its default empty/null state.
 
virtual StatusCode RenameList (const std::string &oldListName, const std::string &newListName)
 Rename a saved list, altering its saved name from a specified old list name to a specified new list name.
 
virtual StatusCode ResetAlgorithmInfo (const Algorithm *const pAlgorithm, bool isAlgorithmFinished)
 Remove temporary lists and reset the current cluster list to that when algorithm was initialized.
 
virtual StatusCode EraseAllContent ()
 Erase all manager content.
 
virtual StatusCode GetList (const std::string &listName, const ObjectList *&pObjectList) const
 Get a list.
 
virtual StatusCode GetCurrentList (const ObjectList *&pObjectList, std::string &listName) const
 Get the current list.
 
virtual StatusCode GetCurrentListName (std::string &listName) const
 Get the current list name.
 
virtual StatusCode GetAlgorithmInputList (const Algorithm *const pAlgorithm, const ObjectList *&pObjectList, std::string &listName) const
 Get the algorithm input list.
 
virtual StatusCode GetAlgorithmInputListName (const Algorithm *const pAlgorithm, std::string &listName) const
 Get the algorithm track list name.
 
virtual StatusCode RegisterAlgorithm (const Algorithm *const pAlgorithm)
 Register an algorithm with the manager.
 
virtual StatusCode ResetForNextEvent ()
 Reset the manager.
 
virtual StatusCode CreateInitialLists ()
 Create initial lists.
 
virtual T * Modifiable (const T *const pT) const
 Access a modifiable object, when provided with address to const object.
 

Protected Attributes

bool m_canMakeNewObjects
 Whether the manager is allowed to make new objects when requested by algorithms.
 
const std::string m_nullListName
 The name of the default empty (NULL) list.
 
const Pandora *const m_pPandora
 The associated pandora object.
 
NameToListMap m_nameToListMap
 The name to list map.
 
AlgorithmInfoMap m_algorithmInfoMap
 The algorithm info map.
 
std::string m_currentListName
 The name of the current list.
 
StringSet m_savedLists
 The set of saved lists.
 

Detailed Description

template<typename T>
class pandora::AlgorithmObjectManager< T >

AlgorithmObjectManager class.

Definition at line 20 of file AlgorithmObjectManager.h.

Member Typedef Documentation

◆ AlgorithmInfoMap

template<typename T >
typedef std::unordered_map<const Algorithm *, AlgorithmInfo> pandora::Manager< T >::AlgorithmInfoMap
protectedinherited

Definition at line 176 of file Manager.h.

◆ NameToListMap

template<typename T >
typedef std::map<std::string, ObjectList *> pandora::Manager< T >::NameToListMap
protectedinherited

Definition at line 175 of file Manager.h.

◆ ObjectList

template<typename T >
typedef Manager<T>::ObjectList pandora::AlgorithmObjectManager< T >::ObjectList
protected

Definition at line 36 of file AlgorithmObjectManager.h.

Constructor & Destructor Documentation

◆ AlgorithmObjectManager()

template<typename T >
pandora::AlgorithmObjectManager< T >::AlgorithmObjectManager ( const Pandora *const  pPandora)

Constructor.

Parameters
pPandoraaddress of the associated pandora object

Definition at line 21 of file AlgorithmObjectManager.cc.

◆ ~AlgorithmObjectManager()

template<typename T >
pandora::AlgorithmObjectManager< T >::~AlgorithmObjectManager ( )
virtual

Destructor.

Definition at line 30 of file AlgorithmObjectManager.cc.

Member Function Documentation

◆ CreateInitialLists()

template<typename T >
StatusCode pandora::Manager< T >::CreateInitialLists ( )
protectedvirtualinherited

Create initial lists.

Reimplemented in pandora::InputObjectManager< T >, pandora::InputObjectManager< CaloHit >, pandora::InputObjectManager< MCParticle >, and pandora::InputObjectManager< Track >.

Definition at line 274 of file Manager.cc.

Here is the caller graph for this function:

◆ CreateTemporaryListAndSetCurrent()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::CreateTemporaryListAndSetCurrent ( const Algorithm *const  pAlgorithm,
std::string &  temporaryListName 
)
protectedvirtual

Make a temporary list and set it to be the current list.

Parameters
pAlgorithmaddress of the algorithm requesting a temporary list
temporaryListNameto receive the name of the temporary list

Reimplemented from pandora::Manager< T >.

Definition at line 37 of file AlgorithmObjectManager.cc.

Here is the call graph for this function:

◆ DeleteObject()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::DeleteObject ( const T *const  pT,
const std::string &  listName 
)
protectedvirtual

Delete an object from a specified list.

Parameters
pClusteraddress of the object to delete
listNamethe name of the list containing the object

Definition at line 167 of file AlgorithmObjectManager.cc.

◆ DeleteObjects()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::DeleteObjects ( const ObjectList objectList,
const std::string &  listName 
)
protectedvirtual

Delete a list of objects from a specified list.

Parameters
objectListthe list of objects to delete
listNamethe name of the list containing the objects

Definition at line 188 of file AlgorithmObjectManager.cc.

◆ DeleteTemporaryObjects()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::DeleteTemporaryObjects ( const Algorithm *const  pAlgorithm,
const std::string &  temporaryListName 
)
protectedvirtual

Delete the contents of a temporary list.

Parameters
pAlgorithmaddress of the algorithm calling this function
temporaryListNamethe name of the temporary list

Definition at line 215 of file AlgorithmObjectManager.cc.

◆ DropCurrentList()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::DropCurrentList ( const Algorithm *const  pAlgorithm)
protectedvirtual

Drop the current list, returning the current list to its default empty/null state.

Parameters
pAlgorithmaddress of the algorithm altering the lists

Reimplemented from pandora::Manager< T >.

Definition at line 284 of file AlgorithmObjectManager.cc.

Here is the call graph for this function:

◆ EraseAllContent()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::EraseAllContent ( )
protectedvirtual

Erase all manager content.

Reimplemented from pandora::Manager< T >.

Definition at line 319 of file AlgorithmObjectManager.cc.

Here is the call graph for this function:

◆ GetAlgorithmInputList()

template<typename T >
StatusCode pandora::Manager< T >::GetAlgorithmInputList ( const Algorithm *const  pAlgorithm,
const ObjectList *&  pObjectList,
std::string &  listName 
) const
protectedvirtualinherited

Get the algorithm input list.

Parameters
pAlgorithmaddress of the algorithm
pObjectListto receive the algorithm input list
listNameto receive the name of the algorithm input list

Definition at line 69 of file Manager.cc.

◆ GetAlgorithmInputListName()

template<typename T >
StatusCode pandora::Manager< T >::GetAlgorithmInputListName ( const Algorithm *const  pAlgorithm,
std::string &  listName 
) const
inlineprotectedvirtualinherited

Get the algorithm track list name.

Parameters
pAlgorithmaddress of the algorithm
listNameto receive the algorithm input list name

Definition at line 88 of file Manager.cc.

◆ GetCurrentList()

template<typename T >
StatusCode pandora::Manager< T >::GetCurrentList ( const ObjectList *&  pObjectList,
std::string &  listName 
) const
protectedvirtualinherited

Get the current list.

Parameters
pObjectListto receive the current list
listNameto receive the name of the current list

Definition at line 48 of file Manager.cc.

Here is the caller graph for this function:

◆ GetCurrentListName()

template<typename T >
StatusCode pandora::Manager< T >::GetCurrentListName ( std::string &  listName) const
inlineprotectedvirtualinherited

Get the current list name.

Parameters
listNameto receive the current list name

Definition at line 57 of file Manager.cc.

◆ GetList()

template<typename T >
StatusCode pandora::Manager< T >::GetList ( const std::string &  listName,
const ObjectList *&  pObjectList 
) const
protectedvirtualinherited

Get a list.

Parameters
listNamethe name of the list
pObjectListto receive the list

Definition at line 34 of file Manager.cc.

Here is the caller graph for this function:

◆ GetResetDeletionObjects()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::GetResetDeletionObjects ( const Algorithm *const  pAlgorithm,
ObjectList objectList 
) const
protectedvirtual

Get the list of objects that will be deleted when the algorithm info is reset.

Parameters
pAlgorithmaddress of the algorithm
objectListto receive the list of objects that will be deleted when the algorithm info is reset

Definition at line 243 of file AlgorithmObjectManager.cc.

◆ Modifiable()

template<typename T >
T * pandora::Manager< T >::Modifiable ( const T *const  pT) const
protectedvirtualinherited

Access a modifiable object, when provided with address to const object.

Parameters
pTthe address of the const object
Returns
address of the modifiable object

Definition at line 288 of file Manager.cc.

Here is the caller graph for this function:

◆ MoveObjectsBetweenLists()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::MoveObjectsBetweenLists ( const std::string &  targetListName,
const std::string &  sourceListName,
const ObjectList pObjectSubset = nullptr 
)
protectedvirtual

Move (a subset of) objects between two lists.

Parameters
targetListNamethe name of the target object list, which will be created if it doesn't currently exist
sourceListNamethe name of the object list containing objects to save
pObjectSubsetif specified, only objects in both this and the source list will be moved

Definition at line 96 of file AlgorithmObjectManager.cc.

◆ MoveObjectsToTemporaryListAndSetCurrent()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::MoveObjectsToTemporaryListAndSetCurrent ( const Algorithm *const  pAlgorithm,
const std::string &  originalListName,
std::string &  temporaryListName,
const ObjectList objectsToMove 
)
protectedvirtual

Move objects to a new temporary object list and set it to be the current object list.

Parameters
pAlgorithmaddress of the algorithm requesting a temporary list
originalListNamethe list in which the object currently exist
temporaryListNameto receive the name of the temporary list
objectsToMoveonly objects in both this and the current list will be moved
  • other object in the current list will remain in original list
  • an empty object list will be rejected

Definition at line 46 of file AlgorithmObjectManager.cc.

◆ RegisterAlgorithm()

template<typename T >
StatusCode pandora::Manager< T >::RegisterAlgorithm ( const Algorithm *const  pAlgorithm)
protectedvirtualinherited

Register an algorithm with the manager.

Parameters
pAlgorithmaddress of the algorithm

Definition at line 198 of file Manager.cc.

◆ RenameList()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::RenameList ( const std::string &  oldListName,
const std::string &  newListName 
)
protectedvirtual

Rename a saved list, altering its saved name from a specified old list name to a specified new list name.

Parameters
oldListNamethe old list name
newListNamethe new list name

Reimplemented from pandora::Manager< T >.

Definition at line 293 of file AlgorithmObjectManager.cc.

Here is the call graph for this function:

◆ ReplaceCurrentAndAlgorithmInputLists()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::ReplaceCurrentAndAlgorithmInputLists ( const Algorithm *const  pAlgorithm,
const std::string &  listName 
)
protectedvirtual

Replace the current and algorithm input lists with a pre-existing list.

Parameters
pAlgorithmaddress of the algorithm changing the current list
listNamethe name of the new current (and algorithm input) list

Reimplemented from pandora::Manager< T >.

Definition at line 275 of file AlgorithmObjectManager.cc.

Here is the call graph for this function:

◆ ResetAlgorithmInfo()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::ResetAlgorithmInfo ( const Algorithm *const  pAlgorithm,
bool  isAlgorithmFinished 
)
protectedvirtual

Remove temporary lists and reset the current cluster list to that when algorithm was initialized.

Parameters
pAlgorithmthe algorithm associated with the temporary objects
isAlgorithmFinishedwhether the algorithm has completely finished and the algorithm info should be entirely removed

Reimplemented from pandora::Manager< T >.

Definition at line 304 of file AlgorithmObjectManager.cc.

Here is the call graph for this function:

◆ ResetCurrentListToAlgorithmInputList()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::ResetCurrentListToAlgorithmInputList ( const Algorithm *const  pAlgorithm)
protectedvirtual

Reset the current list to the algorithm input list.

Parameters
pAlgorithmaddress of the algorithm changing the current track list

Reimplemented from pandora::Manager< T >.

Definition at line 266 of file AlgorithmObjectManager.cc.

Here is the call graph for this function:

◆ ResetForNextEvent()

template<typename T >
StatusCode pandora::Manager< T >::ResetForNextEvent ( )
protectedvirtualinherited

Reset the manager.

Definition at line 247 of file Manager.cc.

Here is the caller graph for this function:

◆ SaveObjects() [1/2]

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::SaveObjects ( const std::string &  targetListName,
const std::string &  sourceListName 
)
protectedvirtual

Save a list of objects.

Parameters
targetListNamethe name of the target object list, which will be created if it doesn't currently exist
sourceListNamethe name of the (typically temporary) object list to save

Definition at line 61 of file AlgorithmObjectManager.cc.

◆ SaveObjects() [2/2]

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::SaveObjects ( const std::string &  targetListName,
const std::string &  sourceListName,
const ObjectList objectsToSave 
)
protectedvirtual

Save a list of objects.

Parameters
targetListNamethe name of the target object list, which will be created if it doesn't currently exist
sourceListNamethe name of the (typically temporary) object list containing objects to save
objectToSaveonly objects in both this and the temporary list will be stored
  • other object will remain in the temporary list and will be deleted when the parent algorithm exits
  • an empty object list will be rejected

Definition at line 77 of file AlgorithmObjectManager.cc.

◆ TemporarilyReplaceCurrentList()

template<typename T >
StatusCode pandora::AlgorithmObjectManager< T >::TemporarilyReplaceCurrentList ( const std::string &  listName)
protectedvirtual

Temporarily replace the current list with another list, which may only be a temporary list. This switch will persist only for the duration of the algorithm and its daughters; unless otherwise specified, the list will revert to the algorithm input list upon algorithm completion.

Parameters
listNamethe name of the new current (and algorithm input) list

Definition at line 154 of file AlgorithmObjectManager.cc.

Member Data Documentation

◆ m_algorithmInfoMap

template<typename T >
AlgorithmInfoMap pandora::Manager< T >::m_algorithmInfoMap
protectedinherited

The algorithm info map.

Definition at line 179 of file Manager.h.

◆ m_canMakeNewObjects

template<typename T >
bool pandora::AlgorithmObjectManager< T >::m_canMakeNewObjects
protected

Whether the manager is allowed to make new objects when requested by algorithms.

Definition at line 172 of file AlgorithmObjectManager.h.

◆ m_currentListName

template<typename T >
std::string pandora::Manager< T >::m_currentListName
protectedinherited

The name of the current list.

Definition at line 181 of file Manager.h.

◆ m_nameToListMap

template<typename T >
NameToListMap pandora::Manager< T >::m_nameToListMap
protectedinherited

The name to list map.

Definition at line 178 of file Manager.h.

◆ m_nullListName

template<typename T >
const std::string pandora::Manager< T >::m_nullListName
protectedinherited

The name of the default empty (NULL) list.

Definition at line 172 of file Manager.h.

◆ m_pPandora

template<typename T >
const Pandora* const pandora::Manager< T >::m_pPandora
protectedinherited

The associated pandora object.

Definition at line 173 of file Manager.h.

◆ m_savedLists

template<typename T >
StringSet pandora::Manager< T >::m_savedLists
protectedinherited

The set of saved lists.

Definition at line 182 of file Manager.h.


The documentation for this class was generated from the following files: