Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
OrderedCaloHitList.h
Go to the documentation of this file.
1
8#ifndef PANDORA_ORDERED_CALO_HIT_LIST_H
9#define PANDORA_ORDERED_CALO_HIT_LIST_H 1
10
11#include "Objects/CaloHit.h"
12
14#include "Pandora/StatusCodes.h"
15
16#include <map>
17
18namespace pandora
19{
20
25{
26public:
27 typedef std::map<unsigned int, CaloHitList *> TheList;
28 typedef TheList::value_type value_type;
29 typedef TheList::const_iterator const_iterator;
30 typedef TheList::const_reverse_iterator const_reverse_iterator;
31
36
43
48
55
62
68 StatusCode Add(const CaloHitList &caloHitList);
69
75 StatusCode Remove(const CaloHitList &caloHitList);
76
82 StatusCode Add(const CaloHit *const pCaloHit);
83
89 StatusCode Remove(const CaloHit *const pCaloHit);
90
97 StatusCode GetCaloHitsInPseudoLayer(const unsigned int pseudoLayer, CaloHitList *&pCaloHitList) const;
98
106 unsigned int GetNCaloHitsInPseudoLayer(const unsigned int pseudoLayer) const;
107
111 void Reset();
112
118 void FillCaloHitList(CaloHitList &caloHitList) const;
119
123 const_iterator begin() const;
124
128 const_iterator end() const;
129
134
139
144 const_iterator find(const unsigned int index) const;
145
149 unsigned int size() const;
150
154 bool empty() const;
155
161 bool operator= (const OrderedCaloHitList &rhs);
162
163private:
167 void clear();
168
175 StatusCode Add(const CaloHit *const pCaloHit, const unsigned int pseudoLayer);
176
183 StatusCode Remove(const CaloHit *const pCaloHit, const unsigned int pseudoLayer);
184
186};
187
188//------------------------------------------------------------------------------------------------------------------------------------------
189
191{
192 return m_theList.begin();
193}
194
195//------------------------------------------------------------------------------------------------------------------------------------------
196
201
202//------------------------------------------------------------------------------------------------------------------------------------------
203
205{
206 return m_theList.find(index);
207}
208
209//------------------------------------------------------------------------------------------------------------------------------------------
210
215
216//------------------------------------------------------------------------------------------------------------------------------------------
217
222//------------------------------------------------------------------------------------------------------------------------------------------
223
224inline unsigned int OrderedCaloHitList::size() const
225{
226 return m_theList.size();
227}
228
229//------------------------------------------------------------------------------------------------------------------------------------------
230
231inline bool OrderedCaloHitList::empty() const
232{
233 return m_theList.empty();
234}
235
236//------------------------------------------------------------------------------------------------------------------------------------------
237
238inline StatusCode OrderedCaloHitList::Add(const CaloHit *const pCaloHit)
239{
240 return this->Add(pCaloHit, pCaloHit->GetPseudoLayer());
241}
242
243//------------------------------------------------------------------------------------------------------------------------------------------
244
245inline StatusCode OrderedCaloHitList::Remove(const CaloHit *const pCaloHit)
246{
247 return this->Remove(pCaloHit, pCaloHit->GetPseudoLayer());
248}
249
250//------------------------------------------------------------------------------------------------------------------------------------------
251
253{
254 m_theList.clear();
255}
256
257} // namespace pandora
258
259#endif // #ifndef PANDORA_ORDERED_CALO_HIT_LIST_H
Header file for the calo hit class.
Header file defining relevant internal typedefs, sort and string conversion functions.
Header file defining status codes and relevant preprocessor macros.
CaloHit class.
Definition CaloHit.h:26
unsigned int GetPseudoLayer() const
Get pseudo layer for the calo hit.
Definition CaloHit.h:462
Calo hit lists arranged by pseudo layer.
const_iterator end() const
Returns a const iterator referring to the past-the-end element in the ordered calo hit list.
void clear()
Clear the ordered calo hit list.
const_iterator begin() const
Returns a const iterator referring to the first element in the ordered calo hit list.
OrderedCaloHitList()
Default constructor.
void Reset()
Reset the ordered calo hit list, emptying its contents.
TheList m_theList
The ordered calo hit list.
bool operator=(const OrderedCaloHitList &rhs)
Assignment operator.
StatusCode Remove(const OrderedCaloHitList &rhs)
Remove the hits in a second ordered calo hit list from this list.
std::map< unsigned int, CaloHitList * > TheList
unsigned int GetNCaloHitsInPseudoLayer(const unsigned int pseudoLayer) const
Get the number of calo hits in a specified pseudo layer.
TheList::const_iterator const_iterator
StatusCode GetCaloHitsInPseudoLayer(const unsigned int pseudoLayer, CaloHitList *&pCaloHitList) const
Get calo hits in specified pseudo layer.
const_reverse_iterator rbegin() const
Returns a const reverse iterator referring to the first element in the ordered calo hit list.
StatusCode Add(const OrderedCaloHitList &rhs)
Add the hits from a second ordered calo hit list to this list.
const_reverse_iterator rend() const
Returns a const reverse iterator referring to the past-the-end element in the ordered calo hit list.
TheList::const_reverse_iterator const_reverse_iterator
unsigned int size() const
Returns the number of elements in the container.
bool empty() const
Returns whether the map container is empty (i.e. whether its size is 0)
const_iterator find(const unsigned int index) const
Searches the container for an element with specified layer and returns an iterator to it if found,...
void FillCaloHitList(CaloHitList &caloHitList) const
Fill a provided calo hit list with all the calo hits in the ordered calo hit list.
MANAGED_CONTAINER< const CaloHit * > CaloHitList
StatusCode
The StatusCode enum.