CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalGeometry.cc
Go to the documentation of this file.
5 #include <algorithm>
6 
7 #include <Math/Transform3D.h>
8 #include <Math/EulerAngles.h>
9 
14 
16  theTopology( topology ) {
17  init();
18 }
19 
21 
23  edm::LogInfo("HcalGeometry") << "HcalGeometry::init() "
24  << " HBSize " << theTopology.getHBSize()
25  << " HESize " << theTopology.getHESize()
26  << " HOSize " << theTopology.getHOSize()
27  << " HFSize " << theTopology.getHFSize();
28 
33 }
34 
35 void
37 {
38  if(!m_emptyIds.isSet()) {
39  std::unique_ptr<std::vector<DetId>> p_hbIds{new std::vector<DetId>};
40  std::unique_ptr<std::vector<DetId>> p_heIds{new std::vector<DetId>};
41  std::unique_ptr<std::vector<DetId>> p_hoIds{new std::vector<DetId>};
42  std::unique_ptr<std::vector<DetId>> p_hfIds{new std::vector<DetId>};
43  std::unique_ptr<std::vector<DetId>> p_emptyIds{new std::vector<DetId>};
44 
45  const std::vector<DetId>& baseIds ( CaloSubdetectorGeometry::getValidDetIds() ) ;
46  for( unsigned int i ( 0 ) ; i != baseIds.size() ; ++i )
47  {
48  const DetId id ( baseIds[i] );
49  if( id.subdetId() == HcalBarrel )
50  {
51  p_hbIds->push_back( id ) ;
52  }
53  else
54  {
55  if( id.subdetId() == HcalEndcap )
56  {
57  p_heIds->push_back( id ) ;
58  }
59  else
60  {
61  if( id.subdetId() == HcalOuter )
62  {
63  p_hoIds->push_back( id ) ;
64  }
65  else
66  {
67  if( id.subdetId() == HcalForward )
68  {
69  p_hfIds->push_back( id ) ;
70  }
71  }
72  }
73  }
74  }
75  std::sort( p_hbIds->begin(), p_hbIds->end() ) ;
76  std::sort( p_heIds->begin(), p_heIds->end() ) ;
77  std::sort( p_hoIds->begin(), p_hoIds->end() ) ;
78  std::sort( p_hfIds->begin(), p_hfIds->end() ) ;
79  p_emptyIds->resize( 0 ) ;
80 
81  m_hbIds.set(std::move(p_hbIds));
82  m_heIds.set(std::move(p_heIds));
83  m_hoIds.set(std::move(p_hoIds));
84  m_hfIds.set(std::move(p_hfIds));
85  m_emptyIds.set(std::move(p_emptyIds));
86  }
87 }
88 
89 const std::vector<DetId>&
91  int subdet ) const
92 {
93  if( 0 != subdet && !m_hbIds.isSet() ) fillDetIds() ;
94  return ( 0 == subdet ? CaloSubdetectorGeometry::getValidDetIds() :
95  ( HcalBarrel == subdet ? *m_hbIds.load() :
96  ( HcalEndcap == subdet ? *m_heIds.load() :
97  ( HcalOuter == subdet ? *m_hoIds.load() :
98  ( HcalForward == subdet ? *m_hfIds.load() : *m_emptyIds.load() ) ) ) ) ) ;
99 }
100 
102 
103  // Now find the closest eta_bin, eta value of a bin i is average
104  // of eta[i] and eta[i-1]
105  double abseta = fabs(r.eta());
106 
107  // figure out subdetector, giving preference to HE in HE/HF overlap region
109  if (abseta <= theHBHEEtaBounds[theTopology.lastHBRing()] ) {
110  bc = HcalBarrel;
111  } else if (abseta <= theHBHEEtaBounds[theTopology.lastHERing()] ) {
112  bc = HcalEndcap;
113  } else {
114  bc = HcalForward;
115  }
116 
117  if (bc == HcalForward) {
118  static const double z_short=1137.0;
119  int etaring = etaRing(bc, abseta); // This is safer
120  /*
121  static const double z_long=1115.0;
122  // determine front-face eta
123  double radius=sqrt(pow(r.x(),2)+pow(r.y(),2));
124  double trueAeta=asinh(z_long/radius);
125  // find eta bin
126  int etaring = etaRing(bc, trueAeta);
127  */
128  if (etaring>theTopology.lastHFRing()) etaring=theTopology.lastHFRing();
129 
130  int phibin = phiBin(r.phi(), etaring);
131 
132  // add a sign to the etaring
133  int etabin = (r.z() > 0) ? etaring : -etaring;
134  // Next line is premature depth 1 and 2 can coexist for large z-extent
135  // HcalDetId bestId(bc,etabin,phibin,((fabs(r.z())>=z_short)?(2):(1)));
136  // above line is no good with finite precision
137  HcalDetId bestId(bc,etabin,phibin,((fabs(r.z()) - z_short >-0.1)?(2):(1)));
138  return bestId;
139  } else {
140 
141  // find eta bin
142  int etaring = etaRing(bc, abseta);
143 
144  int phibin = phiBin(r.phi(), etaring);
145 
146  // add a sign to the etaring
147  int etabin = (r.z() > 0) ? etaring : -etaring;
148 
149  //Now do depth if required
150  int dbin = 1;
151  double pointrz=0, drz=99999.;
152  HcalDetId currentId(bc, etabin, phibin, dbin);
153  if (bc == HcalBarrel) pointrz = r.mag();
154  else pointrz = std::abs(r.z());
155  HcalDetId bestId;
156 // std::cout << "Current ID " << currentId << std::endl;
157  for ( ; currentId != HcalDetId(); theTopology.incrementDepth(currentId)) {
158 // std::cout << "Incremented Current ID " << currentId << std::endl;
159  const CaloCellGeometry * cell = getGeometry(currentId);
160  if (cell == 0) {
161 // std::cout << "Cell 0 for " << currentId << " Best " << bestId << " dummy " << HcalDetId() << std::endl;
162  assert (bestId != HcalDetId());
163  break;
164  } else {
165  double rz;
166  if (bc == HcalEndcap) rz = std::abs(cell->getPosition().z());
167  else rz = cell->getPosition().mag();
168  if (std::abs(pointrz-rz)<drz) {
169  bestId = currentId;
170  drz = std::abs(pointrz-rz);
171  }
172  }
173  }
174 
175  return bestId;
176  }
177 }
178 
179 
180 int HcalGeometry::etaRing(HcalSubdetector bc, double abseta) const
181 {
182  int etaring;
183  if( bc == HcalForward ) {
184  for(etaring = theTopology.firstHFRing();
185  etaring <= theTopology.lastHFRing(); ++etaring)
186  {
187  if(theHFEtaBounds[etaring-theTopology.firstHFRing()+1] > abseta) break;
188  }
189  }
190  else
191  {
192  for(etaring = 1;
193  etaring <= theTopology.lastHERing(); ++etaring)
194  {
195  if(theHBHEEtaBounds[etaring] >= abseta) break;
196  }
197  }
198 
199  return etaring;
200 }
201 
202 int
203 HcalGeometry::phiBin(double phi, int etaring) const
204 {
205  constexpr double twopi = M_PI+M_PI;
206  //put phi in correct range (0->2pi)
207  if(phi<0.0) phi += twopi;
208  if(phi>twopi) phi -= twopi;
209  int nphibins = theTopology.nPhiBins(etaring);
210  int phibin= static_cast<int>(phi/twopi*nphibins)+1;
211  int iphi;
212 
213  // rings 40 and 41 are offset wrt the other phi numbering
214  // 1 1 1 2
215  // ------------------------------
216  // 72 36 36 1
217  if(etaring >= theTopology.firstHFQuadPhiRing())
218  {
219  phi+=(twopi/36); //shift by half tower.
220  phibin=static_cast<int>(phi/twopi*nphibins);
221  if (phibin==0) phibin=18;
222  iphi=phibin*4-1; // 71,3,5,
223  } else {
224  // convert to the convention of numbering 1,3,5, in 36 phi bins
225  iphi=(phibin-1)*(72/nphibins) + 1;
226  }
227 
228  return iphi;
229 }
230 
233  double dR ) const
234 {
235  CaloSubdetectorGeometry::DetIdSet dis; // this is the return object
236 
237  if( 0.000001 < dR )
238  {
239  if( dR > M_PI/2. ) // this version needs "small" dR
240  {
241  dis = CaloSubdetectorGeometry::getCells( r, dR ) ; // base class version
242  }
243  else
244  {
245  const double dR2 ( dR*dR ) ;
246  const double reta ( r.eta() ) ;
247  const double rphi ( r.phi() ) ;
248  const double lowEta ( reta - dR ) ;
249  const double highEta ( reta + dR ) ;
250  const double lowPhi ( rphi - dR ) ;
251  const double highPhi ( rphi + dR ) ;
252 
253  const double hfEtaHi ( theHFEtaBounds[ theTopology.lastHFRing() -
254  theTopology.firstHFRing() + 1 ] ) ;
255 
256  if( highEta > -hfEtaHi &&
257  lowEta < hfEtaHi ) // in hcal
258  {
260 
261  for( unsigned int is ( 0 ) ; is != 4 ; ++is )
262  {
263  const int sign ( reta>0 ? 1 : -1 ) ;
264  const int ieta_center ( sign*etaRing( hs[is], fabs( reta ) ) ) ;
265  const int ieta_lo ( ( 0 < lowEta*sign ? sign : -sign )*etaRing( hs[is], fabs( lowEta ) ) ) ;
266  const int ieta_hi ( ( 0 < highEta*sign ? sign : -sign )*etaRing( hs[is], fabs( highEta ) ) ) ;
267  const int iphi_lo ( phiBin( lowPhi , ieta_center ) ) ;
268  const int iphi_hi ( phiBin( highPhi, ieta_center ) ) ;
269  const int jphi_lo ( iphi_lo>iphi_hi ? iphi_lo - 72 : iphi_lo ) ;
270  const int jphi_hi ( iphi_hi ) ;
271 
272  const int idep_lo ( 1 == is ? 4 : 1 ) ;
273  const int idep_hi ( 1 == is ? 4 :
274  ( 2 == is ? 3 : 2 ) ) ;
275  for( int ieta ( ieta_lo ) ; ieta <= ieta_hi ; ++ieta ) // over eta limits
276  {
277  if( ieta != 0 )
278  {
279  for( int jphi ( jphi_lo ) ; jphi <= jphi_hi ; ++jphi ) // over phi limits
280  {
281  const int iphi ( 1 > jphi ? jphi+72 : jphi ) ;
282 
283  for( int idep ( idep_lo ) ; idep <= idep_hi ; ++idep )
284  {
285  const HcalDetId did ( hs[is], ieta, iphi, idep ) ;
286  if( theTopology.valid(did) )
287 
288  {
289  const CaloCellGeometry* cell ( getGeometry( did ) );
290  if( 0 != cell )
291  {
292  const GlobalPoint& p ( cell->getPosition() ) ;
293  const double eta ( p.eta() ) ;
294  const double phi ( p.phi() ) ;
295  if( reco::deltaR2( eta, phi, reta, rphi ) < dR2 ) dis.insert( did ) ;
296  }
297  }
298  }
299  }
300  }
301  }
302  }
303  }
304  }
305  }
306  return dis;
307 }
308 
309 
310 
311 DetId
313 {
315  const int ieta ( i < numberOfBarrelAlignments()/2 ? -1 : 1 ) ;
316  const int iphi ( 1 + (4*i)%72 ) ;
317  return HcalDetId( HcalBarrel, ieta, iphi, 1 ) ;
318 }
319 
320 DetId
322 {
324  const int ieta ( i < numberOfEndcapAlignments()/2 ? -16 : 16 ) ;
325  const int iphi ( 1 + (4*i)%72 ) ;
326  return HcalDetId( HcalEndcap, ieta, iphi, 1 ) ;
327 }
328 
329 DetId
331 {
333  const int ieta ( i < numberOfForwardAlignments()/2 ? -29 : 29 ) ;
334  const int iphi ( 1 + (4*i)%72 ) ;
335  return HcalDetId( HcalForward, ieta, iphi, 1 ) ;
336 }
337 
338 DetId
340 {
342  const int ring ( i/12 ) ;
343  const int ieta ( 0 == ring ? -11 :
344  1 == ring ? -5 :
345  2 == ring ? 1 :
346  3 == ring ? 5 : 11 ) ;
347  const int iphi ( 1 + ( i - ring*12 )*6 ) ;
348  return HcalDetId( HcalOuter, ieta, iphi, 4 ) ;
349 }
350 
351 DetId
353 {
354  assert( i < numberOfAlignments() ) ;
355 
356  const unsigned int nB ( numberOfBarrelAlignments() ) ;
357  const unsigned int nE ( numberOfEndcapAlignments() ) ;
358  const unsigned int nF ( numberOfForwardAlignments() ) ;
359 // const unsigned int nO ( numberOfOuterAlignments() ) ;
360 
361  return ( i < nB ? detIdFromBarrelAlignmentIndex( i ) :
362  i < nB+nE ? detIdFromEndcapAlignmentIndex( i - nB ) :
363  i < nB+nE+nF ? detIdFromForwardAlignmentIndex( i - nB - nE ) :
364  detIdFromOuterAlignmentIndex( i - nB - nE - nF ) ) ;
365 }
366 
367 unsigned int
369  unsigned int nD )
370 {
371  const HcalDetId hid ( id ) ;
372  const unsigned int iphi ( hid.iphi() ) ;
373  const int ieta ( hid.ieta() ) ;
374  const unsigned int index ( ( 0 < ieta ? nD/2 : 0 ) + ( iphi + 1 )%72/4 ) ;
375  assert( index < nD ) ;
376  return index ;
377 }
378 
379 unsigned int
381 {
383 }
384 unsigned int
386 {
388 }
389 
390 unsigned int
392 {
394 }
395 
396 unsigned int
398 {
399  const HcalDetId hid ( id ) ;
400  const int ieta ( hid.ieta() ) ;
401  const int iphi ( hid.iphi() ) ;
402  const int ring ( ieta < -10 ? 0 :
403  ( ieta < -4 ? 1 :
404  ( ieta < 5 ? 2 :
405  ( ieta < 11 ? 3 : 4 ) ) ) ) ;
406 
407  const unsigned int index ( 12*ring + ( iphi - 1 )/6 ) ;
408  assert( index < numberOfOuterAlignments() ) ;
409  return index ;
410 }
411 
412 unsigned int
414 {
415  assert(id.det() == DetId::Hcal) ;
416 
417  const HcalDetId hid ( id ) ;
418  bool isHB = (hid.subdet() == HcalBarrel);
419  bool isHE = (hid.subdet() == HcalEndcap);
420  bool isHF = (hid.subdet() == HcalForward);
421  // bool isHO = (hid.subdet() == HcalOuter);
422 
423  const unsigned int nB ( numberOfBarrelAlignments() ) ;
424  const unsigned int nE ( numberOfEndcapAlignments() ) ;
425  const unsigned int nF ( numberOfForwardAlignments() ) ;
426  // const unsigned int nO ( numberOfOuterAlignments() ) ;
427 
428  const unsigned int index (
429  isHB ? alignmentBarrelIndexLocal(id) :
430  isHE ? alignmentEndcapIndexLocal(id) + nB :
431  isHF ? alignmentForwardIndexLocal( id ) + nB + nE :
432  alignmentOuterIndexLocal(id) + nB + nE + nF
433  );
434 
435  assert( index < numberOfAlignments() ) ;
436  return index ;
437 }
438 
439 unsigned int
441 {
442  return (unsigned int)DetId::Hcal - 1 ;
443 }
444 
445 void
447  const CCGFloat* pv ,
448  unsigned int i ,
449  Pt3D& ref )
450 {
452 
453  if( hid.subdet() == HcalForward )
454  {
455  IdealZPrism::localCorners( lc, pv, ref ) ;
456  }
457  else
458  {
459  IdealObliquePrism::localCorners( lc, pv, ref ) ;
460  }
461 }
462 
463 void
465  const GlobalPoint& f2 ,
466  const GlobalPoint& f3 ,
467  const CCGFloat* parm ,
468  const DetId& detId ) {
469 
470  assert (detId.det()==DetId::Hcal);
471 
472  const HcalDetId hid ( detId ) ;
473  unsigned int din=theTopology.detId2denseId(detId);
474 
475  edm::LogInfo("HcalGeometry") << " newCell subdet "
476  << detId.subdetId() << ", raw ID "
477  << detId.rawId() << ", hid " << hid << ", din "
478  << din << ", index ";
479 
480  if( hid.subdet()==HcalBarrel) {
481  m_hbCellVec[ din ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
482  } else if( hid.subdet()==HcalEndcap ) {
483  const unsigned int index ( din - m_hbCellVec.size() ) ;
484  m_heCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
485  } else if( hid.subdet()==HcalOuter ) {
486  const unsigned int index ( din
487  - m_hbCellVec.size()
488  - m_heCellVec.size() ) ;
489  m_hoCellVec[ index ] = IdealObliquePrism( f1, cornersMgr(), parm ) ;
490  } else {
491  const unsigned int index ( din
492  - m_hbCellVec.size()
493  - m_heCellVec.size()
494  - m_hoCellVec.size() ) ;
495  m_hfCellVec[ index ] = IdealZPrism( f1, cornersMgr(), parm ) ;
496  }
497 
498  addValidID( detId ) ;
499  m_dins.push_back( din );
500 }
501 
502 const CaloCellGeometry*
503 HcalGeometry::cellGeomPtr( unsigned int din ) const
504 {
505  const CaloCellGeometry* cell ( 0 ) ;
506  if( m_hbCellVec.size() > din )
507  {
508  cell = &m_hbCellVec[ din ] ;
509  }
510  else
511  {
512  if( m_hbCellVec.size() +
513  m_heCellVec.size() > din )
514  {
515  const unsigned int index ( din - m_hbCellVec.size() ) ;
516  cell = &m_heCellVec[ index ] ;
517  }
518  else
519  {
520  if( m_hbCellVec.size() +
521  m_heCellVec.size() +
522  m_hoCellVec.size() > din )
523  {
524  const unsigned int index ( din
525  - m_hbCellVec.size()
526  - m_heCellVec.size() ) ;
527  cell = &m_hoCellVec[ index ] ;
528  }
529  else
530  {
531  if( m_hbCellVec.size() +
532  m_heCellVec.size() +
533  m_hoCellVec.size() +
534  m_hfCellVec.size() > din )
535  {
536  const unsigned int index ( din
537  - m_hbCellVec.size()
538  - m_heCellVec.size()
539  - m_hoCellVec.size() ) ;
540  cell = &m_hfCellVec[ index ] ;
541  }
542  }
543  }
544  }
545 
546  return (( 0 == cell || 0 == cell->param()) ? 0 : cell ) ;
547 }
548 
549 void
553  CaloSubdetectorGeometry::IVec& dinsVec ) const
554 {
555  tVec.reserve( m_dins.size()*numberOfTransformParms() ) ;
556  iVec.reserve( numberOfShapes()==1 ? 1 : m_dins.size() ) ;
557  dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ;
558  dinsVec.reserve( m_dins.size() );
559 
560  for( ParVecVec::const_iterator ivv ( parVecVec().begin() ) ; ivv != parVecVec().end() ; ++ivv )
561  {
562  const ParVec& pv ( *ivv ) ;
563  for( ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv )
564  {
565  dVec.push_back( *iv ) ;
566  }
567  }
568 
569  for( unsigned int i ( 0 ) ; i < theTopology.ncells() ; ++i )
570  {
571  Tr3D tr ;
572  const CaloCellGeometry* ptr ( cellGeomPtr( i ) ) ;
573 
574  if( 0 != ptr )
575  {
576  dinsVec.push_back( i );
577 
578  ptr->getTransform( tr, ( Pt3DVec* ) 0 ) ;
579 
580  if( Tr3D() == tr ) // for preshower there is no rotation
581  {
582  const GlobalPoint& gp ( ptr->getPosition() ) ;
583  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ;
584  }
585 
586  const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ;
587  tVec.push_back( tt.x() ) ;
588  tVec.push_back( tt.y() ) ;
589  tVec.push_back( tt.z() ) ;
590  if( 6 == numberOfTransformParms() )
591  {
592  const CLHEP::HepRotation rr ( tr.getRotation() ) ;
593  const ROOT::Math::Transform3D rtr ( rr.xx(), rr.xy(), rr.xz(), tt.x(),
594  rr.yx(), rr.yy(), rr.yz(), tt.y(),
595  rr.zx(), rr.zy(), rr.zz(), tt.z() ) ;
597  rtr.GetRotation( ea ) ;
598  tVec.push_back( ea.Phi() ) ;
599  tVec.push_back( ea.Theta() ) ;
600  tVec.push_back( ea.Psi() ) ;
601  }
602 
603  const CCGFloat* par ( ptr->param() ) ;
604 
605  unsigned int ishape ( 9999 ) ;
606  for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv )
607  {
608  bool ok ( true ) ;
609  const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ;
610  for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k )
611  {
612  ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ;
613  }
614  if( ok )
615  {
616  ishape = ivv ;
617  break ;
618  }
619  }
620  assert( 9999 != ishape ) ;
621 
622 
623  const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_dins.size() ) ;
624  if( iVec.size() < nn ) iVec.push_back( ishape ) ;
625  }
626  }
627 }
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:56
int firstHFRing() const
Definition: HcalTopology.h:83
unsigned int getHFSize() const
Definition: HcalTopology.h:114
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
int i
Definition: DBlmapReader.cc:9
virtual DetId getClosestCell(const GlobalPoint &r) const
static unsigned int alignmentTransformIndexLocal(const DetId &id)
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
std::vector< CCGFloat > DimVec
unsigned int getHOSize() const
Definition: HcalTopology.h:113
edm::AtomicPtrCache< std::vector< DetId > > m_heIds
Definition: HcalGeometry.h:128
static unsigned int alignmentEndcapIndexLocal(const DetId &id)
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:30
virtual void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const
CaloTopology const * topology(0)
static DetId detIdFromOuterAlignmentIndex(unsigned int i)
double sign(double x)
assert(m_qm.get())
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< unsigned int > IVec
edm::AtomicPtrCache< std::vector< DetId > > m_emptyIds
Definition: HcalGeometry.h:131
int nPhiBins(int etaRing) const
how many phi segments in this ring
int lastHBRing() const
Definition: HcalTopology.h:80
std::vector< CCGFloat > TrVec
const_iterator begin() const
Definition: EZArrayFL.h:63
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition: HcalGeometry.h:99
HepGeom::Transform3D Tr3D
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:19
std::vector< Pt3D > Pt3DVec
bool isHE(int etabin, int depth)
T eta() const
CaloCellGeometry::CCGFloat CCGFloat
bool isSet() const
virtual unsigned int numberOfParametersPerShape() const
Definition: HcalGeometry.h:38
#define constexpr
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
Definition: HcalGeometry.cc:90
virtual CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
const HcalTopology & theTopology
Definition: HcalGeometry.h:125
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HcalGeometry.h:25
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
const CCGFloat * param() const
T mag() const
Definition: PV3DBase.h:67
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:134
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:136
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:137
virtual void getTransform(Tr3D &tr, Pt3DVec *lptr) const
--------— only needed by specific utility; overloaded when needed -—
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:20
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:62
T z() const
Definition: PV3DBase.h:64
int ieta() const
get the cell ieta
Definition: HcalDetId.h:36
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
int lastHFRing() const
Definition: HcalTopology.h:84
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
static unsigned int alignmentBarrelIndexLocal(const DetId &id)
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CaloCellGeometry::CCGFloat CCGFloat
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
virtual DetId denseId2detId(unsigned int) const
return a linear packed id
bool isHB(int etabin, int depth)
static DetId detIdFromLocalAlignmentIndex(unsigned int i)
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:132
HcalGeometry(const HcalTopology &topology)
Definition: HcalGeometry.cc:15
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
#define M_PI
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
static unsigned int alignmentOuterIndexLocal(const DetId &id)
CaloCellGeometry::Pt3D Pt3D
std::vector< IdealZPrism > HFCellVec
Definition: HcalGeometry.h:21
int iphi() const
get the cell iphi
Definition: HcalDetId.h:38
Definition: DetId.h:18
bool incrementDepth(HcalDetId &id) const
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:58
AlgebraicVector EulerAngles
Definition: Definitions.h:36
bool isHF(int etabin, int depth)
void addValidID(const DetId &id)
static const double theHFEtaBounds[]
bool set(std::unique_ptr< T > iNewValue) const
virtual ~HcalGeometry()
The HcalGeometry will delete all its cell geometries at destruction time.
Definition: HcalGeometry.cc:20
CaloCellGeometry::CornersMgr * cornersMgr()
Detector
Definition: DetId.h:24
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealZPrism.cc:103
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:18
virtual const CaloCellGeometry * cellGeomPtr(unsigned int index) const
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:89
unsigned int getHESize() const
Definition: HcalTopology.h:112
HECellVec m_heCellVec
Definition: HcalGeometry.h:135
CaloCellGeometry::Tr3D Tr3D
T eta() const
Definition: PV3DBase.h:76
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
virtual unsigned int numberOfShapes() const
Definition: HcalGeometry.h:37
edm::AtomicPtrCache< std::vector< DetId > > m_hfIds
Definition: HcalGeometry.h:130
#define begin
Definition: vmac.h:30
const_iterator end() const
Definition: EZArrayFL.h:64
void fillDetIds() const
Definition: HcalGeometry.cc:36
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:60
static unsigned int alignmentForwardIndexLocal(const DetId &id)
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
virtual unsigned int numberOfTransformParms() const
edm::AtomicPtrCache< std::vector< DetId > > m_hoIds
Definition: HcalGeometry.h:129
CaloCellGeometry::Pt3D Pt3D
Definition: HcalGeometry.h:24
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
unsigned int getHBSize() const
Definition: HcalTopology.h:111
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
static const double theHBHEEtaBounds[]
int phiBin(double phi, int etaring) const
T const * load() const
edm::AtomicPtrCache< std::vector< DetId > > m_hbIds
Definition: HcalGeometry.h:127
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:66
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
int lastHERing() const
Definition: HcalTopology.h:82
Definition: DDAxes.h:10