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

#include <LArBadChanFEBHasher.h>

Collaboration diagram for LArBadChanFEBHasher:

Public Member Functions

 LArBadChanFEBHasher ()
 LArBadChanFEBHasher (unsigned int firstFEB, unsigned int lastFEB, unsigned int febShift, const LArOnlineID *onlineID)
unsigned int hash (const HWIdentifier &FEBid, int chan) const
unsigned int hash (const HWIdentifier &onlineID) const
unsigned int hash (unsigned int febHash, unsigned int chan) const
unsigned int hashFEB (const HWIdentifier &FEBid) const
unsigned int febHashByChan (const HWIdentifier &chanID) const
unsigned int channelInFeb (const HWIdentifier &chanID) const
unsigned int maxHash () const
unsigned int maxFEBHash () const
unsigned int maxChannel () const
bool initialized () const

Private Attributes

unsigned int m_firstFEBid
unsigned int m_shift
unsigned int m_FEBShift
unsigned int m_maxHash
unsigned int m_maxFEBHash
const LArOnlineIDm_onlineID

Detailed Description

Definition at line 10 of file LArBadChanFEBHasher.h.

Constructor & Destructor Documentation

◆ LArBadChanFEBHasher() [1/2]

LArBadChanFEBHasher::LArBadChanFEBHasher ( )
inline

Definition at line 13 of file LArBadChanFEBHasher.h.

◆ LArBadChanFEBHasher() [2/2]

LArBadChanFEBHasher::LArBadChanFEBHasher ( unsigned int firstFEB,
unsigned int lastFEB,
unsigned int febShift,
const LArOnlineID * onlineID )
inline

Definition at line 16 of file LArBadChanFEBHasher.h.

17 :
18 m_firstFEBid(firstFEB),
19 m_shift( febShift - 7), // 7 bits shift to the left for mult. by 128
20 m_FEBShift( febShift),
21 m_onlineID( onlineID)
22 {
23 m_maxFEBHash = (((lastFEB - firstFEB) >> febShift) + 1);
24 m_maxHash = m_maxFEBHash // range of FEBs
25 * maxChannel(); // number of channels per FEB
26 }
unsigned int maxChannel() const

Member Function Documentation

◆ channelInFeb()

unsigned int LArBadChanFEBHasher::channelInFeb ( const HWIdentifier & chanID) const
inline

Definition at line 49 of file LArBadChanFEBHasher.h.

49 {
50 return m_onlineID->channel(chanID);
51 }

◆ febHashByChan()

unsigned int LArBadChanFEBHasher::febHashByChan ( const HWIdentifier & chanID) const
inline

Definition at line 45 of file LArBadChanFEBHasher.h.

45 {
46 return hashFEB( m_onlineID->feb_Id( chanID));
47 }
unsigned int hashFEB(const HWIdentifier &FEBid) const

◆ hash() [1/3]

unsigned int LArBadChanFEBHasher::hash ( const HWIdentifier & FEBid,
int chan ) const
inline

Definition at line 28 of file LArBadChanFEBHasher.h.

28 {
29 return ((FEBid.get_identifier32().get_compact() - m_firstFEBid) >> m_shift) + chan;
30 }
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.

◆ hash() [2/3]

unsigned int LArBadChanFEBHasher::hash ( const HWIdentifier & onlineID) const
inline

Definition at line 32 of file LArBadChanFEBHasher.h.

32 {
33 return hash( m_onlineID->feb_Id( onlineID), m_onlineID->channel(onlineID));
34 }
unsigned int hash(const HWIdentifier &FEBid, int chan) const

◆ hash() [3/3]

unsigned int LArBadChanFEBHasher::hash ( unsigned int febHash,
unsigned int chan ) const
inline

Definition at line 37 of file LArBadChanFEBHasher.h.

37 {
38 return febHash * maxChannel() + chan;
39 }

◆ hashFEB()

unsigned int LArBadChanFEBHasher::hashFEB ( const HWIdentifier & FEBid) const
inline

Definition at line 41 of file LArBadChanFEBHasher.h.

41 {
42 return ((FEBid.get_identifier32().get_compact() - m_firstFEBid) >> m_FEBShift);
43 }

◆ initialized()

bool LArBadChanFEBHasher::initialized ( ) const
inline

Definition at line 57 of file LArBadChanFEBHasher.h.

57{return ((m_onlineID != 0) && (m_maxHash != 0));}

◆ maxChannel()

unsigned int LArBadChanFEBHasher::maxChannel ( ) const
inline

Definition at line 55 of file LArBadChanFEBHasher.h.

55{return 128;} // max # of channels per FEB

◆ maxFEBHash()

unsigned int LArBadChanFEBHasher::maxFEBHash ( ) const
inline

Definition at line 54 of file LArBadChanFEBHasher.h.

54{ return m_maxFEBHash;}

◆ maxHash()

unsigned int LArBadChanFEBHasher::maxHash ( ) const
inline

Definition at line 53 of file LArBadChanFEBHasher.h.

53{ return m_maxHash;}

Member Data Documentation

◆ m_FEBShift

unsigned int LArBadChanFEBHasher::m_FEBShift
private

Definition at line 63 of file LArBadChanFEBHasher.h.

◆ m_firstFEBid

unsigned int LArBadChanFEBHasher::m_firstFEBid
private

Definition at line 61 of file LArBadChanFEBHasher.h.

◆ m_maxFEBHash

unsigned int LArBadChanFEBHasher::m_maxFEBHash
private

Definition at line 65 of file LArBadChanFEBHasher.h.

◆ m_maxHash

unsigned int LArBadChanFEBHasher::m_maxHash
private

Definition at line 64 of file LArBadChanFEBHasher.h.

◆ m_onlineID

const LArOnlineID* LArBadChanFEBHasher::m_onlineID
private

Definition at line 66 of file LArBadChanFEBHasher.h.

◆ m_shift

unsigned int LArBadChanFEBHasher::m_shift
private

Definition at line 62 of file LArBadChanFEBHasher.h.


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