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