ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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.

13  : m_firstFEBid(0), m_shift(0), m_FEBShift(0),
14  m_maxHash(0), m_maxFEBHash(0), m_onlineID(0) {}

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

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  }

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

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

◆ 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:
LArBadChanFEBHasher::hash
unsigned int hash(const HWIdentifier &FEBid, int chan) const
Definition: LArBadChanFEBHasher.h:28
LArBadChanFEBHasher::maxChannel
unsigned int maxChannel() const
Definition: LArBadChanFEBHasher.h:55
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
LArBadChanFEBHasher::m_maxHash
unsigned int m_maxHash
Definition: LArBadChanFEBHasher.h:64
LArOnlineID_Base::channel
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
Definition: LArOnlineID_Base.cxx:1963
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LArBadChanFEBHasher::m_onlineID
const LArOnlineID * m_onlineID
Definition: LArBadChanFEBHasher.h:66
LArBadChanFEBHasher::m_maxFEBHash
unsigned int m_maxFEBHash
Definition: LArBadChanFEBHasher.h:65
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1479
LArBadChanFEBHasher::m_firstFEBid
unsigned int m_firstFEBid
Definition: LArBadChanFEBHasher.h:61
LArBadChanFEBHasher::hashFEB
unsigned int hashFEB(const HWIdentifier &FEBid) const
Definition: LArBadChanFEBHasher.h:41
LArBadChanFEBHasher::m_FEBShift
unsigned int m_FEBShift
Definition: LArBadChanFEBHasher.h:63
LArBadChanFEBHasher::m_shift
unsigned int m_shift
Definition: LArBadChanFEBHasher.h:62