ATLAS Offline Software
CaloDetDescrManager.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Calorimeter detector description package
7  -----------------------------------------
8  ***************************************************************************/
9 
10 //<doc><file> $Id: CaloDetDescrManager.cxx,v 1.69 2009-03-03 14:34:12 gunal Exp $
11 //<version> $Name: not supported by cvs2svn $
12 
13 
14 // Calo includes
16 #include "CaloDetDescr/CaloDetDescrElement.h"
20 
21 // Athena/Gaudi includes
22 #include "GaudiKernel/Bootstrap.h"
23 #include "GaudiKernel/ISvcLocator.h"
24 #include "GaudiKernel/IMessageSvc.h"
25 #include "StoreGate/StoreGateSvc.h"
26 
27 #include <cmath>
28 
30  m_cell_id(nullptr),
31  m_calo_mgr(nullptr)
32 {
33 }
34 
36 {
37  unsigned tile_min = m_subCalo_min[CaloCell_ID::TILE];
38  unsigned tile_max = m_subCalo_max[CaloCell_ID::TILE];
39  for (size_t i = 0; i < m_element_vec.size(); i++) {
40  // Tile elements are deleted by TileDetDescrManager.
41  if (i >= tile_min && i < tile_max) continue;
42  delete m_element_vec[i];
43  }
44 
45  for (size_t i = 0; i < m_descr_vec.size(); i++)
46  delete m_descr_vec[i];
47 }
48 
50 {
51  // set sizes :
54 
55  // --- --- Temporary, for testing only --- ---
56  for(unsigned int i=0; i<m_element_vec.size(); i++)
57  m_element_vec[i] = nullptr;
58 
59  for(unsigned int i=0; i<m_descr_vec.size(); i++)
60  m_descr_vec[i] = nullptr;
61  // --- --- Temporary, for testing only --- ---
62 
63  // cache offsets :
65 
66  m_subCalo_min.resize(nb);
67  m_subCalo_max.resize(nb);
68  m_subCalo_begin.resize(nb);
69  m_subCalo_end.resize(nb);
70 
71  for(int i = 0; i < nb; i++) {
73 
76  }
77 }
78 
80 {
81  std::cout << " CaloDetDescrManager_Base: \n";
82 
83  std::cout << " Number of Calo descriptors : " << m_descr_vec.size() << "\n";
84 
85  int ntot = m_descr_vec.size();
86  for(int i=0 ; i<ntot; i++ )
87  {
88  std::cout << "\n ------ Calo descriptor number " << i << "\n";
89  if(m_descr_vec[i])
90  m_descr_vec[i]->print();
91  }
92 }
93 
95 {
96  return m_cell_id;
97 }
98 
100 {
101  return m_calo_mgr;
102 }
103 
106 {
107  return m_element_vec.size();
108 }
109 
112 {
113  return m_element_vec.begin();
114 }
115 
118 {
119  return m_element_vec.end();
120 }
121 
124 {
125  return {m_element_vec.begin(),
126  m_element_vec.end()};
127 }
128 
131 {
132  return {m_element_vec.begin(),
133  m_element_vec.end()};
134 }
135 
138 {
139  int sCal = (int)subCalo;
140  return m_subCalo_begin[sCal];
141 }
142 
145 {
146  int sCal = (int) subCalo;
147  return m_subCalo_end[sCal];
148 }
149 
152 {
153  int sCal = (int) subCalo;
154  return {m_subCalo_begin[sCal],
155  m_subCalo_end[sCal]};
156 }
157 
158 const CaloDetDescrElement*
160 {
162  return get_element(hash);
163 }
164 
167 {
169  return get_element_nonconst(hash);
170 }
171 
172 const CaloDetDescrElement*
174  IdentifierHash subCaloCellHash) const
175 {
176  // meaningless interface for Tiles, will only work for LAr
177 
178  int sCal = (int) subCalo;
179  if ( subCaloCellHash + m_subCalo_min[sCal] < m_element_vec.size() )
180  return m_element_vec[subCaloCellHash + m_subCalo_min[sCal]] ;
181  else return nullptr ;
182 }
183 
184 const CaloDetDescrElement*
186  int sampling_or_module,
187  bool barrel,
188  double eta,
189  double phi) const
190 {
191 
192  bool inCell=false;
193  int niter=0;
194  const CaloDetDescrElement* elt=nullptr ;
195  const CaloDetDescrElement* elt_best=nullptr ;
196 
197  double eta2=eta;
198  double phi2=phi;
199  double deltabest=9999.;
200  //std::cout << " in get_element0 " << subCalo << " " << sampling_or_module << " " << barrel << " " << eta << " " << phi << std::endl;
201 
202 
203  while (!inCell && niter<3) {
204 
205  const CaloDetDescriptor* reg = get_descriptor(subCalo,sampling_or_module,barrel,eta2,phi2);
206  if (!reg) return nullptr;
207 
208  if (reg->is_lar_fcal()) return get_element_FCAL(reg,eta,phi);
209 
210  int ieta = reg->eta_channel(eta2);
211  int iphi = reg->phi_channel(phi2);
212  //std::cout << " ieta,iphi " << ieta << " " << iphi << std::endl;
213 
214  if(ieta < 0) return elt;
215  if(iphi < 0) return elt;
216 
217  Identifier regId = reg->identify();
218  Identifier cellId = m_cell_id->cell_id(regId, ieta, iphi);
219  IdentifierHash caloCellHash = m_cell_id->calo_cell_hash(cellId);
220  // Check for invalid identifier.
221  if (m_cell_id->cell_id (caloCellHash) != cellId) return elt;
222  elt = get_element(caloCellHash);
223  //std::cout << " element " << elt->eta() << " " << elt->phi() << " " << elt->deta() << " " << elt->dphi() << std::endl;
224  double deta=std::fabs(eta-elt->eta())-0.5*elt->deta();
225  double dphi = std::fabs(CaloPhiRange::fix(phi-elt->phi())) - 0.5*elt->dphi();
226  if (deta>0. || dphi > 0.) {
227  double delta=0.;
228  if (deta>0.) {
229  eta2=eta2 + (eta-elt->eta());
230  delta = delta + deta;
231  }
232  if (dphi>0.) {
233  phi2=CaloPhiRange::fix(phi2+(phi-elt->phi()));
234  delta = delta + dphi;
235  }
236  //std::cout << " need to iteration => eta2,phi2 " << eta2 << " " << phi2 << std::endl;
237  if (delta<deltabest) {
238  deltabest=delta;
239  elt_best = elt;
240  }
241  niter++;
242  }
243  else inCell=true;
244  }
245  if (!inCell) {
246  elt = elt_best;
247  // std::cout << " after iteration get_element0 " << inCell << " " << eta << " " << phi << " " << elt->eta() << " " << elt->phi() << " " << deltabest << std::endl;
248  }
249 
250 
251 
252  return elt;
253 }
254 
255 const CaloDetDescrElement*
257  double eta,
258  double phi) const
259 {
260  const CaloDetDescrElement* elt=nullptr;
261 
262  // For LAr loop on regions :
263 
269 
270  bool inCell=false;
271  int niter=0;
272  const CaloDetDescrElement* elt_best=nullptr;
273 
274  double eta2=eta;
275  double phi2=phi;
276  double deltabest=9999.;
277 
278  while (!inCell && niter<3) {
279 
280  const CaloDetDescriptor* reg = get_descriptor(sample,eta2,phi2);
281  if ( ! reg ) return elt;
282 
283  if (reg->is_lar_fcal()) return get_element_FCAL(reg,eta2,phi2);
284 
285  int ieta = reg->eta_channel(eta2);
286  int iphi = reg->phi_channel(phi2);
287 
288  if(ieta < 0) return elt;
289  if(iphi < 0) return elt;
290 
291  Identifier regId = reg->identify();
292  Identifier cellId = m_cell_id->cell_id(regId, ieta, iphi);
293  IdentifierHash caloCellHash = m_cell_id->calo_cell_hash(cellId);
294  // Check for invalid identifier.
295  if (m_cell_id->cell_id (caloCellHash) != cellId) return elt;
296  elt = get_element(caloCellHash);
297  double deta=std::fabs(eta-elt->eta())-0.5*elt->deta();
298  double dphi = std::fabs(CaloPhiRange::fix(phi-elt->phi())) - 0.5*elt->dphi();
299  if (deta>0. || dphi > 0.) {
300  double delta=0.;
301  if (deta>0.) {
302  eta2=eta2 + (eta-elt->eta());
303  delta = delta + deta;
304  }
305  if (dphi>0.) {
306  phi2=CaloPhiRange::fix(phi2+(phi-elt->phi()));
307  delta = delta + dphi;
308  }
309  if (delta<deltabest) {
310  deltabest=delta;
311  elt_best = elt;
312  }
313  niter++;
314  }
315  else inCell=true;
316  }
317  if (!inCell) {
318  elt = elt_best;
319  //std::cout << " after iteration get_element " << inCell << " " << eta << " " << phi << " " << elt->eta() << " " << elt->phi() << " " << deltabest << std::endl;
320  }
321 
322 
323  } else {
324 
325  // For Tiles loop on elements :
326 
327  for ( unsigned int i = m_subCalo_min[CaloCell_ID::TILE];
329  {
331  if (pt) {
332  const double dphi = std::fabs(CaloPhiRange::fix(phi-pt->phi()));
333  if ( pt->getSampling() == sample &&
334  pt->eta()+pt->deta()/2 >= eta &&
335  pt->eta()-pt->deta()/2 <= eta &&
336  dphi <= pt->dphi()/2 )
337  {
338  elt = pt;
339  break;
340  }
341  }
342  }
343  }
344  return elt;
345 }
346 
347 // Cut and paste, but from raw eta,phi
348 const CaloDetDescrElement*
350  double eta,
351  double phi) const
352 {
353  //std::cout << " ----- in get_element_raw for eta,phi raw " << eta << " " << phi << std::endl;
354  const CaloDetDescrElement* elt=nullptr;
355 
356  // For LAr loop on regions :
357 
363 
364  bool inCell=false;
365  int niter=0;
366  const CaloDetDescrElement* elt_best=nullptr ;
367 
368  double eta2=eta;
369  double phi2=phi;
370  double deltabest=9999.;
371 
372  while (!inCell && niter<3) {
373 
374  const CaloDetDescriptor* reg = get_descriptor_raw(sample,eta2,phi2);
375  if ( ! reg ) return elt;
376  //std::cout << " get_element_raw: found region calo etamin,etamax " << reg->calo_eta_min() << " " << reg->calo_eta_max() << std::endl;
377 
378  if (reg->is_lar_fcal()) return get_element_FCAL_raw(reg,eta,phi);
379 
380  int ieta = reg->eta_channel_raw(eta2);
381  int iphi = reg->phi_channel_raw(phi2);
382 
383  if(ieta < 0) return elt;
384  if(iphi < 0) return elt;
385 
386  Identifier regId = reg->identify();
387  Identifier cellId = m_cell_id->cell_id(regId, ieta, iphi);
388  IdentifierHash caloCellHash = m_cell_id->calo_cell_hash(cellId);
389  // Check for invalid identifier.
390  if (m_cell_id->cell_id (caloCellHash) != cellId) return elt;
391  elt = get_element(caloCellHash);
392  //std::cout << " elt raw,phi raw " << elt->eta_raw() << " " << elt->phi_raw() << std::endl;
393  double deta=std::fabs(eta-elt->eta_raw())-0.5*elt->deta();
394  double dphi = std::fabs(CaloPhiRange::fix(phi-elt->phi_raw())) - 0.5*elt->dphi();
395  if (deta>0. || dphi > 0.) {
396  double delta=0.;
397  if (deta>0.) {
398  eta2=eta2 + (eta-elt->eta_raw());
399  delta = delta + deta;
400  }
401  if (dphi>0.) {
402  phi2=CaloPhiRange::fix(phi2+(phi-elt->phi_raw()));
403  delta = delta + dphi;
404  }
405  if (delta<deltabest) {
406  deltabest=delta;
407  elt_best = elt;
408  }
409  niter++;
410  }
411  else {
412  //std::cout << " found cell " << elt->eta_raw() << " " << elt->phi_raw() << std::endl;
413  inCell=true;
414  }
415  }
416  if (!inCell) {
417  elt=elt_best;
418  //std::cout << " after iteration raw " << inCell << " " << eta << " " << phi << " " << elt->eta_raw() << " " << elt->phi_raw() << " " << deltabest << std::endl;
419  }
420 
421 
422  } else {
423 
424  // For Tiles loop on elements :
425 
426  for ( unsigned int i = m_subCalo_min[CaloCell_ID::TILE];
429  if (pt)
430  if ( pt->getSampling() == sample &&
431  pt->eta()+pt->deta()/2 <= eta &&
432  pt->eta()-pt->deta()/2 >= eta &&
433  pt->phi()+pt->phi()/2 <= phi &&
434  pt->phi()-pt->phi()/2 >= phi ) elt = pt ;
435  }
436  }
437  return elt;
438 }
439 
440 
441 
442 const CaloDetDescrElement*
444  double eta,
445  double phi) const
446 {
447  const CaloDetDescrElement* elt=nullptr;
448 
449  //std::cout << " in get_element_FCAL " << descr->reg_min() << " " << descr->reg_max() << " eta,phi " << eta << " " << phi << std::endl;
450  if (eta < (descr->reg_min()-0.01) || eta > (descr->reg_max()+0.01) ) return elt;
451 
452  Identifier regId = descr->identify();
453  Identifier cellId;
454  IdentifierHash caloCellHash;
455  const CaloDetDescrElement* elt2;
456  double drmax=9999.;
457  for (int ieta=0; ieta<descr->n_eta(); ieta++) {
458  for (int iphi=0; iphi<descr->n_phi(); iphi++) {
459  cellId = m_cell_id->cell_id(regId, ieta, iphi);
460  caloCellHash = m_cell_id->calo_cell_hash(cellId);
461  elt2 = get_element (caloCellHash);
462  double deta = (eta-elt2->eta());
463  double dphi = CaloPhiRange::diff(phi,elt2->phi());
464  double dr = (deta*deta+dphi*dphi);
465  if (dr<drmax) {
466  drmax=dr;
467  elt = elt2;
468  }
469  }
470  }
471 
472  //if (elt) std::cout << " element found " << elt->eta() << " " << elt->phi() << std::endl;
473  //else std::cout <<" element not found " << std::endl;
474 
475  return elt;
476 }
477 
478 const CaloDetDescrElement*
480  double eta,
481  double phi) const
482 {
483  const CaloDetDescrElement* elt=nullptr;
484 
485  //std::cout << " in get_element_FCAL " << descr->reg_min() << " " << descr->reg_max() << " eta,phi " << eta << " " << phi << std::endl;
486  if (std::fabs(eta) < (descr->calo_eta_min()-0.01) || std::fabs(eta) > (descr->calo_eta_max()+0.01) ) return elt;
487 
488  Identifier regId = descr->identify();
489  Identifier cellId;
490  IdentifierHash caloCellHash;
491  const CaloDetDescrElement* elt2;
492  double drmax=9999.;
493  for (int ieta=0; ieta<descr->n_eta(); ieta++) {
494  for (int iphi=0; iphi<descr->n_phi(); iphi++) {
495  cellId = m_cell_id->cell_id(regId, ieta, iphi);
496  caloCellHash = m_cell_id->calo_cell_hash(cellId);
497  elt2 = get_element (caloCellHash);
498  double deta = (eta-elt2->eta_raw());
499  double dphi = CaloPhiRange::diff(phi,elt2->phi_raw());
500  double dr = (deta*deta+dphi*dphi);
501  if (dr<drmax) {
502  drmax=dr;
503  elt = elt2;
504  }
505  }
506  }
507 
508  //if (elt) std::cout << " element found " << elt->eta() << " " << elt->phi() << std::endl;
509  //else std::cout <<" element not found " << std::endl;
510 
511  return elt;
512 }
513 
514 
515 
518 {
519  return m_descr_vec.begin();
520 }
521 
524 {
525  return m_descr_vec.end();
526 }
527 
530 {
531  return m_descr_vec.size();
532 }
533 
536 {
537  return {m_descr_vec.begin(), m_descr_vec.end()};
538 }
539 
542 {
543  return {m_descr_vec.begin(), m_descr_vec.end()};
544 }
545 
548 {
549  return m_tile_descr_vec.begin();
550 }
551 
554 {
555  return m_tile_descr_vec.end();
556 }
557 
560 {
561  return m_tile_descr_vec.size();
562 }
563 
566 {
567  return {m_tile_descr_vec.begin(),
568  m_tile_descr_vec.end()};
569 }
570 
573 {
574  return {m_tile_descr_vec.begin(),
575  m_tile_descr_vec.end()};
576 }
577 
578 const CaloDetDescriptor*
580 {
582  if(hash < m_descr_vec.size())
583  return m_descr_vec[hash] ;
584  else
585  return nullptr;
586 }
587 
590 {
592  if(hash < m_descr_vec.size())
593  return m_descr_vec[hash] ;
594  else
595  return nullptr;
596 }
597 
598 const CaloDetDescriptor*
600  int sampling_or_module,
601  bool barrel,
602  double eta,
603  double phi) const
604 {
605  const CaloDetDescriptor* desc0 = nullptr;
606  const CaloDetDescriptor* desc1 = nullptr;
607  const CaloDetDescriptor* desc2 = nullptr;
608  const CaloDetDescriptor* desc3 = nullptr;
609 
610  if(subCalo == CaloCell_ID::TILE) return nullptr;
611  if(subCalo == CaloCell_ID::LARHEC && barrel) return nullptr;
612  if(subCalo == CaloCell_ID::LARFCAL && barrel) return nullptr;
613 
614  for (unsigned int i=0; i<m_descr_vec.size(); i++)
615  {
616  const CaloDetDescriptor* reg = m_descr_vec[i];
617 
618  if(reg)
619  {
620 
621  // for em differentiate barrel from endcap :
622  if ((subCalo != CaloCell_ID::LAREM
623  || (!barrel && reg->is_lar_em_endcap())
624  || (barrel && reg->is_lar_em_barrel())
625  )
626  && ((subCalo == CaloCell_ID::LAREM && reg->is_lar_em())
627  || (subCalo == CaloCell_ID::LARHEC && reg->is_lar_hec())
628  || (subCalo == CaloCell_ID::LARFCAL && reg->is_lar_fcal())
629  )
630  )
631  {
632 
633  if(reg->eta_channel(eta) >=0 && reg->phi_channel(phi) >=0)
634  {
635  // this works only for LAr, for Tiles the sampling depends on the
636  // cell
637  int reg_sampl = reg->getSampling(0);
638  // using enums as running indices is not safe! Therefore ask
639  // for each sampling explicitly
640  if(reg->is_lar_em_barrel())
641  {
642  if(reg_sampl == CaloCell_ID::PreSamplerB) desc0 = reg;
643  else if(reg_sampl == CaloCell_ID::EMB1) desc1 = reg;
644  else if(reg_sampl == CaloCell_ID::EMB2) desc2 = reg;
645  else if(reg_sampl == CaloCell_ID::EMB3) desc3 = reg;
646  }
647  else if(reg->is_lar_em_endcap())
648  {
649  if(reg_sampl == CaloCell_ID::PreSamplerE) desc0 = reg;
650  else if(reg_sampl == CaloCell_ID::EME1) desc1 = reg;
651  else if(reg_sampl == CaloCell_ID::EME2) desc2 = reg;
652  else if(reg_sampl == CaloCell_ID::EME3) desc3 = reg;
653  }
654  else if(reg->is_lar_hec())
655  {
656  if(reg_sampl == CaloCell_ID::HEC0) desc0 = reg;
657  else if(reg_sampl == CaloCell_ID::HEC1) desc1 = reg;
658  else if(reg_sampl == CaloCell_ID::HEC2) desc2 = reg;
659  else if(reg_sampl == CaloCell_ID::HEC3) desc3 = reg;
660  }
661  else if(reg->is_lar_fcal())
662  {
663  if(reg_sampl == CaloCell_ID::FCAL0) desc0 = reg;
664  else if(reg_sampl == CaloCell_ID::FCAL1) desc1 = reg;
665  else if(reg_sampl == CaloCell_ID::FCAL2) desc2 = reg;
666  }
667  } //if(reg->eta_channel(eta) >=0 && reg->phi_channel(phi) >=0)
668  }
669  } //if(reg)
670  } // iteration over descriptors
671 
672  if(sampling_or_module == 0) return desc0;
673  else if(sampling_or_module == 1) return desc1;
674  else if(sampling_or_module == 2) return desc2;
675  else if(sampling_or_module == 3) return desc3;
676  else return nullptr;
677 }
678 
679 const CaloDetDescriptor*
681  double eta, double phi) const
682 {
683  // note that this code does not work in the FCal as eta indices depend
684  // on eta and phi
685 
686  const CaloDetDescriptor* desc = nullptr;
687 
688  if ( sample == CaloCell_ID::TileBar0 ||
696  sample == CaloCell_ID::TileExt2 ) return desc;
697 
698  for ( unsigned int i=0; i<m_descr_vec.size(); i++ ) {
699  const CaloDetDescriptor* reg = m_descr_vec[i];
700 
701  if (reg) {
702  if ( reg->eta_channel(eta) >=0 && reg->phi_channel(phi) >=0) {
703  // this works only for LAr EM and HEC, for Tiles the sampling
704  // depends on the cell
705  int reg_sampl = reg->getSampling(0);
706  if ( reg_sampl == sample ) desc = reg;
707  }
708  }
709  }
710 
711  return desc;
712 }
713 
714 const CaloDetDescriptor*
716  double eta, double phi) const
717 {
718  // note that this code does not work in the FCal as eta indices depend
719  // on eta and phi
720 
721  //std::cout << " in CaloDetDescrManager_Base::get_descriptor_raw " << std::endl;
722 
723  const CaloDetDescriptor* desc = nullptr;
724 
725  if ( sample == CaloCell_ID::TileBar0 ||
733  sample == CaloCell_ID::TileExt2 ) return desc;
734 
735  for ( unsigned int i=0; i<m_descr_vec.size(); i++ ) {
736  const CaloDetDescriptor* reg = m_descr_vec[i];
737 
738  if (reg) {
739  int reg_sampl = reg->getSampling(0);
740  if ( reg_sampl == sample ) {
741  if ( reg->eta_channel_raw(eta) >=0 && reg->phi_channel_raw(phi) >=0) {
742  // this works only for LAr EM and HEC, for Tiles the sampling
743  // depends on the cell
744  desc=reg;
745  return desc;
746  }
747  }
748  }
749  }
750 
751  return desc;
752 }
753 
754 
756 {
757  m_element_vec[element->calo_hash()] = element;
758 }
759 
761 {
762  m_descr_vec[descr->calo_hash()] = descr;
763 }
764 
765 void CaloDetDescrManager_Base::add(std::unique_ptr<CaloDetDescriptor> descr)
766 {
767  IdentifierHash idhash = descr->calo_hash();
768  m_descr_vec[idhash] = descr.release();
769 }
770 
772 {
773  m_tile_descr_vec.push_back(descr);
774 }
775 
777 {
779  m_element_vec[hash] = nullptr;
780  return old;
781 }
782 
784 {
785  m_cell_id = idHelper;
786 }
787 
789 {
790  m_calo_mgr = idHelper;
791 }
792 
793 void CaloDetDescrManager_Base::cellsInZone(double eta_min, double eta_max,
794  double phi_min, double phi_max,
795  std::vector<IdentifierHash> & cell_list ) const
796 {
797  cell_list.clear();
798  if ( eta_min >= eta_max ) return;
799  if ( phi_min >= phi_max ) return;
800 
801  std::vector<IdentifierHash> one_list;
802 
803  // For LAr use the descriptors :
804  for ( unsigned int i=0; i<m_descr_vec.size(); i++ ) {
805  const CaloDetDescriptor* reg = m_descr_vec[i];
806  if ( reg ) {
807  cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
808  if (cell_list.empty())
809  cell_list.swap (one_list);
810  else
811  cell_list.insert (cell_list.end(), one_list.begin(), one_list.end());
812  }
813  }
814 
815  // Now Tiles :
816  cellsInZone(eta_min, eta_max, phi_min, phi_max, CaloCell_ID::TILE, one_list);
817  cell_list.insert (cell_list.end(), one_list.begin(), one_list.end());
818 }
819 
820 void CaloDetDescrManager_Base::cellsInZone(double eta_min, double eta_max,
821  double phi_min, double phi_max,
822  CaloCell_ID::SUBCALO subCalo,
823  std::vector<IdentifierHash> & cell_list) const
824 {
825  cell_list.clear();
826  if ( eta_min >= eta_max ) return;
827  if ( phi_min >= phi_max ) return;
828 
829  std::vector<IdentifierHash> one_list;
830 
831 
832  if ( subCalo != CaloCell_ID::TILE ) {
833 
834  for ( unsigned int i=0; i<m_descr_vec.size(); i++ ) {
835  const CaloDetDescriptor* reg = m_descr_vec[i];
836  if ( reg )
837  if ( subCalo == reg->getSubCalo() ) {
838  cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
839  if (cell_list.empty())
840  cell_list.swap (one_list);
841  else
842  cell_list.insert (cell_list.end(),
843  one_list.begin(), one_list.end());
844  }
845  }
846 
847  } else {
848 
849  // For Tiles loop on elements :
850  const CaloDetDescrElement* tile_elt;
851  for ( unsigned int i = m_subCalo_min[subCalo];
852  i < m_subCalo_max[subCalo]; i++ ) {
853  tile_elt = m_element_vec[i];
854  if (tile_elt) {
855 
856  if ( tile_elt->eta()+tile_elt->deta()/2. > eta_min &&
857  tile_elt->eta()-tile_elt->deta()/2. < eta_max) {
858 
859  double dphi1 = CaloPhiRange::diff(tile_elt->phi()+tile_elt->dphi()/2.,phi_min);
860  double dphi2 = CaloPhiRange::diff(phi_max,tile_elt->phi()-tile_elt->dphi()/2);
861 
862  if(dphi1 >=0. && dphi2 >= 0.) {
863  if (cell_list.empty()) {
864  // Guess a good size, incl 3 samplings.
865  cell_list.reserve (static_cast<int>(
866  ((eta_max-eta_min) / tile_elt->deta()) *
867  ((phi_max-phi_min) / tile_elt->dphi()) * 3));
868  }
869  cell_list.push_back(tile_elt->calo_hash());
870  } // phi cut
871  } // eta cut
872  } // tile_elt exits
873  }
874  }
875 }
876 
877 void CaloDetDescrManager_Base::cellsInZone(double eta_min, double eta_max,
878  double phi_min, double phi_max,
880  std::vector<IdentifierHash> & cell_list) const
881 {
882  cell_list.clear();
883  if ( eta_min >= eta_max ) return;
884  if ( phi_min >= phi_max ) return;
885 
886  std::vector<IdentifierHash> one_list;
887 
888  if ( sample != CaloCell_ID::TileBar0 &&
897 
898  for ( unsigned int i=0; i<m_descr_vec.size(); i++ ) {
899  const CaloDetDescriptor* reg = m_descr_vec[i];
900  if ( reg )
901  // this works only for LAr, for Tiles the sampling depends on the
902  // cell
903  if ( sample == reg->getSampling(0) ) {
904  cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
905  if (cell_list.empty())
906  cell_list.swap (one_list);
907  else
908  cell_list.insert (cell_list.end(),
909  one_list.begin(), one_list.end());
910  }
911  }
912 
913  } else {
914 
915  // For Tiles loop on elements :
916  int nb = CaloCell_ID::TILE;
917  const CaloDetDescrElement* tile_elt;
918 
919  for ( unsigned int i = m_subCalo_min[nb]; i < m_subCalo_max[nb]; i++ ) {
920  tile_elt = m_element_vec[i];
921  if (tile_elt ){
922  if (tile_elt->getSampling() == sample) {
923 
924  if ( tile_elt->eta()+tile_elt->deta()/2. > eta_min &&
925  tile_elt->eta()-tile_elt->deta()/2. < eta_max) {
926 
927  double dphi1 = CaloPhiRange::diff(tile_elt->phi()+tile_elt->dphi()/2.,phi_min);
928  double dphi2 = CaloPhiRange::diff(phi_max,tile_elt->phi()-tile_elt->dphi()/2);
929 
930  if(dphi1 >=0. && dphi2 >= 0.) {
931  if (cell_list.empty()) {
932  // Guess a good size, incl 3 samplings.
933  cell_list.reserve (static_cast<int>(
934  ((eta_max-eta_min) / tile_elt->deta()) *
935  ((phi_max-phi_min) / tile_elt->dphi()) * 3));
936  }
937  cell_list.push_back(tile_elt->calo_hash());
938  } // phi cut
939  } // eta cut
940  } // sampling cut
941  } // tile_elt exists
942  }
943  }
944 }
945 
946 void CaloDetDescrManager_Base::cellsInZone(double eta_min, double eta_max,
947  double phi_min, double phi_max,
948  CaloCell_ID::SUBCALO subCalo,
949  int sampling_or_module,
950  std::vector<IdentifierHash> & cell_list) const
951 {
952  cell_list.clear();
953  if ( eta_min >= eta_max ) return;
954  if ( phi_min >= phi_max ) return;
955 
956  // sampling_or_module has no meaning for tiles
957  if ( subCalo == CaloCell_ID::TILE ) return;
958 
959  std::vector<IdentifierHash> one_list;
960 
961  for ( unsigned int i=0; i<m_descr_vec.size(); i++ ) {
962  const CaloDetDescriptor* reg = m_descr_vec[i];
963  if ( reg ) {
964  Identifier regId = reg->identify();
965  if ( subCalo == reg->getSubCalo() &&
966  m_cell_id->sampling(regId) == sampling_or_module ) {
967  cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
968  if (cell_list.empty())
969  cell_list.swap (one_list);
970  else
971  cell_list.insert (cell_list.end(),
972  one_list.begin(), one_list.end());
973  }
974  }
975  }
976 }
977 
978 void
979 CaloDetDescrManager_Base::cellsInZone(double eta, double phi, int ncell_eta,
980  int ncell_phi, CaloCell_ID::SUBCALO subCalo,
981  int sampling_or_module,
982  bool barrel,
983  std::vector<IdentifierHash> & cell_list) const
984 {
985 
986  cell_list.clear();
987  double eta_min, eta_max, phi_min, phi_max;
988  double weta = (ncell_eta-1)/2.;
989  double wphi = (ncell_phi-1)/2.;
990 
991  std::vector<IdentifierHash> one_list;
992 
993  if ( subCalo != CaloCell_ID::TILE ) {
994 
995  for ( unsigned int i=0; i<m_descr_vec.size(); i++ ) {
996  const CaloDetDescriptor* reg = m_descr_vec[i];
997  if ( reg ) {
998  Identifier regId = reg->identify();
999  if ( subCalo == reg->getSubCalo() &&
1000  m_cell_id->sampling(regId) == sampling_or_module) {
1001 
1002  double eta_gran = m_cell_id->etaGranularity(regId);
1003  double phi_gran = m_cell_id->phiGranularity(regId);
1004 
1005  eta_min = eta-weta*eta_gran;
1006  eta_max = eta+weta*eta_gran;
1007  phi_min = phi-wphi*phi_gran;
1008  phi_max = phi+wphi*phi_gran;
1009  cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
1010  cell_list.reserve (cell_list.size() + one_list.size());
1011  for ( unsigned int i = 0; i<one_list.size(); i++ ){
1012  // I know that cellsInZone catches more cells than needed
1013  // => look and cut
1014  const CaloDetDescrElement* elt = get_element (one_list[i]);
1015  double elt_eta = elt->eta();
1016  double elt_phi = elt->phi();
1017  if ( barrel == elt->is_lar_em_barrel() )
1018  if ( std::abs(eta - elt_eta) <= weta )
1019  if ( std::abs(phi - elt_phi) <= wphi )
1020  cell_list.push_back(one_list[i]);
1021  }
1022  }
1023  }
1024  }
1025  }
1026  else {
1027 
1028  // For Tiles loop on elements :
1029  // loosy logic. since I do not know the grannularity in the
1030  // region, I use the one of each element. Hum...
1031  const CaloDetDescrElement* tile_elt;
1032  for ( unsigned int i = m_subCalo_min[subCalo];
1033  i < m_subCalo_max[subCalo]; i++ ) {
1034  tile_elt = m_element_vec[i];
1035  if (tile_elt) {
1036  eta_min = eta-weta*tile_elt->deta();
1037  eta_max = eta+weta*tile_elt->deta();
1038 
1039  if ( tile_elt->eta()+tile_elt->deta()/2. > eta_min &&
1040  tile_elt->eta()-tile_elt->deta()/2. < eta_max) {
1041  phi_min = phi-wphi*tile_elt->dphi();
1042  phi_max = phi+wphi*tile_elt->dphi();
1043  double dphi1 = CaloPhiRange::diff(tile_elt->phi()+tile_elt->dphi()/2.,phi_min);
1044  double dphi2 = CaloPhiRange::diff(phi_max,tile_elt->phi()-tile_elt->dphi()/2);
1045 
1046  if(dphi1 >=0. && dphi2 >= 0. ) {
1047  if (cell_list.empty()) {
1048  // Guess a good size, incl 3 samplings.
1049  cell_list.reserve (static_cast<int> (
1050  ((eta_max-eta_min) / tile_elt->deta()) *
1051  ((phi_max-phi_min) / tile_elt->dphi()) * 3));
1052  }
1053  cell_list.push_back(tile_elt->calo_hash());
1054  } // phi cut
1055  } // eta cut
1056  } // tile elt exisits
1057  }
1058  }
1059 
1060 }
1061 
1062 void CaloDetDescrManager_Base::cellsInZone(double eta_min, double eta_max,
1063  double phi_min, double phi_max,
1064  const CaloDetDescriptor* descr,
1065  std::vector<IdentifierHash> & cell_list) const
1066 {
1067 
1068  cell_list.clear();
1069 
1070  if ( ! descr ) return;
1071  if ( eta_min >= eta_max ) return;
1072 
1073 // FCAL case : explicit loop over all cells to account for the fact that eta and phi are not independent
1074 
1075  if (descr->is_lar_fcal()) {
1076  // std::cout << " in FCAl case descr etamin/max " << descr->reg_min() << " " << descr->reg_max() <<
1077  // " zone etamin/max " << eta_min << " " << eta_max << std::endl;
1078  if (descr->reg_min() > eta_max || descr->reg_max() < eta_min) return;
1079  Identifier regId = descr->identify();
1080  Identifier cellId;
1081  IdentifierHash caloCellHash;
1082  const CaloDetDescrElement* elt;
1083  IdentifierHash prevHash(0);
1084  // std::cout <<" neta,nphi " << descr->n_eta() << " " << descr->n_phi() << std::endl;
1085  for (int ieta=0; ieta<descr->n_eta(); ieta++) {
1086  for (int iphi=0; iphi<descr->n_phi(); iphi++) {
1087  cellId = m_cell_id->cell_id(regId, ieta, iphi);
1088  caloCellHash = m_cell_id->calo_cell_hash(cellId);
1089  // this is required because otherwise caloCellHash of unconnected channels with be the same as some connected channels (
1090  if (caloCellHash != prevHash) {
1091  prevHash=caloCellHash;
1092  elt = get_element (caloCellHash);
1093  if (elt) {
1094  if ( elt->eta()+elt->deta()/2. > eta_min &&
1095  elt->eta()-elt->deta()/2. < eta_max) {
1096 
1097  double dphi1 = CaloPhiRange::diff(elt->phi()+elt->dphi()/2.,phi_min);
1098  double dphi2 = CaloPhiRange::diff(phi_max,elt->phi()-elt->dphi()/2);
1099 
1100  if(dphi1 >=0. && dphi2 >= 0.) {
1101  cell_list.push_back(caloCellHash);
1102  //std::cout << " elt in ! eta= " << elt->eta() << " phi= " << elt->phi() << " " << ieta << " " << iphi << "hash Id " << caloCellHash << " id " << cellId << std::endl;
1103  } // phi cut
1104  } // eta cut
1105  } // if(elt)
1106  //else {
1107  // std::cout << " no FCAL elt for this cell " << ieta << " " << iphi << " " << cellId << " " << caloCellHash << std::endl;
1108  // }
1109  }
1110  } // loop over iphi
1111  } // loop over iea
1112  }
1113 
1114 // everything but FCAL
1115  else {
1116  if ( ! descr->is_in(eta_min,eta_max,phi_min,phi_max)) return;
1117 
1118  double zone_min = eta_min;
1119  double zone_max = eta_max;
1120  int ieta_min = 0;
1121  int ieta_max = 0;
1122 
1123  // loop will start at ieta_min-1 (included) and finish at ieta_max+1 (included)
1124  // ==> be careful at the edges of the descriptor.
1125  // check on which side we are ( for eta<0 channel ordering is swapped )
1126  if ( descr->calo_sign() > 0 ) {
1127 
1128  if ( descr->reg_min() >= zone_min ){
1129  zone_min = descr->reg_min();
1130  ieta_min = 1;
1131  //std::cout << " POS ! setting zone_min to reg_min = " << zone_min << " and ieta_min to " << ieta_min << std::endl;
1132  }
1133  else {
1134  ieta_min = descr->eta_channel(zone_min);
1135  if (ieta_min < 0)
1136  ieta_min = 1;
1137  }
1138 
1139  if ( descr->reg_max() <= zone_max ) {
1140  zone_max = descr->reg_max();
1141  ieta_max = descr->n_eta() -1;
1142  //std::cout << " POS ! setting zone_max to reg_max = " << zone_max << " and ieta_max to " << ieta_max << std::endl;
1143  }
1144  else {
1145  ieta_max = descr->eta_channel(zone_max);
1146  if (ieta_max < 1)
1147  ieta_max = descr->n_eta() - 1;
1148  }
1149 
1150  }
1151  else {
1152 
1153  if ( descr->reg_min() >= zone_min ){
1154  zone_min = descr->reg_min();
1155  ieta_max = descr->n_eta() - 1;
1156  //std::cout << " NEG ! setting zone_min to reg_min = " << zone_min << " and ieta_max to " << ieta_max << std::endl;
1157  }
1158  else {
1159  ieta_max = descr->eta_channel(zone_min);
1160  if (ieta_max < 1)
1161  ieta_max = descr->n_eta() - 1;
1162  }
1163 
1164  if ( descr->reg_max() <= zone_max ) {
1165  zone_max = descr->reg_max();
1166  ieta_min = 1 ;
1167  //std::cout << " NEG ! setting zone_max to reg_max = " << zone_max << " and ieta_min to " << ieta_min << std::endl;
1168  }
1169  else {
1170  ieta_min = descr->eta_channel(zone_max - 0.0001);
1171  if (ieta_min < 0)
1172  ieta_min = 1;
1173  }
1174 
1175  }
1176 
1177 
1178  // phi :
1179 
1180  // for a full detector, the window limits cannot be outside... BUT :
1181  // for zones where phi_min is < 0 and phi_max > 0 ( around 0 ),
1182  // or phi_max is < 0 ( around M_PI )
1183  // the channel number iphi_min is larger than iphi_max and
1184  // the search will have to be done in 2 steps.
1185 
1186  // for a subset ( H8 or H6 testbeams ), if the window is larger than the
1187  // module the min/max channel numbers will be -1 => mess in loops
1188  // ==> reduce the window size to the module size
1189 
1190 
1191  double zone_phi_min = CaloPhiRange::fix (phi_min);
1192  double zone_phi_max = CaloPhiRange::fix (phi_max);
1193 
1194  // *** *** *** TEST BEAM!!! *** *** ***
1195  if (m_lar_geometry == "H8" || m_lar_geometry == "H6") {
1196  double margin = descr->dphi()*0.1;
1197 
1198  // FIXME : ideal values are used here, this should NOT be !!!!
1199 
1200  if ( descr->calo_phi_min() > zone_phi_min) zone_phi_min = descr->calo_phi_min() + margin;
1201  if ( descr->calo_phi_max() < zone_phi_max) zone_phi_max = descr->calo_phi_max() - margin;
1202  }
1203 
1204  int iphi_min = descr->phi_channel(zone_phi_min);
1205  int iphi_max = descr->phi_channel(zone_phi_max);
1206 
1207 // add more safety in case of strips to protect against misalignment
1208  int reg_sampl=descr->getSampling(0);
1209  if (reg_sampl == CaloCell_ID::EMB1 || reg_sampl == CaloCell_ID::EME1) {
1210  ieta_min = ieta_min -1;
1211  ieta_max = ieta_max +1;
1212  }
1213 
1214 
1215  Identifier regId = descr->identify();
1216  Identifier cellId;
1217  IdentifierHash caloCellHash;
1218  const CaloDetDescrElement* elt;
1219 
1220 
1221  /*
1222  std::cout << " cellsInZone : eta ! reg " << descr->reg_min() << " " << descr->reg_max()
1223  << " zone " << zone_min << " " << zone_max
1224  << " channels " << ieta_min << " " << ieta_max << std::endl;
1225 
1226  std::cout << " cellsInZone : phi ! reg " << descr->calo_phi_min() << " " << descr->calo_phi_max()
1227  << " zone " << zone_phi_min << " " << zone_phi_max
1228  << " channels " << iphi_min << " " << iphi_max << std::endl;
1229  */
1230 
1231 
1232  int reg_EtaMin = m_cell_id->eta_min (regId);
1233  int reg_EtaMax = m_cell_id->eta_max (regId);
1234  int reg_PhiMin = m_cell_id->phi_min (regId);
1235  if (reg_PhiMin<0) reg_PhiMin=0; // catch case where it is not defined for Tile
1236  int reg_PhiMax = m_cell_id->phi_max (regId);
1237 
1238 
1239  if ( iphi_min <= iphi_max && zone_phi_min <= zone_phi_max ) {
1240 
1241  // The easy case : just make list a bit larger to avoid rounding effects
1242 
1243  for ( int ieta = ieta_min-1 ; ieta <= ieta_max+1; ieta++ )
1244  for ( int iphi = iphi_min-1 ; iphi <= iphi_max+1; iphi++ )
1245  {
1246  if (ieta>=reg_EtaMin && ieta <=reg_EtaMax && iphi>=reg_PhiMin && iphi<=reg_PhiMax) {
1247  cellId = m_cell_id->cell_id(regId, ieta, iphi);
1248  caloCellHash = m_cell_id->calo_cell_hash(cellId);
1249  elt = get_element (caloCellHash);
1250  //std::cout << " case 1 : for ieta = " << ieta << " iphi = " << iphi << std::endl;
1251  if (elt
1252  && ( (elt->eta()+elt->deta()/2.) > zone_min + 0.00001 )
1253  && ( (elt->eta()-elt->deta()/2.) + 0.00001 < zone_max )
1254  && ( (elt->phi()+elt->dphi()/2.) > zone_phi_min + 0.00001 )
1255  && ( (elt->phi()-elt->dphi()/2.) + 0.00001 < zone_phi_max ) )
1256  {
1257  cell_list.push_back(caloCellHash);
1258  //std::cout << " elt in ! eta= " << elt->eta() << " phi= " << elt->phi() << " " << ieta << " " << iphi << std::endl;
1259  }
1260  //else
1261  //std::cout << " elt out ! eta= " << elt->eta() << " phi= " << elt->phi() << std::endl;
1262  }
1263  }
1264  }
1265  else if ( iphi_min <= iphi_max && zone_phi_min > zone_phi_max ) {
1266 
1267  // we are around the -M_PI -> +M_PI discontinuity , no zone_phi_max cut
1268 
1269  for ( int ieta = ieta_min-1 ; ieta <= ieta_max+1; ieta++ )
1270  for ( int iphi = iphi_min-1 ; iphi <= iphi_max+1; iphi++ )
1271  {
1272  if (ieta>=reg_EtaMin && ieta <=reg_EtaMax && iphi>=reg_PhiMin && iphi<=reg_PhiMax) {
1273  cellId = m_cell_id->cell_id(regId, ieta, iphi);
1274  caloCellHash = m_cell_id->calo_cell_hash(cellId);
1275  elt = get_element (caloCellHash);
1276  //std::cout << " case 2 : for ieta = " << ieta << " iphi = " << iphi << std::endl;
1277  if (elt
1278  && ( (elt->eta()+elt->deta()/2.) > zone_min + 0.00001 )
1279  && ( (elt->eta()-elt->deta()/2.) + 0.00001 < zone_max )
1280  && ( ( (elt->phi()+elt->dphi()/2.) > zone_phi_min + 0.00001 )
1281  || ( (elt->phi()-elt->dphi()/2.) + 0.00001 < zone_phi_max ) )
1282  )
1283  {
1284  cell_list.push_back(caloCellHash);
1285  //std::cout << " elt in ! eta= " << elt->eta() << " phi= " << elt->phi() << " " << ieta << " " << iphi << std::endl;
1286  }
1287  //else
1288  //std::cout << " elt out ! eta= " << elt->eta() << " phi= " << elt->phi() << std::endl;
1289  }
1290  }
1291  }
1292  else {
1293 
1294  // iphi_min > iphi_max => we are around phi = 0
1295 
1296  int nchmax = m_cell_id->phi_max(regId);
1297  // number of cells = nchmax + 1 ==> 0 to nchmax included
1298 
1299  for ( int ieta = ieta_min-1 ; ieta <= ieta_max+1; ieta++ ) {
1300 
1301  // first cells from min up to 2*M_PI
1302  for ( int iphi = iphi_min-1 ; iphi <= nchmax; iphi++ )
1303  {
1304  if (ieta>=reg_EtaMin && ieta <=reg_EtaMax && iphi>=reg_PhiMin && iphi<=reg_PhiMax) {
1305  cellId = m_cell_id->cell_id(regId, ieta, iphi);
1306  caloCellHash = m_cell_id->calo_cell_hash(cellId);
1307  elt = get_element (caloCellHash);
1308  //std::cout << " case 3 : for ieta = " << ieta << " iphi = " << iphi << std::endl;
1309  if (elt
1310  && ( (elt->eta()+elt->deta()/2.) > zone_min + 0.00001 )
1311  && ( (elt->eta()-elt->deta()/2.) + 0.00001 < zone_max )
1312  && ( (elt->phi()+elt->dphi()/2.) > zone_phi_min + 0.00001 )
1313  && ( (elt->phi()-elt->dphi()/2.) + 0.00001 < zone_phi_max ) )
1314  {
1315  cell_list.push_back(caloCellHash);
1316  //std::cout << " elt in ! eta= " << elt->eta() << " phi= " << elt->phi() << " " << ieta << " " << iphi << std::endl;
1317  }
1318  //else
1319  //std::cout << " elt out ! eta= " << elt->eta() << " phi= " << elt->phi() << std::endl;
1320  }
1321  }
1322  // now cells from 0 to min
1323  for ( int iphi = 0 ; iphi <= iphi_max+1; iphi++ )
1324  {
1325  if (ieta>=reg_EtaMin && ieta <=reg_EtaMax && iphi>=reg_PhiMin && iphi<=reg_PhiMax) {
1326  cellId = m_cell_id->cell_id(regId, ieta, iphi);
1327  caloCellHash = m_cell_id->calo_cell_hash(cellId);
1328  elt = get_element (caloCellHash);
1329  //std::cout << " case 4 : for ieta = " << ieta << " iphi = " << iphi << std::endl;
1330  if (elt
1331  && ( (elt->eta()+elt->deta()/2.) > zone_min + 0.00001 )
1332  && ( (elt->eta()-elt->deta()/2.) + 0.00001 < zone_max )
1333  && ( (elt->phi()+elt->dphi()/2.) > zone_phi_min + 0.00001 )
1334  && ( (elt->phi()-elt->dphi()/2.) + 0.00001 < zone_phi_max ) )
1335  {
1336  cell_list.push_back(caloCellHash);
1337  //std::cout << " elt in ! eta= " << elt->eta() << " phi= " << elt->phi() << " " << ieta << " " << iphi << std::endl;
1338  }
1339  //else
1340  //std::cout << " elt out ! eta= " << elt->eta() << " phi= " << elt->phi() << std::endl;
1341  }
1342  }
1343  }
1344  }
1345  } // if else FCAL
1346 }
1347 
1349 const
1350 {
1351  // note that this code does not work in the FCal as eta indices depend
1352  // on eta and phi
1353 
1354  // I'm looking for the distance between the eta direction and the closest edge.
1355  // all in absolute value --> the sign will indicate if it is in or out.
1356 
1357  bool result = false;
1358  etadist = 9999999.;
1359  double aeta = std::abs(eta);
1360 
1361  // Tile first
1362  // Treat Tile Barrel and End Cap in different ways
1363  // -- Barrel
1364  if(sample == CaloCell_ID::TileBar0 ||
1367  {
1368  for(unsigned int i=0; i<m_tile_descr_vec.size(); i++)
1369  {
1370  const CaloDetDescriptor* reg = m_tile_descr_vec[i];
1371 
1372  if(reg && reg->getSampling(0) == sample)
1373  {
1374  etadist = std::abs(aeta - reg->calo_eta_max());
1375  if(aeta <= reg->calo_eta_max()) result = true;
1376  break;
1377  }
1378  }
1379  }
1380  // End Cap
1381  else if(sample == CaloCell_ID::TileExt0 ||
1387  {
1388  for(unsigned int i=0; i<m_tile_descr_vec.size(); i++)
1389  {
1390  const CaloDetDescriptor* reg = m_tile_descr_vec[i];
1391 
1392  if(reg && reg->getSampling(0) == sample)
1393  {
1394  double edgemin = std::abs(aeta - reg->calo_eta_min());
1395  double edgemax = std::abs(aeta - reg->calo_eta_max());
1396  if(edgemin < etadist) etadist = edgemin;
1397  if(edgemax < etadist) etadist = edgemax;
1398 
1399  if(aeta >= reg->calo_eta_min() &&
1400  aeta <= reg->calo_eta_max()) result = true;
1401  break;
1402  }
1403  }
1404  }
1405  else {
1406  for ( unsigned int i=0; i<m_descr_vec.size(); i++ ) {
1407  const CaloDetDescriptor* reg = m_descr_vec[i];
1408  if ( reg ) {
1409  if ( reg->getSampling(0) == sample ) {
1410  if ( reg->eta_channel(eta) >=0 && reg->phi_channel(phi) >=0) result = true;
1411  double edgemin = std::abs( aeta - reg->reg_min() );
1412  double edgemax = std::abs( aeta - reg->reg_max() );
1413  if ( edgemin < etadist ) etadist = edgemin;
1414  if ( edgemax < etadist ) etadist = edgemax;
1415  }
1416  }
1417  }
1418  }
1419 
1420  if (result) etadist = etadist*(-1.);
1421 
1422  return result;
1423 }
1424 
1426  const bool barrel,
1427  const int sampling_or_module,
1429 {
1430  if ( subCalo == CaloCell_ID::LAREM ) {
1431  if ( barrel ) {
1432  if (sampling_or_module == 0) sample = CaloCell_ID::PreSamplerB;
1433  if (sampling_or_module == 1) sample = CaloCell_ID::EMB1;
1434  if (sampling_or_module == 2) sample = CaloCell_ID::EMB2;
1435  if (sampling_or_module == 3) sample = CaloCell_ID::EMB3;
1436  } else {
1437  if (sampling_or_module == 0) sample = CaloCell_ID::PreSamplerE;
1438  if (sampling_or_module == 1) sample = CaloCell_ID::EME1;
1439  if (sampling_or_module == 2) sample = CaloCell_ID::EME2;
1440  if (sampling_or_module == 3) sample = CaloCell_ID::EME3;
1441  }
1442  return;
1443  }
1444  else if ( subCalo == CaloCell_ID::LARHEC ) {
1445  if (sampling_or_module == 0) sample = CaloCell_ID::HEC0;
1446  if (sampling_or_module == 1) sample = CaloCell_ID::HEC1;
1447  if (sampling_or_module == 2) sample = CaloCell_ID::HEC2;
1448  if (sampling_or_module == 3) sample = CaloCell_ID::HEC3;
1449  }
1450  else if ( subCalo == CaloCell_ID::LARFCAL ) {
1451  if (sampling_or_module == 0) sample = CaloCell_ID::FCAL0;
1452  if (sampling_or_module == 1) sample = CaloCell_ID::FCAL1;
1453  if (sampling_or_module == 2) sample = CaloCell_ID::FCAL2;
1454  }
1455  else if ( subCalo == CaloCell_ID::TILE ) {
1456  // For Tiles sampling_or_module has a different meaning :
1457  // assume the client meant the entrance of the Tiles and ignore the gap
1458  if ( barrel )
1460  else
1462  }
1463  else
1465 
1466 }
1467 
1469  bool& barrel,
1470  int& sampling_or_module,
1472 {
1473  if ( sample == CaloCell_ID::PreSamplerB) {
1474  subCalo = CaloCell_ID::LAREM;
1475  barrel = true;
1476  sampling_or_module = 0;
1477  return;
1478  }
1479  else if ( sample == CaloCell_ID::EMB1) {
1480  subCalo = CaloCell_ID::LAREM;
1481  barrel = true;
1482  sampling_or_module = 1;
1483  return;
1484  }
1485  else if ( sample == CaloCell_ID::EMB2) {
1486  subCalo = CaloCell_ID::LAREM;
1487  barrel = true;
1488  sampling_or_module = 2;
1489  return;
1490  }
1491  else if ( sample == CaloCell_ID::EMB3) {
1492  subCalo = CaloCell_ID::LAREM;
1493  barrel = true;
1494  sampling_or_module = 3;
1495  return;
1496  }
1497  else if ( sample == CaloCell_ID::PreSamplerE) {
1498  subCalo = CaloCell_ID::LAREM;
1499  barrel = false;
1500  sampling_or_module = 0;
1501  return;
1502  }
1503  else if ( sample == CaloCell_ID::EME1) {
1504  subCalo = CaloCell_ID::LAREM;
1505  barrel = false;
1506  sampling_or_module = 1;
1507  return;
1508  }
1509  else if ( sample == CaloCell_ID::EME2) {
1510  subCalo = CaloCell_ID::LAREM;
1511  barrel = false;
1512  sampling_or_module = 2;
1513  return;
1514  }
1515  else if ( sample == CaloCell_ID::EME3) {
1516  subCalo = CaloCell_ID::LAREM;
1517  barrel = false;
1518  sampling_or_module = 3;
1519  return;
1520  }
1521  else if ( sample == CaloCell_ID::HEC0) {
1522  subCalo = CaloCell_ID::LARHEC;
1523  barrel = false;
1524  sampling_or_module = 0;
1525  return;
1526  }
1527  else if ( sample == CaloCell_ID::HEC1) {
1528  subCalo = CaloCell_ID::LARHEC;
1529  barrel = false;
1530  sampling_or_module = 1;
1531  return;
1532  }
1533  else if ( sample == CaloCell_ID::HEC2) {
1534  subCalo = CaloCell_ID::LARHEC;
1535  barrel = false;
1536  sampling_or_module = 2;
1537  return;
1538  }
1539  else if ( sample == CaloCell_ID::HEC3) {
1540  subCalo = CaloCell_ID::LARHEC;
1541  barrel = false;
1542  sampling_or_module = 3;
1543  return;
1544  }
1545  else if ( sample == CaloCell_ID::FCAL0) {
1546  subCalo = CaloCell_ID::LARFCAL;
1547  barrel = false;
1548  sampling_or_module = 0;
1549  return;
1550  }
1551  else if ( sample == CaloCell_ID::FCAL1) {
1552  subCalo = CaloCell_ID::LARFCAL;
1553  barrel = false;
1554  sampling_or_module = 1;
1555  return;
1556  }
1557  else if ( sample == CaloCell_ID::FCAL2) {
1558  subCalo = CaloCell_ID::LARFCAL;
1559  barrel = false;
1560  sampling_or_module = 2;
1561  return;
1562  }
1563  else if ( sample == CaloCell_ID::TileBar0 ||
1569  subCalo = CaloCell_ID::TILE;
1570  barrel = true;
1571  sampling_or_module = 0;
1572  return;
1573  }
1574  else if ( sample == CaloCell_ID::TileExt0 ||
1577  subCalo = CaloCell_ID::TILE;
1578  barrel = false;
1579  sampling_or_module = 0;
1580  return;
1581  }
1582  else {
1583  subCalo = CaloCell_ID::NOT_VALID;
1584  barrel = true;
1585  sampling_or_module = 0;
1586  }
1587 
1588 }
1589 
1591 {
1592  return static_cast<const CaloCell_ID*>
1594 }
1595 
1597 {
1599 }
1600 
1601 
1603 {
1605 }
1606 
1607 
1609 {
1610  return static_cast<const CaloCell_SuperCell_ID*>
1612 }
1613 
1615 {
1617 }
1618 
1619 
1621 {
1623 }
1624 
1625 
1626 
1628 {
1629  // For offline case, the manager does not own the tile elements.
1630  // But for the supercell case, we do.
1631  // So delete them here.
1632 
1633  for (const CaloDetDescriptor* d : tile_descriptors_range()) {
1634  delete d;
1635  }
1636 
1638  delete d;
1639  }
1640 }
CaloDetDescrElement::deta
float deta() const
cell deta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
CaloDetDescriptor::calo_eta_max
double calo_eta_max() const
'ideal' geometry: eta maximal
Definition: CaloDetDescriptor.h:563
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloDetDescrManager_Base::element_range
calo_element_range element_range() const
Range over element vector.
Definition: CaloDetDescrManager.cxx:123
CaloDetDescrManager_Base::m_subCalo_end
std::vector< calo_element_const_iterator > m_subCalo_end
offsets for subcalo's elements
Definition: CaloDetDescrManager.h:445
CaloDetDescrManager_Base::tile_descriptors_size
calo_descr_size tile_descriptors_size() const
number of tile descriptors
Definition: CaloDetDescrManager.cxx:559
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
CaloDetDescrManager_Base::calo_descriptors_begin
calo_descr_const_iterator calo_descriptors_begin() const
first descriptor in the vector
Definition: CaloDetDescrManager.cxx:517
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
get_generator_info.result
result
Definition: get_generator_info.py:21
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
CaloDetDescrManager_Base::tile_descriptors_begin
calo_descr_const_iterator tile_descriptors_begin() const
first tile descriptor (they are in separate vector)
Definition: CaloDetDescrManager.cxx:547
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
CaloDetDescrManager_Base::set_helper
void set_helper(const CaloCell_Base_ID *idHelper)
set calo Cell ID helper
Definition: CaloDetDescrManager.cxx:783
CaloDetDescriptor::getSubCalo
CaloCell_ID::SUBCALO getSubCalo() const
get subcalo
Definition: CaloDetDescriptor.h:533
CaloDetDescriptor::is_lar_fcal
bool is_lar_fcal() const
descriptor belongs to FCAL
Definition: CaloDetDescriptor.h:491
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
CaloDetDescriptor::reg_min
double reg_min() const
eta min and max once misaligned
Definition: CaloDetDescriptor.h:608
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloCell_Base_ID::phi_min
int phi_min(const Identifier regId) const
min value of phi index (-999 == failure)
CaloDetDescrManager_Base::element_end
calo_element_const_iterator element_end() const
end of element vector
Definition: CaloDetDescrManager.cxx:117
CaloDetDescriptor::phi_channel
int phi_channel(double phi) const
channel number for a given eta/phi (if outside returns -1) Should not be used for FCAL
Definition: CaloDetDescriptor.cxx:275
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloDetDescrManager_Base::m_subCalo_max
std::vector< IdentifierHash > m_subCalo_max
offsets for subcalo's elements
Definition: CaloDetDescrManager.h:439
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloDetDescrManager_Base::calo_descriptors_range_nonconst
calo_nonconst_descr_range calo_descriptors_range_nonconst()
Range over descriptors, with non-const elements.
Definition: CaloDetDescrManager.cxx:541
hist_file_dump.d
d
Definition: hist_file_dump.py:137
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrManager_Base::calo_element_range
boost::iterator_range< calo_element_const_iterator > calo_element_range
Definition: CaloDetDescrManager.h:186
CaloDetDescrManager_Base::calo_descriptors_size
calo_descr_size calo_descriptors_size() const
number of descriptors
Definition: CaloDetDescrManager.cxx:529
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
test_pyathena.pt
pt
Definition: test_pyathena.py:11
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
CaloDetDescriptor::is_lar_hec
bool is_lar_hec() const
descriptor belongs to HEC
Definition: CaloDetDescriptor.h:486
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
CaloCell_Base_ID::eta_max
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
CaloDetDescrManager_Base::add
void add(CaloDetDescrElement *element)
add Calo DD element to the elements vector
Definition: CaloDetDescrManager.cxx:755
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
CaloDetDescriptor::eta_channel_raw
int eta_channel_raw(double eta) const
channel number for a given eta/phi raw (if outside returns -1).
Definition: CaloDetDescriptor.cxx:290
CaloDetDescrManager_Base::calo_descriptors_end
calo_descr_const_iterator calo_descriptors_end() const
end of descriptors vector
Definition: CaloDetDescrManager.cxx:523
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
CaloDetDescrManager_Base::build_sample
static void build_sample(CaloCell_ID::SUBCALO subCalo, bool barrel, int sampling_or_module, CaloCell_ID::CaloSample &sample)
translate between the 2 ways to label a sub-detector:
Definition: CaloDetDescrManager.cxx:1425
CaloDetDescrManager_Base::m_tile_descr_vec
calo_descr_vec m_tile_descr_vec
vector of descriptors
Definition: CaloDetDescrManager.h:449
CaloDetDescrManager_Base::print
void print() const
print out the contents
Definition: CaloDetDescrManager.cxx:79
CaloDetDescrManager_Base::CaloDetDescrManager_Base
CaloDetDescrManager_Base()
Default Constructor.
Definition: CaloDetDescrManager.cxx:29
CaloCell_Base_ID::calo_region_hash
IdentifierHash calo_region_hash(const Identifier regionId) const
create hash id from 'global' region id
CaloDetDescriptor.h
Definition of CaloDetDescriptor.
CaloCell_Base_ID::phi_max
int phi_max(const Identifier regId) const
max value of phi index (-999 == failure)
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
CaloCondBlobAlgs_fillNoiseFromASCII.desc
desc
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:54
CaloDetDescrManager_Base::m_lar_geometry
std::string m_lar_geometry
LAr geometry label (full atlas/TB) for backwards compatibility.
Definition: CaloDetDescrManager.h:453
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition: CaloIdManager.h:45
CaloDetDescrManager_Base::calo_nonconst_element_range
boost::iterator_range< calo_nonconst_element_const_iterator > calo_nonconst_element_range
Definition: CaloDetDescrManager.h:190
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
CaloCell_SuperCell_ID
Helper class for offline supercell identifiers.
Definition: CaloCell_SuperCell_ID.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloDetDescrManager_Base::m_calo_mgr
const CaloIdManager * m_calo_mgr
Calo ID Manager helper.
Definition: CaloDetDescrManager.h:425
CaloCell_Base_ID::calo_cell_hash_range
void calo_cell_hash_range(const Identifier id, IdentifierHash &caloCellMin, IdentifierHash &caloCellMax) const
to loop on 'global' cell hashes of one sub-calorimeter alone
CaloDetDescrManager::set_helper
void set_helper(const CaloCell_ID *idHelper)
set calo Cell ID helper
Definition: CaloDetDescrManager.cxx:1596
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
CaloCell_Base_ID::sampling
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
CaloDetDescrManager_Base::getCaloCell_ID
const CaloCell_Base_ID * getCaloCell_ID() const
get calo cell ID helper
Definition: CaloDetDescrManager.cxx:94
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
CaloDetDescriptor::eta_channel
int eta_channel(double eta) const
channel number for a given eta/phi (if outside returns -1).
Definition: CaloDetDescriptor.cxx:260
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
CaloDetDescrManager_Base::element_range_nonconst
calo_nonconst_element_range element_range_nonconst()
Range over element vector, with non-const elements.
Definition: CaloDetDescrManager.cxx:130
CaloCell_SuperCell_ID.h
Helper class for offline supercell identifiers.
CaloDetDescrManager_Base::calo_element_const_iterator
CaloConstIteratorAdaptor< calo_element_vec::const_iterator > calo_element_const_iterator
Definition: CaloDetDescrManager.h:185
CaloDetDescriptor::is_lar_em
bool is_lar_em() const
descriptor belongs to EM calorimeter
Definition: CaloDetDescriptor.h:461
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
CaloPhiRange.h
CaloPhiRange class declaration.
CaloDetDescrManager_Base::m_descr_vec
calo_descr_vec m_descr_vec
vector of descriptors
Definition: CaloDetDescrManager.h:432
python.TransformConfig.descr
descr
print "%s.properties()" % self.__name__
Definition: TransformConfig.py:360
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
CaloDetDescriptor::is_lar_em_barrel
bool is_lar_em_barrel() const
descriptor belongs to EM barrel
Definition: CaloDetDescriptor.h:466
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
CaloDetDescrManager_Base::m_subCalo_min
std::vector< IdentifierHash > m_subCalo_min
offsets for subcalo's elements
Definition: CaloDetDescrManager.h:436
CaloDetDescrManager_Base::calo_descr_range
boost::iterator_range< calo_descr_const_iterator > calo_descr_range
Definition: CaloDetDescrManager.h:325
CaloDetDescrManager_Base::cellsInZone
void cellsInZone(double eta_min, double eta_max, double phi_min, double phi_max, std::vector< IdentifierHash > &cell_list) const
the only client is CaloCellList class
Definition: CaloDetDescrManager.cxx:793
CaloDetDescrManager_Base::getCalo_Mgr
const CaloIdManager * getCalo_Mgr() const
get calo ID manager
Definition: CaloDetDescrManager.cxx:99
CaloCell_Base_ID::phiGranularity
float phiGranularity(const Identifier regId) const
LAr phi granularity (NOT_VALID == failure)
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
CaloDetDescriptor::getSampling
CaloCell_ID::CaloSample getSampling(IdentifierHash onecalo_hash) const
get sampling
Definition: CaloDetDescriptor.cxx:185
CaloPhiRange::fix
static double fix(double phi)
Definition: CaloPhiRange.cxx:14
CaloSuperCellDetDescrManager::set_helper
void set_helper(const CaloCell_SuperCell_ID *idHelper)
set calo Cell ID helper
Definition: CaloDetDescrManager.cxx:1614
CaloDetDescrManager_Base::add_tile
void add_tile(CaloDetDescriptor *descr)
add tile descriptor to the tile descriptors vector
Definition: CaloDetDescrManager.cxx:771
CaloDetDescrManager_Base::~CaloDetDescrManager_Base
~CaloDetDescrManager_Base()
destructor
Definition: CaloDetDescrManager.cxx:35
CaloCell_Base_ID::eta_min
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
CaloDetDescriptor::is_lar_em_endcap
bool is_lar_em_endcap() const
descriptor belongs to EM end cap
Definition: CaloDetDescriptor.h:471
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
CaloDetDescrManager_Base::tile_descriptors_end
calo_descr_const_iterator tile_descriptors_end() const
end of tile descriptors vector
Definition: CaloDetDescrManager.cxx:553
CaloDetDescriptor::reg_max
double reg_max() const
eta min and max once misaligned
Definition: CaloDetDescriptor.h:613
CaloDetDescrManager_Base::element_begin
calo_element_const_iterator element_begin() const
first element
Definition: CaloDetDescrManager.cxx:111
CaloCell_Base_ID::cell_id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
CaloDetDescrManager_Base::get_element_FCAL_raw
const CaloDetDescrElement * get_element_FCAL_raw(const CaloDetDescriptor *reg, double eta, double phi) const
LArFCAl private methode to get element from raw eta,phi.
Definition: CaloDetDescrManager.cxx:479
CaloDetDescrManager_Base::is_in
bool is_in(double eta, double phi, CaloCell_ID::CaloSample sample, double &etadist) const
return true if direction eta,phi crosses ANY of the corresponding descriptors
Definition: CaloDetDescrManager.cxx:1348
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
CaloDetDescrManager_Base::calo_descriptors_range
calo_descr_range calo_descriptors_range() const
Range over descriptors.
Definition: CaloDetDescrManager.cxx:535
CaloDetDescrManager_Base::get_element_FCAL
const CaloDetDescrElement * get_element_FCAL(const CaloDetDescriptor *reg, double eta, double phi) const
LArFCAl private methode to get element.
Definition: CaloDetDescrManager.cxx:443
CaloDetDescrElement::dphi
float dphi() const
cell dphi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:358
CaloDetDescrElement::is_lar_em_barrel
bool is_lar_em_barrel() const
cell belongs to EM barrel
Definition: CaloDetDescrElement.cxx:98
CaloDetDescrManager_Base::get_element_nonconst
CaloDetDescrElement * get_element_nonconst(const Identifier &cellId)
get element by its identifier, non-const version.
Definition: CaloDetDescrManager.cxx:166
CaloDetDescrManager_Base::calo_nonconst_descr_range
boost::iterator_range< calo_nonconst_descr_const_iterator > calo_nonconst_descr_range
Definition: CaloDetDescrManager.h:330
CaloDetDescriptor::calo_eta_min
double calo_eta_min() const
'ideal' geometry: eta minimal
Definition: CaloDetDescriptor.h:558
CaloDetDescriptor
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
Definition: CaloDetDescriptor.h:58
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CSV_InDetExporter.old
old
Definition: CSV_InDetExporter.py:145
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
CaloDetDescriptor::phi_channel_raw
int phi_channel_raw(double phi) const
channel number for a given eta/phi raw (if outside returns -1) Should not be used for FCAL
Definition: CaloDetDescriptor.cxx:305
CaloDetDescrManager_Base::m_subCalo_begin
std::vector< calo_element_const_iterator > m_subCalo_begin
offsets for subcalo's elements
Definition: CaloDetDescrManager.h:442
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloDetDescrManager_Base::element_size
calo_element_vec_size element_size() const
total number of elements
Definition: CaloDetDescrManager.cxx:105
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
CaloDetDescrManager_Base::decode_sample
static void decode_sample(CaloCell_ID::SUBCALO &subCalo, bool &barrel, int &sampling_or_module, CaloCell_ID::CaloSample sample)
translate between the 2 ways to label a sub-detector:
Definition: CaloDetDescrManager.cxx:1468
DetectorZone::barrel
@ barrel
CaloDetDescrManager_Base::tile_descriptors_range_nonconst
calo_nonconst_descr_range tile_descriptors_range_nonconst()
Range over tile descriptors, with non-const elements.
Definition: CaloDetDescrManager.cxx:572
CaloDetDescrManager_Base::tile_descriptors_range
calo_descr_range tile_descriptors_range() const
Range over tile descriptors.
Definition: CaloDetDescrManager.cxx:565
CaloDetDescrManager_Base::calo_descr_size
calo_descr_vec::size_type calo_descr_size
Definition: CaloDetDescrManager.h:322
CaloDetDescrManager_Base::release_element
CaloDetDescrElement * release_element(IdentifierHash hash)
Definition: CaloDetDescrManager.cxx:776
CaloDetDescrManager::getCaloCell_ID
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
Definition: CaloDetDescrManager.cxx:1590
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
CaloDetDescrManager_Base::m_element_vec
calo_element_vec m_element_vec
vector of Calo DD elements
Definition: CaloDetDescrManager.h:429
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
CaloDetDescrManager_Base::initialize
void initialize()
initialization of the manager, used by the Converter when it creates the Manager
Definition: CaloDetDescrManager.cxx:49
CaloSuperCellDetDescrManager::getCaloCell_ID
const CaloCell_SuperCell_ID * getCaloCell_ID() const
get calo cell ID helper
Definition: CaloDetDescrManager.cxx:1608
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CaloSuperCellDetDescrManager::~CaloSuperCellDetDescrManager
virtual ~CaloSuperCellDetDescrManager()
Definition: CaloDetDescrManager.cxx:1627
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
CaloCell_Base_ID::NOT_VALID
@ NOT_VALID
Definition: CaloCell_Base_ID.h:46
hotSpotInTAG.nb
nb
Definition: hotSpotInTAG.py:164
CaloDetDescrManager_Base::get_element_raw
const CaloDetDescrElement * get_element_raw(CaloCell_ID::CaloSample sample, double eta, double phi) const
Get element from raw quantities (to build real fixed size clusters)
Definition: CaloDetDescrManager.cxx:349
CaloCell_Base_ID
Helper base class for offline cell identifiers.
Definition: CaloCell_Base_ID.h:41
CaloDetDescriptor::identify
Identifier identify() const override final
get region identifier
Definition: CaloDetDescriptor.h:501
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
StoreGateSvc.h
CaloDetDescrManager_Base::get_descriptor_nonconst
CaloDetDescriptor * get_descriptor_nonconst(const Identifier &regionId)
get descriptor by region identifier, non-const version.
Definition: CaloDetDescrManager.cxx:589
CaloCell_Base_ID::calo_region_hash_max
size_type calo_region_hash_max(void) const
cell 'global' region table max size
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
CaloConstIteratorAdaptor
Tranform iterator over pointers to iterator over const pointers.
Definition: CaloConstIteratorAdaptor.h:47
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
CaloDetDescrManager_Base::m_cell_id
const CaloCell_Base_ID * m_cell_id
Calo Cell ID helper.
Definition: CaloDetDescrManager.h:422
CaloDetDescrManager_Base::calo_element_vec_size
calo_element_vec::size_type calo_element_vec_size
Definition: CaloDetDescrManager.h:183
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352
CaloPhiRange::diff
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
Definition: CaloPhiRange.cxx:22
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size
CaloDetDescrManager_Base::get_descriptor_raw
const CaloDetDescriptor * get_descriptor_raw(CaloCell_ID::CaloSample sample, double eta, double phi) const
get descriptor by sample, eta and phi raw
Definition: CaloDetDescrManager.cxx:715
CaloDetDescrManager_Base::get_descriptor
const CaloDetDescriptor * get_descriptor(const Identifier &regionId) const
get descriptor by region identifier
Definition: CaloDetDescrManager.cxx:579
Identifier
Definition: IdentifierFieldParser.cxx:14
CaloCell_Base_ID::etaGranularity
float etaGranularity(const Identifier regId) const
LAr eta granularity (NOT_VALID == failure)