![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Concrete tool for coping Calo cells.
More...
#include <CaloCellFastCopyTool.h>
|
StatusCode | viewNotAvoidingDuplicatesFindCellIsFast (const CaloCellContainer *srcCont, CaloConstCellContainer *destCont) const |
|
StatusCode | viewAvoidingDuplicatesFindCellIsFast (const CaloCellContainer *srcCont, CaloConstCellContainer *destCont) const |
|
StatusCode | viewNotAvoidingDuplicatesFindCellIsNotFast (const CaloCellContainer *srcCont, CaloConstCellContainer *destCont) const |
|
StatusCode | viewAvoidingDuplicatesFindCellIsNotFast (const CaloCellContainer *srcCont, CaloConstCellContainer *destCont) const |
|
template<class CONTAINER > |
StatusCode | cloneNotAvoidingDuplicatesFindCellIsFast (const CaloCellContainer *srcCont, CONTAINER *destCont) const |
|
template<class CONTAINER > |
StatusCode | cloneAvoidingDuplicatesFindCellIsFast (const CaloCellContainer *srcCont, CONTAINER *destCont) const |
|
template<class CONTAINER > |
StatusCode | cloneNotAvoidingDuplicatesFindCellIsNotFast (const CaloCellContainer *srcCont, CONTAINER *destCont) const |
|
template<class CONTAINER > |
StatusCode | cloneAvoidingDuplicatesFindCellIsNotFast (const CaloCellContainer *srcCont, CONTAINER *destCont) const |
|
StatusCode | dispatchCopy (const CaloCellContainer *srcCont, CaloCellContainer *destCont) const |
|
StatusCode | dispatchCopyConst (const CaloCellContainer *srcCont, CaloConstCellContainer *destCont) const |
|
Concrete tool for coping Calo cells.
CaloCellFastCopyTool to be used by CaloCellMaker algorithms. The tool copies Calo cells from an existing CaloCellContainer to the one processed by the CaloCellMaker algorithm. Properties of the tool: InputName - source cell container (default: "AllCalo") IncludeSamplings - name of CaloSampling to be copied into new CaloCellContainer AvoidDuplicates - indicates if this tool should avoid duplicates in new CaloCellContainer. IsFindCellFast - indicates if source CaloCellContainer find CaloCell fast (i.e. source CaloCellContainer is complete and ordered or has already initialized internal lookUpTable). In this case this tool can be very fast.
Definition at line 52 of file CaloCellFastCopyTool.h.
◆ CaloCellFastCopyTool()
CaloCellFastCopyTool::CaloCellFastCopyTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ cloneAvoidingDuplicatesFindCellIsFast()
template<class CONTAINER >
StatusCode CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsFast |
( |
const CaloCellContainer * |
srcCont, |
|
|
CONTAINER * |
destCont |
|
) |
| const |
|
private |
Definition at line 246 of file CaloCellFastCopyTool.cxx.
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;
◆ cloneAvoidingDuplicatesFindCellIsNotFast()
template<class CONTAINER >
StatusCode CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsNotFast |
( |
const CaloCellContainer * |
srcCont, |
|
|
CONTAINER * |
destCont |
|
) |
| const |
|
private |
Definition at line 292 of file CaloCellFastCopyTool.cxx.
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;
◆ cloneNotAvoidingDuplicatesFindCellIsFast()
template<class CONTAINER >
StatusCode CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsFast |
( |
const CaloCellContainer * |
srcCont, |
|
|
CONTAINER * |
destCont |
|
) |
| const |
|
private |
Definition at line 229 of file CaloCellFastCopyTool.cxx.
237 if (
cell) destCont->push_back_fast(
cell->clone());
240 destCont->resetLookUpTable();
241 return StatusCode::SUCCESS;
◆ cloneNotAvoidingDuplicatesFindCellIsNotFast()
template<class CONTAINER >
StatusCode CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsNotFast |
( |
const CaloCellContainer * |
srcCont, |
|
|
CONTAINER * |
destCont |
|
) |
| const |
|
private |
Definition at line 272 of file CaloCellFastCopyTool.cxx.
279 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
283 destCont->push_back_fast(
cell->clone());
286 destCont->resetLookUpTable();
287 return StatusCode::SUCCESS;
◆ dispatchCopy()
Definition at line 318 of file CaloCellFastCopyTool.cxx.
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);
◆ dispatchCopyConst()
Definition at line 352 of file CaloCellFastCopyTool.cxx.
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);
◆ initialize()
StatusCode CaloCellFastCopyTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 49 of file CaloCellFastCopyTool.cxx.
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;
◆ process() [1/2]
StatusCode CaloCellFastCopyTool::process |
( |
CaloCellContainer * |
theCellContainer, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
overridevirtual |
◆ process() [2/2]
◆ viewAvoidingDuplicatesFindCellIsFast()
Definition at line 161 of file CaloCellFastCopyTool.cxx.
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;
◆ viewAvoidingDuplicatesFindCellIsNotFast()
Definition at line 203 of file CaloCellFastCopyTool.cxx.
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;
◆ viewNotAvoidingDuplicatesFindCellIsFast()
◆ viewNotAvoidingDuplicatesFindCellIsNotFast()
◆ m_acceptedCalos
◆ m_acceptedCellHashes
std::vector<IdentifierHash> CaloCellFastCopyTool::m_acceptedCellHashes |
|
private |
◆ m_acceptedSampleNames
std::vector<std::string> CaloCellFastCopyTool::m_acceptedSampleNames |
|
private |
◆ m_avoidDuplicates
bool CaloCellFastCopyTool::m_avoidDuplicates |
|
private |
◆ m_caloID
◆ m_cellsToBeCopied
std::vector<bool> CaloCellFastCopyTool::m_cellsToBeCopied |
|
private |
◆ m_hashMax
◆ m_isFindCellFast
bool CaloCellFastCopyTool::m_isFindCellFast |
|
private |
◆ m_srcCellContainerKey
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
Const iterator class for DataVector/DataList.
#define REPORT_ERROR(SC)
Report an error.
iterator end() noexcept
Return an iterator pointing past the end of the collection.
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.
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.
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.
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