CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCalGeometry Class Referencefinal

#include <HGCalGeometry.h>

Inheritance diagram for HGCalGeometry:
CaloSubdetectorGeometry

Public Types

typedef HGCalGeometryRecord AlignedRecord
 
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector< FlatHexagonCellVec
 
typedef std::vector< FlatTrdCellVec2
 
typedef std::vector< GlobalPointCornersVec
 
typedef std::set< DetIdDetIdSet
 
typedef PHGCalRcd PGeometryRecord
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
- Public Types inherited from CaloSubdetectorGeometry
typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef std::vector< std::shared_ptr< const CaloCellGeometry > > CellSet
 
typedef std::set< DetIdDetIdSet
 
typedef std::vector< CCGFloatDimVec
 
typedef std::vector< unsigned int > IVec
 
typedef CaloCellGeometry::ParMgr ParMgr
 
typedef CaloCellGeometry::ParVec ParVec
 
typedef CaloCellGeometry::ParVecVec ParVecVec
 
typedef std::vector< CCGFloatTrVec
 

Public Member Functions

std::string cellElement () const
 
virtual void fillNamedParams (DDFilteredView fv)
 
CornersVec get8Corners (const DetId &id) const
 
DetIdSet getCells (const GlobalPoint &r, double dR) const override
 Get a list of all cells within a dR of the given cell. More...
 
DetId getClosestCell (const GlobalPoint &r) const override
 
CornersVec getCorners (const DetId &id) const
 Returns the corner points of this cell's volume. More...
 
std::shared_ptr< const CaloCellGeometrygetGeometry (const DetId &id) const override
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
CornersVec getNewCorners (const DetId &id) const
 
GlobalPoint getPosition (const DetId &id) const
 
void getSummary (CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
 
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) More...
 
const std::vector< DetId > & getValidGeomDetIds (void) const
 
 HGCalGeometry (const HGCalTopology &topology)
 
void initializeParms () override
 
void localCorners (Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
 
DetId neighborZ (const DetId &idin, const GlobalVector &p) const
 
DetId neighborZ (const DetId &idin, const MagneticField *bField, int charge, const GlobalVector &momentum) const
 
void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
 
bool present (const DetId &id) const override
 is this detid present in the geometry? More...
 
void sortDetIds ()
 
const HGCalTopologytopology () const
 
 ~HGCalGeometry () override
 
- Public Member Functions inherited from CaloSubdetectorGeometry
void allocateCorners (CaloCellGeometry::CornersVec::size_type n)
 
void allocatePar (ParVec::size_type n, unsigned int m)
 
 CaloSubdetectorGeometry ()
 
 CaloSubdetectorGeometry (const CaloSubdetectorGeometry &)=delete
 avoid copies More...
 
CaloCellGeometry::CornersMgrcornersMgr ()
 
CCGFloat deltaEta (const DetId &detId) const
 
CCGFloat deltaPhi (const DetId &detId) const
 
virtual void fillDefaultNamedParameters () const
 
virtual CellSet getCellSet (const GlobalPoint &r, double dR) const
 
virtual unsigned int numberOfParametersPerShape () const
 
virtual unsigned int numberOfShapes () const
 
virtual unsigned int numberOfTransformParms () const
 
CaloSubdetectorGeometryoperator= (const CaloSubdetectorGeometry &)=delete
 
ParMgrparMgr ()
 
const ParMgrparMgrConst () const
 
ParVecVecparVecVec ()
 
const ParVecVecparVecVec () const
 
virtual ~CaloSubdetectorGeometry ()
 The base class DOES assume that it owns the CaloCellGeometry objects. More...
 

Static Public Member Functions

static std::string dbString ()
 
static std::string producerTag ()
 

Static Public Attributes

static unsigned int k_NumberOfParametersPerHex = 3
 
static unsigned int k_NumberOfParametersPerShape = 3
 
static unsigned int k_NumberOfParametersPerTrd = 12
 
static unsigned int k_NumberOfShapes = 100
 
static unsigned int k_NumberOfShapesTrd = 1000
 

Protected Member Functions

void addValidID (const DetId &id)
 
std::shared_ptr< const CaloCellGeometrycellGeomPtr (uint32_t index) const override
 
unsigned int getClosestCellIndex (const GlobalPoint &r) const
 
const CaloCellGeometrygetGeometryRawPtr (uint32_t index) const override
 
unsigned int indexFor (const DetId &id) const override
 
unsigned int sizeForDenseIndex () const
 
- Protected Member Functions inherited from CaloSubdetectorGeometry
void addValidID (const DetId &id)
 
virtual unsigned int sizeForDenseIndex (const DetId &id) const
 

Private Member Functions

std::shared_ptr< const CaloCellGeometrycellGeomPtr (uint32_t index, const GlobalPoint &p) const
 
template<class T >
unsigned int getClosestCellIndex (const GlobalPoint &r, const std::vector< T > &vec) const
 
DetId getGeometryDetId (DetId detId) const
 

Private Attributes

CellVec m_cellVec
 
CellVec2 m_cellVec2
 
DetId::Detector m_det
 
ForwardSubdetector m_subdet
 
const HGCalTopologym_topology
 
std::vector< DetIdm_validGeomIds
 
HGCalGeometryMode::GeometryMode mode_
 
const double twoBysqrt3_
 

Static Private Attributes

static double k_half = 0.5
 

Additional Inherited Members

- Static Protected Member Functions inherited from CaloSubdetectorGeometry
static CCGFloat deltaR (const GlobalPoint &p1, const GlobalPoint &p2)
 
- Protected Attributes inherited from CaloSubdetectorGeometry
ParVecVec m_parVecVec
 
std::vector< DetIdm_validIds
 

Detailed Description

Definition at line 30 of file HGCalGeometry.h.

Member Typedef Documentation

Definition at line 43 of file HGCalGeometry.h.

Definition at line 36 of file HGCalGeometry.h.

typedef std::vector<FlatHexagon> HGCalGeometry::CellVec

Definition at line 34 of file HGCalGeometry.h.

typedef std::vector<FlatTrd> HGCalGeometry::CellVec2

Definition at line 35 of file HGCalGeometry.h.

typedef std::vector<GlobalPoint> HGCalGeometry::CornersVec

Definition at line 41 of file HGCalGeometry.h.

typedef std::set<DetId> HGCalGeometry::DetIdSet

Definition at line 40 of file HGCalGeometry.h.

Definition at line 44 of file HGCalGeometry.h.

Definition at line 37 of file HGCalGeometry.h.

Definition at line 38 of file HGCalGeometry.h.

Constructor & Destructor Documentation

HGCalGeometry::HGCalGeometry ( const HGCalTopology topology)

Definition at line 26 of file HGCalGeometry.cc.

References DetId::HGCalHSc, m_cellVec, m_cellVec2, m_det, m_topology, CaloSubdetectorGeometry::m_validIds, HGCalTopology::totalGeomModules(), and HGCalTopology::totalModules().

Referenced by dbString().

27  : m_topology( topology_ ),
28  m_validGeomIds( topology_.totalGeomModules()),
29  mode_( topology_.geomMode()),
30  m_det( topology_.detector()),
31  m_subdet( topology_.subDetector()),
32  twoBysqrt3_(2.0/std::sqrt(3.0)) {
33 
34  if (m_det == DetId::HGCalHSc) {
35  m_cellVec2 = CellVec2(topology_.totalGeomModules());
36  } else {
37  m_cellVec = CellVec(topology_.totalGeomModules());
38  }
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("HGCalGeom") << "Expected total # of Geometry Modules "
43 #endif
44 }
std::vector< DetId > m_validGeomIds
HGCalGeometryMode::GeometryMode mode_
std::vector< FlatHexagon > CellVec
Definition: HGCalGeometry.h:34
const HGCalTopology & m_topology
const double twoBysqrt3_
unsigned int totalGeomModules() const
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< DetId > m_validIds
CellVec2 m_cellVec2
ForwardSubdetector m_subdet
std::vector< FlatTrd > CellVec2
Definition: HGCalGeometry.h:35
unsigned int totalModules() const
Definition: HGCalTopology.h:99
DetId::Detector m_det
CellVec m_cellVec
HGCalGeometry::~HGCalGeometry ( )
override

Definition at line 46 of file HGCalGeometry.cc.

Referenced by dbString().

46 { }

Member Function Documentation

void HGCalGeometry::addValidID ( const DetId id)
protected

Definition at line 625 of file HGCalGeometry.cc.

Referenced by topology().

625  {
626  edm::LogError("HGCalGeom") << "HGCalGeometry::addValidID is not implemented";
627 }
std::string HGCalGeometry::cellElement ( ) const

Definition at line 546 of file HGCalGeometry.cc.

References DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, HGCEE, HGCHEB, HGCHEF, m_det, and m_subdet.

Referenced by producerTag().

546  {
547  if (m_subdet == HGCEE || m_det == DetId::HGCalEE) return "HGCalEE";
548  else if (m_subdet == HGCHEF || m_det == DetId::HGCalHSi) return "HGCalHEFront";
549  else if (m_subdet == HGCHEB || m_det == DetId::HGCalHSc) return "HGCalHEBack";
550  else return "Unknown";
551 }
ForwardSubdetector m_subdet
DetId::Detector m_det
std::shared_ptr< const CaloCellGeometry > HGCalGeometry::cellGeomPtr ( uint32_t  index) const
overrideprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 585 of file HGCalGeometry.cc.

References DetId::HGCalHSc, m_cellVec, m_cellVec2, m_det, and m_validGeomIds.

Referenced by cellGeomPtr(), getGeometry(), getSummary(), and topology().

585  {
586  if ((index >= m_cellVec.size() && m_det != DetId::HGCalHSc) ||
587  (index >= m_cellVec2.size() && m_det == DetId::HGCalHSc) ||
588  (m_validGeomIds[index].rawId() == 0)) return nullptr;
589  static const auto do_not_delete = [](const void*){};
590  if (m_det == DetId::HGCalHSc) {
591  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec2[index],do_not_delete);
592  if (nullptr == cell->param()) return nullptr;
593  return cell;
594  } else {
595  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec[index],do_not_delete);
596  if (nullptr == cell->param()) return nullptr;
597  return cell;
598  }
599 }
std::vector< DetId > m_validGeomIds
CellVec2 m_cellVec2
DetId::Detector m_det
CellVec m_cellVec
std::shared_ptr< const CaloCellGeometry > HGCalGeometry::cellGeomPtr ( uint32_t  index,
const GlobalPoint p 
) const
private

Definition at line 601 of file HGCalGeometry.cc.

References cellGeomPtr(), DetId::HGCalHSc, m_cellVec, m_cellVec2, m_det, and m_validGeomIds.

601  {
602  if ((index >= m_cellVec.size() && m_det != DetId::HGCalHSc) ||
603  (index >= m_cellVec2.size() && m_det == DetId::HGCalHSc) ||
604  (m_validGeomIds[index].rawId() == 0)) return nullptr;
605  if (pos == GlobalPoint()) return cellGeomPtr(index);
606  if (m_det == DetId::HGCalHSc) {
607  auto cell = std::make_shared<FlatTrd>(m_cellVec2[index]);
608  cell->setPosition(pos);
609 #ifdef EDM_ML_DEBUG
610  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
611 #endif
612  if (nullptr == cell->param()) return nullptr;
613  return cell;
614  } else {
615  auto cell = std::make_shared<FlatHexagon>(m_cellVec[index]);
616  cell->setPosition(pos);
617 #ifdef EDM_ML_DEBUG
618  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
619 #endif
620  if (nullptr == cell->param()) return nullptr;
621  return cell;
622  }
623 }
std::vector< DetId > m_validGeomIds
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CellVec2 m_cellVec2
DetId::Detector m_det
CellVec m_cellVec
static std::string HGCalGeometry::dbString ( )
inlinestatic
void HGCalGeometry::fillNamedParams ( DDFilteredView  fv)
virtual

Definition at line 48 of file HGCalGeometry.cc.

Referenced by getValidGeomDetIds().

48 {}
HGCalGeometry::CornersVec HGCalGeometry::get8Corners ( const DetId id) const

Definition at line 321 of file HGCalGeometry.cc.

References HGCalDDDConstants::cellSizeTrap(), funct::cos(), HGCalTopology::dddConstants(), HGCalTopology::decode(), runTauDisplay::dr, PVValHelper::dx, PVValHelper::dz, getPosition(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, DetId::HGCalHSc, mps_fire::i, indexFor(), FlatTrd::k_Cell, FlatTrd::k_dZ, FlatHexagon::k_dZ, k_half, FlatHexagon::k_r, HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellHex(), m_cellVec, m_cellVec2, m_det, m_topology, mode_, FlatTrd::ncorner_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), alignCSCRings::r, findQualityFiles::rr, funct::sin(), findQualityFiles::v, geometryCSVtoXML::xy, and PV3DBase< T, PVType, FrameType >::z().

Referenced by dbString().

321  {
322 
323  unsigned int ncorner = FlatTrd::ncorner_;
324  HGCalGeometry::CornersVec co (ncorner, GlobalPoint(0,0,0));
325  unsigned int cellIndex = indexFor(detid);
327  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
328  GlobalPoint v = getPosition(detid);
329  std::pair<double,double> rr = m_topology.dddConstants().cellSizeTrap(id.iType,id.iSec1);
330  float dr = k_half*(rr.second-rr.first);
331  float dfi= m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
332  float dz = id.zSide*m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
333  float r = v.perp();
334  float fi = v.phi();
335  static const int signr[] = {1,1,-1,-1,1,1,-1,-1};
336  static const int signf[] = {-1,1,1,-1,-1,1,1,-1};
337  static const int signz[] = {-1,-1,-1,-1,1,1,1,1};
338  for (unsigned int i = 0; i < ncorner; ++i) {
339  co[i] = GlobalPoint((r+signr[i]*dr)*cos(fi+signf[i]*dfi),
340  (r+signr[i]*dr)*sin(fi+signf[i]*dfi),
341  (v.z()+signz[i]*dz));
342  }
343  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
344  std::pair<float,float> xy;
347  xy = m_topology.dddConstants().locateCellHex(id.iCell1,id.iSec1,true);
348  } else {
349  xy = m_topology.dddConstants().locateCell(id.iLay,id.iSec1,id.iSec2,
350  id.iCell1,id.iCell2,true,false);
351  }
352  static const int signx[] = {-1,-1,1,1,-1,-1,1,1};
353  static const int signy[] = {-1,1,1,-1,-1,1,1,-1};
354  static const int signz[] = {-1,-1,-1,-1,1,1,1,1};
355  float dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
356  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
357  for (unsigned int i = 0; i < ncorner; ++i) {
358  const HepGeom::Point3D<float> lcoord(xy.first+signx[i]*dx,
359  xy.second+signy[i]*dx,signz[i]*dz);
360  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
361  }
362  }
363  return co;
364 }
HGCalGeometryMode::GeometryMode mode_
T perp() const
Definition: PV3DBase.h:72
std::pair< double, double > cellSizeTrap(int type, int irad) const
const HGCalTopology & m_topology
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< GlobalPoint > CornersVec
Definition: HGCalGeometry.h:41
GlobalPoint getPosition(const DetId &id) const
static constexpr uint32_t k_Cell
Definition: FlatTrd.h:46
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
static constexpr unsigned int ncorner_
Definition: FlatTrd.h:98
static constexpr uint32_t k_r
Definition: FlatHexagon.h:29
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CellVec2 m_cellVec2
DecodedDetId decode(const DetId &id) const
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:28
const HGCalDDDConstants & dddConstants() const
static constexpr uint32_t k_dZ
Definition: FlatTrd.h:27
static double k_half
DetId::Detector m_det
unsigned int indexFor(const DetId &id) const override
CellVec m_cellVec
HGCalGeometry::DetIdSet HGCalGeometry::getCells ( const GlobalPoint r,
double  dR 
) const
overridevirtual

Get a list of all cells within a dR of the given cell.

The default implementation makes a loop over all cell geometries. Cleverer implementations are suggested to use rough conversions between eta/phi and ieta/iphi and test on the boundaries.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 541 of file HGCalGeometry.cc.

Referenced by getValidGeomDetIds().

541  {
543  return dss;
544 }
std::set< DetId > DetIdSet
Definition: HGCalGeometry.h:40
DetId HGCalGeometry::getClosestCell ( const GlobalPoint r) const
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 487 of file HGCalGeometry.cc.

References HGCalDDDConstants::assignCell(), HGCalDDDConstants::assignCellHex(), HGCalDDDConstants::assignCellTrap(), HGCalTopology::dddConstants(), HGCalTopology::decode(), HGCalTopology::encode(), getClosestCellIndex(), HGCalDDDConstants::getLayer(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, DetId::HGCalHSc, DTRecHitClients_cfi::local, m_cellVec, m_cellVec2, m_det, m_topology, m_validGeomIds, mode_, HGCalGeometryMode::Trapezoid, HGCalDDDConstants::waferTypeT(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by getValidGeomDetIds(), and neighborZ().

487  {
488  unsigned int cellIndex = getClosestCellIndex(r);
489  if ((cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) ||
490  (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc)) {
492  HepGeom::Point3D<float> local;
493  if (r.z() > 0) {
494  local = HepGeom::Point3D<float>(r.x(),r.y(),0);
495  id.zSide = 1;
496  } else {
497  local = HepGeom::Point3D<float>(-r.x(),r.y(),0);
498  id.zSide =-1;
499  }
502  const auto & kxy =
503  m_topology.dddConstants().assignCell(local.x(),local.y(),id.iLay,
504  id.iType,true);
505  id.iCell1 = kxy.second;
506  id.iSec1 = kxy.first;
507  id.iType = m_topology.dddConstants().waferTypeT(kxy.first);
508  if (id.iType != 1) id.iType = -1;
509  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
510  id.iLay = m_topology.dddConstants().getLayer(r.z(),true);
511  const auto & kxy =
512  m_topology.dddConstants().assignCellTrap(r.x(),r.y(),r.z(),
513  id.iLay,true);
514  id.iSec1 = kxy[0];
515  id.iCell1 = kxy[1];
516  id.iType = kxy[2];
517  } else {
518  id.iLay = m_topology.dddConstants().getLayer(r.z(),true);
519  const auto & kxy =
520  m_topology.dddConstants().assignCellHex(local.x(),local.y(),id.iLay,
521  true);
522  id.iSec1 = kxy[0]; id.iSec2 = kxy[1]; id.iType = kxy[2];
523  id.iCell1 = kxy[3]; id.iCell2 = kxy[4];
524  }
525 #ifdef EDM_ML_DEBUG
526  edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local
527  << " Id " << id.zSide << ":" << id.iLay
528  << ":" << id.iSec1 << ":" << id.iSec2
529  << ":" << id.iType << ":" << id.iCell1
530  << ":" << id.iCell2;
531 #endif
532 
533  //check if returned cell is valid
534  if (id.iCell1>=0) return m_topology.encode(id);
535  }
536 
537  //if not valid or out of bounds return a null DetId
538  return DetId();
539 }
std::vector< DetId > m_validGeomIds
HGCalGeometryMode::GeometryMode mode_
int getLayer(double z, bool reco) const
unsigned int getClosestCellIndex(const GlobalPoint &r) const
const HGCalTopology & m_topology
T y() const
Definition: PV3DBase.h:63
DetId encode(const DecodedDetId &id_) const
T z() const
Definition: PV3DBase.h:64
CellVec2 m_cellVec2
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
const HGCalDDDConstants & dddConstants() const
std::array< int, 5 > assignCellHex(float x, float y, int lay, bool reco) const
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
DetId::Detector m_det
std::array< int, 3 > assignCellTrap(float x, float y, float z, int lay, bool reco) const
T x() const
Definition: PV3DBase.h:62
int waferTypeT(int wafer) const
CellVec m_cellVec
unsigned int HGCalGeometry::getClosestCellIndex ( const GlobalPoint r) const
protected

Definition at line 629 of file HGCalGeometry.cc.

References DetId::HGCalHSc, m_cellVec, m_cellVec2, and m_det.

Referenced by getClosestCell(), and topology().

629  {
630 
632 }
unsigned int getClosestCellIndex(const GlobalPoint &r) const
CellVec2 m_cellVec2
DetId::Detector m_det
CellVec m_cellVec
template<class T >
unsigned int HGCalGeometry::getClosestCellIndex ( const GlobalPoint r,
const std::vector< T > &  vec 
) const
private

Definition at line 635 of file HGCalGeometry.cc.

References a, funct::abs(), b, PVValHelper::dz, getPosition(), gen::k, M_PI, PV3DBase< T, PVType, FrameType >::phi(), DetId::rawId(), z, and PV3DBase< T, PVType, FrameType >::z().

636  {
637 
638  float phip = r.phi();
639  float zp = r.z();
640  float dzmin(9999), dphimin(9999), dphi10(0.175);
641  unsigned int cellIndex = vec.size();
642  for (unsigned int k=0; k<vec.size(); ++k) {
643  float dphi = phip-vec[k].phiPos();
644  while (dphi > M_PI) dphi -= 2*M_PI;
645  while (dphi <= -M_PI) dphi += 2*M_PI;
646  if (std::abs(dphi) < dphi10) {
647  float dz = std::abs(zp - vec[k].getPosition().z());
648  if (dz < (dzmin+0.001)) {
649  dzmin = dz;
650  if (std::abs(dphi) < (dphimin+0.01)) {
651  cellIndex = k;
652  dphimin = std::abs(dphi);
653  } else {
654  if (cellIndex >= vec.size()) cellIndex = k;
655  }
656  }
657  }
658  }
659 #ifdef EDM_ML_DEBUG
660  edm::LogVerbatim("HGCalGeom") << "getClosestCellIndex::Input " << zp << ":"
661  << phip << " Index " << cellIndex;
662  if (cellIndex < vec.size())
663  edm::LogVerbatim("HGCalGeom") << " Cell z "
664  << vec[cellIndex].getPosition().z()
665  << ":" << dzmin << " phi "
666  << vec[cellIndex].phiPos() << ":" << dphimin;
667 #endif
668  return cellIndex;
669 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint getPosition(const DetId &id) const
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
int k[5][pyjets_maxn]
HGCalGeometry::CornersVec HGCalGeometry::getCorners ( const DetId id) const

Returns the corner points of this cell's volume.

Definition at line 275 of file HGCalGeometry.cc.

References HGCalDDDConstants::cellSizeTrap(), funct::cos(), HGCalTopology::dddConstants(), HGCalTopology::decode(), runTauDisplay::dr, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, getPosition(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, DetId::HGCalHSc, mps_fire::i, indexFor(), FlatTrd::k_Cell, FlatTrd::k_dZ, FlatHexagon::k_dZ, k_half, FlatHexagon::k_r, FlatHexagon::k_R, HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellHex(), m_cellVec, m_cellVec2, m_det, m_topology, mode_, FlatHexagon::ncorner_, FlatTrd::ncorner_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), alignCSCRings::r, findQualityFiles::rr, funct::sin(), findQualityFiles::v, geometryCSVtoXML::xy, and PV3DBase< T, PVType, FrameType >::z().

Referenced by dbString().

275  {
276 
277  unsigned int ncorner = ((m_det == DetId::HGCalHSc) ? FlatTrd::ncorner_ :
279  HGCalGeometry::CornersVec co (ncorner, GlobalPoint(0,0,0));
280  unsigned int cellIndex = indexFor(detid);
282  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
283  GlobalPoint v = getPosition(detid);
284  std::pair<double,double> rr = m_topology.dddConstants().cellSizeTrap(id.iType,id.iSec1);
285  float dr = k_half*(rr.second-rr.first);
286  float dfi= m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
287  float dz = id.zSide*m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
288  float r = v.perp();
289  float fi = v.phi();
290  static const int signr[] = {1,1,-1,-1,1,1,-1,-1};
291  static const int signf[] = {-1,1,1,-1,-1,1,1,-1};
292  static const int signz[] = {-1,-1,-1,-1,1,1,1,1};
293  for (unsigned int i = 0; i < ncorner; ++i) {
294  co[i] = GlobalPoint((r+signr[i]*dr)*cos(fi+signf[i]*dfi),
295  (r+signr[i]*dr)*sin(fi+signf[i]*dfi),
296  (v.z()+signz[i]*dz));
297  }
298  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
299  std::pair<float,float> xy;
302  xy = m_topology.dddConstants().locateCellHex(id.iCell1,id.iSec1,true);
303  } else {
304  xy = m_topology.dddConstants().locateCell(id.iLay,id.iSec1,id.iSec2,
305  id.iCell1,id.iCell2,true,false);
306  }
307  float dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
308  float dy = k_half*m_cellVec[cellIndex].param()[FlatHexagon::k_R];
309  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
310  static const int signx[] = {0,-1,-1,0,1,1,0,-1,-1,0,1,1};
311  static const int signy[] = {-2,-1,1,2,1,-1,-2,-1,1,2,1,-1};
312  static const int signz[] = {-1,-1,-1,-1,-1,-1,1,1,1,1,1,1};
313  for (unsigned int i = 0; i < ncorner; ++i) {
314  const HepGeom::Point3D<float> lcoord(xy.first+signx[i]*dx,xy.second+signy[i]*dy,signz[i]*dz);
315  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
316  }
317  }
318  return co;
319 }
HGCalGeometryMode::GeometryMode mode_
T perp() const
Definition: PV3DBase.h:72
std::pair< double, double > cellSizeTrap(int type, int irad) const
const HGCalTopology & m_topology
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< GlobalPoint > CornersVec
Definition: HGCalGeometry.h:41
GlobalPoint getPosition(const DetId &id) const
static constexpr uint32_t k_Cell
Definition: FlatTrd.h:46
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:82
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
static constexpr unsigned int ncorner_
Definition: FlatTrd.h:98
static constexpr uint32_t k_R
Definition: FlatHexagon.h:30
static constexpr uint32_t k_r
Definition: FlatHexagon.h:29
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CellVec2 m_cellVec2
DecodedDetId decode(const DetId &id) const
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:28
const HGCalDDDConstants & dddConstants() const
static constexpr uint32_t k_dZ
Definition: FlatTrd.h:27
static double k_half
DetId::Detector m_det
unsigned int indexFor(const DetId &id) const override
CellVec m_cellVec
std::shared_ptr< const CaloCellGeometry > HGCalGeometry::getGeometry ( const DetId id) const
overridevirtual

Get the cell geometry of a given detector id. Should return false if not found.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 211 of file HGCalGeometry.cc.

References cellGeomPtr(), HGCalTopology::detId2denseGeomId(), getGeometryDetId(), getPosition(), and m_topology.

Referenced by dbString().

211  {
212  if (detId == DetId()) return nullptr; // nothing to get
213  DetId geomId = getGeometryDetId(detId);
214  const uint32_t cellIndex (m_topology.detId2denseGeomId(geomId));
215  const GlobalPoint pos = (detId != geomId) ? getPosition(detId) : GlobalPoint();
216  return cellGeomPtr (cellIndex, pos);
217 
218 }
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
const HGCalTopology & m_topology
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint getPosition(const DetId &id) const
virtual uint32_t detId2denseGeomId(const DetId &id) const
Definition: DetId.h:18
DetId getGeometryDetId(DetId detId) const
DetId HGCalGeometry::getGeometryDetId ( DetId  detId) const
private

Definition at line 793 of file HGCalGeometry.cc.

References HGCScintillatorDetId::geometryCell(), HGCalDetId::geometryCell(), HGCSiliconDetId::geometryCell(), HFNoseDetId::geometryCell(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, HGCalTopology::isHFNose(), m_topology, mode_, and HGCalGeometryMode::Trapezoid.

Referenced by getGeometry(), indexFor(), newCell(), present(), and topology().

793  {
794  DetId geomId;
795  if ((mode_ == HGCalGeometryMode::Hexagon) ||
797  geomId = static_cast<DetId>(HGCalDetId(detId).geometryCell());
798  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
799  geomId = static_cast<DetId>(HGCScintillatorDetId(detId).geometryCell());
800  } else if (m_topology.isHFNose()) {
801  geomId = static_cast<DetId>(HFNoseDetId(detId).geometryCell());
802  } else {
803  geomId = static_cast<DetId>(HGCSiliconDetId(detId).geometryCell());
804  }
805  return geomId;
806 }
HGCalGeometryMode::GeometryMode mode_
const HGCalTopology & m_topology
HFNoseDetId geometryCell() const
Definition: HFNoseDetId.h:49
HGCalDetId geometryCell() const
Definition: HGCalDetId.h:36
HGCSiliconDetId geometryCell() const
HGCScintillatorDetId geometryCell() const
bool isHFNose() const
Definition: DetId.h:18
const CaloCellGeometry * HGCalGeometry::getGeometryRawPtr ( uint32_t  index) const
overrideprotectedvirtual

Implements CaloSubdetectorGeometry.

Definition at line 572 of file HGCalGeometry.cc.

References DetId::HGCalHSc, m_cellVec, m_cellVec2, m_det, and CaloCellGeometry::param().

Referenced by present(), and topology().

572  {
573  // Modify the RawPtr class
574  if (m_det == DetId::HGCalHSc) {
575  if (m_cellVec2.size() < index) return nullptr;
576  const CaloCellGeometry* cell(&m_cellVec2[index]);
577  return (nullptr == cell->param() ? nullptr : cell);
578  } else {
579  if (m_cellVec2.size() < index) return nullptr;
580  const CaloCellGeometry* cell(&m_cellVec[index]);
581  return (nullptr == cell->param() ? nullptr : cell);
582  }
583 }
CellVec2 m_cellVec2
DetId::Detector m_det
CellVec m_cellVec
HGCalGeometry::CornersVec HGCalGeometry::getNewCorners ( const DetId id) const

Definition at line 366 of file HGCalGeometry.cc.

References HGCalDDDConstants::cellSizeTrap(), funct::cos(), HGCalTopology::dddConstants(), HGCalTopology::decode(), runTauDisplay::dr, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, getPosition(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, DetId::HGCalHSc, mps_fire::i, indexFor(), FlatTrd::k_Cell, FlatTrd::k_dZ, FlatHexagon::k_dZ, k_half, FlatHexagon::k_r, FlatHexagon::k_R, HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellHex(), m_cellVec, m_cellVec2, m_det, m_topology, mode_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), alignCSCRings::r, findQualityFiles::rr, funct::sin(), findQualityFiles::v, geometryCSVtoXML::xy, and PV3DBase< T, PVType, FrameType >::z().

Referenced by FWRecoGeometryESProducer::addCaloGeometry(), and dbString().

366  {
367 
368  unsigned int ncorner = (m_det == DetId::HGCalHSc) ? 5 : 7;
369  HGCalGeometry::CornersVec co (ncorner, GlobalPoint(0,0,0));
370  unsigned int cellIndex = indexFor(detid);
372  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
373  GlobalPoint v = getPosition(detid);
374  std::pair<double,double> rr = m_topology.dddConstants().cellSizeTrap(id.iType,id.iSec1);
375  float dr = k_half*(rr.second-rr.first);
376  float dfi= m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
377  float dz =-id.zSide*m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
378  float r = v.perp();
379  float fi = v.phi();
380  static const int signr[] = {1,1,-1,-1};
381  static const int signf[] = {-1,1,1,-1};
382  for (unsigned int i = 0; i < ncorner-1; ++i) {
383  co[i] = GlobalPoint((r+signr[i]*dr)*cos(fi+signf[i]*dfi),
384  (r+signr[i]*dr)*sin(fi+signf[i]*dfi),
385  (v.z()+dz));
386  }
387  co[ncorner-1] = GlobalPoint(0,0,-2*dz);
388  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
389  std::pair<float,float> xy;
392  xy = m_topology.dddConstants().locateCellHex(id.iCell1,id.iSec1,true);
393  } else {
394  xy = m_topology.dddConstants().locateCell(id.iLay,id.iSec1,id.iSec2,
395  id.iCell1,id.iCell2,true,false);
396  }
397  float dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
398  float dy = k_half*m_cellVec[cellIndex].param()[FlatHexagon::k_R];
399  float dz =-id.zSide*m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
400  static const int signx[] = {0,-1,-1,0,1,1};
401  static const int signy[] = {-2,-1,1,2,1,-1};
402  for (unsigned int i = 0; i < ncorner-1; ++i) {
403  const HepGeom::Point3D<float> lcoord(xy.first+signx[i]*dx,xy.second+signy[i]*dy,dz);
404  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
405  }
406  co[ncorner-1] = GlobalPoint(0,0,-2*dz);
407  }
408  return co;
409 }
HGCalGeometryMode::GeometryMode mode_
T perp() const
Definition: PV3DBase.h:72
std::pair< double, double > cellSizeTrap(int type, int irad) const
const HGCalTopology & m_topology
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< GlobalPoint > CornersVec
Definition: HGCalGeometry.h:41
GlobalPoint getPosition(const DetId &id) const
static constexpr uint32_t k_Cell
Definition: FlatTrd.h:46
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
static constexpr uint32_t k_R
Definition: FlatHexagon.h:30
static constexpr uint32_t k_r
Definition: FlatHexagon.h:29
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CellVec2 m_cellVec2
DecodedDetId decode(const DetId &id) const
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:28
const HGCalDDDConstants & dddConstants() const
static constexpr uint32_t k_dZ
Definition: FlatTrd.h:27
static double k_half
DetId::Detector m_det
unsigned int indexFor(const DetId &id) const override
CellVec m_cellVec
GlobalPoint HGCalGeometry::getPosition ( const DetId id) const

Definition at line 227 of file HGCalGeometry.cc.

References HGCalTopology::dddConstants(), HGCalTopology::decode(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, indexFor(), HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellHex(), m_cellVec, m_cellVec2, m_topology, copyPickMerge_cfg::maxSize, mode_, HGCalGeometryMode::Trapezoid, and geometryCSVtoXML::xy.

Referenced by HGCalTBAnalyzer::analyzeDigi(), HGCalTBAnalyzer::analyzeRecHits(), HGCalTriggerGeometryImp1::buildMaps(), HGCalTriggerGeometryHexImp1::buildTriggerCellsAndModules(), HGCDigitizer::checkPosition(), dbString(), HGCalTriggerNtupleHGCDigis::fill(), get8Corners(), getClosestCellIndex(), getCorners(), getGeometry(), HGCalTriggerGeometryHexImp2::getModulePosition(), HGCalTriggerGeometryV9Imp1::getModulePosition(), HGCalTriggerGeometryHexLayerBasedImp1::getModulePosition(), getNewCorners(), hgcal::RecHitTools::getPosition(), HGCalTriggerGeometryHexImp2::getTriggerCellPosition(), HGCalTriggerGeometryV9Imp1::getTriggerCellPosition(), HGCalTriggerGeometryHexLayerBasedImp1::getTriggerCellPosition(), and neighborZ().

227  {
228 
229  unsigned int cellIndex = indexFor(detid);
230  GlobalPoint glob;
231  unsigned int maxSize = ((mode_ == HGCalGeometryMode::Trapezoid) ?
232  m_cellVec2.size() : m_cellVec.size());
233  if (cellIndex < maxSize) {
235  std::pair<float,float> xy;
238  xy = m_topology.dddConstants().locateCellHex(id.iCell1,id.iSec1,true);
239  const HepGeom::Point3D<float> lcoord(xy.first,xy.second,0);
240  glob = m_cellVec[cellIndex].getPosition(lcoord);
241 #ifdef EDM_ML_DEBUG
242  edm::LogVerbatim("HGCalGeom") << "getPosition:: index " << cellIndex
243  << " Local " << lcoord.x() << ":"
244  << lcoord.y() << " ID " << id.iCell1
245  << ":" << id.iSec1 << " Global " << glob;
246 #endif
247  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
248  const HepGeom::Point3D<float> lcoord(0,0,0);
249  glob = m_cellVec2[cellIndex].getPosition(lcoord);
250 #ifdef EDM_ML_DEBUG
251  edm::LogVerbatim("HGCalGeom") << "getPositionTrap:: index " << cellIndex
252  << " Local " << lcoord.x() << ":"
253  << lcoord.y() << " ID " << id.iLay << ":"
254  << id.iSec1 << ":" << id.iCell1
255  << " Global " << glob;
256 #endif
257  } else {
258  xy = m_topology.dddConstants().locateCell(id.iLay,id.iSec1,id.iSec2,
259  id.iCell1,id.iCell2,true,false);
260  const HepGeom::Point3D<float> lcoord(xy.first,xy.second,0);
261  glob = m_cellVec[cellIndex].getPosition(lcoord);
262 #ifdef EDM_ML_DEBUG
263  edm::LogVerbatim("HGCalGeom") << "getPositionWafer:: index " << cellIndex
264  << " Local " << lcoord.x() << ":"
265  << lcoord.y() << " ID " << id.iLay << ":"
266  << id.iSec1 << ":" << id.iSec2 << ":"
267  << id.iCell1 << ":" << id.iCell2
268  << " Global " << glob;
269 #endif
270  }
271  }
272  return glob;
273 }
HGCalGeometryMode::GeometryMode mode_
const HGCalTopology & m_topology
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
CellVec2 m_cellVec2
DecodedDetId decode(const DetId &id) const
const HGCalDDDConstants & dddConstants() const
unsigned int indexFor(const DetId &id) const override
CellVec m_cellVec
void HGCalGeometry::getSummary ( CaloSubdetectorGeometry::TrVec trVector,
CaloSubdetectorGeometry::IVec iVector,
CaloSubdetectorGeometry::DimVec dimVector,
CaloSubdetectorGeometry::IVec dinsVector 
) const
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 686 of file HGCalGeometry.cc.

References HGCalParameters::hgtrap::alpha, HGCalParameters::hgtrap::bl, cellGeomPtr(), HGCalParameters::hgtrap::cellSize, HGCalTopology::dddConstants(), HGCalTopology::detId2denseGeomId(), HGCalParameters::hgtrap::dz, HGCalParameters::firstModule_, HGCalDDDConstants::getModule(), HGCalDDDConstants::getParameter(), HGCalDDDConstants::getTrForm(), HGCalDDDConstants::getTrFormN(), runTauDisplay::gp, HGCalParameters::hgtrap::h, HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, DetId::HGCalHSc, mps_fire::i, HGCalTopology::isHFNose(), FlatTrd::k_Alp1, FlatTrd::k_Alp2, FlatTrd::k_Cell, FlatTrd::k_dX1, FlatTrd::k_dX2, FlatTrd::k_dX3, FlatTrd::k_dX4, FlatTrd::k_dY1, FlatTrd::k_dY2, FlatTrd::k_dZ, FlatHexagon::k_dZ, k_NumberOfParametersPerHex, k_NumberOfParametersPerTrd, k_NumberOfShapes, FlatTrd::k_Phi, FlatHexagon::k_r, FlatHexagon::k_R, FlatTrd::k_Theta, HGCalParameters::lastModule_, HGCalParameters::hgtrform::lay, HGCScintillatorDetId::layer(), HGCalDetId::layer(), HGCSiliconDetId::layer(), HFNoseDetId::layer(), HGCalDDDConstants::layerIndex(), m_det, m_topology, m_validGeomIds, mode_, CaloSubdetectorGeometry::numberOfParametersPerShape(), CaloSubdetectorGeometry::numberOfShapes(), CaloSubdetectorGeometry::numberOfTransformParms(), findQualityFiles::rr, HGCalDDDConstants::sectors(), HGCalParameters::hgtrap::tl, HGCalTopology::totalGeomModules(), HGCalGeometryMode::Trapezoid, groupFilesInBlocks::tt, twoBysqrt3_, and HGCalDDDConstants::waferInLayer().

Referenced by dbString(), and CaloGeometryDBEP< T, U >::produceAligned().

689  {
690 
691  unsigned int numberOfCells = m_topology.totalGeomModules(); // total Geom Modules both sides
692  unsigned int numberOfShapes = k_NumberOfShapes;
693  unsigned int numberOfParametersPerShape =
694  ((m_det == DetId::HGCalHSc) ? (unsigned int)(k_NumberOfParametersPerTrd) :
695  (unsigned int)(k_NumberOfParametersPerHex));
696 
697  trVector.reserve( numberOfCells * numberOfTransformParms());
698  iVector.reserve( numberOfCells );
699  dimVector.reserve( numberOfShapes * numberOfParametersPerShape );
700  dinsVector.reserve( numberOfCells );
701 
702  for (unsigned itr=0; itr<m_topology.dddConstants().getTrFormN(); ++itr) {
704  int layer = mytr.lay;
705 
708  for (int wafer=0; wafer<m_topology.dddConstants().sectors(); ++wafer) {
709  if (m_topology.dddConstants().waferInLayer(wafer,layer,true)) {
710  HGCalParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
711  ParmVec params( numberOfParametersPerShape, 0 );
712  params[FlatHexagon::k_dZ] = vol.dz;
713  params[FlatHexagon::k_r] = vol.cellSize;
714  params[FlatHexagon::k_R] = twoBysqrt3_*params[1];
715  dimVector.insert( dimVector.end(), params.begin(), params.end());
716  }
717  }
718  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
719  int indx = m_topology.dddConstants().layerIndex(layer,true);
720  for (int md=m_topology.dddConstants().getParameter()->firstModule_[indx];
722  ++md) {
724  ParmVec params( numberOfParametersPerShape, 0 );
725  params[FlatTrd::k_dZ] = vol.dz;
726  params[FlatTrd::k_Theta] = params[FlatTrd::k_Phi] = 0;
727  params[FlatTrd::k_dY1] = params[FlatTrd::k_dY2] = vol.h;
728  params[FlatTrd::k_dX1] = params[FlatTrd::k_dX3] = vol.bl;
729  params[FlatTrd::k_dX2] = params[FlatTrd::k_dX4] = vol.tl;
730  params[FlatTrd::k_Alp1] = params[FlatTrd::k_Alp2]= vol.alpha;
731  params[FlatTrd::k_Cell] = vol.cellSize;
732  dimVector.insert( dimVector.end(), params.begin(), params.end());
733  }
734  } else {
735  for (int wafer=0; wafer<m_topology.dddConstants().sectors(); ++wafer) {
736  if (m_topology.dddConstants().waferInLayer(wafer,layer,true)) {
737  HGCalParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
738  ParmVec params( numberOfParametersPerShape, 0 );
739  params[FlatHexagon::k_dZ] = vol.dz;
740  params[FlatHexagon::k_r] = vol.cellSize;
741  params[FlatHexagon::k_R] = twoBysqrt3_*params[1];
742  dimVector.insert( dimVector.end(), params.begin(), params.end());
743  }
744  }
745  }
746  }
747 
748  for (unsigned int i( 0 ); i < numberOfCells; ++i) {
749  DetId detId = m_validGeomIds[i];
750  int layer(0);
753  layer = HGCalDetId(detId).layer();
754  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
755  layer = HGCScintillatorDetId(detId).layer();
756  } else if (m_topology.isHFNose()) {
757  layer = HFNoseDetId(detId).layer();
758  } else {
759  layer = HGCSiliconDetId(detId).layer();
760  }
761  dinsVector.emplace_back(m_topology.detId2denseGeomId( detId ));
762  iVector.emplace_back( layer );
763 
764  Tr3D tr;
765  auto ptr = cellGeomPtr( i );
766  if ( nullptr != ptr ) {
767  ptr->getTransform( tr, ( Pt3DVec* ) nullptr );
768 
769  if( Tr3D() == tr ) { // there is no rotation
770  const GlobalPoint& gp( ptr->getPosition());
771  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z());
772  }
773 
774  const CLHEP::Hep3Vector tt( tr.getTranslation());
775  trVector.emplace_back( tt.x());
776  trVector.emplace_back( tt.y());
777  trVector.emplace_back( tt.z());
778  if (6 == numberOfTransformParms()) {
779  const CLHEP::HepRotation rr( tr.getRotation());
780  const ROOT::Math::Transform3D rtr( rr.xx(), rr.xy(), rr.xz(), tt.x(),
781  rr.yx(), rr.yy(), rr.yz(), tt.y(),
782  rr.zx(), rr.zy(), rr.zz(), tt.z());
784  rtr.GetRotation( ea );
785  trVector.emplace_back( ea.Phi());
786  trVector.emplace_back( ea.Theta());
787  trVector.emplace_back( ea.Psi());
788  }
789  }
790  }
791 }
std::vector< DetId > m_validGeomIds
HGCalGeometryMode::GeometryMode mode_
virtual unsigned int numberOfParametersPerShape() const
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
HGCalParameters::hgtrform getTrForm(unsigned int k) const
const HGCalParameters * getParameter() const
const HGCalTopology & m_topology
static constexpr uint32_t k_Theta
Definition: FlatTrd.h:28
std::vector< float > ParmVec
static constexpr uint32_t k_Cell
Definition: FlatTrd.h:46
static constexpr uint32_t k_dY1
Definition: FlatTrd.h:32
CaloCellGeometry::Tr3D Tr3D
int layerIndex(int lay, bool reco) const
const double twoBysqrt3_
unsigned int totalGeomModules() const
std::vector< int > firstModule_
static unsigned int k_NumberOfShapes
Definition: HGCalGeometry.h:49
static constexpr uint32_t k_R
Definition: FlatHexagon.h:30
unsigned int getTrFormN() const
static unsigned int k_NumberOfParametersPerHex
Definition: HGCalGeometry.h:47
virtual uint32_t detId2denseGeomId(const DetId &id) const
static constexpr uint32_t k_r
Definition: FlatHexagon.h:29
int layer() const
get the layer #
Definition: HFNoseDetId.h:58
virtual unsigned int numberOfShapes() const
int layer() const
get the layer #
static constexpr uint32_t k_dX1
Definition: FlatTrd.h:33
static constexpr uint32_t k_dY2
Definition: FlatTrd.h:39
static constexpr uint32_t k_dX4
Definition: FlatTrd.h:42
static unsigned int k_NumberOfParametersPerTrd
Definition: HGCalGeometry.h:46
bool isHFNose() const
Definition: DetId.h:18
std::vector< int > lastModule_
AlgebraicVector EulerAngles
Definition: Definitions.h:36
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:28
const HGCalDDDConstants & dddConstants() const
static constexpr uint32_t k_Phi
Definition: FlatTrd.h:30
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
int layer() const
get the layer #
static constexpr uint32_t k_dZ
Definition: FlatTrd.h:27
DetId::Detector m_det
static constexpr uint32_t k_Alp1
Definition: FlatTrd.h:37
virtual unsigned int numberOfTransformParms() const
static constexpr uint32_t k_dX3
Definition: FlatTrd.h:40
HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const
int layer() const
get the layer #
Definition: HGCalDetId.h:48
static constexpr uint32_t k_dX2
Definition: FlatTrd.h:35
bool waferInLayer(int wafer, int lay, bool reco) const
static constexpr uint32_t k_Alp2
Definition: FlatTrd.h:44
const std::vector<DetId>& HGCalGeometry::getValidDetIds ( DetId::Detector  det = DetId::Detector(0),
int  subdet = 0 
) const
inlineoverridevirtual

Get a list of valid detector ids (for the given subdetector)

Note
The implementation in this class is relevant for SubdetectorGeometries which handle only a single subdetector at a time. It does not look at the det and subdet arguments.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 92 of file HGCalGeometry.h.

References CaloSubdetectorGeometry::m_validIds.

92 { return m_validIds; }
std::vector< DetId > m_validIds
const std::vector<DetId>& HGCalGeometry::getValidGeomDetIds ( void  ) const
inline
unsigned int HGCalGeometry::indexFor ( const DetId id) const
overrideprotectedvirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 553 of file HGCalGeometry.cc.

References TauDecayModes::dec, HGCalTopology::detId2denseGeomId(), getGeometryDetId(), DetId::HGCalHSc, m_cellVec, m_cellVec2, m_det, m_topology, and DetId::rawId().

Referenced by get8Corners(), getCorners(), getNewCorners(), getPosition(), and topology().

553  {
554  unsigned int cellIndex = ((m_det == DetId::HGCalHSc) ? m_cellVec2.size() :
555  m_cellVec.size());
556  if (detId != DetId()) {
557  DetId geomId = getGeometryDetId(detId);
558  cellIndex = m_topology.detId2denseGeomId(geomId);
559 #ifdef EDM_ML_DEBUG
560  edm::LogVerbatim("HGCalGeom") << "indexFor " << std::hex << detId.rawId()
561  << ":" << geomId.rawId() << std::dec
562  << " index " << cellIndex;
563 #endif
564  }
565  return cellIndex;
566 }
const HGCalTopology & m_topology
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
virtual uint32_t detId2denseGeomId(const DetId &id) const
CellVec2 m_cellVec2
Definition: DetId.h:18
DetId::Detector m_det
CellVec m_cellVec
DetId getGeometryDetId(DetId detId) const
void HGCalGeometry::initializeParms ( )
overridevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 50 of file HGCalGeometry.cc.

Referenced by getValidGeomDetIds().

50  {
51 }
void HGCalGeometry::localCorners ( Pt3DVec lc,
const CCGFloat pv,
unsigned int  i,
Pt3D ref 
)

Definition at line 53 of file HGCalGeometry.cc.

References DetId::HGCalHSc, FlatHexagon::localCorners(), FlatTrd::localCorners(), and m_det.

Referenced by dbString().

56  {
57  if (m_det == DetId::HGCalHSc) {
58  FlatTrd::localCorners( lc, pv, ref ) ;
59  } else {
60  FlatHexagon::localCorners( lc, pv, ref ) ;
61  }
62 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:175
def pv(vc)
Definition: MetAnalyzer.py:7
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatTrd.cc:175
DetId::Detector m_det
DetId HGCalGeometry::neighborZ ( const DetId idin,
const GlobalVector p 
) const

Definition at line 411 of file HGCalGeometry.cc.

References HGCalTopology::dddConstants(), HGCalTopology::decode(), HGCalDDDConstants::firstLayer(), getClosestCell(), getPosition(), HGCalDDDConstants::lastLayer(), m_topology, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::r, HGCalDDDConstants::rangeR(), topology(), findQualityFiles::v, HGCalDDDConstants::waferZ(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by dbString().

412  {
413  DetId idnew;
415  int lay = ((momentum.z()*id.zSide > 0) ? (id.iLay+1) : (id.iLay-1));
416 #ifdef EDM_ML_DEBUG
417  edm::LogVerbatim("HGCalGeom") << "neighborz1:: ID " << id.iLay << ":"
418  << id.iSec1 << ":" << id.iSec2 << ":"
419  << id.iCell1 << ":" << id.iCell2
420  << " New Layer " << lay << " Range "
421  << m_topology.dddConstants().firstLayer() <<":"
423  << " pz " << momentum.z();
424 #endif
425  if ((lay >= m_topology.dddConstants().firstLayer()) &&
426  (lay <= m_topology.dddConstants().lastLayer(true)) &&
427  (momentum.z() != 0.0)) {
428  GlobalPoint v = getPosition(idin);
429  double z = id.zSide*m_topology.dddConstants().waferZ(lay,true);
430  double grad = (z - v.z())/momentum.z();
431  GlobalPoint p(v.x()+grad*momentum.x(),v.y()+grad*momentum.y(),z);
432  double r = p.perp();
433  auto rlimit = topology().dddConstants().rangeR(z,true);
434  if (r >= rlimit.first && r <= rlimit.second) idnew = getClosestCell(p);
435 #ifdef EDM_ML_DEBUG
436  edm::LogVerbatim("HGCalGeom") << "neighborz1:: Position " << v << " New Z "
437  << z << ":" << grad << " new position " << p
438  << " r-limit " << rlimit.first << ":"
439  << rlimit.second;
440 #endif
441  }
442  return idnew;
443 }
T perp() const
Definition: PV3DBase.h:72
int lastLayer(bool reco) const
const HGCalTopology & m_topology
T y() const
Definition: PV3DBase.h:63
GlobalPoint getPosition(const DetId &id) const
std::pair< double, double > rangeR(double z, bool reco) const
T z() const
Definition: PV3DBase.h:64
const HGCalTopology & topology() const
double waferZ(int layer, bool reco) const
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
const HGCalDDDConstants & dddConstants() const
DetId getClosestCell(const GlobalPoint &r) const override
int firstLayer() const
T x() const
Definition: PV3DBase.h:62
DetId HGCalGeometry::neighborZ ( const DetId idin,
const MagneticField bField,
int  charge,
const GlobalVector momentum 
) const

Definition at line 445 of file HGCalGeometry.cc.

References alongMomentum, Plane::build(), HGCalTopology::dddConstants(), HGCalTopology::decode(), HGCalDDDConstants::firstLayer(), getClosestCell(), getPosition(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), HGCalDDDConstants::lastLayer(), M_PI, m_topology, AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::perp(), Propagator::propagate(), alignCSCRings::r, HGCalDDDConstants::rangeR(), topology(), findQualityFiles::v, HGCalDDDConstants::waferZ(), z, and PV3DBase< T, PVType, FrameType >::z().

447  {
448  DetId idnew;
450  int lay = ((momentum.z()*id.zSide > 0) ? (id.iLay+1) : (id.iLay-1));
451 #ifdef EDM_ML_DEBUG
452  edm::LogVerbatim("HGCalGeom") << "neighborz2:: ID " << id.iLay << ":"
453  << id.iSec1 << ":" << id.iSec2 << ":"
454  << id.iCell1 << ":" << id.iCell2
455  << " New Layer " << lay << " Range "
456  << m_topology.dddConstants().firstLayer() <<":"
458  << " pz " << momentum.z();
459 #endif
460  if ((lay >= m_topology.dddConstants().firstLayer()) &&
461  (lay <= m_topology.dddConstants().lastLayer(true)) &&
462  (momentum.z() != 0.0)) {
463  GlobalPoint v = getPosition(idin);
464  double z = id.zSide*m_topology.dddConstants().waferZ(lay,true);
465  FreeTrajectoryState fts (v, momentum, charge, bField);
468  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
469  TrajectoryStateOnSurface tsos = myAP.propagate(fts, *nPlane);
470  GlobalPoint p;
471  auto rlimit = topology().dddConstants().rangeR(z,true);
472  if (tsos.isValid()) {
473  p = tsos.globalPosition();
474  double r = p.perp();
475  if (r >= rlimit.first && r <= rlimit.second) idnew = getClosestCell(p);
476  }
477 #ifdef EDM_ML_DEBUG
478  edm::LogVerbatim("HGCalGeom") << "neighborz2:: Position " << v << " New Z "
479  << z << ":" << charge << ":" << tsos.isValid()
480  << " new position " << p << " r limits "
481  << rlimit.first << ":" << rlimit.second;
482 #endif
483  }
484  return idnew;
485 }
T perp() const
Definition: PV3DBase.h:72
int lastLayer(bool reco) const
const HGCalTopology & m_topology
GlobalPoint globalPosition() const
GlobalPoint getPosition(const DetId &id) const
std::pair< double, double > rangeR(double z, bool reco) const
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
T z() const
Definition: PV3DBase.h:64
const HGCalTopology & topology() const
double waferZ(int layer, bool reco) const
#define M_PI
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
const HGCalDDDConstants & dddConstants() const
DetId getClosestCell(const GlobalPoint &r) const override
int firstLayer() const
void HGCalGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
overridevirtual

Implements CaloSubdetectorGeometry.

Definition at line 64 of file HGCalGeometry.cc.

References HGCalDDDConstants::cellInLayer(), postprocess-scan-build::cells, CaloSubdetectorGeometry::cornersMgr(), HGCalTopology::dddConstants(), TauDecayModes::dec, HGCalTopology::decode(), HGCalTopology::detId2denseGeomId(), HGCalTopology::encode(), getGeometryDetId(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, DetId::HGCalHSc, HGCalTopology::isHFNose(), m_cellVec, m_cellVec2, m_det, m_topology, m_validGeomIds, CaloSubdetectorGeometry::m_validIds, mode_, HGCalDDDConstants::numberCellsHexagon(), DetId::rawId(), HGCalGeometryMode::Trapezoid, findQualityFiles::v, HGCalTopology::valid(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by HGCalGeometryLoader::buildGeom(), and dbString().

68  {
69 
70  DetId geomId = getGeometryDetId(detId);
71  int cells (0);
76 #ifdef EDM_ML_DEBUG
77  edm::LogVerbatim("HGCalGeom") << "NewCell " << HGCalDetId(detId)
78  << " GEOM " << HGCalDetId(geomId);
79 #endif
80  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
81  cells = 1;
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("HGCalGeom") << "NewCell " << HGCScintillatorDetId(detId)
84  << " GEOM " << HGCScintillatorDetId(geomId);
85 #endif
86  } else {
87  cells = m_topology.dddConstants().numberCellsHexagon(id.iLay,id.iSec1,
88  id.iSec2,false);
89 #ifdef EDM_ML_DEBUG
90  edm::LogVerbatim("HGCalGeom") << "NewCell " << HGCSiliconDetId(detId)
91  << " GEOM " << HGCSiliconDetId(geomId);
92 #endif
93  }
94  const uint32_t cellIndex (m_topology.detId2denseGeomId(geomId));
95 
96  if (m_det == DetId::HGCalHSc) {
97  m_cellVec2.at( cellIndex ) = FlatTrd( cornersMgr(), f1, f2, f3, parm ) ;
98  } else {
99  m_cellVec.at( cellIndex ) = FlatHexagon( cornersMgr(), f1, f2, f3, parm ) ;
100  }
101  m_validGeomIds.at( cellIndex ) = geomId ;
102 
103 #ifdef EDM_ML_DEBUG
104  edm::LogVerbatim("HGCalGeom") << "Store for DetId " << std::hex
105  << detId.rawId() << " GeomId "
106  << geomId.rawId() << std::dec << " Index "
107  << cellIndex << " cells " << cells;
108  unsigned int nOld = m_validIds.size();
109 #endif
110  if ((mode_ == HGCalGeometryMode::Hexagon) ||
112  for (int cell = 0; cell < cells; ++cell) {
113  id.iCell1 = cell;
114  DetId idc = m_topology.encode(id);
115  if (m_topology.valid(idc)) {
116  m_validIds.emplace_back(idc);
117 #ifdef EDM_ML_DEBUG
118  edm::LogVerbatim("HGCalGeom") << "Valid Id [" << cell << "] "
119  << HGCalDetId(idc);
120 #endif
121  }
122  }
123  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
124  DetId idc = m_topology.encode(id);
125  if (m_topology.valid(idc)) {
126  m_validIds.emplace_back(idc);
127 #ifdef EDM_ML_DEBUG
128  edm::LogVerbatim("HGCalGeom") << "Valid Id [0] "
129  << HGCScintillatorDetId(idc);
130 #endif
131  } else {
132  edm::LogWarning("HGCalGeom") << "Check " << HGCScintillatorDetId(idc)
133  << " from " << HGCScintillatorDetId(detId)
134  << " ERROR ???";
135  }
136  } else {
137 #ifdef EDM_ML_DEBUG
138  unsigned int cellAll(0), cellSelect(0);
139 #endif
140  for (int u=0; u<2*cells; ++u) {
141  for (int v=0; v<2*cells; ++v) {
142  if (((v-u) < cells) && (u-v) <= cells) {
143  id.iCell1 = u; id.iCell2 = v;
144  DetId idc = m_topology.encode(id);
145 #ifdef EDM_ML_DEBUG
146  ++cellAll;
147 #endif
148  if (m_topology.dddConstants().cellInLayer(id.iSec1,id.iSec2,u,v,
149  id.iLay,true)) {
150  m_validIds.emplace_back(idc);
151 #ifdef EDM_ML_DEBUG
152  ++cellSelect;
153  edm::LogVerbatim("HGCalGeom") << "Valid Id [" << u << ", " << v
154  << "] " << HGCSiliconDetId(idc);
155 #endif
156  }
157  }
158  }
159  }
160 #ifdef EDM_ML_DEBUG
161  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry keeps " << cellSelect
162  << " out of " << cellAll << " for wafer "
163  << id.iSec1 << ":" << id.iSec2 << " in "
164  << " layer " << id.iLay;
165 #endif
166  }
167 #ifdef EDM_ML_DEBUG
168  if (m_det == DetId::HGCalHSc) {
169  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry::newCell-> [" << cellIndex
170  << "]" << " front:" << f1.x() << '/'
171  << f1.y() << '/' << f1.z() << " back:"
172  << f2.x() << '/' << f2.y() << '/' << f2.z()
173  << " eta|phi "
174  << m_cellVec2[cellIndex].etaPos() << ":"
175  << m_cellVec2[cellIndex].phiPos();
176  } else {
177  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry::newCell-> [" << cellIndex
178  << "]" << " front:" << f1.x() << '/'
179  << f1.y() << '/' << f1.z() << " back:"
180  << f2.x() << '/' << f2.y() << '/' << f2.z()
181  << " eta|phi "
182  << m_cellVec[cellIndex].etaPos() << ":"
183  << m_cellVec[cellIndex].phiPos();
184  }
185  unsigned int nNew = m_validIds.size();
186  if ((mode_ == HGCalGeometryMode::Hexagon) ||
188  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCalDetId(detId)
189  << " with valid DetId from " << nOld
190  << " to " << nNew;
191  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
192  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCScintillatorDetId(detId)
193  << " with valid DetId from " << nOld
194  << " to " << nNew;
195  } else if (m_topology.isHFNose()) {
196  edm::LogVerbatim("HGCalGeom") << "ID: " << HFNoseDetId(detId)
197  << " with valid DetId from " << nOld
198  << " to " << nNew;
199  } else {
200  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCSiliconDetId(detId)
201  << " with valid DetId from " << nOld
202  << " to " << nNew;
203  }
204  edm::LogVerbatim("HGCalGeom") << "Cell[" << cellIndex << "] " << std::hex
205  << geomId.rawId() << ":"
206  << m_validGeomIds[cellIndex].rawId()
207  << std::dec;
208 #endif
209 }
std::vector< DetId > m_validGeomIds
HGCalGeometryMode::GeometryMode mode_
A base class to handle the particular shape of HGCal volumes.
Definition: FlatTrd.h:19
const HGCalTopology & m_topology
bool cellInLayer(int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
T y() const
Definition: PV3DBase.h:63
virtual uint32_t detId2denseGeomId(const DetId &id) const
int numberCellsHexagon(int wafer) const
DetId encode(const DecodedDetId &id_) const
std::vector< DetId > m_validIds
T z() const
Definition: PV3DBase.h:64
A base class to handle the hexagonal shape of HGCal silicon volumes.
Definition: FlatHexagon.h:20
CellVec2 m_cellVec2
bool isHFNose() const
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
const HGCalDDDConstants & dddConstants() const
CaloCellGeometry::CornersMgr * cornersMgr()
DetId::Detector m_det
bool valid(const DetId &id) const override
Is this a valid cell id.
T x() const
Definition: PV3DBase.h:62
CellVec m_cellVec
DetId getGeometryDetId(DetId detId) const
bool HGCalGeometry::present ( const DetId id) const
overridevirtual

is this detid present in the geometry?

Reimplemented from CaloSubdetectorGeometry.

Definition at line 220 of file HGCalGeometry.cc.

References HGCalTopology::detId2denseGeomId(), getGeometryDetId(), getGeometryRawPtr(), and m_topology.

Referenced by dbString().

220  {
221  if (detId == DetId()) return false;
222  DetId geomId = getGeometryDetId(detId);
223  const uint32_t index (m_topology.detId2denseGeomId(geomId));
224  return (nullptr != getGeometryRawPtr(index)) ;
225 }
const HGCalTopology & m_topology
virtual uint32_t detId2denseGeomId(const DetId &id) const
Definition: DetId.h:18
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
DetId getGeometryDetId(DetId detId) const
static std::string HGCalGeometry::producerTag ( )
inlinestatic

Definition at line 109 of file HGCalGeometry.h.

References cellElement(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by PCaloGeometryBuilder::beginRun(), and CaloGeometryBuilder::produceAligned().

109 { return "HGCal" ; }
unsigned int HGCalGeometry::sizeForDenseIndex ( ) const
protected

Definition at line 568 of file HGCalGeometry.cc.

References m_topology, and HGCalTopology::totalGeomModules().

Referenced by topology().

568  {
569  return m_topology.totalGeomModules();
570 }
const HGCalTopology & m_topology
unsigned int totalGeomModules() const
void HGCalGeometry::sortDetIds ( void  )

Definition at line 681 of file HGCalGeometry.cc.

References CaloSubdetectorGeometry::m_validIds.

Referenced by HGCalGeometryLoader::build(), and topology().

681  {
682  m_validIds.shrink_to_fit();
683  std::sort( m_validIds.begin(), m_validIds.end(), rawIdSort());
684 }
std::vector< DetId > m_validIds
const HGCalTopology& HGCalGeometry::topology ( ) const
inline

Member Data Documentation

double HGCalGeometry::k_half = 0.5
staticprivate

Definition at line 136 of file HGCalGeometry.h.

Referenced by get8Corners(), getCorners(), and getNewCorners().

unsigned int HGCalGeometry::k_NumberOfParametersPerHex = 3
static

Definition at line 47 of file HGCalGeometry.h.

Referenced by HGCalGeometryLoader::build(), and getSummary().

unsigned int HGCalGeometry::k_NumberOfParametersPerShape = 3
static

Definition at line 48 of file HGCalGeometry.h.

Referenced by CaloGeometryDBEP< T, U >::produceAligned().

unsigned int HGCalGeometry::k_NumberOfParametersPerTrd = 12
static

Definition at line 46 of file HGCalGeometry.h.

Referenced by HGCalGeometryLoader::build(), and getSummary().

unsigned int HGCalGeometry::k_NumberOfShapes = 100
static
unsigned int HGCalGeometry::k_NumberOfShapesTrd = 1000
static

Definition at line 50 of file HGCalGeometry.h.

Referenced by HGCalGeometryLoader::build().

CellVec HGCalGeometry::m_cellVec
private
CellVec2 HGCalGeometry::m_cellVec2
private
DetId::Detector HGCalGeometry::m_det
private
ForwardSubdetector HGCalGeometry::m_subdet
private

Definition at line 144 of file HGCalGeometry.h.

Referenced by cellElement().

const HGCalTopology& HGCalGeometry::m_topology
private
std::vector<DetId> HGCalGeometry::m_validGeomIds
private

Definition at line 141 of file HGCalGeometry.h.

Referenced by cellGeomPtr(), getClosestCell(), getSummary(), getValidGeomDetIds(), and newCell().

HGCalGeometryMode::GeometryMode HGCalGeometry::mode_
private
const double HGCalGeometry::twoBysqrt3_
private

Definition at line 145 of file HGCalGeometry.h.

Referenced by getSummary().