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

Helper to calculate hash offsets in each COOL channel. More...

#include <CaloNoiseHashRanges.h>

Collaboration diagram for CaloNoiseHashRanges:

Public Types

enum  SYSTEM {
  EMECZNEG = 0, EMBZNEG = 1, EMBZPOS = 2, EMECZPOS = 3,
  HEC =16, FCAL =32, TILE =48
}
 

Public Member Functions

 CaloNoiseHashRanges ()=delete
 
 CaloNoiseHashRanges (const CaloCell_ID *cellId)
 Constructor. More...
 
 ~CaloNoiseHashRanges ()=default
 
const std::map< SYSTEM, IdentifierHash > & hashOffsets () const
 Return a map of cool-channel and hash-offset. More...
 
std::size_t maxLArCells () const
 Return the number of LAr cells. More...
 
std::size_t maxTileCells () const
 Return the number of Tile cells. More...
 

Private Attributes

std::map< SYSTEM, IdentifierHashm_hashOffsets
 
std::size_t m_maxLArCells
 
std::size_t m_maxTileCells
 

Detailed Description

Helper to calculate hash offsets in each COOL channel.

Definition at line 18 of file CaloNoiseHashRanges.h.

Member Enumeration Documentation

◆ SYSTEM

Enumerator
EMECZNEG 
EMBZNEG 
EMBZPOS 
EMECZPOS 
HEC 
FCAL 
TILE 

Definition at line 36 of file CaloNoiseHashRanges.h.

36  {EMECZNEG = 0,
37  EMBZNEG = 1,
38  EMBZPOS = 2,
39  EMECZPOS = 3,
40  HEC =16,
41  FCAL =32,
42  TILE =48};

Constructor & Destructor Documentation

◆ CaloNoiseHashRanges() [1/2]

CaloNoiseHashRanges::CaloNoiseHashRanges ( )
delete

◆ CaloNoiseHashRanges() [2/2]

CaloNoiseHashRanges::CaloNoiseHashRanges ( const CaloCell_ID cellId)

Constructor.

Parameters
cellIdCaloCell_ID pointer to a CaloCell_ID object

Initializes the hash ranges

Definition at line 9 of file CaloNoiseHashRanges.cxx.

9  {
10 
11  std::array<IdentifierHash,4> emHashRanges {IdentifierHash(),IdentifierHash(),IdentifierHash(),IdentifierHash()};
12  IdentifierHash emHashBegin, emHashEnd;
13  caloCellID->calo_cell_hash_range(CaloCell_ID::LAREM, emHashBegin, emHashEnd);
14  for (IdentifierHash cellHash=emHashBegin;cellHash != emHashEnd; cellHash+=1) {
15  const Identifier id = caloCellID->cell_id(cellHash);
16  int sys = 0;
17  if ( caloCellID->is_em_barrel(id)) {
18  sys = ( caloCellID->pos_neg(id) > 0) ? EMBZPOS : EMBZNEG;
19  } else if ( caloCellID->is_em_endcap(id)) {
20  sys = ( caloCellID->pos_neg(id) > 0) ? EMECZPOS : EMECZNEG;
21  }
22  if (!emHashRanges[sys].is_valid())
23  emHashRanges[sys]=cellHash;
24  }
25 
26  m_hashOffsets[EMECZNEG]=emHashRanges[EMECZNEG];
27  m_hashOffsets[EMBZNEG]=emHashRanges[EMBZNEG];
28  m_hashOffsets[EMBZPOS]=emHashRanges[EMBZPOS];
29  m_hashOffsets[EMECZPOS]=emHashRanges[EMECZPOS];
30 
31  IdentifierHash from, to;
32  caloCellID->calo_cell_hash_range(CaloCell_ID::LARHEC,from,to);
33  m_hashOffsets[HEC]=from;
34 
35  caloCellID->calo_cell_hash_range(CaloCell_ID::LARFCAL,from,to);
36  m_hashOffsets[FCAL]=from;
38 
39  caloCellID->calo_cell_hash_range(CaloCell_ID::TILE,from,to);
40  m_hashOffsets[TILE]=from;
41  m_maxTileCells=to-from;
42 }

◆ ~CaloNoiseHashRanges()

CaloNoiseHashRanges::~CaloNoiseHashRanges ( )
default

Member Function Documentation

◆ hashOffsets()

const std::map<SYSTEM,IdentifierHash>& CaloNoiseHashRanges::hashOffsets ( ) const
inline

Return a map of cool-channel and hash-offset.

Definition at line 48 of file CaloNoiseHashRanges.h.

48 {return m_hashOffsets;}

◆ maxLArCells()

std::size_t CaloNoiseHashRanges::maxLArCells ( ) const
inline

Return the number of LAr cells.

Definition at line 50 of file CaloNoiseHashRanges.h.

50 {return m_maxLArCells;}

◆ maxTileCells()

std::size_t CaloNoiseHashRanges::maxTileCells ( ) const
inline

Return the number of Tile cells.

Definition at line 52 of file CaloNoiseHashRanges.h.

52 {return m_maxTileCells;}

Member Data Documentation

◆ m_hashOffsets

std::map<SYSTEM,IdentifierHash> CaloNoiseHashRanges::m_hashOffsets
private

Definition at line 56 of file CaloNoiseHashRanges.h.

◆ m_maxLArCells

std::size_t CaloNoiseHashRanges::m_maxLArCells
private

Definition at line 57 of file CaloNoiseHashRanges.h.

◆ m_maxTileCells

std::size_t CaloNoiseHashRanges::m_maxTileCells
private

Definition at line 58 of file CaloNoiseHashRanges.h.


The documentation for this class was generated from the following files:
CaloNoiseHashRanges::EMBZNEG
@ EMBZNEG
Definition: CaloNoiseHashRanges.h:37
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
CaloNoiseHashRanges::EMBZPOS
@ EMBZPOS
Definition: CaloNoiseHashRanges.h:38
CaloNoiseHashRanges::m_maxLArCells
std::size_t m_maxLArCells
Definition: CaloNoiseHashRanges.h:57
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CaloNoiseHashRanges::TILE
@ TILE
Definition: CaloNoiseHashRanges.h:42
CaloNoiseHashRanges::EMECZNEG
@ EMECZNEG
Definition: CaloNoiseHashRanges.h:36
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
CaloNoiseHashRanges::FCAL
@ FCAL
Definition: CaloNoiseHashRanges.h:41
CaloNoiseHashRanges::HEC
@ HEC
Definition: CaloNoiseHashRanges.h:40
WriteCellNoiseToCool.cellHash
cellHash
Definition: WriteCellNoiseToCool.py:433
CaloNoiseHashRanges::m_maxTileCells
std::size_t m_maxTileCells
Definition: CaloNoiseHashRanges.h:58
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
CaloNoiseHashRanges::EMECZPOS
@ EMECZPOS
Definition: CaloNoiseHashRanges.h:39
CaloNoiseHashRanges::m_hashOffsets
std::map< SYSTEM, IdentifierHash > m_hashOffsets
Definition: CaloNoiseHashRanges.h:56
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
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
Identifier
Definition: IdentifierFieldParser.cxx:14