ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterNavigable Class Reference

Navigable part of CaloCluster, use CaloCellLink. More...

#include <CaloClusterNavigable.h>

Inheritance diagram for CaloClusterNavigable:
Collaboration diagram for CaloClusterNavigable:

Public Types

typedef CaloCellLink::cell_iterator object_iter
 external cell iterator type
typedef CaloClusterLinkTemplate< CaloCellLinkContainer >::link_type cell_link_type

Public Member Functions

 CaloClusterNavigable ()
 default constructor
 CaloClusterNavigable (CaloCellLinkContainer *pLinkCont, CaloCellLink *pLink)
 constructor
 CaloClusterNavigable (CaloCellLink *pLink)
 constructor
virtual ~CaloClusterNavigable ()
 destructor
void putElement (const CaloCellContainer *pContainer, const CaloCell *pCell, const double &weight=double(1.))
 add element to the Navigable: use pointer
void putElement (const CaloCellContainer *pContainer, size_t &iCell, const double &weight=double(1.))
 add element to the Navigable: use element index (direct access!)
void insertElement (const CaloCellContainer *pContainer, const CaloCell *pCell, const double &weight=double(1.))
 insert element without checking if already in store: use element pointer
void insertElement (const CaloCellContainer *pContainer, size_t &iCell, const double &weight=double(1.))
 insert element without checking if already in store: use index
void insertElement (const CaloCellContainer *pContainer, size_t iCell, const double weight, size_t size_hint)
 same, with a size hint.
void insertElement (const ElementLink< CaloCellContainer > &el, const double weight, size_t size_hint=0)
 Insert element via ElementLink.
void reweight (const CaloCell *pCell, const double &weight=double(1.))
 re-weight (overwrite old weight)
void reweight (const CaloCellContainer *pContainer, size_t &iCell, const double &weight=double(1.))
 re-weight (overwrite old weight)
void reweight (object_iter &cellIter, const double &weight=double(1.))
 re-weight (overwrite old weight)
bool remove (const CaloCell *pCell)
 remove object from the Navigable
bool remove (const CaloCellContainer *pContainer, size_t &iCell)
 remove object from the Navigable
bool removeAll ()
 remove all objects from the Navigable
bool contains (const CaloCell *pCell) const
 check if constituent is already there
bool contains (const CaloCellContainer *pContainer, size_t &iCell) const
 check if constituent is already there
virtual object_iter begin () const
 begin iterator for public object access
virtual object_iter end () const
 end iterator for public object access
virtual unsigned int nCells () const
 size of object access
double getParameter (const CaloCell *pCell) const
 public container access: relational parameter retrieval
double getParameter (const CaloCellContainer *pContainer, size_t &iCell) const
 public container access: relational parameter retrieval
double getParameter (object_iter &cellIter) const
 public container access: relational parameter retrieval
const CaloCellContainergetContainer (const CaloCell *pCell) const
 public container access: retrieve Container for given object pointer
const CaloCellContainergetContainer (object_iter cellIter) const
 public container access: retrieve Container for given object iterator
bool getIndex (const CaloCell *pCell, size_t &iCell) const
 get index of child in original container, given a pointer
bool getIndex (object_iter cellIter, size_t &iCell) const
 get index of child in original container, given an iterator
virtual void fillToken (INavigationToken &iToken) const
 fill token for navigation
virtual void fillToken (INavigationToken &iToken, const std::any &rPar) const
 fill token for navigation
virtual bool isCellLinkValid () const
const cell_link_typecellLink () const
 Access to underlying link.
void resetCellLink (const cell_link_type &cellLink)

Protected Member Functions

CaloCellLinkgetCellLink ()
const CaloCellLinkgetCellLink () const
bool setCellLink (CaloCellLinkContainer *pLink)
bool setLinkStore (CaloCellLink *pLink, bool ownStores=true)
CaloCellLinkgetCellLinkPtr ()
const CaloCellLinkgetCellLinkPtr () const

Protected Attributes

bool m_ownLinkStore

Private Attributes

cell_link_type m_cellLink
 Local pointer to cell store.

Friends

class CaloClusterStoreHelper
class CaloClusterContainerCnv_p2
class CaloClusterContainerCnv_p3
class CaloClusterContainerCnv_p4
class CaloClusterContainerCnv_p5
class CaloClusterContainerCnv_p6
class CaloClusterContainerCnv_p7
class CaloClusterContainerCnvTestMakeCluster

Detailed Description

Navigable part of CaloCluster, use CaloCellLink.

Author
Peter Loch

Definition at line 33 of file CaloClusterNavigable.h.

Member Typedef Documentation

◆ cell_link_type

◆ object_iter

external cell iterator type

Definition at line 51 of file CaloClusterNavigable.h.

Constructor & Destructor Documentation

◆ CaloClusterNavigable() [1/3]

CaloClusterNavigable::CaloClusterNavigable ( )

default constructor

Definition at line 15 of file CaloClusterNavigable.cxx.

16 : m_ownLinkStore(false)
17{ }

◆ CaloClusterNavigable() [2/3]

CaloClusterNavigable::CaloClusterNavigable ( CaloCellLinkContainer * pLinkCont,
CaloCellLink * pLink )

constructor

Definition at line 19 of file CaloClusterNavigable.cxx.

21 : m_ownLinkStore(false)
22{
24 pLink,
26}
cell_link_type m_cellLink
Local pointer to cell store.
static bool setLink(CONT *pCont, DOBJ *pDat, ELEM &rElm)

◆ CaloClusterNavigable() [3/3]

CaloClusterNavigable::CaloClusterNavigable ( CaloCellLink * pLink)

constructor

Definition at line 28 of file CaloClusterNavigable.cxx.

29 : m_ownLinkStore(true)
30{
31 m_cellLink.setElement(pLink);
32}

◆ ~CaloClusterNavigable()

CaloClusterNavigable::~CaloClusterNavigable ( )
virtual

destructor

Definition at line 34 of file CaloClusterNavigable.cxx.

35{
36 // If we own the store, the link holds the pointer directly.
37 if ( m_ownLinkStore ) delete m_cellLink.cachedElement();
38}

Member Function Documentation

◆ begin()

CaloClusterNavigable::object_iter CaloClusterNavigable::begin ( ) const
inlinevirtual

begin iterator for public object access

Definition at line 303 of file CaloClusterNavigable.h.

304{
305 return (this->getCellLink())->begin();
306}

◆ cellLink()

const cell_link_type & CaloClusterNavigable::cellLink ( ) const
inline

Access to underlying link.

Definition at line 149 of file CaloClusterNavigable.h.

149{ return m_cellLink; }

◆ contains() [1/2]

bool CaloClusterNavigable::contains ( const CaloCell * pCell) const
inline

check if constituent is already there

Definition at line 290 of file CaloClusterNavigable.h.

291{
292 return (this->getCellLink())->contains(pCell);
293}

◆ contains() [2/2]

bool CaloClusterNavigable::contains ( const CaloCellContainer * pContainer,
size_t & iCell ) const
inline

check if constituent is already there

Definition at line 296 of file CaloClusterNavigable.h.

298{
299 return (this->getCellLink())->contains(pContainer,iCell);
300}

◆ end()

CaloClusterNavigable::object_iter CaloClusterNavigable::end ( ) const
inlinevirtual

end iterator for public object access

Definition at line 309 of file CaloClusterNavigable.h.

310{
311 return (this->getCellLink())->end();
312}

◆ fillToken() [1/2]

void CaloClusterNavigable::fillToken ( INavigationToken & iToken) const
inlinevirtual

fill token for navigation

Implements INavigable.

Definition at line 390 of file CaloClusterNavigable.h.

391{
392 if ( this->getCellLink() )
393 (this->getCellLink())->fillToken(iToken);
394}
virtual void fillToken(INavigationToken &iToken) const
fill token for navigation

◆ fillToken() [2/2]

void CaloClusterNavigable::fillToken ( INavigationToken & iToken,
const std::any & rPar ) const
inlinevirtual

fill token for navigation

Implements INavigable.

Definition at line 397 of file CaloClusterNavigable.h.

399{
400 if ( this->getCellLink() )
401 (this->getCellLink())->fillToken(iToken,rPar);
402}

◆ getCellLink() [1/2]

CaloCellLink * CaloClusterNavigable::getCellLink ( )
protected

Definition at line 40 of file CaloClusterNavigable.cxx.

41{
42 if ( m_ownLinkStore )
43 {
44 if ( *m_cellLink == nullptr ) m_cellLink.setElement(new CaloCellLink());
45 // Ok, because this happens only if we own the pointer.
46 CaloCellLink* link ATLAS_THREAD_SAFE = const_cast<CaloCellLink*>(*m_cellLink);
47 return link;
48 }
49 else
50 {
51 return (CaloCellLink*)nullptr;
52 }
53
54 // check if local pointer to store
55 // if ( m_cellLinkPointer != 0 ) { return m_cellLinkPointer;}
56 // check if linked pointer to store
57 // if ( m_cellLink.isValid() && *m_cellLink != 0 )
58 // {
59 // FIXME
60 // CaloCellLink* pLink = const_cast<CaloCellLink*>(*m_cellLink);
61 // return pLink;
62 // }
63 // create a new local store/
64 // m_cellLinkPointer = new CaloCellLink();
65 // return m_cellLinkPointer;
66}
#define ATLAS_THREAD_SAFE

◆ getCellLink() [2/2]

const CaloCellLink * CaloClusterNavigable::getCellLink ( ) const
protected

Definition at line 69 of file CaloClusterNavigable.cxx.

70{
71 // return *m_cellLink;
72
73 // if ( m_cellLinkPointer != 0 )
74 // {
75 // std::cout << "[CaloClusterNavigable@" << this << "] return "
76 // << "cell link @" << m_cellLinkPointer << std::endl;
77 // return m_cellLinkPointer;
78 // }
79 // if ( *m_cellLink == 0 )
80 // {
81 // std::cout << "[CaloClusterNavigable@" << this << "] problem with "
82 // << "cell link store, unexpected pointer = "
83 // << *m_cellLink << std::endl;
84 // }
85 return m_cellLink.isValid() ? *m_cellLink : nullptr;
86}

◆ getCellLinkPtr() [1/2]

CaloCellLink * CaloClusterNavigable::getCellLinkPtr ( )
inlineprotected

Definition at line 426 of file CaloClusterNavigable.h.

427{
428 CaloCellLink* ret;
429 if (m_cellLink.isValid())
430 ret = const_cast<CaloCellLink*>(*m_cellLink);
431 else
432 ret = 0;
433 return ret;
434
435}

◆ getCellLinkPtr() [2/2]

const CaloCellLink * CaloClusterNavigable::getCellLinkPtr ( ) const
inlineprotected

Definition at line 438 of file CaloClusterNavigable.h.

438 {
439 const CaloCellLink* ret;
440 if (m_cellLink.isValid())
441 ret = *m_cellLink;
442 else
443 ret = 0;
444 return ret;
445}

◆ getContainer() [1/2]

const CaloCellContainer * CaloClusterNavigable::getContainer ( const CaloCell * pCell) const
inline

public container access: retrieve Container for given object pointer

Definition at line 347 of file CaloClusterNavigable.h.

348{
349 return (this->getCellLink())->getContainer(pCell);
350}

◆ getContainer() [2/2]

const CaloCellContainer * CaloClusterNavigable::getContainer ( object_iter cellIter) const
inline

public container access: retrieve Container for given object iterator

Definition at line 354 of file CaloClusterNavigable.h.

355{
356 return (this->getCellLink())->getContainer(cellIter);
357}

◆ getIndex() [1/2]

bool CaloClusterNavigable::getIndex ( const CaloCell * pCell,
size_t & iCell ) const
inline

get index of child in original container, given a pointer

Definition at line 360 of file CaloClusterNavigable.h.

361{
362 return (this->getCellLink())->getIndex(pCell,iCell);
363}

◆ getIndex() [2/2]

bool CaloClusterNavigable::getIndex ( object_iter cellIter,
size_t & iCell ) const
inline

get index of child in original container, given an iterator

Definition at line 366 of file CaloClusterNavigable.h.

367{
368 return (this->getCellLink())->getIndex(cellIter,iCell);
369}

◆ getParameter() [1/3]

double CaloClusterNavigable::getParameter ( const CaloCell * pCell) const
inline

public container access: relational parameter retrieval

Definition at line 327 of file CaloClusterNavigable.h.

328{
329 return (this->getCellLink())->getParameter(pCell);
330}

◆ getParameter() [2/3]

double CaloClusterNavigable::getParameter ( const CaloCellContainer * pContainer,
size_t & iCell ) const
inline

public container access: relational parameter retrieval

Definition at line 333 of file CaloClusterNavigable.h.

335{
336 return (this->getCellLink())->getParameter(pContainer,iCell);
337}

◆ getParameter() [3/3]

double CaloClusterNavigable::getParameter ( object_iter & cellIter) const
inline

public container access: relational parameter retrieval

Definition at line 340 of file CaloClusterNavigable.h.

341{
342 return (this->getCellLink())->getParameter(cellIter);
343}

◆ insertElement() [1/4]

void CaloClusterNavigable::insertElement ( const CaloCellContainer * pContainer,
const CaloCell * pCell,
const double & weight = double(1.) )
inline

insert element without checking if already in store: use element pointer

Definition at line 217 of file CaloClusterNavigable.h.

220{
221 (this->getCellLink())->insertElement(pContainer,pCell,weight);
222}
void insertElement(const CaloCellContainer *pContainer, const CaloCell *pCell, const double &weight=double(1.))
insert element without checking if already in store: use element pointer

◆ insertElement() [2/4]

void CaloClusterNavigable::insertElement ( const CaloCellContainer * pContainer,
size_t & iCell,
const double & weight = double(1.) )
inline

insert element without checking if already in store: use index

Definition at line 225 of file CaloClusterNavigable.h.

228{
229 (this->getCellLink())->insertElement(pContainer,iCell,weight);
230}

◆ insertElement() [3/4]

void CaloClusterNavigable::insertElement ( const CaloCellContainer * pContainer,
size_t iCell,
const double weight,
size_t size_hint )
inline

same, with a size hint.

Definition at line 233 of file CaloClusterNavigable.h.

237{
238 (this->getCellLink())->insertElement(pContainer,iCell,weight,size_hint);
239}

◆ insertElement() [4/4]

void CaloClusterNavigable::insertElement ( const ElementLink< CaloCellContainer > & el,
const double weight,
size_t size_hint = 0 )
inline

Insert element via ElementLink.

Definition at line 243 of file CaloClusterNavigable.h.

246{
247 (this->getCellLink())->insertElement(el,weight,size_hint);
248}

◆ isCellLinkValid()

bool CaloClusterNavigable::isCellLinkValid ( ) const
inlinevirtual

Definition at line 449 of file CaloClusterNavigable.h.

450{
451 return this->getCellLinkPtr() !=0;
452}
CaloCellLink * getCellLinkPtr()

◆ nCells()

unsigned int CaloClusterNavigable::nCells ( ) const
inlinevirtual

size of object access

Definition at line 315 of file CaloClusterNavigable.h.

316{
317
318 const CaloCellLink* link = this->getCellLinkPtr();
319 if (link)
320 return link->size();
321 else
322 return 0;
323
324}
virtual unsigned int size() const

◆ putElement() [1/2]

void CaloClusterNavigable::putElement ( const CaloCellContainer * pContainer,
const CaloCell * pCell,
const double & weight = double(1.) )
inline

add element to the Navigable: use pointer

Definition at line 201 of file CaloClusterNavigable.h.

204{
205 (this->getCellLink())->putElement(pContainer,pCell,weight);
206}
void putElement(const CaloCellContainer *pContainer, const CaloCell *pCell, const double &weight=double(1.))
add element to the Navigable: use pointer

◆ putElement() [2/2]

void CaloClusterNavigable::putElement ( const CaloCellContainer * pContainer,
size_t & iCell,
const double & weight = double(1.) )
inline

add element to the Navigable: use element index (direct access!)

Definition at line 209 of file CaloClusterNavigable.h.

212{
213 (this->getCellLink())->putElement(pContainer,iCell,weight);
214}

◆ remove() [1/2]

bool CaloClusterNavigable::remove ( const CaloCell * pCell)
inline

remove object from the Navigable

Definition at line 271 of file CaloClusterNavigable.h.

272{
273 return (this->getCellLink())->remove(pCell);
274}

◆ remove() [2/2]

bool CaloClusterNavigable::remove ( const CaloCellContainer * pContainer,
size_t & iCell )
inline

remove object from the Navigable

Definition at line 277 of file CaloClusterNavigable.h.

279{
280 return (this->getCellLink())->remove(pContainer,iCell);
281}

◆ removeAll()

bool CaloClusterNavigable::removeAll ( )
inline

remove all objects from the Navigable

Definition at line 284 of file CaloClusterNavigable.h.

285{
286 return (this->getCellLink())->removeAll();
287}

◆ resetCellLink()

void CaloClusterNavigable::resetCellLink ( const cell_link_type & cellLink)
inline

Definition at line 151 of file CaloClusterNavigable.h.

152 {
154 }
const cell_link_type & cellLink() const
Access to underlying link.

◆ reweight() [1/3]

void CaloClusterNavigable::reweight ( const CaloCell * pCell,
const double & weight = double(1.) )
inline

re-weight (overwrite old weight)

Definition at line 251 of file CaloClusterNavigable.h.

252{
253 (this->getCellLink())->reweight(pCell,weight);
254}
void reweight(const CaloCell *pCell, const double &weight=double(1.))
re-weight (overwrite old weight)

◆ reweight() [2/3]

void CaloClusterNavigable::reweight ( const CaloCellContainer * pContainer,
size_t & iCell,
const double & weight = double(1.) )
inline

re-weight (overwrite old weight)

Definition at line 257 of file CaloClusterNavigable.h.

260{
261 (this->getCellLink())->reweight(pContainer,iCell,weight);
262}

◆ reweight() [3/3]

void CaloClusterNavigable::reweight ( object_iter & cellIter,
const double & weight = double(1.) )
inline

re-weight (overwrite old weight)

Definition at line 265 of file CaloClusterNavigable.h.

266{
267 (this->getCellLink())->reweight(cellIter,weight);
268}

◆ setCellLink()

bool CaloClusterNavigable::setCellLink ( CaloCellLinkContainer * pLink)
inlineprotected

Definition at line 405 of file CaloClusterNavigable.h.

406{
407 if (!pLinkStore)
408 return false;
409
410 CaloCellLink* pLink = *m_cellLink != 0
411 ? const_cast<CaloCellLink*>(*m_cellLink) : (CaloCellLink*)0;
412
413 m_ownLinkStore = !pLinkStore->ownElements();
415 pLink,
416 m_cellLink);
417}

◆ setLinkStore()

bool CaloClusterNavigable::setLinkStore ( CaloCellLink * pLink,
bool ownStores = true )
inlineprotected

Definition at line 191 of file CaloClusterNavigable.h.

193{
194 m_cellLink.setElement(pLink);
195 m_ownLinkStore = ownStores;
196 // m_cellLinkPointer = pLink;
197 return *m_cellLink != 0;
198}

◆ CaloClusterContainerCnv_p2

friend class CaloClusterContainerCnv_p2
friend

Definition at line 160 of file CaloClusterNavigable.h.

◆ CaloClusterContainerCnv_p3

friend class CaloClusterContainerCnv_p3
friend

Definition at line 161 of file CaloClusterNavigable.h.

◆ CaloClusterContainerCnv_p4

friend class CaloClusterContainerCnv_p4
friend

Definition at line 162 of file CaloClusterNavigable.h.

◆ CaloClusterContainerCnv_p5

friend class CaloClusterContainerCnv_p5
friend

Definition at line 163 of file CaloClusterNavigable.h.

◆ CaloClusterContainerCnv_p6

friend class CaloClusterContainerCnv_p6
friend

Definition at line 164 of file CaloClusterNavigable.h.

◆ CaloClusterContainerCnv_p7

friend class CaloClusterContainerCnv_p7
friend

Definition at line 165 of file CaloClusterNavigable.h.

◆ CaloClusterContainerCnvTestMakeCluster

friend class CaloClusterContainerCnvTestMakeCluster
friend

Definition at line 166 of file CaloClusterNavigable.h.

◆ CaloClusterStoreHelper

friend class CaloClusterStoreHelper
friend

Definition at line 159 of file CaloClusterNavigable.h.

Member Data Documentation

◆ m_cellLink

cell_link_type CaloClusterNavigable::m_cellLink
private

Local pointer to cell store.

Link to cell links object

Definition at line 186 of file CaloClusterNavigable.h.

◆ m_ownLinkStore

bool CaloClusterNavigable::m_ownLinkStore
protected

Definition at line 178 of file CaloClusterNavigable.h.


The documentation for this class was generated from the following files: