42 for (
const CaloHit *
const pCaloHit : *rhsEntry.second)
48 return STATUS_CODE_SUCCESS;
57 for (
const CaloHit *
const pCaloHit : *rhsEntry.second)
63 return STATUS_CODE_SUCCESS;
70 for (
const CaloHit *
const pCaloHit : caloHitList)
75 return STATUS_CODE_SUCCESS;
82 for (
const CaloHit *
const pCaloHit : caloHitList)
87 return STATUS_CODE_SUCCESS;
96 if (this->
end() == iter)
97 return STATUS_CODE_NOT_FOUND;
99 pCaloHitList = iter->second;
101 return STATUS_CODE_SUCCESS;
110 if (this->
end() == iter)
113 return iter->second->size();
135 caloHitList.insert(caloHitList.end(), entry.second->begin(), entry.second->end());
149 return (STATUS_CODE_SUCCESS == this->
Add(rhs));
156 TheList::iterator iter =
m_theList.find(pseudoLayer);
161 pCaloHitList->push_back(pCaloHit);
163 if (!(
m_theList.insert(TheList::value_type(pseudoLayer, pCaloHitList)).second))
166 return STATUS_CODE_FAILURE;
171 if (iter->second->end() != std::find(iter->second->begin(), iter->second->end(), pCaloHit))
172 return STATUS_CODE_ALREADY_PRESENT;
174 iter->second->push_back(pCaloHit);
177 return STATUS_CODE_SUCCESS;
184 TheList::iterator listIter =
m_theList.find(pseudoLayer);
187 return STATUS_CODE_NOT_FOUND;
189 CaloHitList::iterator caloHitIter = std::find(listIter->second->begin(), listIter->second->end(), pCaloHit);
191 if (listIter->second->end() == caloHitIter)
192 return STATUS_CODE_NOT_FOUND;
194 caloHitIter = listIter->second->erase(caloHitIter);
196 if (listIter->second->empty())
198 delete listIter->second;
202 return STATUS_CODE_SUCCESS;
Header file for the calo hit class.
Header file for the ordered calo hit list class.
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
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.
~OrderedCaloHitList()
Destructor.
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.
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.
StatusCode Add(const OrderedCaloHitList &rhs)
Add the hits from a second ordered calo hit list to this list.
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.
TheList::value_type value_type
StatusCodeException class.
MANAGED_CONTAINER< const CaloHit * > CaloHitList
StatusCode
The StatusCode enum.