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