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