ATLAS Offline Software
CaloNoiseHashRanges.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
6 
7 #include <array>
8 
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;
33  m_hashOffsets[HEC]=from;
34 
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::EMBZNEG
@ EMBZNEG
Definition: CaloNoiseHashRanges.h:37
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
CaloCell_Base_ID::is_em_endcap
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
CaloNoiseHashRanges::EMBZPOS
@ EMBZPOS
Definition: CaloNoiseHashRanges.h:38
CaloCell_Base_ID::pos_neg
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
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
CaloCell_ID.h
CaloNoiseHashRanges::TILE
@ TILE
Definition: CaloNoiseHashRanges.h:42
CaloNoiseHashRanges::EMECZNEG
@ EMECZNEG
Definition: CaloNoiseHashRanges.h:36
CaloCell_Base_ID::calo_cell_hash_range
void calo_cell_hash_range(const Identifier id, IdentifierHash &caloCellMin, IdentifierHash &caloCellMax) const
to loop on 'global' cell hashes of one sub-calorimeter alone
CaloNoiseHashRanges.h
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
CaloNoiseHashRanges::FCAL
@ FCAL
Definition: CaloNoiseHashRanges.h:41
CaloNoiseHashRanges::HEC
@ HEC
Definition: CaloNoiseHashRanges.h:40
WriteCellNoiseToCool.cellHash
cellHash
Definition: WriteCellNoiseToCool.py:433
CaloNoiseHashRanges::CaloNoiseHashRanges
CaloNoiseHashRanges()=delete
CaloCell_Base_ID::is_em_barrel
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
CaloNoiseHashRanges::m_maxTileCells
std::size_t m_maxTileCells
Definition: CaloNoiseHashRanges.h:58
CaloCell_Base_ID::cell_id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
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