MultiPandoraApiImpl.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArControlFlow/MultiPandoraApiImpl.h
3  *
4  * @brief Header file for the MultiPandoraApiImpl class.
5  *
6  * $Log: $
7  */
8 #ifndef MULTI_PANDORA_API_IMPL_H
9 #define MULTI_PANDORA_API_IMPL_H 1
10 
11 #include "Objects/CartesianVector.h"
12 
14 
15 #include <map>
16 #include <unordered_map>
17 
18 /**
19  * @brief MultiPandoraApiImpl class
20  */
22 {
23 private:
24  /**
25  * @brief Default constructor;
26  */
28 
29  /**
30  * @brief Destructor;
31  */
33 
34  /**
35  * @brief Get the pandora instance map
36  *
37  * @return the pandora instance map
38  */
40 
41  /**
42  * @brief Get the address of the pandora instance associated with a given primary pandora instance and volume id number
43  *
44  * @param pPrimaryPandora the address of the primary pandora instance
45  * @param volumeId the volume identifier number
46  *
47  * @return the address of the pandora instance
48  */
49  const pandora::Pandora *GetPandoraInstance(const pandora::Pandora *const pPrimaryPandora, const unsigned int volumeId) const;
50 
51  /**
52  * @brief Get the list of daughter pandora instances associated with a given primary pandora instance
53  *
54  * @param pPrimaryPandora the address of the primary pandora instance
55  *
56  * @return the daughter pandora instance list
57  */
58  const PandoraInstanceList &GetDaughterPandoraInstanceList(const pandora::Pandora *const pPrimaryPandora) const;
59 
60  /**
61  * @brief Get the address of the primary pandora instance associated with a given daughter pandora instance
62  *
63  * @param pDaughterPandora the address of the daughter pandora instance
64  *
65  * @return the address of the primary pandora instance
66  */
67  const pandora::Pandora *GetPrimaryPandoraInstance(const pandora::Pandora *const pDaughterPandora) const;
68 
69  /**
70  * @brief Get the volume id associated with a given pandora instance
71  *
72  * @param pPandora the address of the pandora instance
73  *
74  * @return the volume id
75  */
76  unsigned int GetVolumeId(const pandora::Pandora *const pPandora) const;
77 
78  /**
79  * @brief Declare a new primary pandora instance
80  *
81  * @param pPrimaryPandora the address of the primary pandora instance
82  */
83  void AddPrimaryPandoraInstance(const pandora::Pandora *const pPrimaryPandora);
84 
85  /**
86  * @brief Add a pandora daughter instance, associated to a primary pandora instance
87  *
88  * @param pPrimaryPandora the address of the primary pandora instance
89  * @param pDaughterPandora the address of the daughter pandora instance
90  */
91  void AddDaughterPandoraInstance(const pandora::Pandora *const pPrimaryPandora, const pandora::Pandora *const pDaughterPandora);
92 
93  /**
94  * @brief Delete all pandora instances associated with (and including) a specified primary pandora instance
95  *
96  * @param pPrimaryPandora the address of the primary pandora instance
97  */
98  void DeletePandoraInstances(const pandora::Pandora *const pPrimaryPandora);
99 
100  /**
101  * @brief Set the volume id associated with a given pandora instance
102  *
103  * @param pPandora the address of the pandora instance
104  * @param volumeId the volume id
105  */
106  void SetVolumeId(const pandora::Pandora *const pPandora, const unsigned int volumeId);
107 
108  typedef std::unordered_map<const pandora::Pandora *, const pandora::Pandora *> PandoraRelationMap;
109  typedef std::unordered_map<const pandora::Pandora *, unsigned int> PandoraToVolumeIdMap;
110 
111  PandoraInstanceMap m_primaryToDaughtersMap; ///< The map from primary pandora instance to list of daughter pandora instances
112  PandoraRelationMap m_daughterToPrimaryMap; ///< The map from daughter pandora instance to primary pandora instance
113  PandoraToVolumeIdMap m_pandoraToVolumeIdMap; ///< The map from pandora instance to volume id
114 
115  friend class MultiPandoraApi;
116 };
117 
118 #endif // #ifndef MULTI_PANDORA_API_IMPL_H
PandoraToVolumeIdMap m_pandoraToVolumeIdMap
The map from pandora instance to volume id.
~MultiPandoraApiImpl()
Destructor;.
MultiPandoraApi class.
void AddDaughterPandoraInstance(const pandora::Pandora *const pPrimaryPandora, const pandora::Pandora *const pDaughterPandora)
Add a pandora daughter instance, associated to a primary pandora instance.
void DeletePandoraInstances(const pandora::Pandora *const pPrimaryPandora)
Delete all pandora instances associated with (and including) a specified primary pandora instance...
void AddPrimaryPandoraInstance(const pandora::Pandora *const pPrimaryPandora)
Declare a new primary pandora instance.
const pandora::Pandora * GetPrimaryPandoraInstance(const pandora::Pandora *const pDaughterPandora) const
Get the address of the primary pandora instance associated with a given daughter pandora instance...
std::vector< const pandora::Pandora * > PandoraInstanceList
std::unordered_map< const pandora::Pandora *, PandoraInstanceList > PandoraInstanceMap
void SetVolumeId(const pandora::Pandora *const pPandora, const unsigned int volumeId)
Set the volume id associated with a given pandora instance.
Header file for the MultiPandoraApi class.
PandoraRelationMap m_daughterToPrimaryMap
The map from daughter pandora instance to primary pandora instance.
const PandoraInstanceMap & GetPandoraInstanceMap() const
Get the pandora instance map.
std::unordered_map< const pandora::Pandora *, const pandora::Pandora * > PandoraRelationMap
MultiPandoraApiImpl()
Default constructor;.
const PandoraInstanceList & GetDaughterPandoraInstanceList(const pandora::Pandora *const pPrimaryPandora) const
Get the list of daughter pandora instances associated with a given primary pandora instance...
PandoraInstanceMap m_primaryToDaughtersMap
The map from primary pandora instance to list of daughter pandora instances.
std::unordered_map< const pandora::Pandora *, unsigned int > PandoraToVolumeIdMap
unsigned int GetVolumeId(const pandora::Pandora *const pPandora) const
Get the volume id associated with a given pandora instance.
MultiPandoraApiImpl class.
const pandora::Pandora * GetPandoraInstance(const pandora::Pandora *const pPrimaryPandora, const unsigned int volumeId) const
Get the address of the pandora instance associated with a given primary pandora instance and volume i...