ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
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 More...
 
typedef CaloClusterLinkTemplate< CaloCellLinkContainer >::link_type cell_link_type
 

Public Member Functions

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

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

Definition at line 146 of file CaloClusterNavigable.h.

◆ 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,
25  m_cellLink);
26 }

◆ 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 ( m_ownLinkStore && *m_cellLink != nullptr ) delete *m_cellLink;
37 }

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 }

◆ 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 39 of file CaloClusterNavigable.cxx.

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

◆ getCellLink() [2/2]

const CaloCellLink * CaloClusterNavigable::getCellLink ( ) const
protected

Definition at line 68 of file CaloClusterNavigable.cxx.

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

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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  }

◆ 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 }

◆ 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 }

Friends And Related Function Documentation

◆ 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:
CaloClusterNavigable::cellLink
const cell_link_type & cellLink() const
Access to underlying link.
Definition: CaloClusterNavigable.h:149
CaloClusterNavigable::reweight
void reweight(const CaloCell *pCell, const double &weight=double(1.))
re-weight (overwrite old weight)
Definition: CaloClusterNavigable.h:251
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
CaloClusterNavigable::m_cellLink
cell_link_type m_cellLink
Local pointer to cell store.
Definition: CaloClusterNavigable.h:186
CaloClusterLinkTemplate::setLink
static bool setLink(CONT *pCont, DOBJ *pDat, ELEM &rElm)
Definition: CaloClusterLinkTemplate.h:26
CaloClusterNavigable::fillToken
virtual void fillToken(INavigationToken &iToken) const
fill token for navigation
Definition: CaloClusterNavigable.h:390
CaloClusterNavigable::putElement
void putElement(const CaloCellContainer *pContainer, const CaloCell *pCell, const double &weight=double(1.))
add element to the Navigable: use pointer
Definition: CaloClusterNavigable.h:201
Navigable::size
virtual unsigned int size() const
CaloClusterNavigable::getCellLink
CaloCellLink * getCellLink()
Definition: CaloClusterNavigable.cxx:39
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
CaloClusterNavigable::m_ownLinkStore
bool m_ownLinkStore
Definition: CaloClusterNavigable.h:178
CaloClusterNavigable::getCellLinkPtr
CaloCellLink * getCellLinkPtr()
Definition: CaloClusterNavigable.h:426
CaloClusterNavigable::insertElement
void insertElement(const CaloCellContainer *pContainer, const CaloCell *pCell, const double &weight=double(1.))
insert element without checking if already in store: use element pointer
Definition: CaloClusterNavigable.h:217