ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterNavigable.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7
11
12#include <algorithm>
13//#include <iostream>
14
18
27
33
35{
36 // If we own the store, the link holds the pointer directly.
37 if ( m_ownLinkStore ) delete m_cellLink.cachedElement();
38}
39
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}
67
68const CaloCellLink*
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}
#define ATLAS_THREAD_SAFE
cell_link_type m_cellLink
Local pointer to cell store.
CaloClusterNavigable()
default constructor
virtual ~CaloClusterNavigable()
destructor
static bool setLink(CONT *pCont, DOBJ *pDat, ELEM &rElm)