CMS 3D CMS Logo

HcalGeometry.cc
Go to the documentation of this file.
3 #include <algorithm>
4 #include <iostream>
5 
6 #include <Math/Transform3D.h>
7 #include <Math/EulerAngles.h>
8 
13 
14 //#define EDM_ML_DEBUG
15 
17  m_topology(topology), m_mergePosition(topology.getMergePositionFlag()) {
18  init();
19 }
20 
22 
25 #ifdef EDM_ML_DEBUG
26  std::cout << "HcalGeometry: " << "HcalGeometry::init() "
27  << " HBSize " << m_topology.getHBSize()
28  << " HESize " << m_topology.getHESize()
29  << " HOSize " << m_topology.getHOSize()
30  << " HFSize " << m_topology.getHFSize() << std::endl;
31 #endif
32 
37 }
38 
40  if(!m_emptyIds.isSet()) {
41  std::unique_ptr<std::vector<DetId>> p_hbIds{new std::vector<DetId>};
42  std::unique_ptr<std::vector<DetId>> p_heIds{new std::vector<DetId>};
43  std::unique_ptr<std::vector<DetId>> p_hoIds{new std::vector<DetId>};
44  std::unique_ptr<std::vector<DetId>> p_hfIds{new std::vector<DetId>};
45  std::unique_ptr<std::vector<DetId>> p_emptyIds{new std::vector<DetId>};
46 
47  const std::vector<DetId>& baseIds (CaloSubdetectorGeometry::getValidDetIds());
48  for (unsigned int i ( 0 ) ; i != baseIds.size() ; ++i) {
49  const DetId id ( baseIds[i] );
50  if (id.subdetId() == HcalBarrel) {
51  p_hbIds->push_back( id ) ;
52  } else if (id.subdetId() == HcalEndcap) {
53  p_heIds->push_back( id ) ;
54  } else if (id.subdetId() == HcalOuter) {
55  p_hoIds->push_back( id ) ;
56  } else if (id.subdetId() == HcalForward) {
57  p_hfIds->push_back( id ) ;
58  }
59  }
60  std::sort( p_hbIds->begin(), p_hbIds->end() ) ;
61  std::sort( p_heIds->begin(), p_heIds->end() ) ;
62  std::sort( p_hoIds->begin(), p_hoIds->end() ) ;
63  std::sort( p_hfIds->begin(), p_hfIds->end() ) ;
64  p_emptyIds->resize( 0 ) ;
65 
66  m_hbIds.set(std::move(p_hbIds));
67  m_heIds.set(std::move(p_heIds));
68  m_hoIds.set(std::move(p_hoIds));
69  m_hfIds.set(std::move(p_hfIds));
70  m_emptyIds.set(std::move(p_emptyIds));
71  }
72 }
73 
74 const std::vector<DetId>&
76  int subdet ) const {
77  if( 0 != subdet && !m_hbIds.isSet() ) fillDetIds() ;
78  return ( 0 == subdet ? CaloSubdetectorGeometry::getValidDetIds() :
79  ( HcalBarrel == subdet ? *m_hbIds.load() :
80  ( HcalEndcap == subdet ? *m_heIds.load() :
81  ( HcalOuter == subdet ? *m_hoIds.load() :
82  ( HcalForward == subdet ? *m_hfIds.load() : *m_emptyIds.load() ) ) ) ) ) ;
83 }
84 
86 
87  // Now find the closest eta_bin, eta value of a bin i is average
88  // of eta[i] and eta[i-1]
89  static const double z_long=1100.0;
90  double abseta = fabs(r.eta());
91  double absz = fabs(r.z());
92 
93  // figure out subdetector, giving preference to HE in HE/HF overlap region
95  if (abseta <= m_topology.etaMax(HcalBarrel) ) {
96  bc = HcalBarrel;
97  } else if (absz >= z_long) {
98  bc = HcalForward;
99  } else if (m_topology.etaMax(HcalEndcap) ) {
100  bc = HcalEndcap;
101  } else {
102  bc = HcalForward;
103  }
104 
105  // find eta bin
106  int etaring = etaRing(bc, abseta);
107 
108  int phibin = phiBin(bc, etaring, r.phi());
109 
110  // add a sign to the etaring
111  int etabin = (r.z() > 0) ? etaring : -etaring;
112 
113  if (bc == HcalForward) {
114  static const double z_short=1137.0;
115  // Next line is premature depth 1 and 2 can coexist for large z-extent
116  // HcalDetId bestId(bc,etabin,phibin,((fabs(r.z())>=z_short)?(2):(1)));
117  // above line is no good with finite precision
118  HcalDetId bestId(bc,etabin,phibin,((fabs(r.z()) - z_short >-0.1)?(2):(1)));
119  return correctId(bestId);
120  } else {
121 
122  //Now do depth if required
123  int zside = (r.z() > 0) ? 1 : -1;
124  int dbin = m_topology.dddConstants()->getMinDepth(((int)(bc)-1),etaring,phibin,zside);
125  double pointrz(0), drz(99999.);
126  HcalDetId currentId(bc, etabin, phibin, dbin);
127  if (bc == HcalBarrel) pointrz = r.mag();
128  else pointrz = std::abs(r.z());
129  HcalDetId bestId;
130  for ( ; currentId != HcalDetId(); m_topology.incrementDepth(currentId)) {
131  const CaloCellGeometry * cell = getGeometry(currentId);
132  if (cell == 0) {
133  assert (bestId != HcalDetId());
134  break;
135  } else {
136  double rz;
137  if (bc == HcalEndcap) rz = std::abs(cell->getPosition().z());
138  else rz = cell->getPosition().mag();
139  if (std::abs(pointrz-rz)<drz) {
140  bestId = currentId;
141  drz = std::abs(pointrz-rz);
142  }
143  }
144  }
145 
146  return correctId(bestId);
147  }
148 }
149 
151  if (!m_mergePosition) {
152  return (getGeometry(id)->getPosition());
153  } else {
154  return (getGeometry(m_topology.idFront(id))->getPosition());
155  }
156 }
157 
159  if (!m_mergePosition) {
160  return (getGeometry(id)->getBackPoint());
161  } else {
162  std::vector<HcalDetId> ids;
164  return (getGeometry(ids.back())->getBackPoint());
165  }
166 }
167 
169  if (!m_mergePosition) {
170  return (getGeometry(id)->getCorners());
171  } else {
172  std::vector<HcalDetId> ids;
177  for (unsigned int k=0; k<4; ++k) {
178  mcorners[k] = mcf[k];
179  mcorners[k+4] = mcb[k+4];
180  }
181  return mcorners;
182  }
183 }
184 
185 int HcalGeometry::etaRing(HcalSubdetector bc, double abseta) const {
186  return m_topology.etaRing(bc, abseta);
187 }
188 
189 int HcalGeometry::phiBin(HcalSubdetector bc, int etaring, double phi) const {
190  return m_topology.phiBin(bc, etaring, phi);
191 }
192 
194  double dR ) const {
195  CaloSubdetectorGeometry::DetIdSet dis; // this is the return object
196 
197  if (0.000001 < dR) {
198  if (dR > M_PI/2.) {// this version needs "small" dR
199  dis = CaloSubdetectorGeometry::getCells(r, dR); // base class version
200  } else {
201  const double dR2 ( dR*dR ) ;
202  const double reta ( r.eta() ) ;
203  const double rphi ( r.phi() ) ;
204  const double lowEta ( reta - dR ) ;
205  const double highEta ( reta + dR ) ;
206  const double lowPhi ( rphi - dR ) ;
207  const double highPhi ( rphi + dR ) ;
208 
209  const double hfEtaHi (m_topology.etaMax(HcalForward));
210 
211  if (highEta > -hfEtaHi &&
212  lowEta < hfEtaHi ) { // in hcal
214 
215  for (unsigned int is ( 0 ) ; is != 4 ; ++is ) {
216  const int sign ( reta>0 ? 1 : -1 ) ;
217  const int ieta_center ( sign*etaRing( hs[is], fabs( reta ) ) ) ;
218  const int ieta_lo ( ( 0 < lowEta*sign ? sign : -sign )*etaRing( hs[is], fabs( lowEta ) ) ) ;
219  const int ieta_hi ( ( 0 < highEta*sign ? sign : -sign )*etaRing( hs[is], fabs( highEta ) ) ) ;
220  const int iphi_lo ( phiBin( hs[is], ieta_center, lowPhi ) ) ;
221  const int iphi_hi ( phiBin( hs[is], ieta_center, highPhi ) ) ;
222  const int jphi_lo ( iphi_lo>iphi_hi ? iphi_lo - 72 : iphi_lo ) ;
223  const int jphi_hi ( iphi_hi ) ;
224 
225  const int idep_lo ( 1 == is ? 4 : 1 ) ;
226  const int idep_hi ( m_topology.maxDepth(hs[is]) );
227  for (int ieta ( ieta_lo ) ; ieta <= ieta_hi ; ++ieta) {// over eta limits
228  if (ieta != 0) {
229  for (int jphi ( jphi_lo ) ; jphi <= jphi_hi ; ++jphi) { // over phi limits
230  const int iphi ( 1 > jphi ? jphi+72 : jphi ) ;
231  for (int idep ( idep_lo ) ; idep <= idep_hi ; ++idep ) {
232  const HcalDetId did ( hs[is], ieta, iphi, idep ) ;
233  if (m_topology.valid(did)) {
234  const CaloCellGeometry* cell ( getGeometry( did ) );
235  if (0 != cell ) {
236  const GlobalPoint& p ( cell->getPosition() ) ;
237  const double eta ( p.eta() ) ;
238  const double phi ( p.phi() ) ;
239  if (reco::deltaR2(eta, phi, reta, rphi ) < dR2) dis.insert( did ) ;
240  }
241  }
242  }
243  }
244  }
245  }
246  }
247  }
248  }
249  }
250  return dis;
251 }
252 
253 unsigned int HcalGeometry::getHxSize(const int type) const {
254  unsigned int hxsize(0);
255  if (!m_hbIds.isSet()) fillDetIds();
256  if (type == 1) hxsize = (m_hbIds.isSet()) ? m_hbIds->size() : 0;
257  else if (type == 2) hxsize = (m_heIds.isSet()) ? m_heIds->size() : 0;
258  else if (type == 3) hxsize = (m_hoIds.isSet()) ? m_hoIds->size() : 0;
259  else if (type == 4) hxsize = (m_hfIds.isSet()) ? m_hfIds->size() : 0;
260  else if (type == 0) hxsize = (m_emptyIds.isSet()) ? m_emptyIds->size() : 0;
261  return hxsize;
262 }
263 
265  assert( i < numberOfBarrelAlignments() ) ;
266  const int ieta ( i < numberOfBarrelAlignments()/2 ? -1 : 1 ) ;
267  const int iphi ( 1 + (4*i)%72 ) ;
268  return HcalDetId( HcalBarrel, ieta, iphi, 1 ) ;
269 }
270 
272  assert( i < numberOfEndcapAlignments() ) ;
273  const int ieta ( i < numberOfEndcapAlignments()/2 ? -16 : 16 ) ;
274  const int iphi ( 1 + (4*i)%72 ) ;
275  return HcalDetId( HcalEndcap, ieta, iphi, 1 ) ;
276 }
277 
279  assert( i < numberOfForwardAlignments() ) ;
280  const int ieta ( i < numberOfForwardAlignments()/2 ? -29 : 29 ) ;
281  const int iphi ( 1 + (4*i)%72 ) ;
282  return HcalDetId( HcalForward, ieta, iphi, 1 ) ;
283 }
284 
286  assert( i < numberOfOuterAlignments() ) ;
287  const int ring ( i/12 ) ;
288  const int ieta ( 0 == ring ? -11 :
289  1 == ring ? -5 :
290  2 == ring ? 1 :
291  3 == ring ? 5 : 11 ) ;
292  const int iphi ( 1 + ( i - ring*12 )*6 ) ;
293  return HcalDetId( HcalOuter, ieta, iphi, 4 ) ;
294 }
295 
297  assert( i < numberOfAlignments() ) ;
298 
299  const unsigned int nB ( numberOfBarrelAlignments() ) ;
300  const unsigned int nE ( numberOfEndcapAlignments() ) ;
301  const unsigned int nF ( numberOfForwardAlignments() ) ;
302 // const unsigned int nO ( numberOfOuterAlignments() ) ;
303 
304  return ( i < nB ? detIdFromBarrelAlignmentIndex( i ) :
305  i < nB+nE ? detIdFromEndcapAlignmentIndex( i - nB ) :
306  i < nB+nE+nF ? detIdFromForwardAlignmentIndex( i - nB - nE ) :
307  detIdFromOuterAlignmentIndex( i - nB - nE - nF ) ) ;
308 }
309 
311  unsigned int nD) {
312  const HcalDetId hid ( id ) ;
313  const unsigned int iphi ( hid.iphi() ) ;
314  const int ieta ( hid.ieta() ) ;
315  const unsigned int index ( ( 0 < ieta ? nD/2 : 0 ) + ( iphi + 1 )%72/4 ) ;
316  assert( index < nD ) ;
317  return index ;
318 }
319 
322 }
323 
326 }
327 
330 }
331 
333  const HcalDetId hid ( id ) ;
334  const int ieta ( hid.ieta() ) ;
335  const int iphi ( hid.iphi() ) ;
336  const int ring ( ieta < -10 ? 0 :
337  ( ieta < -4 ? 1 :
338  ( ieta < 5 ? 2 :
339  ( ieta < 11 ? 3 : 4 ) ) ) ) ;
340 
341  const unsigned int index ( 12*ring + ( iphi - 1 )/6 ) ;
342  assert( index < numberOfOuterAlignments() ) ;
343  return index ;
344 }
345 
347  assert(id.det() == DetId::Hcal) ;
348 
349  const HcalDetId hid ( id ) ;
350  bool isHB = (hid.subdet() == HcalBarrel);
351  bool isHE = (hid.subdet() == HcalEndcap);
352  bool isHF = (hid.subdet() == HcalForward);
353  // bool isHO = (hid.subdet() == HcalOuter);
354 
355  const unsigned int nB ( numberOfBarrelAlignments() ) ;
356  const unsigned int nE ( numberOfEndcapAlignments() ) ;
357  const unsigned int nF ( numberOfForwardAlignments() ) ;
358  // const unsigned int nO ( numberOfOuterAlignments() ) ;
359 
360  const unsigned int index (isHB ? alignmentBarrelIndexLocal(id) :
361  isHE ? alignmentEndcapIndexLocal(id) + nB :
362  isHF ? alignmentForwardIndexLocal( id ) + nB + nE :
363  alignmentOuterIndexLocal(id) + nB + nE + nF
364  );
365 
366  assert( index < numberOfAlignments() ) ;
367  return index ;
368 }
369 
371  return (unsigned int)DetId::Hcal - 1 ;
372 }
373 
375  const CCGFloat* pv,
376  unsigned int i,
377  Pt3D& ref) {
379 
380  if (hid.subdet() == HcalForward ) {
381  IdealZPrism::localCorners( lc, pv, ref ) ;
382  } else {
383  IdealObliquePrism::localCorners( lc, pv, ref ) ;
384  }
385 }
386 
388  const GlobalPoint& f2 ,
389  const GlobalPoint& f3 ,
390  const CCGFloat* parm ,
391  const DetId& detId) {
392 
393  assert (detId.det()==DetId::Hcal);
394 
395  const HcalDetId hid ( detId ) ;
396  unsigned int din=m_topology.detId2denseId(detId);
397 
398 #ifdef EDM_ML_DEBUG
399  std::cout << "HcalGeometry: " << " newCell subdet "
400  << detId.subdetId() << ", raw ID "
401  << detId.rawId() << ", hid " << hid << ", din "
402  << din << ", index " << std::endl;
403 #endif
404 
405  if (hid.subdet()==HcalBarrel) {
406  m_hbCellVec.at( din ) = IdealObliquePrism( f1, cornersMgr(), parm ) ;
407  } else if (hid.subdet()==HcalEndcap) {
408  const unsigned int index ( din - m_hbCellVec.size() ) ;
409  m_heCellVec.at( index ) = IdealObliquePrism( f1, cornersMgr(), parm ) ;
410  } else if (hid.subdet()==HcalOuter) {
411  const unsigned int index ( din
412  - m_hbCellVec.size()
413  - m_heCellVec.size() ) ;
414  m_hoCellVec.at( index ) = IdealObliquePrism( f1, cornersMgr(), parm ) ;
415  } else {
416  const unsigned int index ( din
417  - m_hbCellVec.size()
418  - m_heCellVec.size()
419  - m_hoCellVec.size() ) ;
420  m_hfCellVec.at( index ) = IdealZPrism( f1, cornersMgr(), parm, hid.depth()==1 ? IdealZPrism::EM : IdealZPrism::HADR ) ;
421  }
422 
423  return din;
424 }
425 
427  const GlobalPoint& f2 ,
428  const GlobalPoint& f3 ,
429  const CCGFloat* parm ,
430  const DetId& detId) {
431 
432  unsigned int din = newCellImpl(f1,f2,f3,parm,detId);
433 
434  addValidID( detId ) ;
435  m_dins.push_back( din );
436 }
437 
439  const GlobalPoint& f2 ,
440  const GlobalPoint& f3 ,
441  const CCGFloat* parm ,
442  const DetId& detId) {
443 
444  unsigned int din = newCellImpl(f1,f2,f3,parm,detId);
445 
446  m_validIds.push_back( detId ) ;
447  m_dins.push_back( din );
448 }
449 
450 const CaloCellGeometry* HcalGeometry::cellGeomPtr( unsigned int din ) const {
451  const CaloCellGeometry* cell ( 0 ) ;
452  if( m_hbCellVec.size() > din ) {
453  cell = &m_hbCellVec[ din ] ;
454  } else {
455  if (m_hbCellVec.size() + m_heCellVec.size() > din) {
456  const unsigned int index (din - m_hbCellVec.size() ) ;
457  cell = &m_heCellVec[ index ] ;
458  } else if (m_hbCellVec.size()+m_heCellVec.size()+m_hoCellVec.size() > din) {
459  const unsigned int index (din - m_hbCellVec.size() - m_heCellVec.size());
460  cell = &m_hoCellVec[ index ] ;
461  } else if (m_hbCellVec.size() + m_heCellVec.size() + m_hoCellVec.size() +
462  m_hfCellVec.size() > din) {
463  const unsigned int index (din - m_hbCellVec.size() - m_heCellVec.size() -
464  m_hoCellVec.size() ) ;
465  cell = &m_hfCellVec[ index ] ;
466  }
467  }
468 
469  return (( 0 == cell || 0 == cell->param()) ? 0 : cell ) ;
470 }
471 
475  CaloSubdetectorGeometry::IVec& dinsVec ) const {
476 
477  tVec.reserve( m_topology.ncells()*numberOfTransformParms());
478  iVec.reserve( numberOfShapes()==1 ? 1 : m_topology.ncells());
479  dVec.reserve( numberOfShapes()*numberOfParametersPerShape());
480  dinsVec.reserve( m_topology.ncells());
481 
482  for (ParVecVec::const_iterator ivv (parVecVec().begin());
483  ivv != parVecVec().end() ; ++ivv) {
484  const ParVec& pv ( *ivv ) ;
485  for (ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv) {
486  dVec.push_back( *iv ) ;
487  }
488  }
489 
490  for( auto i : m_dins ) {
491  Tr3D tr ;
492  const CaloCellGeometry* ptr ( cellGeomPtr( i ) ) ;
493 
494  if (0 != ptr) {
495  dinsVec.push_back( i );
496 
497  const CCGFloat* par ( ptr->param() ) ;
498 
499  unsigned int ishape ( 9999 ) ;
500 
501  for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv ) {
502  bool ok ( true ) ;
503  const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ;
504  for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k ) {
505  ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ;
506  }
507  if( ok ) {
508  ishape = ivv;
509  break ;
510  }
511  }
512  assert( 9999 != ishape ) ;
513 
514  const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_dins.size() ) ;
515  if( iVec.size() < nn ) iVec.push_back( ishape ) ;
516 
517  ptr->getTransform( tr, ( Pt3DVec* ) 0 ) ;
518 
519  if( Tr3D() == tr ) { // for preshower there is no rotation
520  const GlobalPoint& gp ( ptr->getPosition() ) ;
521  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ;
522  }
523 
524  const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ;
525  tVec.push_back( tt.x() ) ;
526  tVec.push_back( tt.y() ) ;
527  tVec.push_back( tt.z() ) ;
528  if (6 == numberOfTransformParms()) {
529  const CLHEP::HepRotation rr ( tr.getRotation() ) ;
530  const ROOT::Math::Transform3D rtr (rr.xx(), rr.xy(), rr.xz(), tt.x(),
531  rr.yx(), rr.yy(), rr.yz(), tt.y(),
532  rr.zx(), rr.zy(), rr.zz(), tt.z());
534  rtr.GetRotation( ea ) ;
535  tVec.push_back( ea.Phi() ) ;
536  tVec.push_back( ea.Theta() ) ;
537  tVec.push_back( ea.Psi() ) ;
538  }
539  }
540  }
541 }
542 
544 
545  if (m_mergePosition) {
546  HcalDetId hid(id);
547  return ((DetId)(m_topology.mergedDepthDetId(hid)));
548  } else {
549  return id;
550  }
551 }
552 
553 void HcalGeometry::increaseReserve(unsigned int extra) {
554  m_validIds.reserve(m_validIds.size()+extra);
555 }
556 
558  std::sort(m_validIds.begin(),m_validIds.end());
559 }
560 
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:65
type
Definition: HCALResponse.h:21
unsigned int getHFSize() const
Definition: HcalTopology.h:135
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: HcalGeometry.cc:85
static unsigned int alignmentTransformIndexLocal(const DetId &id)
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:161
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
std::vector< CCGFloat > DimVec
unsigned int getHOSize() const
Definition: HcalTopology.h:134
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HcalGeometry.cc:11
edm::AtomicPtrCache< std::vector< DetId > > m_heIds
Definition: HcalGeometry.h:158
static unsigned int alignmentEndcapIndexLocal(const DetId &id)
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
int phiBin(HcalSubdetector subdet, int etaRing, double phi) const
virtual void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const
CaloTopology const * topology(0)
unsigned int getHxSize(const int type) const
static DetId detIdFromOuterAlignmentIndex(unsigned int i)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const HcalTopology & m_topology
Definition: HcalGeometry.h:154
std::vector< unsigned int > IVec
edm::AtomicPtrCache< std::vector< DetId > > m_emptyIds
Definition: HcalGeometry.h:161
bool isHE(int etabin, int depth)
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:108
HepGeom::Transform3D Tr3D
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:25
std::vector< Pt3D > Pt3DVec
bool isHB(int etabin, int depth)
CaloCellGeometry::CCGFloat CCGFloat
bool m_mergePosition
Definition: HcalGeometry.h:155
bool isSet() const
virtual unsigned int numberOfParametersPerShape() const
Definition: HcalGeometry.h:44
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:75
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)
HcalDetId mergedDepthDetId(const HcalDetId &id) const
Definition: HcalTopology.h:163
CaloCellGeometry::Tr3D Tr3D
Definition: HcalGeometry.cc:12
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void newCellFast(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HcalGeometry.h:31
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:164
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:166
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
int getMinDepth(const int itype, const int ieta, const int iphi, const int zside) const
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:167
virtual void getTransform(Tr3D &tr, Pt3DVec *lptr) const
--------— only needed by specific utility; overloaded when needed -—
std::vector< DetId > m_validIds
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:26
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:71
int maxDepth(HcalSubdetector subdet) const
void sortValidIds()
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
DetId correctId(const DetId &id) const
T z() const
Definition: PV3DBase.h:64
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
static unsigned int alignmentBarrelIndexLocal(const DetId &id)
HcalSubdetector
Definition: HcalAssistant.h:31
def pv(vc)
Definition: MetAnalyzer.py:6
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
void unmergeDepthDetId(const HcalDetId &id, std::vector< HcalDetId > &ids) const
Definition: HcalTopology.h:165
CaloCellGeometry::CCGFloat CCGFloat
Definition: HcalGeometry.cc:9
virtual DetId denseId2detId(unsigned int) const
return a linear packed id
int phiBin(HcalSubdetector bc, int etaring, double phi) const
static DetId detIdFromLocalAlignmentIndex(unsigned int i)
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:162
HcalGeometry(const HcalTopology &topology)
Definition: HcalGeometry.cc:16
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
GlobalPoint getPosition(const DetId &id) const
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
#define M_PI
int k[5][pyjets_maxn]
static unsigned int alignmentOuterIndexLocal(const DetId &id)
std::vector< IdealZPrism > HFCellVec
Definition: HcalGeometry.h:27
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
Definition: DetId.h:18
bool incrementDepth(HcalDetId &id) const
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:67
CaloCellGeometry::Pt3D Pt3D
Definition: HcalGeometry.cc:10
AlgebraicVector EulerAngles
Definition: Definitions.h:36
void addValidID(const DetId &id)
bool set(std::unique_ptr< T > iNewValue) const
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:122
CaloCellGeometry::CornersVec getCorners(const DetId &id) const
HepGeom::Point3D< CCGFloat > Pt3D
bool isHF(int etabin, int depth)
virtual bool valid(const DetId &id) const
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:24
virtual const CaloCellGeometry * cellGeomPtr(unsigned int index) const
unsigned int getHESize() const
Definition: HcalTopology.h:133
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
HECellVec m_heCellVec
Definition: HcalGeometry.h:165
CaloCellGeometry::Tr3D Tr3D
void increaseReserve(unsigned int extra)
T eta() const
Definition: PV3DBase.h:76
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
virtual unsigned int numberOfShapes() const
Definition: HcalGeometry.h:43
edm::AtomicPtrCache< std::vector< DetId > > m_hfIds
Definition: HcalGeometry.h:160
#define begin
Definition: vmac.h:30
const_iterator end() const
Definition: EZArrayFL.h:64
void fillDetIds() const
Definition: HcalGeometry.cc:39
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:69
static unsigned int alignmentForwardIndexLocal(const DetId &id)
GlobalPoint getBackPosition(const DetId &id) const
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
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:159
CaloCellGeometry::Pt3D Pt3D
Definition: HcalGeometry.h:30
bool withSpecialRBXHBHE() const
Definition: HcalTopology.h:162
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
unsigned int getHBSize() const
Definition: HcalTopology.h:132
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
unsigned int newCellImpl(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
T const * load() const
edm::AtomicPtrCache< std::vector< DetId > > m_hbIds
Definition: HcalGeometry.h:157
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:75
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
def move(src, dest)
Definition: eostools.py:510
double etaMax(HcalSubdetector subdet) const