ATLAS Offline Software
Loading...
Searching...
No Matches
LArHEC_Base_ID.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
10
11
15#include "IdDict/IdDictField.h"
16#include "IdDict/IdDictMgr.h"
17#include "IdDict/IdDictRegion.h"
20#include "LArHEC_region.h"
22
23#include <cmath>
24#include <set>
25#include <string>
26
27
29 const std::string& group,
30 bool supercell) :
32 , m_slar (supercell ? 1 : 0)
34 , m_LAR_INDEX(999)
35 , m_HEC_INDEX(999)
36 , m_POSNEG_INDEX(999)
37 , m_SAMPLING_INDEX(999)
38 , m_REGION_INDEX(999)
39 , m_ETA_INDEX(999)
40 , m_PHI_INDEX(999)
41 , m_SLAR_INDEX(999)
43{
44}
45
47{
48 std::vector<LArHEC_region*>::iterator first = m_vecOfRegions.begin();
49 std::vector<LArHEC_region*>::iterator last = m_vecOfRegions.end();
50 for (; first != last; ++first) delete (*first);
51}
52
54 int eta, int phi ) const
55{
56 // must calculate region number and shift eta
57 int region=999;
58 if ( 0 <= eta && eta < 10 ) { region = 0;}
59 else if ( 10 <= eta && eta < 14 ) { region = 1; eta -= 10;}
60
61 return (channel_id (pos_neg, sampling, region, eta, phi));
62}
63
64
66 int eta, int phi_sector ) const
67{
68 int phi = ( region == 0 ? sector*2 + phi_sector : sector );
69 return (channel_id (pos_neg, sampling, region, eta, phi ));
70}
71
72int LArHEC_Base_ID::eta_min(const Identifier regId) const
73{
75 IdContext region_cntxt = region_context();
76 if(!get_expanded_id(regId, expId, &region_cntxt)) {
77 int result = -999;
78 for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
79 const Range& range = m_full_channel_range[i];
80 if (range.match(expId)) {
81 const Range::field& eta_field = range[m_ETA_INDEX];
82 if (not eta_field.empty()) {
83 int etamin = eta_field.get_minimum();
84 if (-999 == result) {
85 result = etamin;
86 }
87 else {
88 if (etamin < result) result = etamin;
89 }
90 }
91 }
92 }
93 return (result);
94 }
95 return (-999);
96}
97
98int LArHEC_Base_ID::eta_max(const Identifier regId) const
99{
100 ExpandedIdentifier expId;
101 IdContext region_cntxt = region_context();
102 if(!get_expanded_id(regId, expId, &region_cntxt)) {
103 int result = -999;
104 for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
105 const Range& range = m_full_channel_range[i];
106 if (range.match(expId)) {
107 const Range::field& eta_field = range[m_ETA_INDEX];
108 if (not eta_field.empty()) {
109 int etamax = eta_field.get_maximum();
110 if (result < etamax) result = etamax;
111 }
112 }
113 }
114 return (result);
115 }
116 return (-999); // default
117}
118
120{
121 ExpandedIdentifier expId;
122 IdContext region_cntxt = region_context();
123 if(!get_expanded_id(regId, expId, &region_cntxt)) {
124 int result = -999;
125 for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
126 const Range& range = m_full_channel_range[i];
127 if (range.match(expId)) {
128 const Range::field& phi_field = range[m_PHI_INDEX];
129 if (not phi_field.empty()) {
130 int phimin = phi_field.get_minimum();
131 if (-999 == result) {
132 result = phimin;
133 }
134 else {
135 if (phimin < result) result = phimin;
136 }
137 }
138 }
139 }
140 return (result);
141 }
142 return (-999); // default
143}
144
146{
147 ExpandedIdentifier expId;
148 IdContext region_cntxt = region_context();
149 if(!get_expanded_id(regId, expId, &region_cntxt)) {
150 int result = -999;
151 for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
152 const Range& range = m_full_channel_range[i];
153 if (range.match(expId)) {
154 const Range::field& phi_field = range[m_PHI_INDEX];
155 if (not phi_field.empty()) {
156 int phimax = phi_field.get_maximum();
157 if (result < phimax) result = phimax;
158 }
159 }
160 }
161 return (result);
162 }
163 return (-999); // default
164}
165
167 const std::string& group_name)
168/*===================================================================*/
169{
170 ATH_MSG_DEBUG("initialize_base_from_dictionary");
171
172 // Check whether this helper should be reinitialized
173 if (!reinitialize(dict_mgr)) {
174 ATH_MSG_DEBUG("Request to reinitialize not satisfied - tags have not changed");
175 return (0);
176 }
177 else {
178 ATH_MSG_DEBUG("(Re)initialize");
179 }
180
181 // init base object
182 if(CaloIDHelper::initialize_base_from_dictionary(dict_mgr,
183 "LArCalorimeter"))
184 return (1);
185
186 // initialize dictionary version
187 AtlasDetectorID::setDictVersion(dict_mgr, "LArCalorimeter");
188
189 // Initialize the field indices
190 if(initLevelsFromDict(group_name)) {
191 ATH_MSG_WARNING(" initialize_base_from_dict - cannot initialize HEC part of LArCalorimeter dictionary ");
192 // return (1); // to allow TB dictionary (no HEC in H8)
193 }
194 else {
195 // Find value for the field LAr Calorimeter
196 const IdDictDictionary* atlasDict = dict_mgr.find_dictionary ("ATLAS");
197 int larField = -1;
198 if (atlasDict->get_label_value("subdet", "LArCalorimeter", larField)) {
199 ATH_MSG_ERROR("Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary " << atlasDict->name());
200 return (1);
201 }
202
203 // Find value for the field LArHEC
204 int larHecField = -1;
205 if (dict()->get_label_value("part", "LArHEC", larHecField)) {
206 ATH_MSG_ERROR("Could not get value for label 'LArHEC' of field 'part' in dictionary " << atlasDict->name());
207 return (1);
208 }
209
210 // Set up id for region and range prefix
211 ExpandedIdentifier exp_region_id;
212 exp_region_id.add(larField);
213 exp_region_id.add(larHecField);
214 Range prefix;
215 m_full_channel_range = dict()->build_multirange(exp_region_id, group_name, prefix);
216 m_full_region_range = dict()->build_multirange(exp_region_id, group_name, prefix, "region");
217
218 ATH_MSG_DEBUG("initialize_from_dict : ");
219 ATH_MSG_DEBUG(" channel range -> " << (std::string)m_full_channel_range);
220 ATH_MSG_DEBUG(" region range -> " << (std::string)m_full_region_range);
221
222 // initilize m_two_sym_sides
223 m_two_sym_sides = ( dictionaryVersion() == "fullAtlas" );
224
225 // Setup the hash tables
226 if(init_hashes()) return (1);
227
228 // initialize dictionary regions
229 if (fill_vec_of_dict_regions (group_name)) return 1;
230
232 for (unsigned int i = 0; i < region_hash_max(); ++i) {
233 Identifier regId = region_id(i);
234 m_vecOfPhiMin[i] = phi_min_init(regId);
235 }
236
237 // Setup for hash calculation
238 // The regions have uniform eta/phi granularity.
239 // The lookup table only needs to contain the
240 // hash offset for each region, the first eta index
241 // and the number of phi cells.
242
243 // The implementation requires:
244
245 // 1) a lookup table for each region containing hash offset,
246 // etamin and nphi
247 // 2) a decoder to access the "index" corresponding to the
248 // pn/samp/reg fields. These fields use 4 bits, so the
249 // vector has a length of 16 for 16 regions.
250
251 // Create decoder for fields pn to region
253 m_pn_impl.bits() +
254 m_sampling_impl.bits() +
255 m_region_impl.bits();
256 IdDictFieldImplementation::size_type bits_offset = m_pn_impl.bits_offset();
257 m_pn_reg_impl.set_bits(bits, bits_offset);
258
259 // std::cout << "pn_reg " << m_pn_reg_impl.decode_index() << " "
260 // << (std::string)m_pn_reg_impl.ored_field() << " "
261 // << std::hex << m_pn_reg_impl.mask() << " "
262 // << m_pn_reg_impl.zeroing_mask() << " "
263 // << std::dec << m_pn_reg_impl.shift()
264 // << " " << m_pn_reg_impl.bits() << " " <<m_pn_reg_impl.bits_offset()
265 // << std::endl;
266
267
268 // Set up vector as lookup table for hash calculation.
269 m_hash_calcs.resize(16);
270
271 for (unsigned int i = 0; i < region_hash_max(); ++i) {
272
273 Identifier regId = region_id(i) ;
274 HashCalc hc;
275
276 int etamin = eta_min(regId);
277 if(etamin < 0) {
278 etamin = 0;
279 ATH_MSG_WARNING("setting etamin to 0 because actual value not found for regId " << show_to_string(regId));
280 }
281 int phimin = phi_min(regId);
282 int phimax = phi_max(regId);
283 if(phimin < 0 || phimax < 0) {
284 phimin = phimax = 0;
285 ATH_MSG_WARNING("setting phimin/phimax to 0 because actual value not found for regId " << show_to_string(regId));
286 }
287 Identifier min = channel_id ( regId, etamin, phimin);
289 hc.m_hash = min_hash;
290 hc.m_etamin = etamin;
291 hc.m_phimin = phimin;
292 hc.m_nphi = phimax-phimin+1 ;
293 m_hash_calcs[m_pn_reg_impl.unpack(min)] = hc;
294
295 if (m_pn_reg_impl.unpack(min) > 15) {
296 ATH_MSG_ERROR("min > 15 " << i << m_pn_reg_impl.unpack(min) << show_to_string(min));
297 }
298 }
299
300 // Check hash calculation
301 for (unsigned int i = 0; i < channel_hash_max(); ++i) {
302 Identifier id = channel_id(i);
303 if (channel_hash(id) != i) {
304 ATH_MSG_ERROR("channel ranges, id, hash, i = " << show_to_string(id) << channel_hash(id) << i);
305 }
306 }
307 }
308
309 // Setup hash tables for finding neighbors
310 if(m_do_neighbours) {
311 if(init_neighbors()) return (1);
312 }
313
314 return 0;
315}
316
317
318
320{
321
322 // Check that id is within allowed range
323 // Fill expanded id (initially with 4/2/0/0/0/0/0)
325 expId << pos_neg << sampling << region ;
326
327 if (!m_full_region_range.match(expId)) {
328 std::string errorMessage = "LArHEC_Base_ID::region_id() result is not OK: ID, range = "
329 + std::string(expId) + " , " + (std::string)m_full_region_range;
330 throw LArID_Exception(errorMessage , 7);
331 }
332
333}
334
336 int eta, int phi ) const
337{
338
339 // Check that id is within allowed range
340 // Fill expanded id
342 expId << pos_neg << sampling << region << eta << phi << m_slar ;
343
344 if (!m_full_channel_range.match(expId)) {
345 std::string errorMessage = "LArHEC_Base_ID::channel_id() result is not OK: ID, range = "
346 + std::string(expId) + " , " + (std::string)m_full_channel_range;
347 throw LArID_Exception(errorMessage , 8);
348 }
349}
350
352 int eta, int phi ) const
353{
354
355 // Check that id is within allowed range
356 // Fill expanded id
357 ExpandedIdentifier expId;
358
359 IdContext context = region_context();
360 if (get_expanded_id(regionId, expId, &context)) {
361 std::string errorMessage = "LArHEC_Base_ID::channel_id(regId) result is not OK: ID = "
362 + show_to_string(regionId) ;
363 throw LArID_Exception(errorMessage , 8);
364 }
365
366 expId << eta << phi << m_slar;
367
368 if (!m_full_channel_range.match(expId)) {
369 std::string errorMessage = "LArHEC_Base_ID::channel_id(regId) result is not OK: ID, range = "
370 + std::string(expId) + " , " + (std::string)m_full_channel_range;
371 throw LArID_Exception(errorMessage , 8);
372 }
373}
374
375int LArHEC_Base_ID::get_expanded_id (const Identifier& id, ExpandedIdentifier& exp_id, const IdContext* context) const
376{
377 // We assume that the context is >= region
378 exp_id.clear();
379 exp_id << lar_field_value()
381 << pos_neg(id)
382 << sampling(id)
383 << region(id);
384 if(context && context->end_index() >= m_ETA_INDEX) {
385 exp_id << eta(id);
386 if(context->end_index() >= m_PHI_INDEX) {
387 exp_id << phi(id);
388 if ( context->end_index() >= m_SLAR_INDEX) {
389 exp_id << (unsigned)is_supercell(id);
390 }
391 }
392 }
393 return (0);
394}
395
396int LArHEC_Base_ID::initLevelsFromDict (const std::string& /*group_name*/)
397{
398 if(!dict()) {
399 ATH_MSG_ERROR("initLevelsFromDict - dictionary NOT initialized");
400 return (1);
401 }
402
403 // Find out which identifier field corresponds to each level.
404
405 m_LAR_INDEX = 999 ;
406 m_HEC_INDEX = 999 ;
407 m_POSNEG_INDEX = 999 ;
408 m_SAMPLING_INDEX = 999 ;
409 m_REGION_INDEX = 999 ;
410 m_ETA_INDEX = 999 ;
411 m_PHI_INDEX = 999 ;
412 m_SLAR_INDEX = 999 ;
413
414 // Save index to a HEC region for unpacking
416 if (dict()->find_region(expId,m_hec_region_index)){
417 ATH_MSG_ERROR("initLevelsFromDict - unable to find hec region index: id, reg " << expId << m_hec_region_index);
418 return (1);
419 }
420
421 const IdDictField* field = dict()->find_field("subdet") ;
422 if (field) {
423 m_LAR_INDEX = field->index();
424 }
425 else {
426 ATH_MSG_ERROR("initLevelsFromDict - unable to find 'subdet' field");
427 return (1);
428 }
429
430 field = dict()->find_field("part") ;
431 if (field) {
432 m_HEC_INDEX = field->index();
433 }
434 else {
435 ATH_MSG_ERROR("initLevelsFromDict - unable to find 'part' field");
436 return (1);
437 }
438
439 field = dict()->find_field("barrel-endcap") ;
440 if (field) {
441 m_POSNEG_INDEX = field->index();
442 }
443 else {
444 ATH_MSG_ERROR("initLevelsFromDict - unable to find 'barrel-endcap' field");
445 return (1);
446 }
447
448 field = dict()->find_field("sampling") ;
449 if (field) {
450 m_SAMPLING_INDEX = field->index();
451 }
452 else {
453 ATH_MSG_ERROR("initLevelsFromDict - unable to find 'sampling' field");
454 return (1);
455 }
456
457 field = dict()->find_field("region") ;
458 if (field) {
459 m_REGION_INDEX = field->index();
460 }
461 else {
462 ATH_MSG_ERROR("initLevelsFromDict - unable to find 'region' field");
463 return (1);
464 }
465
466 field = dict()->find_field("eta") ;
467 if (field) {
468 m_ETA_INDEX = field->index();
469 }
470 else {
471 ATH_MSG_ERROR("initLevelsFromDict - unable to find 'eta' field");
472 return (1);
473 }
474
475 field = dict()->find_field("phi") ;
476 if (field) {
477 m_PHI_INDEX = field->index();
478 }
479 else {
480 ATH_MSG_ERROR("initLevelsFromDict - unable to find 'phi' field");
481 return (1);
482 }
483
484 field = dict()->find_field("is-slar-hec") ;
485 if (field) {
486 m_SLAR_INDEX = field->index();
487 }
488 else {
489 ATH_MSG_ERROR("initLevelsFromDict - unable to find 'is-slar-hec' field");
490 return (1);
491 }
492
493
494 // Set the field implementations
495
496 const IdDictRegion& region = dict()->region(m_hec_region_index);
497
498 m_lar_impl = region.implementation(m_LAR_INDEX);
499 m_hec_impl = region.implementation(m_HEC_INDEX);
500 m_pn_impl = region.implementation(m_POSNEG_INDEX);
501 m_sampling_impl = region.implementation(m_SAMPLING_INDEX);
502 m_region_impl = region.implementation(m_REGION_INDEX);
503 m_eta_impl = region.implementation(m_ETA_INDEX);
504 m_phi_impl = region.implementation(m_PHI_INDEX);
505 m_slar_impl = region.implementation(m_SLAR_INDEX);
506
507 ATH_MSG_DEBUG("decode index and bit fields for each level: ");
508 ATH_MSG_DEBUG("lar " << m_lar_impl);
509 ATH_MSG_DEBUG("hec " << m_hec_impl);
510 ATH_MSG_DEBUG("pn " << m_pn_impl);
511 ATH_MSG_DEBUG("samp " << m_sampling_impl);
512 ATH_MSG_DEBUG("reg " << m_region_impl);
513 ATH_MSG_DEBUG("eta " << m_eta_impl);
514 ATH_MSG_DEBUG("phi " << m_phi_impl);
515 ATH_MSG_DEBUG("is-slar " << m_slar_impl);
516
517 return(0) ;
518}
519
521{
522 if (channels().init (*this, "channels",
525 return 1;
526 if (regions().init (*this, "regions",
529 return 1;
530
531 return (0);
532}
533
534int LArHEC_Base_ID::get_neighbours(const IdentifierHash id, const LArNeighbours::neighbourOption& option, std::vector<IdentifierHash>& neighbourList) const
535{
536 int result = 1;
537
538 neighbourList.clear();
539
540 if(!m_do_neighbours) {
541 ATH_MSG_WARNING("neighbours not initialized !!! returning empty list");
542 return result;
543 }
544
545 if(id>=channel_hash_max()) {
546 ATH_MSG_WARNING("neighbours requested for non-existing channel -- id/max " << id << "/" << channel_hash_max());
547 return result;
548 }
549
550 const short int maxNeighb=20;
551 IdentifierHash neighbList[maxNeighb];
552 int neighbourIndex = 0;
553
554 // cell index
555 unsigned int index=id;
556
557 //
558 // .... find in which region is the cell
559 //
560 short int regionN=m_vecOfCellInfo[index];
561 // get pointer to this region
562 LArHEC_region* hecRegion = m_vecOfRegions[regionN];
563 // retrieve characteristic numbers for this region
564 short int nPhi = hecRegion->phiN();
565 float gPhi = hecRegion->phiGranularity();
566 unsigned int minHash = hecRegion->hashMin();
567 unsigned int maxHash = hecRegion->hashMax();
568
569 bool corners2DOnly = ( (option & LArNeighbours::all2D)
571 //
572 // .... previous neighbour in phi
573 //
574 IdentifierHash prevNeighbInPhi=NOT_VALID_HASH;
575 if( (option & LArNeighbours::prevInPhi)
576 || corners2DOnly ){
577 if(!get_prevInPhi(hecRegion, index, nPhi, minHash, neighbourIndex, neighbList)){
578 prevNeighbInPhi=neighbList[neighbourIndex-1];
579 if( corners2DOnly ){
580 neighbourIndex--;
581 }
582 }
583 }
584
585 //
586 // ....next neighbour in phi
587 //
588 IdentifierHash nextNeighbInPhi=NOT_VALID_HASH;
589 if( (option & LArNeighbours::nextInPhi)
590 || corners2DOnly ){
591 if(!get_nextInPhi(hecRegion, index, nPhi, minHash, neighbourIndex, neighbList)){
592 nextNeighbInPhi=neighbList[neighbourIndex-1];
593 if( corners2DOnly ){
594 neighbourIndex--;
595 }
596 }
597 }
598
599 //
600 // ....previous neighbours in eta
601 //
602 unsigned int nPrevBiggerCell=NOT_VALID_HASH;
603 if( (option & LArNeighbours::prevInEta) ){
604 get_prevInEta(hecRegion, index, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
605 }
606
607 //
608 // ....next neighbours in eta
609 //
610 unsigned int nNextBiggerCell=NOT_VALID_HASH;
611 if( (option & LArNeighbours::nextInEta) ){
612 get_nextInEta(hecRegion, index, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
613 }
614
615 //
616 // ....corners in the same sampling
617 //
618 if( (option & LArNeighbours::corners2D) ){
619 if(prevNeighbInPhi != NOT_VALID_HASH){
620 unsigned int index1=prevNeighbInPhi;
621 int oldNeighbourIndex = neighbourIndex;
622 // allow only 1 corner cell in order to avoid the problem of
623 // non-mutual neighbourness
624 // since the cells come ordered in phi it should be the last cell for
625 // prevNeighbInPhi as starting points
626 get_prevInEta(hecRegion, index1, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
627 if ( neighbourIndex > oldNeighbourIndex+1 ) {
628 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
629 neighbourIndex = oldNeighbourIndex+1;
630 }
631 oldNeighbourIndex = neighbourIndex;
632 get_nextInEta(hecRegion, index1, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
633 if ( neighbourIndex > oldNeighbourIndex+1 ) {
634 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
635 neighbourIndex = oldNeighbourIndex+1;
636 }
637 }
638
639 if(nextNeighbInPhi != NOT_VALID_HASH){
640 unsigned int index2=nextNeighbInPhi;
641 int oldNeighbourIndex = neighbourIndex;
642 // allow only 1 corner cell in order to avoid the problem of
643 // non-mutual neighbourness
644 // since the cells come ordered in phi it should be the 1st cell for
645 // nextNeighbInPhi
646 get_prevInEta(hecRegion, index2, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
647 if ( neighbourIndex > oldNeighbourIndex+1 ) {
648 neighbourIndex = oldNeighbourIndex+1;
649 }
650 oldNeighbourIndex = neighbourIndex;
651 get_nextInEta(hecRegion, index2, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
652 if ( neighbourIndex > oldNeighbourIndex+1 ) {
653 neighbourIndex = oldNeighbourIndex+1;
654 }
655 }
656 }
657
658 //
659 // .... neighbours in sampling (common code)
660 // HEC caracteristics = no granularity change, partial overlap of samplings
661 //
662 if( (option & LArNeighbours::upAndDown) ){
663 // initial eta granularity
664 float granEta = hecRegion->etaGranularity();
665 // initial eta
666 int nEta = int( (index-minHash) / nPhi);
667 double absEta = hecRegion->etaMin() + nEta*granEta;
668
669 // previous neighbours in sampling
670 if( (option & LArNeighbours::prevInSamp) ){
671 get_prevInSamp(hecRegion, index, nPhi, minHash, absEta, neighbourIndex, neighbList);
672 } // end option
673
674 // next neighbours in sampling
675 if( (option & LArNeighbours::nextInSamp) ){
676 get_nextInSamp(hecRegion, index, nPhi, minHash, absEta, neighbourIndex, neighbList);
677 }
678 }
679
680 neighbourList.resize(neighbourIndex);
681 if (neighbourIndex <= maxNeighb) {
682 std::copy (&neighbList[0], &neighbList[neighbourIndex], neighbourList.begin());
683 result = 0 ;
684 } else {
685 ATH_MSG_WARNING("more than 20 neighbours for this cell, NONE will be retained " << neighbourIndex);
686 }
687 return result;
688
689}
690
691int LArHEC_Base_ID::get_prevInPhi(const LArHEC_region* hecRegion, const unsigned int& index, const short int& nPhi, const unsigned int& minHash,
692 int& neighbourIndex, IdentifierHash* neighbList)
693{
694 int result = 1;
695 if(!hecRegion->isPhiMin(index)) {
696 unsigned int nIndex = index-1;
697 if( ((index-minHash)%(nPhi)) == 0 ) nIndex=index+nPhi-1;
698 IdentifierHash nHash = nIndex;
699 neighbList[neighbourIndex] = nHash;
700 neighbourIndex++;
701 result = 0;
702 }
703 return result;
704}
705
706int LArHEC_Base_ID::get_nextInPhi(const LArHEC_region* hecRegion, const unsigned int& index, const short int& nPhi, const unsigned int& minHash,
707 int& neighbourIndex, IdentifierHash* neighbList)
708{
709 int result = 1;
710 if(!hecRegion->isPhiMax(index)) {
711 unsigned int nIndex = index+1;
712 if( ((index-minHash+1)%(nPhi)) == 0 ) nIndex=index-nPhi+1;
713 IdentifierHash nHash = nIndex;
714 neighbList[neighbourIndex] = nHash;
715 neighbourIndex++;
716 result = 0;
717 }
718 return result;
719}
720
721int LArHEC_Base_ID::get_prevInEta(const LArHEC_region* hecRegion, const unsigned int& index, const short int& nPhi, const float& gPhi, const unsigned int& minHash,
722 int& neighbourIndex, IdentifierHash* neighbList, unsigned int& nBiggerCell) const
723{
724 int result = 1;
725 unsigned int nIndex = 0;
726 IdentifierHash nHash = 0;
727
728 if( hecRegion->isEtaMin(index)){
729 // eta == etaMin -> go to previous region in eta
730 short int nPrevEtaRegion = hecRegion->prevEtaRegion();
731 // no neighbour if no previous region in eta
732 if( nPrevEtaRegion != NOT_VALID_HEC_REGION ) {
733 // Tell clang to optimize assuming that FP exceptions can trap.
734 // Otherwise, it can vectorize the division, which can lead to
735 // spurious division-by-zero traps from unused vector lanes.
737 LArHEC_region* prevHecRegion = m_vecOfRegions[nPrevEtaRegion];
738 short int nPhiMinus = prevHecRegion->phiN();
739 float gPhiMinus= prevHecRegion->phiGranularity();
740 unsigned int maxHashMinus = prevHecRegion->hashMax();
741 float phiMargin = 0.25*std::min(gPhi,gPhiMinus);
742 float rPhi = (index-minHash)*gPhi+hecRegion->phiMin();
743 int nPhiMinusFirst = int(std::floor((rPhi -prevHecRegion->phiMin())
744 /gPhiMinus+phiMargin))
745 +maxHashMinus-nPhiMinus;
746 int nPhiMinusNext = int(std::floor((rPhi+gPhi-prevHecRegion->phiMin())
747 /gPhiMinus+phiMargin))
748 +maxHashMinus-nPhiMinus;
749 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
750
751 for(int i=nPhiMinusFirst; i<nPhiMinusNext; i++){
752 nIndex = i ;
753 if(nIndex != nBiggerCell) {
754 nHash = nIndex;
755 neighbList[neighbourIndex] = nHash;
756 neighbourIndex++;
757 result = 0;
758 }
759 // to avoid duplicated cells in corners
760 if(gPhi < gPhiMinus && nBiggerCell == NOT_VALID_HASH) nBiggerCell=nIndex;
761 }
762 }
763 }
764 else {
765 // stay in same region (1 neighbour)
766 nIndex = index - nPhi;
767 nHash = nIndex;
768 neighbList[neighbourIndex] = nHash;
769 neighbourIndex++;
770 result = 0;
771 }
772 return result;
773}
774
775int LArHEC_Base_ID::get_nextInEta(const LArHEC_region* hecRegion, const unsigned int& index, const short int& nPhi, const float& gPhi,
776 const unsigned int& maxHash,
777 int& neighbourIndex, IdentifierHash* neighbList, unsigned int& nBiggerCell) const
778{
779 int result = 1;
780 unsigned int nIndex = 0;
781 IdentifierHash nHash = 0;
782
783 if( hecRegion->isEtaMax(index)){
784 // eta == etaMax -> go to next region in eta
785 short int nNextEtaRegion = hecRegion->nextEtaRegion();
786 // no neighbour if no next region in eta
787 if( nNextEtaRegion != NOT_VALID_HEC_REGION ) {
788 // Tell clang to optimize assuming that FP exceptions can trap.
789 // Otherwise, it can vectorize the division, which can lead to
790 // spurious division-by-zero traps from unused vector lanes.
792 LArHEC_region* nextHecRegion = m_vecOfRegions[nNextEtaRegion];
793 float gPhiPlus= nextHecRegion->phiGranularity();
794 unsigned int minHashPlus = nextHecRegion->hashMin();
795 float phiMargin = 0.25*std::min(gPhi,gPhiPlus);
796 float rPhi = (index+nPhi-maxHash)*gPhi+hecRegion->phiMin();
797 int nPhiPlusFirst = int(std::floor((rPhi -nextHecRegion->phiMin())
798 /gPhiPlus+phiMargin))+minHashPlus;
799 int nPhiPlusNext = int(std::floor((rPhi+gPhi-nextHecRegion->phiMin())
800 /gPhiPlus+phiMargin))+minHashPlus;
801 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
802
803 for(int i=nPhiPlusFirst; i<nPhiPlusNext; i++){
804 nIndex = i ;
805 if(nIndex != nBiggerCell) {
806 nHash = nIndex;
807 neighbList[neighbourIndex] = nHash;
808 neighbourIndex++;
809 result = 0;
810 }
811 // to avoid duplicated cells in corners
812 if(gPhi < gPhiPlus && nBiggerCell == NOT_VALID_HASH) nBiggerCell=nIndex;
813 }
814 }
815 }
816 else {
817 // stay in same region (1 neighbour)
818 nIndex = index + nPhi;
819 nHash = nIndex;
820 neighbList[neighbourIndex] = nHash;
821 neighbourIndex++;
822 result = 0;
823 }
824 return result;
825}
826
827int LArHEC_Base_ID::get_prevInSamp(const LArHEC_region* hecRegion, const unsigned int& index, const short int& nPhi, const unsigned int& minHash,
828 const double& absEta,
829 int& neighbourIndex, IdentifierHash* neighbList) const
830{
831 int result = 1;
832 // neighbours' indices
833 unsigned int nIndex=0;
834 // neighbours' hash
835 IdentifierHash nHash=0;
836
837 // previous region in sampling
838 const std::vector<short int>& prevSampRegion=hecRegion->prevSamplingRegion();
839 int nPrevSampReg = prevSampRegion.size();
840 if(nPrevSampReg > 0) {
841 float gEta = hecRegion->etaGranularity();
842 float gPhi = hecRegion->phiGranularity();
843 for(int ireg=0; ireg<nPrevSampReg; ireg++) {
844 LArHEC_region* prevHecRegion = m_vecOfRegions[prevSampRegion[ireg]];
845 float minEtaMinus = prevHecRegion->etaMin();
846 float maxEtaMinus = prevHecRegion->etaMax();
847 // eta granularity of previous region
848 float granEtaMinus = prevHecRegion->etaGranularity();
849 float margin = 0.25*std::min(gEta,granEtaMinus);
850 if((minEtaMinus < absEta+gEta-margin) && (absEta+margin < maxEtaMinus)) {
851 // Tell clang to optimize assuming that FP exceptions can trap.
852 // Otherwise, it can vectorize the division, which can lead to
853 // spurious division-by-zero traps from unused vector lanes.
855
856 // max phi of previous region in sampling
857 short int nPhiMinus = prevHecRegion->phiN();
858 // first hash of previous region in sampling
859 unsigned int minHashMinus = prevHecRegion->hashMin();
860 float gPhiMinus = prevHecRegion->phiGranularity();
861 float phiMargin = 0.25*std::min(gPhi,gPhiMinus);
862 // phi 'coordinate' in initial region
863 float rPhi = ((index-minHash)%nPhi)*gPhi+hecRegion->phiMin();
864 int nPhiMinusFirst = int(std::floor((rPhi -prevHecRegion->phiMin())
865 /gPhiMinus+phiMargin));
866 int nPhiMinusNext = int(std::floor((rPhi+gPhi-prevHecRegion->phiMin())
867 /gPhiMinus+phiMargin));
868 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
869 // eta coordinate in initial region
870 double fEtaMinus = (absEta-minEtaMinus) / granEtaMinus + margin;
871 short int nEtaMinus = int(fEtaMinus) ;
872 for(int i=nPhiMinusFirst; i<nPhiMinusNext; i++){
873 nIndex = minHashMinus + nEtaMinus * nPhiMinus + i;
874 if( (nIndex >= prevHecRegion->hashMin()) && (nIndex < prevHecRegion->hashMax()) ) {
875 nHash = nIndex;
876 neighbList[neighbourIndex] = nHash;
877 neighbourIndex++;
878 result = 0;
879 }
880 }
881 } // end eta condition
882 } // end loop on ireg
883 } // end if(nPrevSampReg>0)
884 return result;
885}
886
887int LArHEC_Base_ID::get_nextInSamp(const LArHEC_region* hecRegion, const unsigned int& index, const short int& nPhi, const unsigned int& minHash,
888 const double& absEta,
889 int& neighbourIndex, IdentifierHash* neighbList) const
890{
891 int result = 1;
892 // neighbours' indices
893 unsigned int nIndex=0;
894 // neighbours' hash
895 IdentifierHash nHash=0;
896
897 const std::vector<short int>& nextSampRegion=hecRegion->nextSamplingRegion();
898 int nNextSampReg = nextSampRegion.size();
899 if(nNextSampReg > 0) {
900 float gEta = hecRegion->etaGranularity();
901 float gPhi = hecRegion->phiGranularity();
902 for(int ireg=0; ireg<nNextSampReg; ireg++) {
903 LArHEC_region* nextHecRegion = m_vecOfRegions[nextSampRegion[ireg]];
904 float granEtaPlus = nextHecRegion->etaGranularity();
905 float minEtaPlus = nextHecRegion->etaMin();
906 float maxEtaPlus = nextHecRegion->etaMax();
907 float margin = 0.25*std::min(gEta,granEtaPlus);
908 if((minEtaPlus < absEta+gEta-margin) && (absEta+margin < maxEtaPlus)) {
909 // Tell clang to optimize assuming that FP exceptions can trap.
910 // Otherwise, it can vectorize the division, which can lead to
911 // spurious division-by-zero traps from unused vector lanes.
913
914 short int nPhiPlus = nextHecRegion->phiN();
915 unsigned int minHashPlus = nextHecRegion->hashMin();
916 float gPhiPlus = nextHecRegion->phiGranularity();
917 float phiMargin = 0.25*std::min(gPhi,gPhiPlus);
918 // phi 'coordinate' in initial region
919 float rPhi = ((index-minHash)%nPhi)*gPhi+hecRegion->phiMin();
920 int nPhiPlusFirst = int(std::floor((rPhi -nextHecRegion->phiMin())
921 /gPhiPlus+phiMargin));
922 int nPhiPlusNext = int(std::floor((rPhi+gPhi-nextHecRegion->phiMin())
923 /gPhiPlus+phiMargin));
924 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
925
926 double fEtaPlus = (absEta-minEtaPlus) / granEtaPlus + margin ;
927 int nEtaPlus = int(fEtaPlus) ;
928 for(int i=nPhiPlusFirst; i<nPhiPlusNext; i++){
929 nIndex = minHashPlus + nEtaPlus * nPhiPlus + i;
930 if( (nIndex >= nextHecRegion->hashMin()) && (nIndex < nextHecRegion->hashMax()) ) {
931 nHash = nIndex;
932 neighbList[neighbourIndex] = nHash;
933 neighbourIndex++;
934 result = 0;
935 }
936 }
937 }
938 }
939 }
940 return result;
941}
942
943
945{
946 const std::vector<const IdDictRegion*>& vecOfDictRegions = dictRegions();
947
948 ATH_MSG_DEBUG("init_neighbors");
949
950 //
951 // ..... loop on HEC regions -> store vector of LArHEC_region*
952 //
953 short int reg=0;
954 std::vector<Identifier>::const_iterator debut=reg_begin() ;
955 std::vector<Identifier>::const_iterator fin =reg_end() ;
956
957 for (; debut != fin; ++debut)
958 {
959 const Identifier& regId = (*debut);
960 bool fullSym = (dictionaryVersion() == "fullAtlas" );
961 //
962 // ..... translate regId to chanId and get hash
963 //
964 Identifier id ;
965 unsigned int index0 = NOT_VALID_HASH;
966 int etaMin = eta_min(regId);
967 int phiMin = phi_min(regId);
968 if(etaMin >= 0 && phiMin >= 0)
969 {
970 try{
971 id = channel_id (regId, etaMin, phiMin );
972 }
973 catch(LArID_Exception & except){
974 ATH_MSG_ERROR(" LArId exception " << (std::string)except);
975 }
976 IdentifierHash hashId = channel_hash(id) ;
977 index0=hashId;
978 }
979 else
980 {
981 ATH_MSG_WARNING(" could not find non negative etaMin and phiMin for region " << show_to_string(regId));
982 index0 = 0;
983 }
984
985
986 short int deltaEta = eta_max(regId) - eta_min(regId) + 1 ;
987 short int nPhi = phi_max(regId) - phi_min(regId) + 1 ;
988 // starting eta
989 float eta0 = this->eta0(reg);
990 // eta granularity
991 float deta = this->etaGranularity(reg);
992 // starting phi
993 float phi0 = this->phi0(reg);
994 // phi granularity
995 float dphi = this->phiGranularity(reg);
996
997 // full range of regions
998 unsigned int ireg0=0;
999 unsigned int ireg1=region_hash_max();
1000 // if 2 symetric sides, in which side is the current reg.
1001 if(twoSymSides()) {
1002 if(reg < (short int)region_hash_max()/2) {
1003 ireg0=0;
1004 ireg1=region_hash_max()/2;
1005 } else {
1006 ireg0=region_hash_max()/2;
1007 ireg1=region_hash_max();
1008 }
1009 }
1010
1011 //
1012 // .... compute prev/next regions in eta
1013 //
1014 short int regForPrevEta=NOT_VALID_HEC_REGION;
1015 const IdDictRegion* prevEtaDicReg = vecOfDictRegions[reg]->prev_abs_eta();
1016 short int regForNextEta=NOT_VALID_HEC_REGION;
1017 const IdDictRegion* nextEtaDicReg = vecOfDictRegions[reg]->next_abs_eta();
1018 for(unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1019 if(vecOfDictRegions[ireg] == prevEtaDicReg) regForPrevEta = ireg;
1020 if(vecOfDictRegions[ireg] == nextEtaDicReg) regForNextEta = ireg;
1021 }
1022
1023 //
1024 // .... compute prev/next regions in sampling
1025 //
1026 //
1027 std::vector<short int> regForPrevSamp;
1028 for (const IdDictRegion* dictreg : vecOfDictRegions[reg]->prev_samp()) {
1029 for(unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1030 if(vecOfDictRegions[ireg] == dictreg) regForPrevSamp.push_back(ireg);
1031 }
1032 }
1033
1034 std::vector<short int> regForNextSamp;
1035 for (const IdDictRegion* dictreg : vecOfDictRegions[reg]->next_samp()) {
1036 for(unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1037 if(vecOfDictRegions[ireg] == dictreg) regForNextSamp.push_back(ireg);
1038 }
1039 }
1040
1041 //
1042 // ....now ready to build region object
1043 //
1044
1045 LArHEC_region * hecRegion = new LArHEC_region(index0,deltaEta,nPhi,eta0,deta,phi0,dphi,fullSym,
1046 regForPrevEta,regForNextEta,
1047 regForPrevSamp,regForNextSamp);
1048 // save in a vector for further use in get_neighbours method
1049 m_vecOfRegions.push_back(hecRegion);
1050 reg++;
1051 } // end of loop on regions
1052
1053 //
1054 // ..... loop on channels
1055 //
1056 reg=0;
1057 debut = hec_begin();
1058 fin = hec_end();
1059 if( debut != fin ){
1060 Identifier lastRegId=region_id(*debut);
1061 for (; debut != fin; ++debut) {
1062 const Identifier& chanId = (*debut);
1063 const Identifier& regId = region_id(chanId);
1064 if(regId != lastRegId) reg++;
1065
1066 if(m_do_checks) {
1067 // for cross check only
1068 IdentifierHash hashReg = region_hash(regId);
1069 if ((short int)hashReg != reg) {
1070 ATH_MSG_ERROR(" init_neighbors: problem reg, hashReg = " << reg << " " << hashReg);
1071 }
1072 }
1073
1074 // save region of the cell in a vector for further use in get_neighbours method
1075 m_vecOfCellInfo.push_back(reg);
1076
1077 lastRegId=regId;
1078 }
1079 }
1080 return (0);
1081}
1082
1083
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Factor out code common between LArHEC_ID and LArHEC_SuperCell_ID.
@ NOT_VALID_HEC_REGION
#define min(a, b)
Definition cfImp.cxx:40
virtual std::string dictionaryVersion(void) const override
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
bool m_do_neighbours
Flag for subclasses to know whether or not to perform neighbour initialization.
int lar_hec_field_value() const
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
ExpandedIdentifier lar_hec_exp(void) const
int lar_field_value() const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
const std::string & group() const
Group name for this helper.
float phi0(const IdentifierHash regHash) const
Return the minimum phi of region, or NOT_VALID.
const HashGroup & regions() const
Return the HashGroup for regions.
IdentifierHash region_hash(Identifier regionId) const
Convert a connected region Identifier to a hash code.
float eta0(const IdentifierHash regHash) const
Return the minimum eta of region, or NOT_VALID.
const std::vector< const IdDictRegion * > & dictRegions() const
Return the vector of IdDictRegion, accessed via region hash.
float etaGranularity(const IdentifierHash regHash) const
Return the eta granularity of a region, or NOT_VALID.
size_type region_hash_max() const
One more than the largest region hash code.
IdContext region_context() const
Return the context for regions.
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
CaloIDHelper(const std::string &name, const std::string &group)
Constructor.
int fill_vec_of_dict_regions(const std::string &group_name="")
Do basic initialization of the helper.
float phiGranularity(const IdentifierHash regHash) const
Return the phi granularity of a region, or NOT_VALID.
const std::string & name() const
Return the name for this helper.
const HashGroup & channels() const
Return the HashGroup for channels (cells).
void add(element_type value)
Append a value into a new field.
void clear()
Erase all fields.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition IdContext.h:26
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & name() const
Dictionary name.
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
element_type get_minimum() const
Query the values.
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
element_type get_maximum() const
This is a "hash" representation of an Identifier.
small class holding the starting hash value, the min eta and the number of phi bins of each region
size_type m_REGION_INDEX
IdDictFieldImplementation m_region_impl
id_iterator hec_end() const
end iterator over full set of Hec Identifiers for channels
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,...
IdDictFieldImplementation m_phi_impl
int initLevelsFromDict(const std::string &group_name)
int region(const Identifier id) const
return region [0,1]
LArHEC_Base_ID(const std::string &name, const std::string &group, bool supercell)
Constructor.
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
size_type m_SAMPLING_INDEX
id_iterator reg_begin() const
begin iterator over set of region Identifiers
static int get_prevInPhi(const LArHEC_region *hecRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, int &neighbourIndex, IdentifierHash *neighbList)
Identifier channel_id(const ExpandedIdentifier &exp_id) const
channel identifier for a channel from ExpandedIdentifier
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &group_name)
initialization from the identifier dictionary
bool twoSymSides() const
True if the + and - sides of the calorimeter are identical (true layout).
size_type m_LAR_INDEX
int phi_min_init(const Identifier regId) const
void channel_id_checks(int pos_neg, int sampling, int region, int eta, int phi) const
static int get_nextInPhi(const LArHEC_region *hecRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, int &neighbourIndex, IdentifierHash *neighbList)
int phi_max(const Identifier regId) const
max value of phi index (-999 == failure)
size_type m_SLAR_INDEX
void region_id_checks(int pos_neg, int sampling, int region) const
IdDictFieldImplementation m_hec_impl
Identifier region_id(const ExpandedIdentifier &exp_id) const
region identifier for a channel from ExpandedIdentifier
IdDictFieldImplementation m_slar_impl
size_type m_ETA_INDEX
IdDictFieldImplementation m_sampling_impl
std::vector< HashCalc > m_hash_calcs
int get_nextInSamp(const LArHEC_region *hecRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, const double &absEta, int &neighbourIndex, IdentifierHash *neighbList) const
MultiRange m_full_channel_range
std::vector< short int > m_vecOfPhiMin
int phi(const Identifier id) const
return phi[0,63] outer part [0,31] inner part
IdDictFieldImplementation m_pn_impl
size_type m_hec_region_index
int get_prevInEta(const LArHEC_region *hecRegion, const unsigned int &index, const short int &nPhi, const float &gPhi, const unsigned int &minHash, int &neighbourIndex, IdentifierHash *neighbList, unsigned int &nBiggerCell) const
size_type m_POSNEG_INDEX
int get_prevInSamp(const LArHEC_region *hecRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, const double &absEta, int &neighbourIndex, IdentifierHash *neighbList) const
IdDictFieldImplementation m_pn_reg_impl
id_iterator hec_begin() const
begin iterator over full set of Hec Identifiers for channels
MultiRange m_full_region_range
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
int phi_min(const Identifier regId) const
min value of phi index (-999 == failure)
int eta(const Identifier id) const
return eta [0,9] outer part [0,3] inner part
size_type m_HEC_INDEX
int pos_neg(const Identifier id) const
return pos_neg -2 (C side) or 2 (A side)
int get_nextInEta(const LArHEC_region *hecRegion, const unsigned int &index, const short int &nPhi, const float &gPhi, const unsigned int &maxHash, int &neighbourIndex, IdentifierHash *neighbList, unsigned int &nBiggerCell) const
virtual int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
std::vector< short int > m_vecOfCellInfo
IdDictFieldImplementation m_lar_impl
std::vector< LArHEC_region * > m_vecOfRegions
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
IdDictFieldImplementation m_eta_impl
size_type m_PHI_INDEX
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
id_iterator reg_end() const
end iterator over set of region Identifiers
IdentifierHash channel_hash_binary_search(Identifier channelId) const
create hash id from channel id – method NOT optimised, please use channel_hash() above
This class provides an interface to deal with regions in the neighbours finding.
bool isEtaMax(const unsigned int &index) const
is the considered cell in the last eta bin of the region ?
float etaGranularity() const
eta granularity
bool isPhiMax(const unsigned int &index) const
is the considered cell in the last phi bin of the region ?
const std::vector< short int > & prevSamplingRegion() const
region number of the prev region in sampling
float etaMax() const
end eta
const std::vector< short int > & nextSamplingRegion() const
region number of the next region in sampling
short int nextEtaRegion() const
region number of the next region in eta
unsigned int hashMax() const
hash Id of the last cell of the region +1
unsigned int hashMin() const
hash Id of the first cell of the region
float phiMin() const
starting phi
short int prevEtaRegion() const
region number of the previous region in eta
float phiGranularity() const
phi granularity
short int phiN() const
number of phi bins
float etaMin() const
starting eta
bool isPhiMin(const unsigned int &index) const
is the considered cell in the first phi bin of the region ?
bool isEtaMin(const unsigned int &index) const
is the considered cell in the first eta bin of the region ?
Exception class for LAr Identifiers.
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition index.py:1
Tell the compiler to optimize assuming that FP may trap.
#define CXXUTILS_TRAPPING_FP
Definition trapping_fp.h:24