ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SiChargedDiodeCollection Class Reference

#include <SiChargedDiodeCollection.h>

Inheritance diagram for SiChargedDiodeCollection:
Collaboration diagram for SiChargedDiodeCollection:

Public Member Functions

 SiChargedDiodeCollection ()
 
 SiChargedDiodeCollection (const InDetDD::SolidStateDetectorElementBase *)
 
 ~SiChargedDiodeCollection ()
 
const InDetDD::SolidStateDetectorElementBaseelement () const
 
virtual Identifier identify () const override final
 
virtual IdentifierHash identifyHash () const override final
 
const AtlasDetectorIDid_helper ()
 
const InDetDD::DetectorDesigndesign () const
 
Identifier getId (const InDetDD::SiCellId &id) const
 
void clear ()
 
SiChargedDiodeMapchargedDiodes ()
 
void setDetectorElement (const InDetDD::SolidStateDetectorElementBase *SiElement)
 
template<class T >
void add (const InDetDD::SiCellId &diode, const T &charge)
 
template<class T >
void emplace_charge (const InDetDD::SiCellId &diode, const T &charge)
 
bool AlreadyHit (const InDetDD::SiCellId &siId)
 
bool AlreadyHit (const Identifier &id)
 
SiChargedDiodeIterator begin ()
 
SiChargedDiodeIterator end ()
 
SiChargedDiodeOrderedIterator orderedBegin ()
 
SiChargedDiodeOrderedIterator orderedEnd ()
 
bool empty () const
 
SiChargedDiodefind (const InDetDD::SiCellId &siId)
 
SiChargedDiodefind (Identifier)
 

Private Member Functions

 SiChargedDiodeCollection (const SiChargedDiodeCollection &)
 
SiChargedDiodeCollectionoperator= (const SiChargedDiodeCollection &)
 
void order ()
 
virtual const IdHelpergetHelper () const
 

Private Attributes

SiChargedDiodeMap m_chargedDiodes
 
SiChargedDiodeOrderedSet m_orderedChargedDiodes
 
const InDetDD::SolidStateDetectorElementBasem_sielement
 

Detailed Description

Definition at line 109 of file SiChargedDiodeCollection.h.

Constructor & Destructor Documentation

◆ SiChargedDiodeCollection() [1/3]

SiChargedDiodeCollection::SiChargedDiodeCollection ( )

Definition at line 28 of file SiChargedDiodeCollection.cxx.

28  :
30  m_sielement()
31 {
32 }

◆ SiChargedDiodeCollection() [2/3]

SiChargedDiodeCollection::SiChargedDiodeCollection ( const InDetDD::SolidStateDetectorElementBase sielement)

Definition at line 34 of file SiChargedDiodeCollection.cxx.

34  :
36  m_sielement(sielement)
37 {
38 }

◆ ~SiChargedDiodeCollection()

SiChargedDiodeCollection::~SiChargedDiodeCollection ( )
default

◆ SiChargedDiodeCollection() [3/3]

SiChargedDiodeCollection::SiChargedDiodeCollection ( const SiChargedDiodeCollection )
private

Member Function Documentation

◆ add()

template<class T >
void SiChargedDiodeCollection::add ( const InDetDD::SiCellId diode,
const T &  charge 
)

Definition at line 299 of file SiChargedDiodeCollection.h.

301 {
302  // check the pointer is correct
303  if (!diode.isValid()) return;
304  SiChargedDiodeIterator the_diode = m_chargedDiodes.find(diode);
305  if(the_diode != m_chargedDiodes.end()) the_diode->second.add(charge);
306  else emplace_charge(diode, charge);
307 }

◆ AlreadyHit() [1/2]

bool SiChargedDiodeCollection::AlreadyHit ( const Identifier id)

Definition at line 57 of file SiChargedDiodeCollection.cxx.

57  {
58 
59  const SiCellId cellId = m_sielement->cellIdFromIdentifier(id);
60  return AlreadyHit(cellId);
61 }

◆ AlreadyHit() [2/2]

bool SiChargedDiodeCollection::AlreadyHit ( const InDetDD::SiCellId siId)

Definition at line 53 of file SiChargedDiodeCollection.cxx.

53  {
54  return m_chargedDiodes.find(siId) != m_chargedDiodes.end();
55 }

◆ begin()

SiChargedDiodeIterator SiChargedDiodeCollection::begin ( )
inline

Definition at line 248 of file SiChargedDiodeCollection.h.

249 {
250  return m_chargedDiodes.begin();
251 }

◆ chargedDiodes()

SiChargedDiodeMap & SiChargedDiodeCollection::chargedDiodes ( )
inline

Definition at line 212 of file SiChargedDiodeCollection.h.

213 {
214  return m_chargedDiodes;
215 }

◆ clear()

void SiChargedDiodeCollection::clear ( )

Definition at line 45 of file SiChargedDiodeCollection.cxx.

45  {
46  m_sielement = nullptr;
47  m_chargedDiodes.erase(m_chargedDiodes.begin(), m_chargedDiodes.end() );
48  m_orderedChargedDiodes.clear();
49 }

◆ design()

const InDetDD::DetectorDesign & SiChargedDiodeCollection::design ( ) const
inline

Definition at line 224 of file SiChargedDiodeCollection.h.

225 {
226  return m_sielement->design();
227 }

◆ element()

const InDetDD::SolidStateDetectorElementBase * SiChargedDiodeCollection::element ( ) const
inline

Definition at line 218 of file SiChargedDiodeCollection.h.

219 {
220  return m_sielement;
221 }

◆ emplace_charge()

template<class T >
void SiChargedDiodeCollection::emplace_charge ( const InDetDD::SiCellId diode,
const T &  charge 
)

Definition at line 279 of file SiChargedDiodeCollection.h.

280 {
282  if (!roCell.isValid()) { // I don't think this can occur at this stage but cant hurt.
283  MsgStream log(Athena::getMessageSvc(),"SiChargedDiodeCollection");
284  log << MSG::FATAL << "Could not create SiReadoutCellId object !"<< endmsg;
285  }
286  // create a new charged diode
287  SiChargedDiode chargedDiode(diode,roCell);
288  // add the new charge to it
289  chargedDiode.add(charge);
290  if (charge.processType() == SiCharge::extraNoise) SiHelper::noise(chargedDiode,true);
291  // add the new charged diode to the charged diode collection
292  auto p = m_chargedDiodes.emplace(diode,chargedDiode);
293  if (!m_orderedChargedDiodes.empty()) {
294  m_orderedChargedDiodes.insert (&p.first->second);
295  }
296 }

◆ empty()

bool SiChargedDiodeCollection::empty ( ) const
inline

Definition at line 274 of file SiChargedDiodeCollection.h.

274  {
275  return m_chargedDiodes.empty();
276 }

◆ end()

SiChargedDiodeIterator SiChargedDiodeCollection::end ( )
inline

Definition at line 253 of file SiChargedDiodeCollection.h.

254 {
255  return m_chargedDiodes.end();
256 }

◆ find() [1/2]

SiChargedDiode * SiChargedDiodeCollection::find ( const InDetDD::SiCellId siId)

Definition at line 63 of file SiChargedDiodeCollection.cxx.

63  {
64  // get the compact Id to access the map
65  SiChargedDiodeIterator theEl = m_chargedDiodes.find(siId);
66  // if the diode exists return a pointer to it:
67  if (theEl == m_chargedDiodes.end() ) return nullptr;
68  else return &( (*theEl).second);
69 }

◆ find() [2/2]

SiChargedDiode * SiChargedDiodeCollection::find ( Identifier  siId)

Definition at line 71 of file SiChargedDiodeCollection.cxx.

71  {
72 
73  // Get the key for the map lookup
74  const SiCellId cellId = m_sielement->cellIdFromIdentifier(siId);
75  return find(cellId);
76 }

◆ getHelper()

const IdHelper * Identifiable::getHelper ( ) const
virtualinherited

Definition at line 18 of file Identifiable.cxx.

18  {
19  return (nullptr);
20 }

◆ getId()

Identifier SiChargedDiodeCollection::getId ( const InDetDD::SiCellId id) const
inline

Definition at line 144 of file SiChargedDiodeCollection.h.

145  {
146  return (element()->identifierFromCellId(id));
147  }

◆ id_helper()

const AtlasDetectorID * SiChargedDiodeCollection::id_helper ( )
inline

Definition at line 242 of file SiChargedDiodeCollection.h.

243 {
244  return m_sielement->getIdHelper();
245 }

◆ identify()

Identifier SiChargedDiodeCollection::identify ( ) const
inlinefinaloverridevirtual

Implements Identifiable.

Definition at line 230 of file SiChargedDiodeCollection.h.

231 {
232  return m_sielement->identify();
233 }

◆ identifyHash()

IdentifierHash SiChargedDiodeCollection::identifyHash ( ) const
inlinefinaloverridevirtual

Reimplemented from Identifiable.

Definition at line 236 of file SiChargedDiodeCollection.h.

237 {
238  return m_sielement->identifyHash();
239 }

◆ operator=()

SiChargedDiodeCollection& SiChargedDiodeCollection::operator= ( const SiChargedDiodeCollection )
private

◆ order()

void SiChargedDiodeCollection::order ( )
private

Definition at line 78 of file SiChargedDiodeCollection.cxx.

79 {
80  for (auto& p : m_chargedDiodes) {
81  m_orderedChargedDiodes.insert (&p.second);
82  }
83 }

◆ orderedBegin()

SiChargedDiodeOrderedIterator SiChargedDiodeCollection::orderedBegin ( )
inline

Definition at line 258 of file SiChargedDiodeCollection.h.

259 {
260  if (m_orderedChargedDiodes.empty() && !m_chargedDiodes.empty()) {
261  order();
262  }
263  return m_orderedChargedDiodes.begin();
264 }

◆ orderedEnd()

SiChargedDiodeOrderedIterator SiChargedDiodeCollection::orderedEnd ( )
inline

Definition at line 266 of file SiChargedDiodeCollection.h.

267 {
268  if (m_orderedChargedDiodes.empty() && !m_chargedDiodes.empty()) {
269  order();
270  }
271  return m_orderedChargedDiodes.end();
272 }

◆ setDetectorElement()

void SiChargedDiodeCollection::setDetectorElement ( const InDetDD::SolidStateDetectorElementBase SiElement)
inline

Definition at line 207 of file SiChargedDiodeCollection.h.

208 {
209  m_sielement=SiElement;
210 }

Member Data Documentation

◆ m_chargedDiodes

SiChargedDiodeMap SiChargedDiodeCollection::m_chargedDiodes
private

Definition at line 197 of file SiChargedDiodeCollection.h.

◆ m_orderedChargedDiodes

SiChargedDiodeOrderedSet SiChargedDiodeCollection::m_orderedChargedDiodes
private

Definition at line 198 of file SiChargedDiodeCollection.h.

◆ m_sielement

const InDetDD::SolidStateDetectorElementBase* SiChargedDiodeCollection::m_sielement
private

Definition at line 199 of file SiChargedDiodeCollection.h.


The documentation for this class was generated from the following files:
SiChargedDiode
Definition: SiChargedDiode.h:30
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
SiChargedDiodeCollection::element
const InDetDD::SolidStateDetectorElementBase * element() const
Definition: SiChargedDiodeCollection.h:218
SiHelper::noise
static void noise(SiChargedDiode &chDiode, bool flag, bool mask=false)
Definition: SiHelper.h:75
InDetDD::SiCellId::isValid
bool isValid() const
Test if its in a valid state.
Definition: SiCellId.h:136
SiCharge::extraNoise
@ extraNoise
Definition: SiCharge.h:28
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
InDetDD::SolidStateDetectorElementBase::getIdHelper
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
SiChargedDiodeIterator
SiChargedDiodeMap::iterator SiChargedDiodeIterator
Definition: SiChargedDiodeCollection.h:70
SiChargedDiodeCollection::find
SiChargedDiode * find(const InDetDD::SiCellId &siId)
Definition: SiChargedDiodeCollection.cxx:63
InDetDD::DetectorDesign::readoutIdOfCell
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const =0
diode id -> readout id NB assignment of a SiReadoutCellId to a SiCellId is allowed so you are can pas...
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
InDetDD::SolidStateDetectorElementBase::design
virtual const DetectorDesign & design() const
access to the local description (inline):
SiChargedDiodeCollection::m_chargedDiodes
SiChargedDiodeMap m_chargedDiodes
Definition: SiChargedDiodeCollection.h:197
SiChargedDiodeCollection::m_sielement
const InDetDD::SolidStateDetectorElementBase * m_sielement
Definition: SiChargedDiodeCollection.h:199
charge
double charge(const T &p)
Definition: AtlasPID.h:756
InDetDD::SiCellId
Definition: SiCellId.h:29
SiChargedDiodeCollection::m_orderedChargedDiodes
SiChargedDiodeOrderedSet m_orderedChargedDiodes
Definition: SiChargedDiodeCollection.h:198
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SiChargedDiodeCollection::emplace_charge
void emplace_charge(const InDetDD::SiCellId &diode, const T &charge)
Definition: SiChargedDiodeCollection.h:279
InDetDD::SiReadoutCellId
Definition: SiReadoutCellId.h:42
InDetDD::SolidStateDetectorElementBase::cellIdFromIdentifier
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const =0
SiCellId from Identifier.
SiChargedDiodeCollection::AlreadyHit
bool AlreadyHit(const InDetDD::SiCellId &siId)
Definition: SiChargedDiodeCollection.cxx:53
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
SiChargedDiodeCollection::design
const InDetDD::DetectorDesign & design() const
Definition: SiChargedDiodeCollection.h:224
SiChargedDiodeCollection::order
void order()
Definition: SiChargedDiodeCollection.cxx:78