Loading [MathJax]/extensions/tex2jax.js
 |
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.
◆ cloneAvoidingDuplicatesFindCellIsFast()
template<class CONTAINER >
StatusCode CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsFast |
( |
const CaloCellContainer * |
srcCont, |
|
|
CONTAINER * |
destCont |
|
) |
| const |
|
private |
Definition at line 228 of file CaloCellFastCopyTool.cxx.
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;
◆ cloneAvoidingDuplicatesFindCellIsNotFast()
template<class CONTAINER >
StatusCode CaloCellFastCopyTool::cloneAvoidingDuplicatesFindCellIsNotFast |
( |
const CaloCellContainer * |
srcCont, |
|
|
CONTAINER * |
destCont |
|
) |
| const |
|
private |
Definition at line 274 of file CaloCellFastCopyTool.cxx.
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;
◆ cloneNotAvoidingDuplicatesFindCellIsFast()
template<class CONTAINER >
StatusCode CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsFast |
( |
const CaloCellContainer * |
srcCont, |
|
|
CONTAINER * |
destCont |
|
) |
| const |
|
private |
Definition at line 211 of file CaloCellFastCopyTool.cxx.
219 if (
cell) destCont->push_back_fast(
cell->clone());
222 destCont->resetLookUpTable();
223 return StatusCode::SUCCESS;
◆ cloneNotAvoidingDuplicatesFindCellIsNotFast()
template<class CONTAINER >
StatusCode CaloCellFastCopyTool::cloneNotAvoidingDuplicatesFindCellIsNotFast |
( |
const CaloCellContainer * |
srcCont, |
|
|
CONTAINER * |
destCont |
|
) |
| const |
|
private |
Definition at line 254 of file CaloCellFastCopyTool.cxx.
261 for (; itSrcCell != srcCont->
end(); ++itSrcCell) {
265 destCont->push_back_fast(
cell->clone());
268 destCont->resetLookUpTable();
269 return StatusCode::SUCCESS;
◆ dispatchCopy()
Definition at line 300 of file CaloCellFastCopyTool.cxx.
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);
◆ dispatchCopyConst()
Definition at line 334 of file CaloCellFastCopyTool.cxx.
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);
◆ initialize()
StatusCode CaloCellFastCopyTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 31 of file CaloCellFastCopyTool.cxx.
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;
◆ process() [1/2]
StatusCode CaloCellFastCopyTool::process |
( |
CaloCellContainer * |
theCellContainer, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
overridevirtual |
◆ process() [2/2]
◆ viewAvoidingDuplicatesFindCellIsFast()
Definition at line 143 of file CaloCellFastCopyTool.cxx.
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;
◆ viewAvoidingDuplicatesFindCellIsNotFast()
Definition at line 185 of file CaloCellFastCopyTool.cxx.
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;
◆ viewNotAvoidingDuplicatesFindCellIsFast()
◆ viewNotAvoidingDuplicatesFindCellIsNotFast()
◆ m_acceptedCalos
◆ m_acceptedCellHashes
std::vector<IdentifierHash> CaloCellFastCopyTool::m_acceptedCellHashes |
|
private |
◆ m_acceptedSampleNames
Gaudi::Property<std::vector<std::string> > CaloCellFastCopyTool::m_acceptedSampleNames {this, "includeSamplings", {}} |
|
private |
◆ m_avoidDuplicates
Gaudi::Property<bool> CaloCellFastCopyTool::m_avoidDuplicates {this, "AvoidDuplicates", false} |
|
private |
◆ m_caloID
◆ m_cellsToBeCopied
std::vector<bool> CaloCellFastCopyTool::m_cellsToBeCopied |
|
private |
◆ m_hashMax
◆ m_isFindCellFast
Gaudi::Property<bool> CaloCellFastCopyTool::m_isFindCellFast {this, "IsFindCellFast", false} |
|
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.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
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