2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 * @file CaloIdentifier/CaloCell_Base_ID.icc
6 * @author scott snyder <snyder@bnl.gov>
8 * @brief Helper base class for offline cell identifiers
16//----------------------------------------------------------------------------
18CaloCell_Base_ID::region_id (const int subCalo,
19 const int barec_or_posneg,
20 const int sampling_or_fcalmodule,
21 const int region_or_dummy,
24 Identifier result(0); // this returns a pixel identifier [2.1.-2.0.0]
25 if( subCalo == LAREM ) {
26 return m_emHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, checks);
28 else if( subCalo == LARHEC ) {
29 return m_hecHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, checks);
31 else if( subCalo == LARFCAL ) {
32 return m_fcalHelper->module_id(barec_or_posneg, sampling_or_fcalmodule, checks);
34 else if( subCalo == LARMINIFCAL ) {
35 return m_minifcalHelper->module_id(barec_or_posneg, sampling_or_fcalmodule, checks);
37 else if( subCalo == TILE ) {
38 return m_tileHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, checks);
46CaloCell_Base_ID::region_id (const int subCalo,
47 const int barec_or_posneg,
48 const int sampling_or_fcalmodule,
49 const int region_or_dummy ) const
51 return region_id (subCalo, barec_or_posneg, sampling_or_fcalmodule,
52 region_or_dummy, do_checks());
55//----------------------------------------------------------------------------
57CaloCell_Base_ID::cell_id (const int subCalo,
58 const int barec_or_posneg,
59 const int sampling_or_fcalmodule,
60 const int region_or_dummy,
66 if( subCalo == LAREM ) {
67 return m_emHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
69 else if( subCalo == LARHEC ) {
70 return m_hecHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
72 else if( subCalo == LARFCAL ) {
73 return m_fcalHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, eta, phi, checks);
75 else if( subCalo == LARMINIFCAL ) {
76 return m_minifcalHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
78 else if( subCalo == TILE ) {
79 return m_tileHelper->cell_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
87CaloCell_Base_ID::cell_id (const int subCalo,
88 const int barec_or_posneg,
89 const int sampling_or_fcalmodule,
90 const int region_or_dummy,
94 return cell_id (subCalo, barec_or_posneg, sampling_or_fcalmodule,
95 region_or_dummy, eta, phi, do_checks());
98//----------------------------------------------------------------------------
100CaloCell_Base_ID::region_id ( const Identifier cellId ) const
102 Identifier result(0);
103 if(m_emHelper->is_lar_em(cellId)) {
104 return m_emHelper->region_id(cellId);
106 else if(m_emHelper->is_lar_hec(cellId)) {
107 return m_hecHelper->region_id(cellId);
109 else if(m_emHelper->is_lar_minifcal(cellId)) {
110 // must do minifcal before fcal because miniFCAL IS FCAL
111 return m_minifcalHelper->module_id(cellId);
113 else if(m_emHelper->is_lar_fcal(cellId)) {
114 return m_fcalHelper->module_id(cellId);
116 else if(m_emHelper->is_tile(cellId)) {
117 return m_tileHelper->region_id(cellId);
124//----------------------------------------------------------------------------
126CaloCell_Base_ID::cell_id (const Identifier regionId,
132 Identifier result(0);
133 if(m_emHelper->is_lar_em(regionId)) {
134 return m_emHelper->channel_id(regionId,eta,phi,checks);
136 else if(m_emHelper->is_lar_hec(regionId)) {
137 return m_hecHelper->channel_id(regionId,eta,phi,checks);
139 else if(m_emHelper->is_lar_minifcal(regionId)) {
140 // must do minifcal before fcal because miniFCAL IS FCAL
141 return m_minifcalHelper->channel_id(regionId, depth,eta,phi,checks);
143 else if(m_emHelper->is_lar_fcal(regionId)) {
144 return m_fcalHelper->channel_id(regionId,eta,phi,checks);
152CaloCell_Base_ID::cell_id (const Identifier regionId,
157 return cell_id (regionId, eta, phi, depth, do_checks());
160//----------------------------------------------------------------------------
162CaloCell_Base_ID::region_id (const IdentifierHash caloRegionHash) const
164 return(m_region_vec.at(caloRegionHash));
167//----------------------------------------------------------------------------
169CaloCell_Base_ID::region_id (const int subCalo,
170 const IdentifierHash subCaloRegionHash) const
172 return(m_region_vec.at(subCaloRegionHash + m_reg_min.at(subCalo)));
175//----------------------------------------------------------------------------
177CaloCell_Base_ID::cell_id (const IdentifierHash caloCellHash) const
179 return(m_cell_vec.at(caloCellHash));
182//----------------------------------------------------------------------------
184CaloCell_Base_ID::cell_id (const int subCalo, const IdentifierHash subCaloCellHash) const
186 return(m_cell_vec.at(subCaloCellHash + m_cell_min.at(subCalo)));
189//----------------------------------------------------------------------------
191CaloCell_Base_ID::calo_region_hash (const Identifier regionId) const
193 std::vector<Identifier>::const_iterator it = std::lower_bound(m_region_vec.begin(),m_region_vec.end(),regionId);
194 if ( it != m_region_vec.end() ){
195 return (it - m_region_vec.begin());
200//----------------------------------------------------------------------------
202CaloCell_Base_ID::subcalo_region_hash (const Identifier regionId, int& subCalo) const
205 if(is_hec(regionId)) {
208 else if (is_minifcal(regionId)) {
209 // must do minifcal before fcal because miniFCAL IS FCAL
210 subCalo = LARMINIFCAL ;
212 else if (is_fcal(regionId)) {
215 else if (is_tile(regionId)) {
218 std::vector<Identifier>::const_iterator it = std::lower_bound(m_region_vec.begin(),m_region_vec.end(),regionId);
219 if ( it != m_region_vec.end() ){
220 return (it - m_region_vec.begin() - m_reg_min.at(subCalo));
225//----------------------------------------------------------------------------
227CaloCell_Base_ID::subcalo_cell_hash (const Identifier cellId, int& subCalo) const
229 subCalo = get_subcalo (cellId);
232 // LArEM / HEC have subdetector-specific optimized methods.
234 return m_emHelper->channel_hash (cellId);
236 return m_hecHelper->channel_hash (cellId);
240 return m_helpers.at(subCalo)->channel_hash (cellId);
246//----------------------------------------------------------------------------
248CaloCell_Base_ID::calo_cell_hash (const Identifier cellId) const
251 IdentifierHash hash = subcalo_cell_hash (cellId, subcalo);
252 if (hash != NOT_VALID)
253 return m_cell_min.at(subcalo) + hash;
257//----------------------------------------------------------------------------
258inline CaloCell_Base_ID::size_type CaloCell_Base_ID::calo_cell_hash_max () const
260 return m_cell_hash_max;
263//----------------------------------------------------------------------------
264inline CaloCell_Base_ID::size_type CaloCell_Base_ID::calo_region_hash_max () const
266 return m_region_hash_max;
269//----------------------------------------------------------------------------
270inline void CaloCell_Base_ID::calo_cell_hash_range (const Identifier id, IdentifierHash& caloCellMin, IdentifierHash& caloCellMax) const
272 if(m_emHelper->is_lar_em(id)) {
273 caloCellMin = m_cell_min[LAREM];
274 caloCellMax = m_cell_max[LAREM];
276 else if(m_emHelper->is_lar_hec(id)) {
277 caloCellMin = m_cell_min[LARHEC];
278 caloCellMax = m_cell_max[LARHEC];
280 else if(m_emHelper->is_lar_minifcal(id)) {
281 // must do minifcal before fcal because miniFCAL IS FCAL
282 caloCellMin = m_cell_min[LARMINIFCAL];
283 caloCellMax = m_cell_max[LARMINIFCAL];
285 else if(m_emHelper->is_lar_fcal(id)) {
286 caloCellMin = m_cell_min[LARFCAL];
287 caloCellMax = m_cell_max[LARFCAL];
289 else if(m_emHelper->is_tile(id)) {
290 caloCellMin = m_cell_min[TILE];
291 caloCellMax = m_cell_max[TILE];
294 caloCellMin = NOT_VALID;
295 caloCellMax = NOT_VALID;
299//----------------------------------------------------------------------------
300inline void CaloCell_Base_ID::calo_reg_hash_range (const Identifier id, IdentifierHash& caloRegMin, IdentifierHash& caloRegMax) const
302 if(m_emHelper->is_lar_em(id)) {
303 caloRegMin = m_reg_min[LAREM];
304 caloRegMax = m_reg_max[LAREM];
306 else if(m_emHelper->is_lar_hec(id)) {
307 caloRegMin = m_reg_min[LARHEC];
308 caloRegMax = m_reg_max[LARHEC];
310 else if(m_emHelper->is_lar_minifcal(id)) {
311 // must do minifcal before fcal because miniFCAL IS FCAL
312 caloRegMin = m_reg_min[LARMINIFCAL];
313 caloRegMax = m_reg_max[LARMINIFCAL];
315 else if(m_emHelper->is_lar_fcal(id)) {
316 caloRegMin = m_reg_min[LARFCAL];
317 caloRegMax = m_reg_max[LARFCAL];
319 else if(m_emHelper->is_tile(id)) {
320 caloRegMin = m_reg_min[TILE];
321 caloRegMax = m_reg_max[TILE];
324 caloRegMin = NOT_VALID;
325 caloRegMax = NOT_VALID;
329//----------------------------------------------------------------------------
330inline void CaloCell_Base_ID::calo_cell_hash_range (const int subCalo, IdentifierHash& caloCellMin, IdentifierHash& caloCellMax) const
332 caloCellMin = m_cell_min.at(subCalo);
333 caloCellMax = m_cell_max.at(subCalo);
336//----------------------------------------------------------------------------
337inline void CaloCell_Base_ID::calo_reg_hash_range (const int subCalo, IdentifierHash& caloRegMin, IdentifierHash& caloRegMax) const
339 caloRegMin = m_reg_min.at(subCalo);
340 caloRegMax = m_reg_max.at(subCalo);
343//----------------------------------------------------------------------------
344inline IdentifierHash CaloCell_Base_ID::subcalo_cell_hash ( const IdentifierHash caloHash, int& subCalo) const
346 if(caloHash < m_cell_max[LAREM]) {
349 else if(caloHash < m_cell_max[LARHEC] ) {
352 else if(caloHash < m_cell_max[LARFCAL] ) {
355 else if(caloHash < m_cell_max[TILE] ) {
358 else if(caloHash < m_cell_max[LARMINIFCAL] ) {
359 subCalo = LARMINIFCAL;
365 return( caloHash - m_cell_min.at(subCalo)) ;
368//----------------------------------------------------------------------------
369inline IdentifierHash CaloCell_Base_ID::subcalo_region_hash ( const IdentifierHash caloHash, int& subCalo) const
371 if(caloHash < m_reg_max[LAREM]) {
374 else if(caloHash < m_reg_max[LARHEC] ) {
377 else if(caloHash < m_reg_max[LARFCAL] ) {
380 else if(caloHash < m_reg_max[TILE] ) {
383 else if(caloHash < m_reg_max[LARMINIFCAL] ) {
384 subCalo = LARMINIFCAL;
390 return( caloHash - m_reg_min.at(subCalo)) ;
393//----------------------------------------------------------------------------
394inline IdentifierHash CaloCell_Base_ID::calo_cell_hash (const int subCalo, const IdentifierHash subCaloHash) const
396 return( subCaloHash + m_cell_min.at(subCalo)) ;
400//----------------------------------------------------------------------------
401inline IdentifierHash CaloCell_Base_ID::calo_region_hash (const int subCalo, const IdentifierHash subCaloHash) const
403 return( subCaloHash + m_reg_min.at(subCalo)) ;
406//----------------------------------------------------------------------------
407inline CaloCell_Base_ID::id_iterator CaloCell_Base_ID::cell_begin () const
409 return(m_cell_vec.begin());
412//----------------------------------------------------------------------------
413inline CaloCell_Base_ID::id_iterator CaloCell_Base_ID::cell_end () const
415 return(m_cell_vec.end());
418//----------------------------------------------------------------------------
419inline CaloCell_Base_ID::id_range CaloCell_Base_ID::cell_range () const
421 return id_range (cell_begin(), cell_end());
424//----------------------------------------------------------------------------
426CaloCell_Base_ID::id_iterator
427CaloCell_Base_ID::cell_begin (const int subCalo) const
429 return m_helpers.at(subCalo)->channels().begin();
432//----------------------------------------------------------------------------
434CaloCell_Base_ID::id_iterator
435CaloCell_Base_ID::cell_end (const int subCalo) const
437 return m_helpers.at(subCalo)->channels().end();
440//----------------------------------------------------------------------------
442CaloCell_Base_ID::id_range
443CaloCell_Base_ID::cell_range (const int subCalo) const
445 return m_helpers.at(subCalo)->channels().range();
448//----------------------------------------------------------------------------
450CaloCell_Base_ID::id_iterator
451CaloCell_Base_ID::reg_begin () const
453 return(m_region_vec.begin());
456//----------------------------------------------------------------------------
458CaloCell_Base_ID::id_iterator
459CaloCell_Base_ID::reg_end () const
461 return(m_region_vec.end());
464//----------------------------------------------------------------------------
466CaloCell_Base_ID::id_range
467CaloCell_Base_ID::reg_range () const
469 return id_range (reg_begin(), reg_end());
472//----------------------------------------------------------------------------
474CaloCell_Base_ID::id_iterator
475CaloCell_Base_ID::reg_begin (const int subCalo) const
477 return m_helpers.at(subCalo)->regions().begin();
480//----------------------------------------------------------------------------
482CaloCell_Base_ID::id_iterator
483CaloCell_Base_ID::reg_end (const int subCalo) const
485 return m_helpers.at(subCalo)->regions().end();
488//----------------------------------------------------------------------------
490CaloCell_Base_ID::id_range
491CaloCell_Base_ID::reg_range (const int subCalo) const
493 return m_helpers.at(subCalo)->regions().range();
496//----------------------------------------------------------------------------
497inline bool CaloCell_Base_ID::is_em(const Identifier id) const
499 return m_emHelper->is_lar_em(id);
502//----------------------------------------------------------------------------
503inline bool CaloCell_Base_ID::is_em(const IdentifierHash caloHash) const
506 if(caloHash < m_cell_max[LAREM]) result=true;
510//----------------------------------------------------------------------------
511inline bool CaloCell_Base_ID::is_em_barrel(const Identifier id) const
513 return m_emHelper->is_em_barrel(id);
516//----------------------------------------------------------------------------
517inline bool CaloCell_Base_ID::is_em_endcap(const Identifier id) const
519 return m_emHelper->is_em_endcap(id);
522//----------------------------------------------------------------------------
523inline bool CaloCell_Base_ID::is_em_endcap_inner(const Identifier id) const
525 return m_emHelper->is_em_endcap_inner(id);
528//----------------------------------------------------------------------------
529inline bool CaloCell_Base_ID::is_em_endcap_outer(const Identifier id) const
531 return m_emHelper->is_em_endcap_outer(id);
534//----------------------------------------------------------------------------
535inline bool CaloCell_Base_ID::is_hec(const Identifier id) const
537 return m_emHelper->is_lar_hec(id);
540//----------------------------------------------------------------------------
541inline bool CaloCell_Base_ID::is_hec(const IdentifierHash caloHash) const
544 if(caloHash >= m_cell_min[LARHEC] &&
545 caloHash < m_cell_max[LARHEC] ) result=true;
549//----------------------------------------------------------------------------
550inline bool CaloCell_Base_ID::is_fcal(const Identifier id) const
552 return m_emHelper->is_lar_fcal(id);
555//----------------------------------------------------------------------------
556inline bool CaloCell_Base_ID::is_fcal(const IdentifierHash caloHash) const
559 if(caloHash >= m_cell_min[LARFCAL] && caloHash < m_cell_max[LARFCAL] ) result=true;
563//----------------------------------------------------------------------------
564inline bool CaloCell_Base_ID::is_minifcal(const Identifier id) const
566 return m_emHelper->is_lar_minifcal(id);
569//----------------------------------------------------------------------------
570inline bool CaloCell_Base_ID::is_minifcal(const IdentifierHash caloHash) const
573 if(caloHash >= m_cell_min[LARMINIFCAL] && caloHash < m_cell_max[LARMINIFCAL] ) result=true;
577//----------------------------------------------------------------------------
578inline bool CaloCell_Base_ID::is_tile(const ExpandedIdentifier& id) const
580 return m_emHelper->is_tile(id);
583//----------------------------------------------------------------------------
584inline bool CaloCell_Base_ID::is_tile(const Identifier id) const
586 return m_emHelper->is_tile(id);
589//----------------------------------------------------------------------------
590inline bool CaloCell_Base_ID::is_tile(const IdentifierHash caloHash) const
593 if(caloHash >= m_cell_min[TILE] && caloHash < m_cell_max[TILE] ) result=true;
597//----------------------------------------------------------------------------
598inline bool CaloCell_Base_ID::is_tile_barrel(const Identifier id) const
600 return m_tileHelper->is_tile_barrel(id);
603//----------------------------------------------------------------------------
604inline bool CaloCell_Base_ID::is_tile_extbarrel(const Identifier id) const
606 return m_tileHelper->is_tile_extbarrel(id);
609//----------------------------------------------------------------------------
610inline bool CaloCell_Base_ID::is_tile_gap(const Identifier id) const
612 return m_tileHelper->is_tile_gap(id);
615//----------------------------------------------------------------------------
616inline bool CaloCell_Base_ID::is_tile_gapscin(const Identifier id) const
618 return m_tileHelper->is_tile_gapscin(id);
621//----------------------------------------------------------------------------
622inline bool CaloCell_Base_ID::is_tile_positive(const Identifier id) const
624 return m_tileHelper->is_positive(id);
627//----------------------------------------------------------------------------
628inline bool CaloCell_Base_ID::is_tile_negative(const Identifier id) const
630 return m_tileHelper->is_negative(id);
633//----------------------------------------------------------------------------
634inline int CaloCell_Base_ID::sub_calo (const Identifier id)const
636 if(m_emHelper->is_lar_em(id)) {
639 else if(m_emHelper->is_lar_hec(id)) {
642 else if(m_emHelper->is_lar_minifcal(id)) {
643 // must do minifcal before fcal because miniFCAL IS FCAL
646 else if(m_emHelper->is_lar_fcal(id)) {
649 else if(m_emHelper->is_tile(id)) {
657//----------------------------------------------------------------------------
658inline int CaloCell_Base_ID::sub_calo (const IdentifierHash caloHash)const
660 int result = NOT_VALID;
661 if(caloHash < m_cell_max[LAREM]) {
664 else if(caloHash < m_cell_max[LARHEC] ) {
667 else if(caloHash < m_cell_max[LARFCAL] ) {
670 else if(caloHash < m_cell_max[TILE] ) {
673 else if(caloHash < m_cell_max[LARMINIFCAL] ) {
674 result = LARMINIFCAL;
679//----------------------------------------------------------------------------
680inline int CaloCell_Base_ID::pos_neg (const Identifier id)const
682 if(m_emHelper->is_lar_em(id)) {
683 return m_emHelper->barrel_ec(id);
685 else if(m_emHelper->is_lar_hec(id)) {
686 return m_hecHelper->pos_neg(id);
688 else if(m_emHelper->is_lar_minifcal(id)) {
689 // must do minifcal before fcal because miniFCAL IS FCAL
690 return m_minifcalHelper->pos_neg(id);
692 else if(m_emHelper->is_lar_fcal(id)) {
693 return m_fcalHelper->pos_neg(id);
700//----------------------------------------------------------------------------
701inline int CaloCell_Base_ID::section (const Identifier id)const
703 if(m_emHelper->is_tile(id)) {
704 return m_tileHelper->section(id);
711//----------------------------------------------------------------------------
712inline int CaloCell_Base_ID::sampling (const Identifier id)const
714 if(m_emHelper->is_lar_em(id)) {
715 return m_emHelper->sampling(id);
717 else if(m_emHelper->is_lar_hec(id)) {
718 return m_hecHelper->sampling(id);
720 else if(m_emHelper->is_lar_minifcal(id)) {
721 // must do minifcal before fcal because miniFCAL IS FCAL
722 return m_minifcalHelper->depth(id);
724 else if(m_emHelper->is_lar_fcal(id)) {
725 return m_fcalHelper->module(id);
732//----------------------------------------------------------------------------
733inline int CaloCell_Base_ID::side (const Identifier id)const
735 if(m_emHelper->is_tile(id)) {
736 return m_tileHelper->side(id);
743//----------------------------------------------------------------------------
744inline int CaloCell_Base_ID::region (const Identifier id)const
746 if(m_emHelper->is_lar_em(id)) {
747 return m_emHelper->region(id);
749 else if(m_emHelper->is_lar_hec(id)) {
750 return m_hecHelper->region(id);
757//----------------------------------------------------------------------------
758inline int CaloCell_Base_ID::module (const Identifier id)const
760 if(m_emHelper->is_tile(id)) {
761 return m_tileHelper->module(id);
768//----------------------------------------------------------------------------
769inline int CaloCell_Base_ID::eta(const Identifier id)const
771 if(m_emHelper->is_lar_em(id)) {
772 return m_emHelper->eta(id);
774 else if(m_emHelper->is_lar_hec(id)) {
775 return m_hecHelper->eta(id);
777 else if(m_emHelper->is_lar_minifcal(id)) {
778 // must do minifcal before fcal because miniFCAL IS FCAL
779 return m_minifcalHelper->eta(id);
781 else if(m_emHelper->is_lar_fcal(id)) {
782 return m_fcalHelper->eta(id);
789//----------------------------------------------------------------------------
790inline int CaloCell_Base_ID::tower(const Identifier id)const
792 if(m_emHelper->is_tile(id)) {
793 return m_tileHelper->tower(id);
800//----------------------------------------------------------------------------
801inline int CaloCell_Base_ID::phi(const Identifier id)const
803 if(m_emHelper->is_lar_em(id)) {
804 return m_emHelper->phi(id);
806 else if(m_emHelper->is_lar_hec(id)) {
807 return m_hecHelper->phi(id);
809 else if(m_emHelper->is_lar_minifcal(id)) {
810 // must do minifcal before fcal because miniFCAL IS FCAL
811 return m_minifcalHelper->phi(id);
813 else if(m_emHelper->is_lar_fcal(id)) {
814 return m_fcalHelper->phi(id);
821//----------------------------------------------------------------------------
822inline int CaloCell_Base_ID::sample(const Identifier id)const
824 if(m_emHelper->is_tile(id)) {
825 return m_tileHelper->sample(id);
832//----------------------------------------------------------------------------
833inline bool CaloCell_Base_ID::is_supercell(const Identifier id)const
835 if(m_emHelper->is_lar_em(id)) {
836 return m_emHelper->is_supercell(id);
838 else if(is_hec(id)) {
839 return m_hecHelper->is_supercell(id);
841 else if(m_emHelper->is_lar_fcal(id)) {
842 return m_fcalHelper->is_supercell(id);
844 else if(is_tile(id)) {
845 return m_tileHelper->is_supercell(id);
851//----------------------------------------------------------------------------
852inline int CaloCell_Base_ID::eta_min(const Identifier regId) const
854 if(m_emHelper->is_lar_em(regId)) {
855 return m_emHelper->eta_min(regId);
857 else if(m_emHelper->is_lar_hec(regId)) {
858 return m_hecHelper->eta_min(regId);
860 else if(m_emHelper->is_lar_minifcal(regId)) {
861 // must do minifcal before fcal because miniFCAL IS FCAL
862 return m_minifcalHelper->eta_min(regId);
864 else if(m_emHelper->is_lar_fcal(regId)) {
865 return m_fcalHelper->eta_min(regId);
867 else if(m_emHelper->is_tile(regId)) {
868 return m_tileHelper->eta_min(regId);
875//----------------------------------------------------------------------------
876inline int CaloCell_Base_ID::eta_max(const Identifier regId) const
878 if(m_emHelper->is_lar_em(regId)) {
879 return m_emHelper->eta_max(regId);
881 else if(m_emHelper->is_lar_hec(regId)) {
882 return m_hecHelper->eta_max(regId);
884 else if(m_emHelper->is_lar_minifcal(regId)) {
885 // must do minifcal before fcal because miniFCAL IS FCAL
886 return m_minifcalHelper->eta_max(regId);
888 else if(m_emHelper->is_lar_fcal(regId)) {
889 return m_fcalHelper->eta_max(regId);
891 else if(m_emHelper->is_tile(regId)) {
892 return m_tileHelper->eta_max(regId);
899//----------------------------------------------------------------------------
900inline int CaloCell_Base_ID::phi_min(const Identifier regId) const
902 if(m_emHelper->is_lar_em(regId)) {
903 return m_emHelper->phi_min(regId);
905 else if(m_emHelper->is_lar_hec(regId)) {
906 return m_hecHelper->phi_min(regId);
908 else if(m_emHelper->is_lar_minifcal(regId)) {
909 // must do minifcal before fcal because miniFCAL IS FCAL
910 return m_minifcalHelper->phi_min(regId);
912 else if(m_emHelper->is_lar_fcal(regId)) {
913 return m_fcalHelper->phi_min(regId);
920//----------------------------------------------------------------------------
921inline int CaloCell_Base_ID::phi_max(const Identifier regId) const
923 if(m_emHelper->is_lar_em(regId)) {
924 return m_emHelper->phi_max(regId);
926 else if(m_emHelper->is_lar_hec(regId)) {
927 return m_hecHelper->phi_max(regId);
929 else if(m_emHelper->is_lar_minifcal(regId)) {
930 // must do minifcal before fcal because miniFCAL IS FCAL
931 return m_minifcalHelper->phi_max(regId);
933 else if(m_emHelper->is_lar_fcal(regId)) {
934 return m_fcalHelper->phi_max(regId);
936 else if(m_emHelper->is_tile(regId)) {
937 return m_tileHelper->phi_max(regId);
944//----------------------------------------------------------------------------
945inline float CaloCell_Base_ID::etaGranularity(const Identifier regId) const
948 IdentifierHash regHash = subcalo_region_hash (regId, subcalo);
949 if (regHash == NOT_VALID) return NOT_VALID;
950 return m_helpers.at(subcalo)->etaGranularity (regHash);
953//----------------------------------------------------------------------------
954inline float CaloCell_Base_ID::phiGranularity(const Identifier regId) const
957 IdentifierHash regHash = subcalo_region_hash (regId, subcalo);
958 if (regHash == NOT_VALID) return NOT_VALID;
959 return m_helpers.at(subcalo)->phiGranularity (regHash);
962//----------------------------------------------------------------------------
963inline float CaloCell_Base_ID::eta0(const Identifier regId) const
966 IdentifierHash regHash = subcalo_region_hash (regId, subcalo);
967 if (regHash == NOT_VALID) return NOT_VALID;
968 return m_helpers.at(subcalo)->eta0 (regHash);
971//----------------------------------------------------------------------------
972inline float CaloCell_Base_ID::phi0(const Identifier regId) const
975 IdentifierHash regHash = subcalo_region_hash (regId, subcalo);
976 if (regHash == NOT_VALID) return NOT_VALID;
977 return m_helpers.at(subcalo)->phi0 (regHash);
980//---------------------------------------------------------------------------
981inline int CaloCell_Base_ID::GetSubCaloName(const std::string& SubCaloName )const
983 if(SubCaloName=="LAREM"){
986 else if(SubCaloName=="LARHEC"){
989 else if(SubCaloName=="LARMINIFCAL"){
992 else if(SubCaloName=="LARFCAL"){
995 else if(SubCaloName=="TILE"){
1004//---------------------------------------------------------------------------
1006CaloCell_Base_ID::SUBCALO
1007CaloCell_Base_ID::get_subcalo (Identifier id) const
1009 if (m_emHelper->is_lar_em(id))
1011 else if (m_emHelper->is_lar_hec(id))
1013 else if (m_emHelper->is_lar_minifcal (id)) {
1014 // must do minifcal before fcal because miniFCAL IS FCAL
1017 else if (m_emHelper->is_lar_fcal (id))
1019 else if (m_emHelper->is_tile (id))