|
ATLAS Offline Software
|
Go to the documentation of this file.
11 const unsigned INDEXBITS=18;
12 const unsigned INDEXBIT_MASK = (0x1 << INDEXBITS) -1;
13 const unsigned HAS_WEIGHT_BIT=0x1 << INDEXBITS;
30 for (
size_t iCluster=0;iCluster<nClusters;++iCluster) {
36 if (nextStep > maxPersIdx) {
37 msg << MSG::ERROR <<
"Inconsistent persistent object: To few persistent values, expected at least " << nextStep
38 <<
" got only "<< maxPersIdx <<
endmsg;
41 cccl->
reserve(nextStep-persIdx);
42 for (;persIdx<nextStep;++persIdx) {
44 if (pers->
m_indices[persIdx] & HAS_WEIGHT_BIT) {
58 const std::string&
key,
66 const size_t nClusters=trans->
size();
79 if (!dec_clusts || !dec_clusts->
thinned (icluster)) {
80 const size_t nCells=cccl->size();
88 unsigned ndx =
it.index();
89 if (dec_cells) ndx = dec_cells->
index (ndx);
96 float fweight =
it.weight();
98 pers->
m_indices.push_back(ndx & INDEXBIT_MASK);
101 pers->
m_indices.push_back((ndx & INDEXBIT_MASK) | HAS_WEIGHT_BIT);
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
Container class for CaloCellLink.
DataLinkCnv_p2< DataLink< CaloCellContainer > > m_linkCnv
Hold thinning decisions for one container.
virtual void persToTrans(const PersDLink_t &pers, DLink_t &trans, MsgStream &log) const
bool thinned(size_t ndx) const
Return true if element ndx should be thinned.
virtual void persToTransWithKey(const CaloClusterCellLinkContainer_p1 *pers, CaloClusterCellLinkContainer *trans, const std::string &key, MsgStream &log) const override
Convert from persistent to transient object.
virtual void transToPers(const DLink_t &trans, PersDLink_t &pers, MsgStream &log) const
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
void reserve(const size_t s)
Method to reserve space the underlying vector<pair>
setRawEt setRawPhi nCells
Helpers to retrieve the current thinning cache from the event context.
bool addCell(const unsigned cellIdx, const weight_t weight=1.0)
Method to add a cell to the cluster.
const SG::ThinningCache * getThinningCache(const EventContext &ctx)
Retrieve the current thinning cache from the event context.
const SG::ThinningDecisionBase * getThinningDecision(const EventContext &ctx, const std::string &key)
Retrieve the current thinning decision for key.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_t index(size_t ndxOrig) const
Return the index corresponding to ndxOrig after thinning.
const ThinningDecisionBase * thinning(const std::string &key) const
Return thinning for key.
std::vector< float > m_weights
virtual void transToPersWithKey(const CaloClusterCellLinkContainer *trans, CaloClusterCellLinkContainer_p1 *pers, const std::string &key, MsgStream &log) const override
Convert from transient to persistent object.
Cache thinning decisions for converters.
const_iterator to loop over cells belonging to a cluster
size_type size() const noexcept
Returns the number of elements in the collection.
std::vector< unsigned > m_indices
std::vector< unsigned > m_nCellsPerCluster