![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
19 #include "CaloGeoHelpers/CaloSampling.h"
31 const std::string&
name,
const IInterface*
parent)
33 , m_srcCellContainerKey(
"AllCalo")
34 , m_avoidDuplicates(false)
35 , m_isFindCellFast(false)
55 std::vector<bool> acceptedSamplings(
m_caloID->Unknown,
false);
56 std::vector<CaloSampling::CaloSample> acceptedSamples;
62 acceptedSamplings[sampInd] =
true;
63 acceptedSamples.push_back(sampInd);
73 for (; itSampling < acceptedSamples.end(); ++itSampling) {
107 return StatusCode::SUCCESS;
112 const EventContext& ctx)
const
124 return StatusCode::SUCCESS;
129 const EventContext& ctx)
const
141 return StatusCode::SUCCESS;
157 return StatusCode::SUCCESS;
165 std::vector<bool> notInContainer(
m_hashMax,
true);
167 for (; itCell != destCont->
end(); ++itCell) {
168 notInContainer[(*itCell)->caloDDE()->calo_hash()] =
false;
174 if (notInContainer[*
it]) {
181 return StatusCode::SUCCESS;
192 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
199 return StatusCode::SUCCESS;
207 std::vector<bool> notInContainer(
m_hashMax,
true);
209 for (; itCell != destCont->
end(); ++itCell) {
210 notInContainer[(*itCell)->caloDDE()->calo_hash()] =
false;
216 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
224 return StatusCode::SUCCESS;
228 template <
class CONTAINER>
231 CONTAINER* destCont)
const
237 if (
cell) destCont->push_back_fast(
cell->clone());
240 destCont->resetLookUpTable();
241 return StatusCode::SUCCESS;
245 template <
class CONTAINER>
248 CONTAINER* destCont)
const
251 std::vector<bool> notInContainer(
m_hashMax,
true);
253 for (; itCell != destCont->end(); ++itCell) {
254 notInContainer[(*itCell)->caloDDE()->calo_hash()] =
false;
260 if (notInContainer[*
it]) {
262 if (
cell) destCont->push_back_fast(
cell->clone());
266 destCont->resetLookUpTable();
267 return StatusCode::SUCCESS;
271 template <
class CONTAINER>
274 CONTAINER* destCont)
const
279 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
283 destCont->push_back_fast(
cell->clone());
286 destCont->resetLookUpTable();
287 return StatusCode::SUCCESS;
291 template <
class CONTAINER>
294 CONTAINER* destCont)
const
296 std::vector<bool> notInContainer(
m_hashMax,
true);
298 for (; itCell != destCont->end(); ++itCell) {
299 notInContainer[(*itCell)->caloDDE()->calo_hash()] =
false;
305 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
309 destCont->push_back_fast(
cell->clone());
312 destCont->resetLookUpTable();
313 return StatusCode::SUCCESS;
323 COPY_CELLS copyCells;
327 (&CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsFast<CaloCellContainer>) :
328 (&CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsFast<CaloCellContainer>);
331 REPORT_ERROR(StatusCode::FAILURE) <<
"Can't copy to a non-const view container.";
332 return StatusCode::FAILURE;
338 (&CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsNotFast<CaloCellContainer>) :
339 (&CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsNotFast<CaloCellContainer>);
342 REPORT_ERROR(StatusCode::FAILURE) <<
"Can't copy to a non-const view container.";
343 return StatusCode::FAILURE;
347 return (this->*copyCells)(srcCont, destCont);
357 COPY_CONST_CELLS copyConstCells;
361 (&CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsFast<CaloConstCellContainer>) :
362 (&CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsFast<CaloConstCellContainer>);
371 (&CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsNotFast<CaloConstCellContainer>) :
372 (&CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsNotFast<CaloConstCellContainer>);
380 return (this->*copyConstCells)(srcCont, destCont);
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
Const iterator class for DataVector/DataList.
#define REPORT_ERROR(SC)
Report an error.
const_pointer_type cptr()
Dereference the pointer.
iterator end() noexcept
Return an iterator pointing past the end of the collection.
void setHasCalo(const CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
void resetLookUpTable()
reset look up table
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
@ OWN_ELEMENTS
this data object owns its elements
::StatusCode StatusCode
StatusCode definition for legacy code.
void push_back_fast(const CaloCell *cell)
reimplementation of push_back to gain speed in readin
static bool getCalos(const std::vector< CaloSampling::CaloSample > &theSamplings, std::vector< CaloCell_ID::SUBCALO > &theCalos)
Returns a list of sub-calos for a list of samplings.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
Helpers for checking error return status codes and reporting errors.
Container class for CaloCell.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Data object for each calorimeter readout cell.
CaloCellContainer that can accept const cell pointers.
void setHasCalo(CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
static CaloSampling::CaloSample getSamplingId(const std::string &samplingName)
Returns the CaloSampling::CaloSample enumerator value.
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
bool hasCalo(const CaloCell_ID::SUBCALO caloNum) const
tell wether it has been filled with cells (maybe none) of a given calo
CaloCellContainer that can accept const cell pointers.
iterator begin() noexcept
Return an iterator pointing at the beginning of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size