Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
PandoraContentApiImpl.h
Go to the documentation of this file.
1
8#ifndef PANDORA_CONTENT_API_IMPL_H
9#define PANDORA_CONTENT_API_IMPL_H 1
10
12
14#include "Pandora/StatusCodes.h"
15
16namespace pandora
17{
18
19class Pandora;
20
21//------------------------------------------------------------------------------------------------------------------------------------------
22
27{
28private:
32 template<class T>
34 {
35 public:
36 typedef T Type;
37 };
38
44 template<typename T>
46
47
48 /* Object-metadata manipulation */
49
57 template <typename OBJECT, typename METADATA>
58 StatusCode AlterMetadata(const OBJECT *const pObject, const METADATA &metadata) const;
59
60
61 /* Object-creation functions */
62
70 template <typename PARAMETERS, typename OBJECT>
71 StatusCode Create(const PARAMETERS &parameters, const OBJECT *&pObject, const ObjectFactory<PARAMETERS, OBJECT> &factory) const;
72
73
74 /* Accessors for plugins and global settings */
75
81 const PandoraSettings *GetSettings() const;
82
88 const GeometryManager *GetGeometry() const;
89
95 const PluginManager *GetPlugins() const;
96
97
98 /* High-level steering functions */
99
104
113
122
128 StatusCode RunAlgorithm(const std::string &algorithmName) const;
129
139 const ClusterList *&pNewClusterList, std::string &newClusterListName) const;
140
141
142 /* List-manipulation functions */
143
150 template <typename T>
151 StatusCode GetCurrentList(const T *&pT, std::string &listName) const;
152
158 template <typename T>
159 StatusCode GetCurrentListName(std::string &listName) const;
160
168 template <typename T>
169 StatusCode ReplaceCurrentList(const Algorithm &algorithm, const std::string &newListName) const;
170
176 template <typename T>
178
185 template <typename T>
186 StatusCode GetList(const std::string &listName, const T *&pT) const;
187
194 template <typename T>
195 StatusCode RenameList(const std::string &oldListName, const std::string &newListName) const;
196
197
198 /* List-manipulation functions: input objects only (CaloHits, Tracks, MCParticles) */
199
206 template <typename T>
207 StatusCode SaveList(const T &t, const std::string &newListName) const;
208
209
210 /* List-manipulation functions: algorithm objects only (Clusters, Pfos, Vertices) */
211
218 template <typename T>
219 StatusCode SaveList(const std::string &newListName) const;
220
228 template <typename T>
229 StatusCode SaveList(const std::string &oldListName, const std::string &newListName) const;
230
238 template <typename T>
239 StatusCode SaveList(const std::string &newListName, const T &t) const;
240
249 template <typename T>
250 StatusCode SaveList(const std::string &oldListName, const std::string &newListName, const T &t) const;
251
259 template <typename T>
260 StatusCode TemporarilyReplaceCurrentList(const std::string &newListName) const;
261
269 template <typename T>
271
272
273 /* Object-related functions */
274
282 template <typename T>
283 bool IsAvailable(const T *const pT) const;
284
285
286 /* Object-related functions: algorithm objects only (Clusters, Pfos, Vertices) */
287
293 template <typename T>
294 StatusCode Delete(const T *const pT) const;
295
302 template <typename T>
303 StatusCode Delete(const T *const pT, const std::string &listName) const;
304
305
306 /* CaloHit-related functions */
307
314 template <typename T>
315 StatusCode AddToCluster(const Cluster *const pCluster, const T *const pT) const;
316
324 StatusCode RemoveFromCluster(const Cluster *const pCluster, const CaloHit *const pCaloHit) const;
325
333 template <typename T>
334 StatusCode AddIsolatedToCluster(const Cluster *const pCluster, const T *const pT) const;
335
343 StatusCode RemoveIsolatedFromCluster(const Cluster *const pCluster, const CaloHit *const pCaloHit) const;
344
356
367
368
369 /* Track-related functions */
370
377 StatusCode AddTrackClusterAssociation(const Track *const pTrack, const Cluster *const pCluster) const;
378
385 StatusCode RemoveTrackClusterAssociation(const Track *const pTrack, const Cluster *const pCluster) const;
386
391
396
397
398 /* MCParticle-related functions */
399
404
409
410
411 /* Cluster-related functions */
412
420
430 const std::string &deleteListName) const;
431
432
433 /* Pfo-related functions */
434
441 template <typename T>
442 StatusCode AddToPfo(const ParticleFlowObject *const pPfo, const T *const pT) const;
443
451 template <typename T>
452 StatusCode RemoveFromPfo(const ParticleFlowObject *const pPfo, const T *const pT) const;
453
461
469
470
471 /* Reclustering functions */
472
483 std::string &originalClustersListName, std::string &fragmentClustersListName) const;
484
493 const std::string &clusterListToDeleteName) const;
494
505 const ClusterList &inputClusterList, std::string &originalClustersListName) const;
506
513 StatusCode EndReclustering(const Algorithm &algorithm, const std::string &selectedClusterListName) const;
514
515private:
522
531 bool IsAddToClusterAllowed(const Cluster *const pCluster, const CaloHit *const pCaloHit) const;
532
538 template <typename T>
539 StatusCode PrepareForDeletion(const T *const pT) const;
540
546 template <typename T>
548
555
562
564
565 friend class Pandora;
566 friend class PandoraImpl;
567 friend class ::PandoraContentApi;
568 template<typename PARAMETERS, typename METADATA, typename OBJECT> friend class ::object_creation::ObjectCreationHelper;
569};
570
571} // namespace pandora
572
573#endif // #ifndef PANDORA_CONTENT_API_IMPL_H
Header file for pandora object creation classes.
Header file for the pandora content api class.
Header file defining status codes and relevant preprocessor macros.
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
Definition Algorithm.h:21
AlgorithmTool class. Algorithm tools will tend to be tailored for specific parent algorithms,...
CaloHit class.
Definition CaloHit.h:26
Cluster class.
Definition Cluster.h:31
GeometryManager class.
ObjectFactory class responsible for extended pandora object creation.
PandoraContentApiImpl class.
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 RepeatMCParticlePreparation() const
Repeat the mc particle preparation, performing pfo target identification and forming relationships wi...
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....
ReturnType< T >::Type * GetManager() const
Manager type adaptor.
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...
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
PandoraImpl class.
Definition PandoraImpl.h:18
PandoraSettings class.
ParticleFlowObject class.
PluginManager class.
Track class.
Definition Track.h:26
MANAGED_CONTAINER< const Cluster * > ClusterList
MANAGED_CONTAINER< const Track * > TrackList
StatusCode
The StatusCode enum.