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

#include <LArOnOffIdMapping.h>

Collaboration diagram for LArOnOffIdMapping:

Public Member Functions

 LArOnOffIdMapping ()=delete
 
 LArOnOffIdMapping (const LArOnlineID_Base *onlineId, const CaloCell_Base_ID *m_caloId)
 
HWIdentifier createSignalChannelID (const Identifier &id) const
 create a HWIdentifier from an Identifier (not inline)
More...
 
HWIdentifier createSignalChannelIDFromHash (const IdentifierHash &id_hash) const
 create a HWIdentifier from an Identifier (from hash) (inline)
More...
 
Identifier cnvToIdentifier (const HWIdentifier &sid) const
 create an Identifier from a HWIdentifier (inline)
More...
 
IdentifierHash oflHashFromOnlHash (const IdentifierHash &onlHash) const
 Offline identifier hash from online. More...
 
Identifier cnvToIdentifierFromHash (const IdentifierHash &sid_hash) const
 create an Identifier from a HWIdentifier (from hash) (inline)
More...
 
bool isOnlineConnectedFromHash (const IdentifierHash &sid_hash) const
 Test whether a HWIdentifier is connected of not (by online hash) (inline)
More...
 
bool isOnlineConnected (const HWIdentifier &sid) const
 Test whether a HWIdentifier is connected of not (inline)
More...
 
std::vector< Identifier > & getOnlHash2OflId ()
 Access to underlying storage (not-const only!) More...
 
std::vector< HWIdentifier > & getOflHash2OnId ()
 

Private Attributes

const LArOnlineID_Basem_onlineId
 
const CaloCell_Base_IDm_caloId
 
std::vector< Identifierm_onlHashToOffline
 
std::vector< HWIdentifierm_oflHashToOnline
 
std::vector< IdentifierHashm_onlHashToOflHash
 
const Identifier m_idEmpty
 Invalid default instance of Identifier. More...
 
const HWIdentifier m_hwidEmpty
 Invalid default instance of HWIdentifier. More...
 

Friends

class LArOnOffMappingAlg
 

Detailed Description

Definition at line 20 of file LArOnOffIdMapping.h.

Constructor & Destructor Documentation

◆ LArOnOffIdMapping() [1/2]

LArOnOffIdMapping::LArOnOffIdMapping ( )
delete

◆ LArOnOffIdMapping() [2/2]

LArOnOffIdMapping::LArOnOffIdMapping ( const LArOnlineID_Base onlineId,
const CaloCell_Base_ID m_caloId 
)

Definition at line 6 of file LArOnOffIdMapping.cxx.

6  :
7 
8  m_onlineId(onlineId),
9  m_caloId(caloId)
10 
11 {
12  unsigned nChan=m_onlineId->channelHashMax();
13  m_onlHashToOffline.assign(nChan,m_idEmpty);
14  m_oflHashToOnline.assign(nChan,m_hwidEmpty);
15  m_onlHashToOflHash.assign(nChan,1+caloId->calo_cell_hash_max());
16 }

Member Function Documentation

◆ cnvToIdentifier()

Identifier LArOnOffIdMapping::cnvToIdentifier ( const HWIdentifier sid) const
inline

create an Identifier from a HWIdentifier (inline)

Definition at line 116 of file LArOnOffIdMapping.h.

116  {
117  const IdentifierHash sid_hash=m_onlineId->channel_Hash(sid);
118  return this->cnvToIdentifierFromHash(sid_hash);
119  }

◆ cnvToIdentifierFromHash()

Identifier LArOnOffIdMapping::cnvToIdentifierFromHash ( const IdentifierHash sid_hash) const
inline

create an Identifier from a HWIdentifier (from hash) (inline)

Definition at line 109 of file LArOnOffIdMapping.h.

109  {
110  if (sid_hash <m_onlHashToOffline.size())
111  return m_onlHashToOffline[sid_hash];
112 
113  return m_idEmpty;
114 }

◆ createSignalChannelID()

HWIdentifier LArOnOffIdMapping::createSignalChannelID ( const Identifier id) const
inline

create a HWIdentifier from an Identifier (not inline)

Definition at line 126 of file LArOnOffIdMapping.h.

126  {
127  const IdentifierHash id_hash=m_caloId->calo_cell_hash(id);
128  return this->createSignalChannelIDFromHash(id_hash);
129 }

◆ createSignalChannelIDFromHash()

HWIdentifier LArOnOffIdMapping::createSignalChannelIDFromHash ( const IdentifierHash id_hash) const
inline

create a HWIdentifier from an Identifier (from hash) (inline)

Definition at line 104 of file LArOnOffIdMapping.h.

104  {
105  return m_oflHashToOnline[id_hash];
106 }

◆ getOflHash2OnId()

std::vector< HWIdentifier > & LArOnOffIdMapping::getOflHash2OnId ( )
inline

Definition at line 135 of file LArOnOffIdMapping.h.

135  {
136  return m_oflHashToOnline;
137 }

◆ getOnlHash2OflId()

std::vector< Identifier > & LArOnOffIdMapping::getOnlHash2OflId ( )
inline

Access to underlying storage (not-const only!)

Definition at line 131 of file LArOnOffIdMapping.h.

131  {
132  return m_onlHashToOffline;
133 }

◆ isOnlineConnected()

bool LArOnOffIdMapping::isOnlineConnected ( const HWIdentifier sid) const
inline

Test whether a HWIdentifier is connected of not (inline)

Definition at line 121 of file LArOnOffIdMapping.h.

121  {
122  const IdentifierHash sid_hash=m_onlineId->channel_Hash(sid);
123  return this->isOnlineConnectedFromHash(sid_hash);
124 }

◆ isOnlineConnectedFromHash()

bool LArOnOffIdMapping::isOnlineConnectedFromHash ( const IdentifierHash sid_hash) const
inline

Test whether a HWIdentifier is connected of not (by online hash) (inline)

Definition at line 96 of file LArOnOffIdMapping.h.

96  {
97  if (sid_hash <m_onlHashToOffline.size())
98  return (m_idEmpty!=m_onlHashToOffline[sid_hash]);
99 
100  return false;
101 }

◆ oflHashFromOnlHash()

IdentifierHash LArOnOffIdMapping::oflHashFromOnlHash ( const IdentifierHash onlHash) const
inline

Offline identifier hash from online.

Definition at line 139 of file LArOnOffIdMapping.h.

139  {
140  assert(onlHash < m_onlHashToOflHash.size());
141  return m_onlHashToOflHash[onlHash];
142 }

Friends And Related Function Documentation

◆ LArOnOffMappingAlg

friend class LArOnOffMappingAlg
friend

Definition at line 22 of file LArOnOffIdMapping.h.

Member Data Documentation

◆ m_caloId

const CaloCell_Base_ID* LArOnOffIdMapping::m_caloId
private

Definition at line 79 of file LArOnOffIdMapping.h.

◆ m_hwidEmpty

const HWIdentifier LArOnOffIdMapping::m_hwidEmpty
private

Invalid default instance of HWIdentifier.

Definition at line 89 of file LArOnOffIdMapping.h.

◆ m_idEmpty

const Identifier LArOnOffIdMapping::m_idEmpty
private

Invalid default instance of Identifier.

Definition at line 86 of file LArOnOffIdMapping.h.

◆ m_oflHashToOnline

std::vector<HWIdentifier> LArOnOffIdMapping::m_oflHashToOnline
private

Definition at line 82 of file LArOnOffIdMapping.h.

◆ m_onlHashToOffline

std::vector<Identifier> LArOnOffIdMapping::m_onlHashToOffline
private

Definition at line 81 of file LArOnOffIdMapping.h.

◆ m_onlHashToOflHash

std::vector<IdentifierHash> LArOnOffIdMapping::m_onlHashToOflHash
private

Definition at line 83 of file LArOnOffIdMapping.h.

◆ m_onlineId

const LArOnlineID_Base* LArOnOffIdMapping::m_onlineId
private

Definition at line 78 of file LArOnOffIdMapping.h.


The documentation for this class was generated from the following files:
LArOnOffIdMapping::createSignalChannelIDFromHash
HWIdentifier createSignalChannelIDFromHash(const IdentifierHash &id_hash) const
create a HWIdentifier from an Identifier (from hash) (inline)
Definition: LArOnOffIdMapping.h:104
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1632
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
LArOnOffIdMapping::m_idEmpty
const Identifier m_idEmpty
Invalid default instance of Identifier.
Definition: LArOnOffIdMapping.h:86
LArOnOffIdMapping::m_onlHashToOflHash
std::vector< IdentifierHash > m_onlHashToOflHash
Definition: LArOnOffIdMapping.h:83
LArOnOffIdMapping::m_hwidEmpty
const HWIdentifier m_hwidEmpty
Invalid default instance of HWIdentifier.
Definition: LArOnOffIdMapping.h:89
LArOnOffIdMapping::cnvToIdentifierFromHash
Identifier cnvToIdentifierFromHash(const IdentifierHash &sid_hash) const
create an Identifier from a HWIdentifier (from hash) (inline)
Definition: LArOnOffIdMapping.h:109
LArOnOffIdMapping::m_caloId
const CaloCell_Base_ID * m_caloId
Definition: LArOnOffIdMapping.h:79
LArOnOffIdMapping::m_onlineId
const LArOnlineID_Base * m_onlineId
Definition: LArOnOffIdMapping.h:78
LArOnOffIdMapping::isOnlineConnectedFromHash
bool isOnlineConnectedFromHash(const IdentifierHash &sid_hash) const
Test whether a HWIdentifier is connected of not (by online hash) (inline)
Definition: LArOnOffIdMapping.h:96
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1897
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArOnOffIdMapping::m_oflHashToOnline
std::vector< HWIdentifier > m_oflHashToOnline
Definition: LArOnOffIdMapping.h:82
LArOnOffIdMapping::m_onlHashToOffline
std::vector< Identifier > m_onlHashToOffline
Definition: LArOnOffIdMapping.h:81