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
 
double getArea (const DetId &detid) const
 Returns area of a cell. More...
 
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_fac1 = 0.5
 
static double k_fac2 = 1.0/3.0
 
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 653 of file HGCalGeometry.cc.

Referenced by topology().

653  {
654  edm::LogError("HGCalGeom") << "HGCalGeometry::addValidID is not implemented";
655 }
std::string HGCalGeometry::cellElement ( ) const

Definition at line 574 of file HGCalGeometry.cc.

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

Referenced by producerTag().

574  {
575  if (m_subdet == HGCEE || m_det == DetId::HGCalEE) return "HGCalEE";
576  else if (m_subdet == HGCHEF || m_det == DetId::HGCalHSi) return "HGCalHEFront";
577  else if (m_subdet == HGCHEB || m_det == DetId::HGCalHSc) return "HGCalHEBack";
578  else return "Unknown";
579 }
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 613 of file HGCalGeometry.cc.

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

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

613  {
614  if ((index >= m_cellVec.size() && m_det != DetId::HGCalHSc) ||
615  (index >= m_cellVec2.size() && m_det == DetId::HGCalHSc) ||
616  (m_validGeomIds[index].rawId() == 0)) return nullptr;
617  static const auto do_not_delete = [](const void*){};
618  if (m_det == DetId::HGCalHSc) {
619  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec2[index],do_not_delete);
620  if (nullptr == cell->param()) return nullptr;
621  return cell;
622  } else {
623  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec[index],do_not_delete);
624  if (nullptr == cell->param()) return nullptr;
625  return cell;
626  }
627 }
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 629 of file HGCalGeometry.cc.

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

629  {
630  if ((index >= m_cellVec.size() && m_det != DetId::HGCalHSc) ||
631  (index >= m_cellVec2.size() && m_det == DetId::HGCalHSc) ||
632  (m_validGeomIds[index].rawId() == 0)) return nullptr;
633  if (pos == GlobalPoint()) return cellGeomPtr(index);
634  if (m_det == DetId::HGCalHSc) {
635  auto cell = std::make_shared<FlatTrd>(m_cellVec2[index]);
636  cell->setPosition(pos);
637 #ifdef EDM_ML_DEBUG
638  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
639 #endif
640  if (nullptr == cell->param()) return nullptr;
641  return cell;
642  } else {
643  auto cell = std::make_shared<FlatHexagon>(m_cellVec[index]);
644  cell->setPosition(pos);
645 #ifdef EDM_ML_DEBUG
646  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
647 #endif
648  if (nullptr == cell->param()) return nullptr;
649  return cell;
650  }
651 }
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 347 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_fac2, 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().

347  {
348 
349  unsigned int ncorner = FlatTrd::ncorner_;
350  HGCalGeometry::CornersVec co (ncorner, GlobalPoint(0,0,0));
351  unsigned int cellIndex = indexFor(detid);
353  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
354  GlobalPoint v = getPosition(detid);
355  std::pair<double,double> rr = m_topology.dddConstants().cellSizeTrap(id.iType,id.iSec1);
356  float dr = k_half*(rr.second-rr.first);
357  float dfi= m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
358  float dz = id.zSide*m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
359  float r = v.perp();
360  float fi = v.phi();
361  static const int signr[] = {1,1,-1,-1,1,1,-1,-1};
362  static const int signf[] = {-1,1,1,-1,-1,1,1,-1};
363  static const int signz[] = {-1,-1,-1,-1,1,1,1,1};
364  for (unsigned int i = 0; i < ncorner; ++i) {
365  co[i] = GlobalPoint((r+signr[i]*dr)*cos(fi+signf[i]*dfi),
366  (r+signr[i]*dr)*sin(fi+signf[i]*dfi),
367  (v.z()+signz[i]*dz));
368  }
369  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
370  std::pair<float,float> xy;
371  float dx(0);
374  xy = m_topology.dddConstants().locateCellHex(id.iCell1,id.iSec1,true);
375  dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
376  } else {
377  xy = m_topology.dddConstants().locateCell(id.iLay,id.iSec1,id.iSec2,
378  id.iCell1,id.iCell2,true,false);
379  dx = k_fac2*m_cellVec[cellIndex].param()[FlatHexagon::k_r];
380  }
381  static const int signx[] = {-1,-1,1,1,-1,-1,1,1};
382  static const int signy[] = {-1,1,1,-1,-1,1,1,-1};
383  static const int signz[] = {-1,-1,-1,-1,1,1,1,1};
384  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
385  for (unsigned int i = 0; i < ncorner; ++i) {
386  const HepGeom::Point3D<float> lcoord(xy.first+signx[i]*dx,
387  xy.second+signy[i]*dx,signz[i]*dz);
388  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
389  }
390  }
391  return co;
392 }
std::pair< double, double > cellSizeTrap(int type, int irad) const
HGCalGeometryMode::GeometryMode mode_
T perp() const
Definition: PV3DBase.h:72
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
static double k_fac2
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
double HGCalGeometry::getArea ( const DetId detid) const

Returns area of a cell.

Definition at line 275 of file HGCalGeometry.cc.

References custom_jme_cff::area, getNewCorners(), mps_fire::i, gen::n, and y.

Referenced by dbString().

275  {
276 
277  HGCalGeometry::CornersVec corners = getNewCorners(detid);
278  double area(0);
279  if (corners.size() > 1) {
280  int n = corners.size()-1;
281  int j = n-1;
282  for (int i=0; i<n; ++i) {
283  area += ((corners[j].x()+corners[i].x())*
284  (corners[i].y()-corners[j].y()));
285  j = i;
286  }
287  }
288  return (0.5*area);
289 }
std::vector< GlobalPoint > CornersVec
Definition: HGCalGeometry.h:41
CornersVec getNewCorners(const DetId &id) const
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 569 of file HGCalGeometry.cc.

Referenced by getValidGeomDetIds().

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 515 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().

515  {
516  unsigned int cellIndex = getClosestCellIndex(r);
517  if ((cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) ||
518  (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc)) {
520  HepGeom::Point3D<float> local;
521  if (r.z() > 0) {
522  local = HepGeom::Point3D<float>(r.x(),r.y(),0);
523  id.zSide = 1;
524  } else {
525  local = HepGeom::Point3D<float>(-r.x(),r.y(),0);
526  id.zSide =-1;
527  }
530  const auto & kxy =
531  m_topology.dddConstants().assignCell(local.x(),local.y(),id.iLay,
532  id.iType,true);
533  id.iCell1 = kxy.second;
534  id.iSec1 = kxy.first;
535  id.iType = m_topology.dddConstants().waferTypeT(kxy.first);
536  if (id.iType != 1) id.iType = -1;
537  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
538  id.iLay = m_topology.dddConstants().getLayer(r.z(),true);
539  const auto & kxy =
540  m_topology.dddConstants().assignCellTrap(r.x(),r.y(),r.z(),
541  id.iLay,true);
542  id.iSec1 = kxy[0];
543  id.iCell1 = kxy[1];
544  id.iType = kxy[2];
545  } else {
546  id.iLay = m_topology.dddConstants().getLayer(r.z(),true);
547  const auto & kxy =
548  m_topology.dddConstants().assignCellHex(local.x(),local.y(),id.iLay,
549  true);
550  id.iSec1 = kxy[0]; id.iSec2 = kxy[1]; id.iType = kxy[2];
551  id.iCell1 = kxy[3]; id.iCell2 = kxy[4];
552  }
553 #ifdef EDM_ML_DEBUG
554  edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local
555  << " Id " << id.zSide << ":" << id.iLay
556  << ":" << id.iSec1 << ":" << id.iSec2
557  << ":" << id.iType << ":" << id.iCell1
558  << ":" << id.iCell2;
559 #endif
560 
561  //check if returned cell is valid
562  if (id.iCell1>=0) return m_topology.encode(id);
563  }
564 
565  //if not valid or out of bounds return a null DetId
566  return DetId();
567 }
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 657 of file HGCalGeometry.cc.

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

Referenced by getClosestCell(), and topology().

657  {
658 
660 }
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 663 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().

664  {
665 
666  float phip = r.phi();
667  float zp = r.z();
668  float dzmin(9999), dphimin(9999), dphi10(0.175);
669  unsigned int cellIndex = vec.size();
670  for (unsigned int k=0; k<vec.size(); ++k) {
671  float dphi = phip-vec[k].phiPos();
672  while (dphi > M_PI) dphi -= 2*M_PI;
673  while (dphi <= -M_PI) dphi += 2*M_PI;
674  if (std::abs(dphi) < dphi10) {
675  float dz = std::abs(zp - vec[k].getPosition().z());
676  if (dz < (dzmin+0.001)) {
677  dzmin = dz;
678  if (std::abs(dphi) < (dphimin+0.01)) {
679  cellIndex = k;
680  dphimin = std::abs(dphi);
681  } else {
682  if (cellIndex >= vec.size()) cellIndex = k;
683  }
684  }
685  }
686  }
687 #ifdef EDM_ML_DEBUG
688  edm::LogVerbatim("HGCalGeom") << "getClosestCellIndex::Input " << zp << ":"
689  << phip << " Index " << cellIndex;
690  if (cellIndex < vec.size())
691  edm::LogVerbatim("HGCalGeom") << " Cell z "
692  << vec[cellIndex].getPosition().z()
693  << ":" << dzmin << " phi "
694  << vec[cellIndex].phiPos() << ":" << dphimin;
695 #endif
696  return cellIndex;
697 }
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 291 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_fac1, k_fac2, 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().

291  {
292 
293  unsigned int ncorner = ((m_det == DetId::HGCalHSc) ? FlatTrd::ncorner_ :
295  HGCalGeometry::CornersVec co (ncorner, GlobalPoint(0,0,0));
296  unsigned int cellIndex = indexFor(detid);
298  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
299  GlobalPoint v = getPosition(detid);
300  std::pair<double,double> rr = m_topology.dddConstants().cellSizeTrap(id.iType,id.iSec1);
301  float dr = k_half*(rr.second-rr.first);
302  float dfi= m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
303  float dz = id.zSide*m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
304  float r = v.perp();
305  float fi = v.phi();
306  static const int signr[] = {1,1,-1,-1,1,1,-1,-1};
307  static const int signf[] = {-1,1,1,-1,-1,1,1,-1};
308  static const int signz[] = {-1,-1,-1,-1,1,1,1,1};
309  for (unsigned int i = 0; i < ncorner; ++i) {
310  co[i] = GlobalPoint((r+signr[i]*dr)*cos(fi+signf[i]*dfi),
311  (r+signr[i]*dr)*sin(fi+signf[i]*dfi),
312  (v.z()+signz[i]*dz));
313  }
314  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
315  std::pair<float,float> xy;
318  xy = m_topology.dddConstants().locateCellHex(id.iCell1,id.iSec1,true);
319  float dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
320  float dy = k_half*m_cellVec[cellIndex].param()[FlatHexagon::k_R];
321  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
322  static const int signx[] = {0,-1,-1,0,1,1,0,-1,-1,0,1,1};
323  static const int signy[] = {-2,-1,1,2,1,-1,-2,-1,1,2,1,-1};
324  static const int signz[] = {-1,-1,-1,-1,-1,-1,1,1,1,1,1,1};
325  for (unsigned int i = 0; i < ncorner; ++i) {
326  const HepGeom::Point3D<float> lcoord(xy.first+signx[i]*dx,xy.second+signy[i]*dy,signz[i]*dz);
327  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
328  }
329  } else {
330  xy = m_topology.dddConstants().locateCell(id.iLay,id.iSec1,id.iSec2,
331  id.iCell1,id.iCell2,true,false);
332  float dx = k_fac2*m_cellVec[cellIndex].param()[FlatHexagon::k_r];
333  float dy = k_fac1*m_cellVec[cellIndex].param()[FlatHexagon::k_R];
334  float dz =-id.zSide*m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
335  static const int signx[] = {1,-1,-2,-1, 1,2,1,-1,-2,-1, 1,2};
336  static const int signy[] = {1, 1, 0,-1,-1,0,1, 1, 0,-1,-1,0};
337  static const int signz[] = {-1,-1,-1,-1,-1,-1,1,1,1,1,1,1};
338  for (unsigned int i = 0; i < ncorner; ++i) {
339  const HepGeom::Point3D<float> lcoord(xy.first+signx[i]*dx,xy.second+signy[i]*dy,signz[i]*dz);
340  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
341  }
342  }
343  }
344  return co;
345 }
std::pair< double, double > cellSizeTrap(int type, int irad) const
HGCalGeometryMode::GeometryMode mode_
T perp() const
Definition: PV3DBase.h:72
static double k_fac1
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
static double k_fac2
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 821 of file HGCalGeometry.cc.

References HGCalDetId::geometryCell(), HGCScintillatorDetId::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().

821  {
822  DetId geomId;
823  if ((mode_ == HGCalGeometryMode::Hexagon) ||
825  geomId = static_cast<DetId>(HGCalDetId(detId).geometryCell());
826  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
827  geomId = static_cast<DetId>(HGCScintillatorDetId(detId).geometryCell());
828  } else if (m_topology.isHFNose()) {
829  geomId = static_cast<DetId>(HFNoseDetId(detId).geometryCell());
830  } else {
831  geomId = static_cast<DetId>(HGCSiliconDetId(detId).geometryCell());
832  }
833  return geomId;
834 }
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 600 of file HGCalGeometry.cc.

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

Referenced by present(), and topology().

600  {
601  // Modify the RawPtr class
602  if (m_det == DetId::HGCalHSc) {
603  if (m_cellVec2.size() < index) return nullptr;
604  const CaloCellGeometry* cell(&m_cellVec2[index]);
605  return (nullptr == cell->param() ? nullptr : cell);
606  } else {
607  if (m_cellVec2.size() < index) return nullptr;
608  const CaloCellGeometry* cell(&m_cellVec[index]);
609  return (nullptr == cell->param() ? nullptr : cell);
610  }
611 }
CellVec2 m_cellVec2
DetId::Detector m_det
CellVec m_cellVec
HGCalGeometry::CornersVec HGCalGeometry::getNewCorners ( const DetId id) const

Definition at line 394 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_fac1, k_fac2, 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(), dbString(), and getArea().

394  {
395 
396  unsigned int ncorner = (m_det == DetId::HGCalHSc) ? 5 : 7;
397  HGCalGeometry::CornersVec co (ncorner, GlobalPoint(0,0,0));
398  unsigned int cellIndex = indexFor(detid);
400  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
401  GlobalPoint v = getPosition(detid);
402  std::pair<double,double> rr = m_topology.dddConstants().cellSizeTrap(id.iType,id.iSec1);
403  float dr = k_half*(rr.second-rr.first);
404  float dfi= m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
405  float dz =-id.zSide*m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
406  float r = v.perp();
407  float fi = v.phi();
408  static const int signr[] = {1,1,-1,-1};
409  static const int signf[] = {-1,1,1,-1};
410  for (unsigned int i = 0; i < ncorner-1; ++i) {
411  co[i] = GlobalPoint((r+signr[i]*dr)*cos(fi+signf[i]*dfi),
412  (r+signr[i]*dr)*sin(fi+signf[i]*dfi),
413  (v.z()+dz));
414  }
415  co[ncorner-1] = GlobalPoint(0,0,-2*dz);
416  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
417  std::pair<float,float> xy;
420  xy = m_topology.dddConstants().locateCellHex(id.iCell1,id.iSec1,true);
421  } else {
422  xy = m_topology.dddConstants().locateCell(id.iLay,id.iSec1,id.iSec2,
423  id.iCell1,id.iCell2,true,false);
424  }
425  float dx = k_fac2*m_cellVec[cellIndex].param()[FlatHexagon::k_r];
426  float dy = k_fac1*m_cellVec[cellIndex].param()[FlatHexagon::k_R];
427  float dz =-id.zSide*m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
428  static const int signx[] = {1,-1,-2,-1, 1,2};
429  static const int signy[] = {1, 1, 0,-1,-1,0};
430  for (unsigned int i = 0; i < ncorner-1; ++i) {
431  const HepGeom::Point3D<float> lcoord(xy.first+signx[i]*dx,xy.second+signy[i]*dy,dz);
432  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
433  }
434  co[ncorner-1] = GlobalPoint(0,0,-2*dz);
435  }
436  return co;
437 }
std::pair< double, double > cellSizeTrap(int type, int irad) const
HGCalGeometryMode::GeometryMode mode_
T perp() const
Definition: PV3DBase.h:72
static double k_fac1
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
static double k_fac2
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 FWRecoGeometryESProducer::addCaloGeometry(), HGCalTBAnalyzer::analyzeDigi(), HGCalTBAnalyzer::analyzeRecHits(), HGCalTriggerGeometryImp1::buildMaps(), HGCalTriggerGeometryHexImp1::buildTriggerCellsAndModules(), HGCDigitizer::checkPosition(), dbString(), HGCalTriggerNtupleHGCDigis::fill(), get8Corners(), getClosestCellIndex(), getCorners(), getGeometry(), HGCalTriggerGeometryHexImp2::getModulePosition(), HGCalTriggerGeometryV9Imp1::getModulePosition(), HGCalTriggerGeometryHexLayerBasedImp1::getModulePosition(), HGCalTriggerGeometryV9Imp2::getModulePosition(), getNewCorners(), hgcal::RecHitTools::getPosition(), HGCalTriggerGeometryHexImp2::getTriggerCellPosition(), HGCalTriggerGeometryHexLayerBasedImp1::getTriggerCellPosition(), HGCalTriggerGeometryV9Imp1::getTriggerCellPosition(), HGCalTriggerGeometryV9Imp2::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 714 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, HGCalDetId::layer(), HGCScintillatorDetId::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().

717  {
718 
719  unsigned int numberOfCells = m_topology.totalGeomModules(); // total Geom Modules both sides
720  unsigned int numberOfShapes = k_NumberOfShapes;
721  unsigned int numberOfParametersPerShape =
722  ((m_det == DetId::HGCalHSc) ? (unsigned int)(k_NumberOfParametersPerTrd) :
723  (unsigned int)(k_NumberOfParametersPerHex));
724 
725  trVector.reserve( numberOfCells * numberOfTransformParms());
726  iVector.reserve( numberOfCells );
727  dimVector.reserve( numberOfShapes * numberOfParametersPerShape );
728  dinsVector.reserve( numberOfCells );
729 
730  for (unsigned itr=0; itr<m_topology.dddConstants().getTrFormN(); ++itr) {
732  int layer = mytr.lay;
733 
736  for (int wafer=0; wafer<m_topology.dddConstants().sectors(); ++wafer) {
737  if (m_topology.dddConstants().waferInLayer(wafer,layer,true)) {
738  HGCalParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
739  ParmVec params( numberOfParametersPerShape, 0 );
740  params[FlatHexagon::k_dZ] = vol.dz;
741  params[FlatHexagon::k_r] = vol.cellSize;
743  dimVector.insert( dimVector.end(), params.begin(), params.end());
744  }
745  }
746  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
747  int indx = m_topology.dddConstants().layerIndex(layer,true);
748  for (int md=m_topology.dddConstants().getParameter()->firstModule_[indx];
750  ++md) {
752  ParmVec params( numberOfParametersPerShape, 0 );
753  params[FlatTrd::k_dZ] = vol.dz;
754  params[FlatTrd::k_Theta] = params[FlatTrd::k_Phi] = 0;
755  params[FlatTrd::k_dY1] = params[FlatTrd::k_dY2] = vol.h;
756  params[FlatTrd::k_dX1] = params[FlatTrd::k_dX3] = vol.bl;
757  params[FlatTrd::k_dX2] = params[FlatTrd::k_dX4] = vol.tl;
758  params[FlatTrd::k_Alp1] = params[FlatTrd::k_Alp2]= vol.alpha;
759  params[FlatTrd::k_Cell] = vol.cellSize;
760  dimVector.insert( dimVector.end(), params.begin(), params.end());
761  }
762  } else {
763  for (int wafer=0; wafer<m_topology.dddConstants().sectors(); ++wafer) {
764  if (m_topology.dddConstants().waferInLayer(wafer,layer,true)) {
765  HGCalParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
766  ParmVec params( numberOfParametersPerShape, 0 );
767  params[FlatHexagon::k_dZ] = vol.dz;
768  params[FlatHexagon::k_r] = vol.cellSize;
770  dimVector.insert( dimVector.end(), params.begin(), params.end());
771  }
772  }
773  }
774  }
775 
776  for (unsigned int i( 0 ); i < numberOfCells; ++i) {
777  DetId detId = m_validGeomIds[i];
778  int layer(0);
781  layer = HGCalDetId(detId).layer();
782  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
783  layer = HGCScintillatorDetId(detId).layer();
784  } else if (m_topology.isHFNose()) {
785  layer = HFNoseDetId(detId).layer();
786  } else {
787  layer = HGCSiliconDetId(detId).layer();
788  }
789  dinsVector.emplace_back(m_topology.detId2denseGeomId( detId ));
790  iVector.emplace_back( layer );
791 
792  Tr3D tr;
793  auto ptr = cellGeomPtr( i );
794  if ( nullptr != ptr ) {
795  ptr->getTransform( tr, ( Pt3DVec* ) nullptr );
796 
797  if( Tr3D() == tr ) { // there is no rotation
798  const GlobalPoint& gp( ptr->getPosition());
799  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z());
800  }
801 
802  const CLHEP::Hep3Vector tt( tr.getTranslation());
803  trVector.emplace_back( tt.x());
804  trVector.emplace_back( tt.y());
805  trVector.emplace_back( tt.z());
806  if (6 == numberOfTransformParms()) {
807  const CLHEP::HepRotation rr( tr.getRotation());
808  const ROOT::Math::Transform3D rtr( rr.xx(), rr.xy(), rr.xz(), tt.x(),
809  rr.yx(), rr.yy(), rr.yz(), tt.y(),
810  rr.zx(), rr.zy(), rr.zz(), tt.z());
812  rtr.GetRotation( ea );
813  trVector.emplace_back( ea.Phi());
814  trVector.emplace_back( ea.Theta());
815  trVector.emplace_back( ea.Psi());
816  }
817  }
818  }
819 }
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 95 of file HGCalGeometry.h.

References CaloSubdetectorGeometry::m_validIds.

95 { 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 581 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().

581  {
582  unsigned int cellIndex = ((m_det == DetId::HGCalHSc) ? m_cellVec2.size() :
583  m_cellVec.size());
584  if (detId != DetId()) {
585  DetId geomId = getGeometryDetId(detId);
586  cellIndex = m_topology.detId2denseGeomId(geomId);
587 #ifdef EDM_ML_DEBUG
588  edm::LogVerbatim("HGCalGeom") << "indexFor " << std::hex << detId.rawId()
589  << ":" << geomId.rawId() << std::dec
590  << " index " << cellIndex;
591 #endif
592  }
593  return cellIndex;
594 }
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 439 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().

440  {
441  DetId idnew;
443  int lay = ((momentum.z()*id.zSide > 0) ? (id.iLay+1) : (id.iLay-1));
444 #ifdef EDM_ML_DEBUG
445  edm::LogVerbatim("HGCalGeom") << "neighborz1:: ID " << id.iLay << ":"
446  << id.iSec1 << ":" << id.iSec2 << ":"
447  << id.iCell1 << ":" << id.iCell2
448  << " New Layer " << lay << " Range "
449  << m_topology.dddConstants().firstLayer() <<":"
451  << " pz " << momentum.z();
452 #endif
453  if ((lay >= m_topology.dddConstants().firstLayer()) &&
454  (lay <= m_topology.dddConstants().lastLayer(true)) &&
455  (momentum.z() != 0.0)) {
456  GlobalPoint v = getPosition(idin);
457  double z = id.zSide*m_topology.dddConstants().waferZ(lay,true);
458  double grad = (z - v.z())/momentum.z();
459  GlobalPoint p(v.x()+grad*momentum.x(),v.y()+grad*momentum.y(),z);
460  double r = p.perp();
461  auto rlimit = topology().dddConstants().rangeR(z,true);
462  if (r >= rlimit.first && r <= rlimit.second) idnew = getClosestCell(p);
463 #ifdef EDM_ML_DEBUG
464  edm::LogVerbatim("HGCalGeom") << "neighborz1:: Position " << v << " New Z "
465  << z << ":" << grad << " new position " << p
466  << " r-limit " << rlimit.first << ":"
467  << rlimit.second;
468 #endif
469  }
470  return idnew;
471 }
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 473 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().

475  {
476  DetId idnew;
478  int lay = ((momentum.z()*id.zSide > 0) ? (id.iLay+1) : (id.iLay-1));
479 #ifdef EDM_ML_DEBUG
480  edm::LogVerbatim("HGCalGeom") << "neighborz2:: ID " << id.iLay << ":"
481  << id.iSec1 << ":" << id.iSec2 << ":"
482  << id.iCell1 << ":" << id.iCell2
483  << " New Layer " << lay << " Range "
484  << m_topology.dddConstants().firstLayer() <<":"
486  << " pz " << momentum.z();
487 #endif
488  if ((lay >= m_topology.dddConstants().firstLayer()) &&
489  (lay <= m_topology.dddConstants().lastLayer(true)) &&
490  (momentum.z() != 0.0)) {
491  GlobalPoint v = getPosition(idin);
492  double z = id.zSide*m_topology.dddConstants().waferZ(lay,true);
493  FreeTrajectoryState fts (v, momentum, charge, bField);
496  AnalyticalPropagator myAP (bField, alongMomentum, 2*M_PI);
497  TrajectoryStateOnSurface tsos = myAP.propagate(fts, *nPlane);
498  GlobalPoint p;
499  auto rlimit = topology().dddConstants().rangeR(z,true);
500  if (tsos.isValid()) {
501  p = tsos.globalPosition();
502  double r = p.perp();
503  if (r >= rlimit.first && r <= rlimit.second) idnew = getClosestCell(p);
504  }
505 #ifdef EDM_ML_DEBUG
506  edm::LogVerbatim("HGCalGeom") << "neighborz2:: Position " << v << " New Z "
507  << z << ":" << charge << ":" << tsos.isValid()
508  << " new position " << p << " r limits "
509  << rlimit.first << ":" << rlimit.second;
510 #endif
511  }
512  return idnew;
513 }
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 112 of file HGCalGeometry.h.

References cellElement(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

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

Definition at line 596 of file HGCalGeometry.cc.

References m_topology, and HGCalTopology::totalGeomModules().

Referenced by topology().

596  {
597  return m_topology.totalGeomModules();
598 }
const HGCalTopology & m_topology
unsigned int totalGeomModules() const
void HGCalGeometry::sortDetIds ( void  )

Definition at line 709 of file HGCalGeometry.cc.

References CaloSubdetectorGeometry::m_validIds.

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

709  {
710  m_validIds.shrink_to_fit();
711  std::sort( m_validIds.begin(), m_validIds.end(), rawIdSort());
712 }
std::vector< DetId > m_validIds
const HGCalTopology& HGCalGeometry::topology ( ) const
inline

Member Data Documentation

double HGCalGeometry::k_fac1 = 0.5
staticprivate

Definition at line 140 of file HGCalGeometry.h.

Referenced by getCorners(), and getNewCorners().

double HGCalGeometry::k_fac2 = 1.0/3.0
staticprivate

Definition at line 141 of file HGCalGeometry.h.

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

double HGCalGeometry::k_half = 0.5
staticprivate

Definition at line 139 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 149 of file HGCalGeometry.h.

Referenced by cellElement().

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

Definition at line 146 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 150 of file HGCalGeometry.h.

Referenced by getSummary().