2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
7 * @file CaloIdentifier/CaloCell_Base_ID.icc
8 * @author scott snyder <snyder@bnl.gov>
10 * @brief Helper base class for offline cell identifiers
14 //--------------------
16 //--------------------
18 //----------------------------------------------------------------------------
20 CaloCell_Base_ID::region_id (const int subCalo,
21 const int barec_or_posneg,
22 const int sampling_or_fcalmodule,
23 const int region_or_dummy,
26 Identifier result(0); // this returns a pixel identifier [2.1.-2.0.0]
27 if( subCalo == LAREM ) {
28 return m_emHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, checks);
30 else if( subCalo == LARHEC ) {
31 return m_hecHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, checks);
33 else if( subCalo == LARFCAL ) {
34 return m_fcalHelper->module_id(barec_or_posneg, sampling_or_fcalmodule, checks);
36 else if( subCalo == LARMINIFCAL ) {
37 return m_minifcalHelper->module_id(barec_or_posneg, sampling_or_fcalmodule, checks);
39 else if( subCalo == TILE ) {
40 return m_tileHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, checks);
48 CaloCell_Base_ID::region_id (const int subCalo,
49 const int barec_or_posneg,
50 const int sampling_or_fcalmodule,
51 const int region_or_dummy ) const
53 return region_id (subCalo, barec_or_posneg, sampling_or_fcalmodule,
54 region_or_dummy, do_checks());
57 //----------------------------------------------------------------------------
59 CaloCell_Base_ID::cell_id (const int subCalo,
60 const int barec_or_posneg,
61 const int sampling_or_fcalmodule,
62 const int region_or_dummy,
68 if( subCalo == LAREM ) {
69 return m_emHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
71 else if( subCalo == LARHEC ) {
72 return m_hecHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
74 else if( subCalo == LARFCAL ) {
75 return m_fcalHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, eta, phi, checks);
77 else if( subCalo == LARMINIFCAL ) {
78 return m_minifcalHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
80 else if( subCalo == TILE ) {
81 return m_tileHelper->cell_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
89 CaloCell_Base_ID::cell_id (const int subCalo,
90 const int barec_or_posneg,
91 const int sampling_or_fcalmodule,
92 const int region_or_dummy,
96 return cell_id (subCalo, barec_or_posneg, sampling_or_fcalmodule,
97 region_or_dummy, eta, phi, do_checks());
100 //----------------------------------------------------------------------------
102 CaloCell_Base_ID::region_id ( const Identifier cellId ) const
104 Identifier result(0);
105 if(m_emHelper->is_lar_em(cellId)) {
106 return m_emHelper->region_id(cellId);
108 else if(m_emHelper->is_lar_hec(cellId)) {
109 return m_hecHelper->region_id(cellId);
111 else if(m_emHelper->is_lar_minifcal(cellId)) {
112 // must do minifcal before fcal because miniFCAL IS FCAL
113 return m_minifcalHelper->module_id(cellId);
115 else if(m_emHelper->is_lar_fcal(cellId)) {
116 return m_fcalHelper->module_id(cellId);
118 else if(m_emHelper->is_tile(cellId)) {
119 return m_tileHelper->region_id(cellId);
126 //----------------------------------------------------------------------------
128 CaloCell_Base_ID::cell_id (const Identifier regionId,
134 Identifier result(0);
135 if(m_emHelper->is_lar_em(regionId)) {
136 return m_emHelper->channel_id(regionId,eta,phi,checks);
138 else if(m_emHelper->is_lar_hec(regionId)) {
139 return m_hecHelper->channel_id(regionId,eta,phi,checks);
141 else if(m_emHelper->is_lar_minifcal(regionId)) {
142 // must do minifcal before fcal because miniFCAL IS FCAL
143 return m_minifcalHelper->channel_id(regionId, depth,eta,phi,checks);
145 else if(m_emHelper->is_lar_fcal(regionId)) {
146 return m_fcalHelper->channel_id(regionId,eta,phi,checks);
154 CaloCell_Base_ID::cell_id (const Identifier regionId,
159 return cell_id (regionId, eta, phi, depth, do_checks());
162 //----------------------------------------------------------------------------
164 CaloCell_Base_ID::region_id (const IdentifierHash caloRegionHash) const
166 return(m_region_vec[caloRegionHash]);
169 //----------------------------------------------------------------------------
171 CaloCell_Base_ID::region_id (const int subCalo,
172 const IdentifierHash subCaloRegionHash) const
174 return(m_region_vec[subCaloRegionHash + m_reg_min[subCalo]]);
177 //----------------------------------------------------------------------------
179 CaloCell_Base_ID::cell_id (const IdentifierHash caloCellHash) const
181 return(m_cell_vec[caloCellHash]);
184 //----------------------------------------------------------------------------
186 CaloCell_Base_ID::cell_id (const int subCalo, const IdentifierHash subCaloCellHash) const
188 return(m_cell_vec[subCaloCellHash + m_cell_min[subCalo]]);
191 //----------------------------------------------------------------------------
192 inline IdentifierHash
193 CaloCell_Base_ID::calo_region_hash (const Identifier regionId) const
195 std::vector<Identifier>::const_iterator it = std::lower_bound(m_region_vec.begin(),m_region_vec.end(),regionId);
196 if ( it != m_region_vec.end() ){
197 return (it - m_region_vec.begin());
202 //----------------------------------------------------------------------------
203 inline IdentifierHash
204 CaloCell_Base_ID::subcalo_region_hash (const Identifier regionId, int& subCalo) const
207 if(is_hec(regionId)) {
210 else if (is_minifcal(regionId)) {
211 // must do minifcal before fcal because miniFCAL IS FCAL
212 subCalo = LARMINIFCAL ;
214 else if (is_fcal(regionId)) {
217 else if (is_tile(regionId)) {
220 std::vector<Identifier>::const_iterator it = std::lower_bound(m_region_vec.begin(),m_region_vec.end(),regionId);
221 if ( it != m_region_vec.end() ){
222 return (it - m_region_vec.begin() - m_reg_min[subCalo]);
227 //----------------------------------------------------------------------------
228 inline IdentifierHash
229 CaloCell_Base_ID::subcalo_cell_hash (const Identifier cellId, int& subCalo) const
231 subCalo = get_subcalo (cellId);
234 // LArEM / HEC have subdetector-specific optimized methods.
236 return m_emHelper->channel_hash (cellId);
238 return m_hecHelper->channel_hash (cellId);
242 return m_helpers[subCalo]->channel_hash (cellId);
248 //----------------------------------------------------------------------------
249 inline IdentifierHash
250 CaloCell_Base_ID::calo_cell_hash (const Identifier cellId) const
253 IdentifierHash hash = subcalo_cell_hash (cellId, subcalo);
254 if (hash != NOT_VALID)
255 return m_cell_min[subcalo] + hash;
259 //----------------------------------------------------------------------------
260 inline CaloCell_Base_ID::size_type CaloCell_Base_ID::calo_cell_hash_max (void) const
262 return m_cell_hash_max;
265 //----------------------------------------------------------------------------
266 inline CaloCell_Base_ID::size_type CaloCell_Base_ID::calo_region_hash_max (void) const
268 return m_region_hash_max;
271 //----------------------------------------------------------------------------
272 inline void CaloCell_Base_ID::calo_cell_hash_range (const Identifier id, IdentifierHash& caloCellMin, IdentifierHash& caloCellMax) const
274 if(m_emHelper->is_lar_em(id)) {
275 caloCellMin = m_cell_min[LAREM];
276 caloCellMax = m_cell_max[LAREM];
278 else if(m_emHelper->is_lar_hec(id)) {
279 caloCellMin = m_cell_min[LARHEC];
280 caloCellMax = m_cell_max[LARHEC];
282 else if(m_emHelper->is_lar_minifcal(id)) {
283 // must do minifcal before fcal because miniFCAL IS FCAL
284 caloCellMin = m_cell_min[LARMINIFCAL];
285 caloCellMax = m_cell_max[LARMINIFCAL];
287 else if(m_emHelper->is_lar_fcal(id)) {
288 caloCellMin = m_cell_min[LARFCAL];
289 caloCellMax = m_cell_max[LARFCAL];
291 else if(m_emHelper->is_tile(id)) {
292 caloCellMin = m_cell_min[TILE];
293 caloCellMax = m_cell_max[TILE];
296 caloCellMin = NOT_VALID;
297 caloCellMax = NOT_VALID;
301 //----------------------------------------------------------------------------
302 inline void CaloCell_Base_ID::calo_reg_hash_range (const Identifier id, IdentifierHash& caloRegMin, IdentifierHash& caloRegMax) const
304 if(m_emHelper->is_lar_em(id)) {
305 caloRegMin = m_reg_min[LAREM];
306 caloRegMax = m_reg_max[LAREM];
308 else if(m_emHelper->is_lar_hec(id)) {
309 caloRegMin = m_reg_min[LARHEC];
310 caloRegMax = m_reg_max[LARHEC];
312 else if(m_emHelper->is_lar_minifcal(id)) {
313 // must do minifcal before fcal because miniFCAL IS FCAL
314 caloRegMin = m_reg_min[LARMINIFCAL];
315 caloRegMax = m_reg_max[LARMINIFCAL];
317 else if(m_emHelper->is_lar_fcal(id)) {
318 caloRegMin = m_reg_min[LARFCAL];
319 caloRegMax = m_reg_max[LARFCAL];
321 else if(m_emHelper->is_tile(id)) {
322 caloRegMin = m_reg_min[TILE];
323 caloRegMax = m_reg_max[TILE];
326 caloRegMin = NOT_VALID;
327 caloRegMax = NOT_VALID;
331 //----------------------------------------------------------------------------
332 inline void CaloCell_Base_ID::calo_cell_hash_range (const int subCalo, IdentifierHash& caloCellMin, IdentifierHash& caloCellMax) const
334 caloCellMin = m_cell_min[subCalo];
335 caloCellMax = m_cell_max[subCalo];
338 //----------------------------------------------------------------------------
339 inline void CaloCell_Base_ID::calo_reg_hash_range (const int subCalo, IdentifierHash& caloRegMin, IdentifierHash& caloRegMax) const
341 caloRegMin = m_reg_min[subCalo];
342 caloRegMax = m_reg_max[subCalo];
345 //----------------------------------------------------------------------------
346 inline IdentifierHash CaloCell_Base_ID::subcalo_cell_hash ( const IdentifierHash caloHash, int& subCalo) const
348 if(caloHash < m_cell_max[LAREM]) {
351 else if(caloHash < m_cell_max[LARHEC] ) {
354 else if(caloHash < m_cell_max[LARFCAL] ) {
357 else if(caloHash < m_cell_max[TILE] ) {
360 else if(caloHash < m_cell_max[LARMINIFCAL] ) {
361 subCalo = LARMINIFCAL;
367 return( caloHash - m_cell_min[subCalo]) ;
370 //----------------------------------------------------------------------------
371 inline IdentifierHash CaloCell_Base_ID::subcalo_region_hash ( const IdentifierHash caloHash, int& subCalo) const
373 if(caloHash < m_reg_max[LAREM]) {
376 else if(caloHash < m_reg_max[LARHEC] ) {
379 else if(caloHash < m_reg_max[LARFCAL] ) {
382 else if(caloHash < m_reg_max[TILE] ) {
385 else if(caloHash < m_reg_max[LARMINIFCAL] ) {
386 subCalo = LARMINIFCAL;
392 return( caloHash - m_reg_min[subCalo]) ;
395 //----------------------------------------------------------------------------
396 inline IdentifierHash CaloCell_Base_ID::calo_cell_hash (const int subCalo, const IdentifierHash subCaloHash) const
398 return( subCaloHash + m_cell_min[subCalo]) ;
402 //----------------------------------------------------------------------------
403 inline IdentifierHash CaloCell_Base_ID::calo_region_hash (const int subCalo, const IdentifierHash subCaloHash) const
405 return( subCaloHash + m_reg_min[subCalo]) ;
408 //----------------------------------------------------------------------------
409 inline CaloCell_Base_ID::id_iterator CaloCell_Base_ID::cell_begin (void) const
411 return(m_cell_vec.begin());
414 //----------------------------------------------------------------------------
415 inline CaloCell_Base_ID::id_iterator CaloCell_Base_ID::cell_end (void) const
417 return(m_cell_vec.end());
420 //----------------------------------------------------------------------------
421 inline CaloCell_Base_ID::id_range CaloCell_Base_ID::cell_range (void) const
423 return id_range (cell_begin(), cell_end());
426 //----------------------------------------------------------------------------
428 CaloCell_Base_ID::id_iterator
429 CaloCell_Base_ID::cell_begin (const int subCalo) const
431 return m_helpers[subCalo]->channels().begin();
434 //----------------------------------------------------------------------------
436 CaloCell_Base_ID::id_iterator
437 CaloCell_Base_ID::cell_end (const int subCalo) const
439 return m_helpers[subCalo]->channels().end();
442 //----------------------------------------------------------------------------
444 CaloCell_Base_ID::id_range
445 CaloCell_Base_ID::cell_range (const int subCalo) const
447 return m_helpers[subCalo]->channels().range();
450 //----------------------------------------------------------------------------
452 CaloCell_Base_ID::id_iterator
453 CaloCell_Base_ID::reg_begin (void) const
455 return(m_region_vec.begin());
458 //----------------------------------------------------------------------------
460 CaloCell_Base_ID::id_iterator
461 CaloCell_Base_ID::reg_end (void) const
463 return(m_region_vec.end());
466 //----------------------------------------------------------------------------
468 CaloCell_Base_ID::id_range
469 CaloCell_Base_ID::reg_range (void) const
471 return id_range (reg_begin(), reg_end());
474 //----------------------------------------------------------------------------
476 CaloCell_Base_ID::id_iterator
477 CaloCell_Base_ID::reg_begin (const int subCalo) const
479 return m_helpers[subCalo]->regions().begin();
482 //----------------------------------------------------------------------------
484 CaloCell_Base_ID::id_iterator
485 CaloCell_Base_ID::reg_end (const int subCalo) const
487 return m_helpers[subCalo]->regions().end();
490 //----------------------------------------------------------------------------
492 CaloCell_Base_ID::id_range
493 CaloCell_Base_ID::reg_range (const int subCalo) const
495 return m_helpers[subCalo]->regions().range();
498 //----------------------------------------------------------------------------
499 inline bool CaloCell_Base_ID::is_em(const Identifier id) const
501 return m_emHelper->is_lar_em(id);
504 //----------------------------------------------------------------------------
505 inline bool CaloCell_Base_ID::is_em(const IdentifierHash caloHash) const
508 if(caloHash < m_cell_max[LAREM]) result=true;
512 //----------------------------------------------------------------------------
513 inline bool CaloCell_Base_ID::is_em_barrel(const Identifier id) const
515 return m_emHelper->is_em_barrel(id);
518 //----------------------------------------------------------------------------
519 inline bool CaloCell_Base_ID::is_em_endcap(const Identifier id) const
521 return m_emHelper->is_em_endcap(id);
524 //----------------------------------------------------------------------------
525 inline bool CaloCell_Base_ID::is_em_endcap_inner(const Identifier id) const
527 return m_emHelper->is_em_endcap_inner(id);
530 //----------------------------------------------------------------------------
531 inline bool CaloCell_Base_ID::is_em_endcap_outer(const Identifier id) const
533 return m_emHelper->is_em_endcap_outer(id);
536 //----------------------------------------------------------------------------
537 inline bool CaloCell_Base_ID::is_hec(const Identifier id) const
539 return m_emHelper->is_lar_hec(id);
542 //----------------------------------------------------------------------------
543 inline bool CaloCell_Base_ID::is_hec(const IdentifierHash caloHash) const
546 if(caloHash >= m_cell_min[LARHEC] &&
547 caloHash < m_cell_max[LARHEC] ) result=true;
551 //----------------------------------------------------------------------------
552 inline bool CaloCell_Base_ID::is_fcal(const Identifier id) const
554 return m_emHelper->is_lar_fcal(id);
557 //----------------------------------------------------------------------------
558 inline bool CaloCell_Base_ID::is_fcal(const IdentifierHash caloHash) const
561 if(caloHash >= m_cell_min[LARFCAL] && caloHash < m_cell_max[LARFCAL] ) result=true;
565 //----------------------------------------------------------------------------
566 inline bool CaloCell_Base_ID::is_minifcal(const Identifier id) const
568 return m_emHelper->is_lar_minifcal(id);
571 //----------------------------------------------------------------------------
572 inline bool CaloCell_Base_ID::is_minifcal(const IdentifierHash caloHash) const
575 if(caloHash >= m_cell_min[LARMINIFCAL] && caloHash < m_cell_max[LARMINIFCAL] ) result=true;
579 //----------------------------------------------------------------------------
580 inline bool CaloCell_Base_ID::is_tile(const ExpandedIdentifier& id) const
582 return m_emHelper->is_tile(id);
585 //----------------------------------------------------------------------------
586 inline bool CaloCell_Base_ID::is_tile(const Identifier id) const
588 return m_emHelper->is_tile(id);
591 //----------------------------------------------------------------------------
592 inline bool CaloCell_Base_ID::is_tile(const IdentifierHash caloHash) const
595 if(caloHash >= m_cell_min[TILE] && caloHash < m_cell_max[TILE] ) result=true;
599 //----------------------------------------------------------------------------
600 inline bool CaloCell_Base_ID::is_tile_barrel(const Identifier id) const
602 return m_tileHelper->is_tile_barrel(id);
605 //----------------------------------------------------------------------------
606 inline bool CaloCell_Base_ID::is_tile_extbarrel(const Identifier id) const
608 return m_tileHelper->is_tile_extbarrel(id);
611 //----------------------------------------------------------------------------
612 inline bool CaloCell_Base_ID::is_tile_gap(const Identifier id) const
614 return m_tileHelper->is_tile_gap(id);
617 //----------------------------------------------------------------------------
618 inline bool CaloCell_Base_ID::is_tile_gapscin(const Identifier id) const
620 return m_tileHelper->is_tile_gapscin(id);
623 //----------------------------------------------------------------------------
624 inline bool CaloCell_Base_ID::is_tile_positive(const Identifier id) const
626 return m_tileHelper->is_positive(id);
629 //----------------------------------------------------------------------------
630 inline bool CaloCell_Base_ID::is_tile_negative(const Identifier id) const
632 return m_tileHelper->is_negative(id);
635 //----------------------------------------------------------------------------
636 inline int CaloCell_Base_ID::sub_calo (const Identifier id)const
638 if(m_emHelper->is_lar_em(id)) {
641 else if(m_emHelper->is_lar_hec(id)) {
644 else if(m_emHelper->is_lar_minifcal(id)) {
645 // must do minifcal before fcal because miniFCAL IS FCAL
648 else if(m_emHelper->is_lar_fcal(id)) {
651 else if(m_emHelper->is_tile(id)) {
659 //----------------------------------------------------------------------------
660 inline int CaloCell_Base_ID::sub_calo (const IdentifierHash caloHash)const
662 int result = NOT_VALID;
663 if(caloHash < m_cell_max[LAREM]) {
666 else if(caloHash < m_cell_max[LARHEC] ) {
669 else if(caloHash < m_cell_max[LARFCAL] ) {
672 else if(caloHash < m_cell_max[TILE] ) {
675 else if(caloHash < m_cell_max[LARMINIFCAL] ) {
676 result = LARMINIFCAL;
681 //----------------------------------------------------------------------------
682 inline int CaloCell_Base_ID::pos_neg (const Identifier id)const
684 if(m_emHelper->is_lar_em(id)) {
685 return m_emHelper->barrel_ec(id);
687 else if(m_emHelper->is_lar_hec(id)) {
688 return m_hecHelper->pos_neg(id);
690 else if(m_emHelper->is_lar_minifcal(id)) {
691 // must do minifcal before fcal because miniFCAL IS FCAL
692 return m_minifcalHelper->pos_neg(id);
694 else if(m_emHelper->is_lar_fcal(id)) {
695 return m_fcalHelper->pos_neg(id);
702 //----------------------------------------------------------------------------
703 inline int CaloCell_Base_ID::section (const Identifier id)const
705 if(m_emHelper->is_tile(id)) {
706 return m_tileHelper->section(id);
713 //----------------------------------------------------------------------------
714 inline int CaloCell_Base_ID::sampling (const Identifier id)const
716 if(m_emHelper->is_lar_em(id)) {
717 return m_emHelper->sampling(id);
719 else if(m_emHelper->is_lar_hec(id)) {
720 return m_hecHelper->sampling(id);
722 else if(m_emHelper->is_lar_minifcal(id)) {
723 // must do minifcal before fcal because miniFCAL IS FCAL
724 return m_minifcalHelper->depth(id);
726 else if(m_emHelper->is_lar_fcal(id)) {
727 return m_fcalHelper->module(id);
734 //----------------------------------------------------------------------------
735 inline int CaloCell_Base_ID::side (const Identifier id)const
737 if(m_emHelper->is_tile(id)) {
738 return m_tileHelper->side(id);
745 //----------------------------------------------------------------------------
746 inline int CaloCell_Base_ID::region (const Identifier id)const
748 if(m_emHelper->is_lar_em(id)) {
749 return m_emHelper->region(id);
751 else if(m_emHelper->is_lar_hec(id)) {
752 return m_hecHelper->region(id);
759 //----------------------------------------------------------------------------
760 inline int CaloCell_Base_ID::module (const Identifier id)const
762 if(m_emHelper->is_tile(id)) {
763 return m_tileHelper->module(id);
770 //----------------------------------------------------------------------------
771 inline int CaloCell_Base_ID::eta(const Identifier id)const
773 if(m_emHelper->is_lar_em(id)) {
774 return m_emHelper->eta(id);
776 else if(m_emHelper->is_lar_hec(id)) {
777 return m_hecHelper->eta(id);
779 else if(m_emHelper->is_lar_minifcal(id)) {
780 // must do minifcal before fcal because miniFCAL IS FCAL
781 return m_minifcalHelper->eta(id);
783 else if(m_emHelper->is_lar_fcal(id)) {
784 return m_fcalHelper->eta(id);
791 //----------------------------------------------------------------------------
792 inline int CaloCell_Base_ID::tower(const Identifier id)const
794 if(m_emHelper->is_tile(id)) {
795 return m_tileHelper->tower(id);
802 //----------------------------------------------------------------------------
803 inline int CaloCell_Base_ID::phi(const Identifier id)const
805 if(m_emHelper->is_lar_em(id)) {
806 return m_emHelper->phi(id);
808 else if(m_emHelper->is_lar_hec(id)) {
809 return m_hecHelper->phi(id);
811 else if(m_emHelper->is_lar_minifcal(id)) {
812 // must do minifcal before fcal because miniFCAL IS FCAL
813 return m_minifcalHelper->phi(id);
815 else if(m_emHelper->is_lar_fcal(id)) {
816 return m_fcalHelper->phi(id);
823 //----------------------------------------------------------------------------
824 inline int CaloCell_Base_ID::sample(const Identifier id)const
826 if(m_emHelper->is_tile(id)) {
827 return m_tileHelper->sample(id);
834 //----------------------------------------------------------------------------
835 inline bool CaloCell_Base_ID::is_supercell(const Identifier id)const
837 if(m_emHelper->is_lar_em(id)) {
838 return m_emHelper->is_supercell(id);
840 else if(is_hec(id)) {
841 return m_hecHelper->is_supercell(id);
843 else if(m_emHelper->is_lar_fcal(id)) {
844 return m_fcalHelper->is_supercell(id);
846 else if(is_tile(id)) {
847 return m_tileHelper->is_supercell(id);
853 //----------------------------------------------------------------------------
854 inline int CaloCell_Base_ID::eta_min(const Identifier regId) const
856 if(m_emHelper->is_lar_em(regId)) {
857 return m_emHelper->eta_min(regId);
859 else if(m_emHelper->is_lar_hec(regId)) {
860 return m_hecHelper->eta_min(regId);
862 else if(m_emHelper->is_lar_minifcal(regId)) {
863 // must do minifcal before fcal because miniFCAL IS FCAL
864 return m_minifcalHelper->eta_min(regId);
866 else if(m_emHelper->is_lar_fcal(regId)) {
867 return m_fcalHelper->eta_min(regId);
869 else if(m_emHelper->is_tile(regId)) {
870 return m_tileHelper->eta_min(regId);
877 //----------------------------------------------------------------------------
878 inline int CaloCell_Base_ID::eta_max(const Identifier regId) const
880 if(m_emHelper->is_lar_em(regId)) {
881 return m_emHelper->eta_max(regId);
883 else if(m_emHelper->is_lar_hec(regId)) {
884 return m_hecHelper->eta_max(regId);
886 else if(m_emHelper->is_lar_minifcal(regId)) {
887 // must do minifcal before fcal because miniFCAL IS FCAL
888 return m_minifcalHelper->eta_max(regId);
890 else if(m_emHelper->is_lar_fcal(regId)) {
891 return m_fcalHelper->eta_max(regId);
893 else if(m_emHelper->is_tile(regId)) {
894 return m_tileHelper->eta_max(regId);
901 //----------------------------------------------------------------------------
902 inline int CaloCell_Base_ID::phi_min(const Identifier regId) const
904 if(m_emHelper->is_lar_em(regId)) {
905 return m_emHelper->phi_min(regId);
907 else if(m_emHelper->is_lar_hec(regId)) {
908 return m_hecHelper->phi_min(regId);
910 else if(m_emHelper->is_lar_minifcal(regId)) {
911 // must do minifcal before fcal because miniFCAL IS FCAL
912 return m_minifcalHelper->phi_min(regId);
914 else if(m_emHelper->is_lar_fcal(regId)) {
915 return m_fcalHelper->phi_min(regId);
922 //----------------------------------------------------------------------------
923 inline int CaloCell_Base_ID::phi_max(const Identifier regId) const
925 if(m_emHelper->is_lar_em(regId)) {
926 return m_emHelper->phi_max(regId);
928 else if(m_emHelper->is_lar_hec(regId)) {
929 return m_hecHelper->phi_max(regId);
931 else if(m_emHelper->is_lar_minifcal(regId)) {
932 // must do minifcal before fcal because miniFCAL IS FCAL
933 return m_minifcalHelper->phi_max(regId);
935 else if(m_emHelper->is_lar_fcal(regId)) {
936 return m_fcalHelper->phi_max(regId);
938 else if(m_emHelper->is_tile(regId)) {
939 return m_tileHelper->phi_max(regId);
946 //----------------------------------------------------------------------------
947 inline float CaloCell_Base_ID::etaGranularity(const Identifier regId) const
950 IdentifierHash regHash = subcalo_region_hash (regId, subcalo);
951 if (regHash == NOT_VALID) return NOT_VALID;
952 return m_helpers[subcalo]->etaGranularity (regHash);
955 //----------------------------------------------------------------------------
956 inline float CaloCell_Base_ID::phiGranularity(const Identifier regId) const
959 IdentifierHash regHash = subcalo_region_hash (regId, subcalo);
960 if (regHash == NOT_VALID) return NOT_VALID;
961 return m_helpers[subcalo]->phiGranularity (regHash);
964 //----------------------------------------------------------------------------
965 inline float CaloCell_Base_ID::eta0(const Identifier regId) const
968 IdentifierHash regHash = subcalo_region_hash (regId, subcalo);
969 if (regHash == NOT_VALID) return NOT_VALID;
970 return m_helpers[subcalo]->eta0 (regHash);
973 //----------------------------------------------------------------------------
974 inline float CaloCell_Base_ID::phi0(const Identifier regId) const
977 IdentifierHash regHash = subcalo_region_hash (regId, subcalo);
978 if (regHash == NOT_VALID) return NOT_VALID;
979 return m_helpers[subcalo]->phi0 (regHash);
982 //---------------------------------------------------------------------------
983 inline int CaloCell_Base_ID::GetSubCaloName(const std::string& SubCaloName )const
985 if(SubCaloName=="LAREM"){
988 else if(SubCaloName=="LARHEC"){
991 else if(SubCaloName=="LARMINIFCAL"){
994 else if(SubCaloName=="LARFCAL"){
997 else if(SubCaloName=="TILE"){
1006 //---------------------------------------------------------------------------
1008 CaloCell_Base_ID::SUBCALO
1009 CaloCell_Base_ID::get_subcalo (Identifier id) const
1011 if (m_emHelper->is_lar_em(id))
1013 else if (m_emHelper->is_lar_hec(id))
1015 else if (m_emHelper->is_lar_minifcal (id)) {
1016 // must do minifcal before fcal because miniFCAL IS FCAL
1019 else if (m_emHelper->is_lar_fcal (id))
1021 else if (m_emHelper->is_tile (id))