ATLAS Offline Software
Loading...
Searching...
No Matches
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;
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}
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
void calo_cell_hash_range(const Identifier id, IdentifierHash &caloCellMin, IdentifierHash &caloCellMax) const
to loop on 'global' cell hashes of one sub-calorimeter alone
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
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,...
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
std::map< SYSTEM, IdentifierHash > m_hashOffsets
CaloNoiseHashRanges()=delete
This is a "hash" representation of an Identifier.