ATLAS Offline Software
CaloCell_Base_ID.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id$
16 
17 
19  const LArHEC_Base_ID* hec_id,
20  const LArFCAL_Base_ID* fcal_id,
21  const LArMiniFCAL_ID* minifcal_id,
22  const Tile_Base_ID* tile_id,
23  bool supercell)
24  : m_emHelper(em_id),
25  m_hecHelper(hec_id),
26  m_fcalHelper(fcal_id),
27  m_minifcalHelper(minifcal_id),
28  m_tileHelper(tile_id),
29  m_cell_hash_max(0),
30  m_region_hash_max(0),
31  m_caloNeighbours (nullptr),
32  m_supercell(supercell ? 1 : 0)
33 {
34  m_helpers[LAREM] = em_id;
35  m_helpers[LARHEC] = hec_id;
36  m_helpers[LARFCAL] = fcal_id;
37  m_helpers[TILE] = tile_id;
38  m_helpers[LARMINIFCAL] = minifcal_id;
39 
40  for (int i=0; i < NSUBCALO; i++) {
41  if (i == 0) {
42  m_cell_min[i] = 0;
43  m_reg_min[i] = 0;
44  }
45  else {
46  m_cell_min[i] = m_cell_max[i-1];
47  m_reg_min[i] = m_reg_max[i-1];
48  }
49 
52  }
53 
56 
57  // count number of helpers with enabled neighbors and instantiate
58  // super neighbors in case this is more than 1
59 
60  int nNeigh(0);
61 
62  if ( m_emHelper->do_neighbours() ) nNeigh++;
63  if ( m_hecHelper->do_neighbours() ) nNeigh++;
64  if ( m_fcalHelper->do_neighbours() ) nNeigh++;
65  if ( m_minifcalHelper->do_neighbours() ) nNeigh++;
66  if ( m_tileHelper->do_neighbours() ) nNeigh++;
67 
68  if ( nNeigh > 1 ) {
70  }
71 }
72 
73 
75 {
76  if ( m_caloNeighbours ) delete m_caloNeighbours;
77 }
78 
79 
81 {
82 
83  MsgStream log(m_msgSvc, "CaloCell_Base_ID");
84  if(m_msgSvc)log << MSG::DEBUG << "Initialize" << endmsg;
85 
86  // Check whether this helper should be reinitialized
87  if (!reinitialize(dict_mgr)) {
88  if(m_msgSvc)log << MSG::DEBUG << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
89  return (0);
90  }
91  else {
92  if(m_msgSvc)log << MSG::DEBUG << "(Re)initialize" << endmsg;
93  }
94 
95  // init base object
96  if(AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return (1);
97 
98  // Register version of the different dictionaries
99  if (register_dict_tag(dict_mgr, "LArCalorimeter")) return(1);
100  if (register_dict_tag(dict_mgr, "TileCalorimeter")) return(1);
101 
102  //
103  // ... initialize cell / region vectors
104  //
105  m_region_vec.clear();
107 
108  m_cell_vec.clear();
109  m_cell_vec.reserve(m_cell_hash_max);
110 
111  for (int i=0; i < NSUBCALO; i++) {
112  m_region_vec.insert (m_region_vec.end(),
113  m_helpers[i]->regions().begin(),
114  m_helpers[i]->regions().end());
115  m_cell_vec.insert (m_cell_vec.end(),
116  m_helpers[i]->channels().begin(),
117  m_helpers[i]->channels().end());
118  }
119  assert (m_region_vec.size() == m_region_hash_max);
120  assert (m_cell_vec.size() == m_cell_hash_max);
121 
122  // initialize CaloCell neighbours
123  if(m_caloNeighbours) {
124  std::string neighbourFile;
125  if ( !m_supercell ) {
126  neighbourFile = dict_mgr.find_metadata("FULLATLASNEIGHBORS");
127  }
128  else {
129  // use this file name for Super Cells - should be replaced by db tag ...
130  neighbourFile = "SuperCaloNeighborsSuperCells-April2014.dat";
131  }
132  if (neighbourFile.empty()) throw std::runtime_error("CaloCell_ID: Cannot find the CaloNeighbour file name");
133  if(m_msgSvc)log << MSG::DEBUG << "Initializing Super3D Neighbors from file " << neighbourFile << endmsg;
134  m_caloNeighbours->initialize(this, neighbourFile);
135  }
136 
137  return 0;
138 }
139 
140 
142 {
143  int calo_sampl = (int) Unknown;
144 
145  if(m_emHelper->is_em_barrel(id)) {
146  calo_sampl = m_emHelper->sampling(id)+(int)PreSamplerB;
147  }
148  else if (m_emHelper->is_em_endcap_outer(id)) {
149  calo_sampl = m_emHelper->sampling(id)+(int)PreSamplerE;
150  }
151  else if (m_emHelper->is_em_endcap_inner(id)) {
152  calo_sampl = m_emHelper->sampling(id)+(int)EME1;
153  }
154 
155  else if(m_hecHelper->is_lar_hec(id)) {
156  calo_sampl = m_hecHelper->sampling(id) + (int) HEC0;
157  }
158 
159  else if(m_minifcalHelper->is_lar_minifcal(id)) {
160  // must do minifcal before fcal because miniFCAL IS FCAL
161  calo_sampl = m_minifcalHelper->depth(id) - 1 + (int) MINIFCAL0;
162  }
163  else if(m_fcalHelper->is_lar_fcal(id)) {
164  calo_sampl = m_fcalHelper->module(id) - 1 + (int) FCAL0;
165  }
166 
167  else if (m_tileHelper->is_tile_barrel( id )) {
168  calo_sampl = TileBar0 + m_tileHelper->sample(id);
169  }
170 
171  else if (m_tileHelper->is_tile_extbarrel( id )) {
172  calo_sampl = TileExt0 + m_tileHelper->sample(id);
173  }
174 
175  else if (m_tileHelper->is_tile_gap( id )) {
176  calo_sampl = TileGap1 - 1 + m_tileHelper->sample(id);
177  }
178 
179  return calo_sampl;
180 }
181 
183 {
184  Identifier id = cell_id (caloHash);
185  return calo_sample(id);
186 }
187 
188 
189 int
191  const LArNeighbours::neighbourOption& option,
192  std::vector<IdentifierHash>& neighbourList) const
193 {
194  int result = 1;
195 
196  int subCalo = NOT_VALID;
197  IdentifierHash subHash = subcalo_cell_hash (caloHashId, subCalo);
198 
199  switch (subCalo) {
200  case LAREM:
201  em_idHelper()->get_neighbours(subHash, option, neighbourList);
202  break;
203 
204  case LARHEC:
205  hec_idHelper()->get_neighbours(subHash, option, neighbourList);
206  break;
207 
208  case LARFCAL:
209  fcal_idHelper()->get_neighbours(subHash, option, neighbourList);
210  break;
211 
212  case TILE:
213  tile_idHelper()->get_neighbours(subHash, option, neighbourList);
214  break;
215 
216  case LARMINIFCAL:
217  minifcal_idHelper()->get_neighbours(subHash, option, neighbourList);
218  break;
219 
220  default:
221  neighbourList.resize(0);
222  return result;
223  }
224 
225  unsigned int shift = caloHashId - subHash;
226  int neighbourIndex = neighbourList.size();
227 
228  if (neighbourIndex > 0) {
229  if (shift != 0) {
230  for (int iN = 0 ; iN <neighbourIndex ; ++iN) {
231  neighbourList[iN] += shift;
232  }
233  }
234  result = 0 ;
235  }
236 
237  if ( m_caloNeighbours ) {
238  if ( (option & LArNeighbours::prevSuperCalo) ){
239  result = m_caloNeighbours->get_prevInCalo(caloHashId,neighbourList);
240  if ( result != 0 )
241  return result;
242  }
243 
244  if ( (option & LArNeighbours::nextSuperCalo) ){
245  result = m_caloNeighbours->get_nextInCalo(caloHashId,neighbourList);
246  if ( result != 0 )
247  return result;
248  }
249  }
250 
251  return result;
252 }
253 
254 std::string CaloCell_Base_ID::cell_name(const Identifier id) const {
255  std::ostringstream s1;
257  s1 << (this->pos_neg(id) == 0 ? "/C-SIDE" : "/A-SIDE");
258  if (this->is_tile(id)) {
259  s1 << "/SECTION " << this->section(id) << "/SIDE " << this->side(id)
260  << "/MODULE " << this->module(id) << "/TOWER " << this->tower(id)
261  << "/SAMPLE " << this->sample(id);
262 
263  } else {
264  s1 << "/REGION " << this->region(id) << "/IETA " << this->eta(id)
265  << "/iPHI " << this->phi(id);
266  }
267  return s1.str();
268 }
LArNeighbours::nextSuperCalo
@ nextSuperCalo
Definition: LArNeighbours.h:28
LArNeighbours::neighbourOption
neighbourOption
Definition: LArNeighbours.h:12
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
LArFCAL_Base_ID
Definition: LArFCAL_Base_ID.h:19
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:320
get_generator_info.result
result
Definition: get_generator_info.py:21
CaloCell_Base_ID::region
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
CaloNeighbours::initialize
int initialize(const CaloCell_Base_ID *caloID, const std::string &filename)
Definition: CaloNeighbours.cxx:295
CaloCell_Base_ID::tower
int tower(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
AtlasDetectorID::is_lar_fcal
bool is_lar_fcal(Identifier id) const
Definition: AtlasDetectorID.h:839
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloIDHelper::HashGroup::end
id_iterator end() const
Return an end iterator over the group's Identifiers.
LArHEC_Base_ID
This class factors out code common between LArEM_ID and LArEM_SuperCell_ID.
Definition: LArHEC_Base_ID.h:44
LArEM_Base_ID
This class factors out code common between LArEM_ID and LArEM_SuperCell_ID.
Definition: LArEM_Base_ID.h:38
Tile_Base_ID::is_tile_gap
bool is_tile_gap(const Identifier &id) const
Definition: Tile_Base_ID.cxx:223
LArEM_Base_ID::is_em_endcap_outer
bool is_em_endcap_outer(const Identifier id) const
test if the id belongs to the EM Endcap outer wheel
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_Base_ID::LARMINIFCAL
@ LARMINIFCAL
Definition: CaloCell_Base_ID.h:46
CaloCell_Base_ID::pos_neg
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
CaloCell_Base_ID::cell_name
std::string cell_name(const Identifier id) const
Returns the cell-location in a human readable form.
Definition: CaloCell_Base_ID.cxx:254
CaloCell_Base_ID::m_cell_max
size_type m_cell_max[NSUBCALO]
Definition: CaloCell_Base_ID.h:394
Tile_Base_ID::sample
int sample(const Identifier &id) const
Definition: Tile_Base_ID.cxx:171
CaloCell_Base_ID::m_cell_min
size_type m_cell_min[NSUBCALO]
Definition: CaloCell_Base_ID.h:393
CaloIDHelper::HashGroup::begin
id_iterator begin() const
Return a begin iterator over the group's Identifiers.
LArFCAL_Base_ID::module
int module(const Identifier id) const
module [1,3]
LArMiniFCAL_ID::depth
int depth(const Identifier id) const
depth [0,3]
Definition: LArMiniFCAL_ID.h:502
Tile_Base_ID::is_tile_extbarrel
bool is_tile_extbarrel(const Identifier &id) const
Definition: Tile_Base_ID.cxx:214
LArEM_Base_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:368
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
IdDictMgr::find_metadata
const std::string & find_metadata(const std::string &name) const
Access to meta data, name/value pairs.
Definition: IdDictMgr.cxx:133
CaloNeighbours::get_nextInCalo
int get_nextInCalo(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: CaloNeighbours.cxx:449
CaloCell_Base_ID::calo_sample
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
Definition: CaloCell_Base_ID.cxx:141
LArFCAL_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = all2D,...
Definition: LArFCAL_Base_ID.cxx:537
CaloCell_Base_ID::is_tile
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
CaloCell_Base_ID::module
int module(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
AtlasDetectorID::do_neighbours
virtual bool do_neighbours(void) const override
Neighbour initialization is performed by default One can switch or query this mode for any idHelper w...
Definition: AtlasDetectorID.cxx:738
CaloIDHelper::regions
const HashGroup & regions() const
Return the HashGroup for regions.
CaloCell_Base_ID::fcal_idHelper
const LArFCAL_Base_ID * fcal_idHelper() const
access to FCAL idHelper
Definition: CaloCell_Base_ID.h:343
CaloCell_Base_ID::m_region_hash_max
size_type m_region_hash_max
Definition: CaloCell_Base_ID.h:392
CaloCell_Base_ID::em_idHelper
const LArEM_Base_ID * em_idHelper() const
access to EM idHelper
Definition: CaloCell_Base_ID.h:332
IdDictMgr
Definition: IdDictDefs.h:32
CaloCell_Base_ID::m_helpers
const CaloIDHelper * m_helpers[NSUBCALO]
Definition: CaloCell_Base_ID.h:389
CaloCell_Base_ID::m_cell_hash_max
size_type m_cell_hash_max
Definition: CaloCell_Base_ID.h:391
CaloCell_Base_ID::sample
int sample(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloNeighbours
Definition: CaloNeighbours.h:93
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
LArHEC_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = prevInPhi,...
Definition: LArHEC_Base_ID.cxx:701
CaloNeighbours.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
CaloCell_Base_ID::m_minifcalHelper
const LArMiniFCAL_ID * m_minifcalHelper
Definition: CaloCell_Base_ID.h:387
Tile_Base_ID
This class factors out code common between TileID and Tile_SuperCell_ID.
Definition: Tile_Base_ID.h:39
CaloCell_Base_ID.h
Helper base class for offline cell identifiers.
CaloCell_Base_ID::m_caloNeighbours
CaloNeighbours * m_caloNeighbours
Definition: CaloCell_Base_ID.h:405
CaloCell_Base_ID::eta
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
LArNeighbours::prevSuperCalo
@ prevSuperCalo
Definition: LArNeighbours.h:27
CaloCell_Base_ID::subcalo_cell_hash
IdentifierHash subcalo_cell_hash(const Identifier cellId, int &subCalo) const
create hash id from 'global' cell id
CaloCell_Base_ID::minifcal_idHelper
const LArMiniFCAL_ID * minifcal_idHelper() const
access to MiniFCAL idHelper
Definition: CaloCell_Base_ID.h:349
AtlasDetectorID::is_lar_hec
bool is_lar_hec(Identifier id) const
Definition: AtlasDetectorID.h:829
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
CaloCell_Base_ID::m_hecHelper
const LArHEC_Base_ID * m_hecHelper
Definition: CaloCell_Base_ID.h:385
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
CaloCell_Base_ID::m_fcalHelper
const LArFCAL_Base_ID * m_fcalHelper
Definition: CaloCell_Base_ID.h:386
CaloCell_Base_ID::m_reg_max
size_type m_reg_max[NSUBCALO]
Definition: CaloCell_Base_ID.h:396
AtlasDetectorID::register_dict_tag
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
Definition: AtlasDetectorID.cxx:266
CaloCell_Base_ID::CaloCell_Base_ID
CaloCell_Base_ID(const LArEM_Base_ID *em_id, const LArHEC_Base_ID *hec_id, const LArFCAL_Base_ID *fcal_id, const LArMiniFCAL_ID *minifcal_id, const Tile_Base_ID *tile_id, bool supercell)
enumeration of samplings (i.e.layers) separately for various sub calorimeters
Definition: CaloCell_Base_ID.cxx:18
CaloCell_Base_ID::m_supercell
unsigned m_supercell
Definition: CaloCell_Base_ID.h:407
AtlasDetectorID::is_lar_minifcal
bool is_lar_minifcal(Identifier id) const
Definition: AtlasDetectorID.h:849
LArEM_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = prevInPhi,...
Definition: LArEM_Base_ID.cxx:696
CaloCell_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash caloHash, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found
Definition: CaloCell_Base_ID.cxx:190
CaloCell_Base_ID::m_cell_vec
std::vector< Identifier > m_cell_vec
Definition: CaloCell_Base_ID.h:397
CaloCell_Base_ID::phi
int phi(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
Tile_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash &id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = prevInPhi,...
Definition: Tile_Base_ID.cxx:1786
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,...
LArEM_Base_ID::is_em_endcap_inner
bool is_em_endcap_inner(const Identifier id) const
test if the id belongs to the EM Endcap inner wheel
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
CaloIDHelper::channels
const HashGroup & channels() const
Return the HashGroup for channels (cells).
LArMiniFCAL_ID::get_neighbours
int get_neighbours(const IdentifierHash id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = all2D,...
Definition: LArMiniFCAL_ID.cxx:139
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:284
CaloCell_Base_ID::side
int side(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
LArEM_Base_ID::is_em_barrel
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
LArMiniFCAL_ID
Helper class for LArMiniFCAL offline identifiers.
Definition: LArMiniFCAL_ID.h:57
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
DEBUG
#define DEBUG
Definition: page_access.h:11
LArHEC_Base_ID::sampling
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CaloCell_Base_ID::m_tileHelper
const Tile_Base_ID * m_tileHelper
Definition: CaloCell_Base_ID.h:388
CaloCell_Base_ID::m_reg_min
size_type m_reg_min[NSUBCALO]
Definition: CaloCell_Base_ID.h:395
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
CaloSampling::getSamplingName
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
Definition: Calorimeter/CaloGeoHelpers/Root/CaloSampling.cxx:18
CaloCell_Base_ID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: CaloCell_Base_ID.cxx:80
CaloCell_Base_ID::~CaloCell_Base_ID
~CaloCell_Base_ID()
Definition: CaloCell_Base_ID.cxx:74
IdentifierHash
Definition: IdentifierHash.h:38
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
Tile_Base_ID::is_tile_barrel
bool is_tile_barrel(const Identifier &id) const
Test of an Identifier to see if it belongs to a particular part of the calorimeter.
Definition: Tile_Base_ID.cxx:205
CaloCell_Base_ID::NOT_VALID
@ NOT_VALID
Definition: CaloCell_Base_ID.h:46
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
CaloCell_Base_ID::tile_idHelper
const Tile_Base_ID * tile_idHelper() const
access to Tile idHelper
Definition: CaloCell_Base_ID.h:355
CaloNeighbours::get_prevInCalo
int get_prevInCalo(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: CaloNeighbours.cxx:456
CaloCell_Base_ID::m_region_vec
std::vector< Identifier > m_region_vec
Definition: CaloCell_Base_ID.h:398
CaloCell_Base_ID::m_emHelper
const LArEM_Base_ID * m_emHelper
Definition: CaloCell_Base_ID.h:384
CaloCell_Base_ID::section
int section(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
CaloCell_Base_ID::hec_idHelper
const LArHEC_Base_ID * hec_idHelper() const
access to HEC idHelper
Definition: CaloCell_Base_ID.h:337
CaloIDHelper::HashGroup::hash_max
size_type hash_max() const
Return one more than the largest hash code.