 |
ATLAS Offline Software
|
Go to the documentation of this file.
19 #include "CaloGeoHelpers/CaloSampling.h"
37 std::vector<bool> acceptedSamplings(
m_caloID->Unknown,
false);
38 std::vector<CaloSampling::CaloSample> acceptedSamples;
44 acceptedSamplings[sampInd] =
true;
45 acceptedSamples.push_back(sampInd);
55 for (; itSampling < acceptedSamples.end(); ++itSampling) {
89 return StatusCode::SUCCESS;
94 const EventContext& ctx)
const
106 return StatusCode::SUCCESS;
111 const EventContext& ctx)
const
123 return StatusCode::SUCCESS;
139 return StatusCode::SUCCESS;
147 std::vector<bool> notInContainer(
m_hashMax,
true);
149 for (; itCell != destCont->
end(); ++itCell) {
150 notInContainer[(*itCell)->caloDDE()->calo_hash()] =
false;
156 if (notInContainer[*
it]) {
163 return StatusCode::SUCCESS;
174 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
181 return StatusCode::SUCCESS;
189 std::vector<bool> notInContainer(
m_hashMax,
true);
191 for (; itCell != destCont->
end(); ++itCell) {
192 notInContainer[(*itCell)->caloDDE()->calo_hash()] =
false;
198 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
206 return StatusCode::SUCCESS;
210 template <
class CONTAINER>
213 CONTAINER* destCont)
const
219 if (
cell) destCont->push_back_fast(
cell->clone());
222 destCont->resetLookUpTable();
223 return StatusCode::SUCCESS;
227 template <
class CONTAINER>
230 CONTAINER* destCont)
const
233 std::vector<bool> notInContainer(
m_hashMax,
true);
235 for (; itCell != destCont->end(); ++itCell) {
236 notInContainer[(*itCell)->caloDDE()->calo_hash()] =
false;
242 if (notInContainer[*
it]) {
244 if (
cell) destCont->push_back_fast(
cell->clone());
248 destCont->resetLookUpTable();
249 return StatusCode::SUCCESS;
253 template <
class CONTAINER>
256 CONTAINER* destCont)
const
261 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
265 destCont->push_back_fast(
cell->clone());
268 destCont->resetLookUpTable();
269 return StatusCode::SUCCESS;
273 template <
class CONTAINER>
276 CONTAINER* destCont)
const
278 std::vector<bool> notInContainer(
m_hashMax,
true);
280 for (; itCell != destCont->end(); ++itCell) {
281 notInContainer[(*itCell)->caloDDE()->calo_hash()] =
false;
287 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
291 destCont->push_back_fast(
cell->clone());
294 destCont->resetLookUpTable();
295 return StatusCode::SUCCESS;
305 COPY_CELLS copyCells;
309 (&CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsFast<CaloCellContainer>) :
310 (&CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsFast<CaloCellContainer>);
313 REPORT_ERROR(StatusCode::FAILURE) <<
"Can't copy to a non-const view container.";
314 return StatusCode::FAILURE;
320 (&CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsNotFast<CaloCellContainer>) :
321 (&CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsNotFast<CaloCellContainer>);
324 REPORT_ERROR(StatusCode::FAILURE) <<
"Can't copy to a non-const view container.";
325 return StatusCode::FAILURE;
329 return (this->*copyCells)(srcCont, destCont);
339 COPY_CONST_CELLS copyConstCells;
343 (&CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsFast<CaloConstCellContainer>) :
344 (&CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsFast<CaloConstCellContainer>);
353 (&CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsNotFast<CaloConstCellContainer>) :
354 (&CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsNotFast<CaloConstCellContainer>);
362 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.
size_type calo_cell_hash_max() const
cell 'global' hash table max size
@ 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
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
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.