CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Attributes
CaloSubdetectorGeometry Class Referenceabstract

#include <CaloSubdetectorGeometry.h>

Inheritance diagram for CaloSubdetectorGeometry:
CaloTowerGeometry CastorGeometry EcalBarrelGeometry EcalEndcapGeometry EcalPreshowerGeometry EcalTBHodoscopeGeometry FastTimeGeometry HcalDDDGeometry HcalGeometry HGCalGeometry ZdcGeometry

Public Types

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

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 DetIdSet getCells (const GlobalPoint &r, double dR) const
 Get a list of all cells within a dR of the given cell. More...
 
virtual CellSet getCellSet (const GlobalPoint &r, double dR) const
 
virtual DetId getClosestCell (const GlobalPoint &r) const
 
virtual std::shared_ptr< const
CaloCellGeometry
getGeometry (const DetId &id) const
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
virtual void getSummary (TrVec &trVector, IVec &iVector, DimVec &dimVector, IVec &dinsVector) const
 
virtual const std::vector
< DetId > & 
getValidDetIds (DetId::Detector det=DetId::Detector(0), int subdet=0) const
 Get a list of valid detector ids (for the given subdetector) More...
 
virtual void initializeParms ()
 
virtual void newCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)=0
 
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 bool present (const DetId &id) const
 is this detid present in the geometry? More...
 
virtual ~CaloSubdetectorGeometry ()
 The base class DOES assume that it owns the CaloCellGeometry objects. More...
 

Protected Member Functions

void addValidID (const DetId &id)
 
virtual std::shared_ptr< const
CaloCellGeometry
cellGeomPtr (uint32_t index) const
 
virtual const CaloCellGeometrygetGeometryRawPtr (uint32_t index) const =0
 
virtual unsigned int indexFor (const DetId &id) const
 
virtual unsigned int sizeForDenseIndex (const DetId &id) const
 

Static Protected Member Functions

static CCGFloat deltaR (const GlobalPoint &p1, const GlobalPoint &p2)
 

Protected Attributes

ParVecVec m_parVecVec
 
std::vector< DetIdm_validIds
 

Private Attributes

CaloCellGeometry::CornersMgrm_cmgr
 
std::atomic< std::vector
< CCGFloat > * > 
m_deltaEta
 
std::atomic< std::vector
< CCGFloat > * > 
m_deltaPhi
 
ParMgrm_parMgr
 
bool m_sortedIds
 

Detailed Description

Base class for a geometry container for a specific calorimetry subdetector.

Author
J. Mans - Minnesota

Definition at line 22 of file CaloSubdetectorGeometry.h.

Member Typedef Documentation

Definition at line 25 of file CaloSubdetectorGeometry.h.

typedef std::vector<std::shared_ptr<const CaloCellGeometry> > CaloSubdetectorGeometry::CellSet

Definition at line 24 of file CaloSubdetectorGeometry.h.

Definition at line 27 of file CaloSubdetectorGeometry.h.

Definition at line 35 of file CaloSubdetectorGeometry.h.

typedef std::vector<unsigned int> CaloSubdetectorGeometry::IVec

Definition at line 34 of file CaloSubdetectorGeometry.h.

Definition at line 29 of file CaloSubdetectorGeometry.h.

Definition at line 30 of file CaloSubdetectorGeometry.h.

Definition at line 31 of file CaloSubdetectorGeometry.h.

Definition at line 33 of file CaloSubdetectorGeometry.h.

Constructor & Destructor Documentation

CaloSubdetectorGeometry::CaloSubdetectorGeometry ( )

Definition at line 15 of file CaloSubdetectorGeometry.cc.

16  : m_parMgr(nullptr), m_cmgr(nullptr), m_deltaPhi(nullptr), m_deltaEta(nullptr) {}
CaloCellGeometry::CornersMgr * m_cmgr
std::atomic< std::vector< CCGFloat > * > m_deltaPhi
std::atomic< std::vector< CCGFloat > * > m_deltaEta
CaloSubdetectorGeometry::~CaloSubdetectorGeometry ( )
virtual

The base class DOES assume that it owns the CaloCellGeometry objects.

Definition at line 18 of file CaloSubdetectorGeometry.cc.

References m_cmgr, m_deltaEta, m_deltaPhi, and m_parMgr.

18  {
19  delete m_cmgr;
20  delete m_parMgr;
21  if (m_deltaPhi)
22  delete m_deltaPhi.load();
23  if (m_deltaEta)
24  delete m_deltaEta.load();
25 }
CaloCellGeometry::CornersMgr * m_cmgr
std::atomic< std::vector< CCGFloat > * > m_deltaPhi
std::atomic< std::vector< CCGFloat > * > m_deltaEta
CaloSubdetectorGeometry::CaloSubdetectorGeometry ( const CaloSubdetectorGeometry )
delete

avoid copies

Member Function Documentation

void CaloSubdetectorGeometry::addValidID ( const DetId id)
protected

Definition at line 27 of file CaloSubdetectorGeometry.cc.

References gpuClustering::id, cuda_std::lower_bound(), and m_validIds.

Referenced by EcalTBHodoscopeGeometry::newCell(), HcalDDDGeometry::newCell(), CaloTowerGeometry::newCell(), ZdcGeometry::newCell(), CastorGeometry::newCell(), EcalPreshowerGeometry::newCell(), EcalEndcapGeometry::newCell(), EcalBarrelGeometry::newCell(), and HcalGeometry::newCell().

27  {
28  auto pos = std::lower_bound(m_validIds.begin(), m_validIds.end(), id);
29  m_validIds.insert(pos, id);
30 }
uint16_t *__restrict__ id
std::vector< DetId > m_validIds
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
void CaloSubdetectorGeometry::allocateCorners ( CaloCellGeometry::CornersVec::size_type  n)
void CaloSubdetectorGeometry::allocatePar ( ParVec::size_type  n,
unsigned int  m 
)
std::shared_ptr< const CaloCellGeometry > CaloSubdetectorGeometry::cellGeomPtr ( uint32_t  index) const
protectedvirtual

Reimplemented in HGCalGeometry, and FastTimeGeometry.

Definition at line 260 of file CaloSubdetectorGeometry.cc.

References getGeometryRawPtr().

Referenced by EcalEndcapGeometry::avgAbsZFrontFaceCenter(), EcalBarrelGeometry::avgRadiusXYFrontFaceCenter(), deltaEta(), deltaPhi(), CaloTowerGeometry::getGeometry(), getGeometry(), HcalGeometry::getGeometryBase(), CaloTowerGeometry::getSummary(), getSummary(), HcalGeometry::getSummary(), and EcalEndcapGeometry::initializeParms().

260  {
261  // Default version
262  auto ptr = getGeometryRawPtr(index);
263  static const auto do_not_delete = [](const void*) {};
264  return ptr == nullptr ? nullptr : std::shared_ptr<const CaloCellGeometry>(ptr, do_not_delete);
265 }
virtual const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const =0
CaloCellGeometry::CornersMgr* CaloSubdetectorGeometry::cornersMgr ( )
inline
CCGFloat CaloSubdetectorGeometry::deltaEta ( const DetId detId) const

Definition at line 220 of file CaloSubdetectorGeometry.cc.

References cellGeomPtr(), PV3DBase< T, PVType, FrameType >::eta(), mps_fire::i, indexFor(), m_deltaEta, and sizeForDenseIndex().

220  {
221  if (!m_deltaEta.load(std::memory_order_acquire)) {
222  const uint32_t kSize(sizeForDenseIndex(detId));
223  auto ptr = new std::vector<CCGFloat>(kSize);
224  for (uint32_t i(0); i != kSize; ++i) {
225  std::shared_ptr<const CaloCellGeometry> cellPtr(cellGeomPtr(i));
226  if (nullptr != cellPtr) {
227  const CCGFloat dEta1(fabs(GlobalPoint((cellPtr->getCorners()[0].x() + cellPtr->getCorners()[1].x()) / 2.,
228  (cellPtr->getCorners()[0].y() + cellPtr->getCorners()[1].y()) / 2.,
229  (cellPtr->getCorners()[0].z() + cellPtr->getCorners()[1].z()) / 2.)
230  .eta() -
231  GlobalPoint((cellPtr->getCorners()[2].x() + cellPtr->getCorners()[3].x()) / 2.,
232  (cellPtr->getCorners()[2].y() + cellPtr->getCorners()[3].y()) / 2.,
233  (cellPtr->getCorners()[2].z() + cellPtr->getCorners()[3].z()) / 2.)
234  .eta()));
235  const CCGFloat dEta2(fabs(GlobalPoint((cellPtr->getCorners()[0].x() + cellPtr->getCorners()[3].x()) / 2.,
236  (cellPtr->getCorners()[0].y() + cellPtr->getCorners()[3].y()) / 2.,
237  (cellPtr->getCorners()[0].z() + cellPtr->getCorners()[3].z()) / 2.)
238  .eta() -
239  GlobalPoint((cellPtr->getCorners()[2].x() + cellPtr->getCorners()[1].x()) / 2.,
240  (cellPtr->getCorners()[2].y() + cellPtr->getCorners()[1].y()) / 2.,
241  (cellPtr->getCorners()[2].z() + cellPtr->getCorners()[1].z()) / 2.)
242  .eta()));
243  (*ptr)[i] = dEta1 > dEta2 ? dEta1 : dEta2;
244  }
245  }
246  std::vector<CCGFloat>* expect = nullptr;
247  bool exchanged = m_deltaEta.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
248  if (!exchanged)
249  delete ptr;
250  }
251  return (*m_deltaEta.load(std::memory_order_acquire))[indexFor(detId)];
252 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
CaloCellGeometry::CCGFloat CCGFloat
T eta() const
Definition: PV3DBase.h:73
virtual unsigned int indexFor(const DetId &id) const
std::atomic< std::vector< CCGFloat > * > m_deltaEta
virtual unsigned int sizeForDenseIndex(const DetId &id) const
CCGFloat CaloSubdetectorGeometry::deltaPhi ( const DetId detId) const

Definition at line 180 of file CaloSubdetectorGeometry.cc.

References cellGeomPtr(), mps_fire::i, indexFor(), m_deltaPhi, M_PI, PV3DBase< T, PVType, FrameType >::phi(), and sizeForDenseIndex().

180  {
181  const CaloGenericDetId cgId(detId);
182 
183  if (!m_deltaPhi.load(std::memory_order_acquire)) {
184  const uint32_t kSize(sizeForDenseIndex(detId));
185  auto ptr = new std::vector<CCGFloat>(kSize);
186  for (uint32_t i(0); i != kSize; ++i) {
187  std::shared_ptr<const CaloCellGeometry> cellPtr(cellGeomPtr(i));
188  if (nullptr != cellPtr) {
189  CCGFloat dPhi1(fabs(GlobalPoint((cellPtr->getCorners()[0].x() + cellPtr->getCorners()[1].x()) / 2.,
190  (cellPtr->getCorners()[0].y() + cellPtr->getCorners()[1].y()) / 2.,
191  (cellPtr->getCorners()[0].z() + cellPtr->getCorners()[1].z()) / 2.)
192  .phi() -
193  GlobalPoint((cellPtr->getCorners()[2].x() + cellPtr->getCorners()[3].x()) / 2.,
194  (cellPtr->getCorners()[2].y() + cellPtr->getCorners()[3].y()) / 2.,
195  (cellPtr->getCorners()[2].z() + cellPtr->getCorners()[3].z()) / 2.)
196  .phi()));
197  CCGFloat dPhi2(fabs(GlobalPoint((cellPtr->getCorners()[0].x() + cellPtr->getCorners()[3].x()) / 2.,
198  (cellPtr->getCorners()[0].y() + cellPtr->getCorners()[3].y()) / 2.,
199  (cellPtr->getCorners()[0].z() + cellPtr->getCorners()[3].z()) / 2.)
200  .phi() -
201  GlobalPoint((cellPtr->getCorners()[2].x() + cellPtr->getCorners()[1].x()) / 2.,
202  (cellPtr->getCorners()[2].y() + cellPtr->getCorners()[1].y()) / 2.,
203  (cellPtr->getCorners()[2].z() + cellPtr->getCorners()[1].z()) / 2.)
204  .phi()));
205  if (M_PI < dPhi1)
206  dPhi1 = fabs(dPhi1 - 2. * M_PI);
207  if (M_PI < dPhi2)
208  dPhi2 = fabs(dPhi2 - 2. * M_PI);
209  (*ptr)[i] = dPhi1 > dPhi2 ? dPhi1 : dPhi2;
210  }
211  }
212  std::vector<CCGFloat>* expect = nullptr;
213  bool exchanged = m_deltaPhi.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
214  if (!exchanged)
215  delete ptr;
216  }
217  return (*m_deltaPhi.load(std::memory_order_acquire))[indexFor(detId)];
218 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
std::atomic< std::vector< CCGFloat > * > m_deltaPhi
CaloCellGeometry::CCGFloat CCGFloat
#define M_PI
virtual unsigned int indexFor(const DetId &id) const
virtual unsigned int sizeForDenseIndex(const DetId &id) const
static CCGFloat CaloSubdetectorGeometry::deltaR ( const GlobalPoint p1,
const GlobalPoint p2 
)
inlinestaticprotected

Definition at line 111 of file CaloSubdetectorGeometry.h.

References reco::deltaR().

111 { return reco::deltaR(p1, p2); }
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
virtual void CaloSubdetectorGeometry::fillDefaultNamedParameters ( ) const
inlinevirtual

Definition at line 96 of file CaloSubdetectorGeometry.h.

96 { return; }
CaloSubdetectorGeometry::DetIdSet CaloSubdetectorGeometry::getCells ( const GlobalPoint r,
double  dR 
) const
virtual

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 in HGCalGeometry, FastTimeGeometry, EcalBarrelGeometry, EcalEndcapGeometry, and HcalGeometry.

Definition at line 66 of file CaloSubdetectorGeometry.cc.

References reco::deltaR2(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), getGeometry(), mps_fire::i, M_PI, m_validIds, AlCaHLTBitMon_ParallelJobs::p, phi, and PV3DBase< T, PVType, FrameType >::phi().

Referenced by egammaisolation::EgammaRecHitExtractor::collect(), HcalGeometry::getCells(), EcalEndcapGeometry::getCells(), EcalBarrelGeometry::getCells(), getCellSet(), EgammaRecHitIsolation::getSum_(), CaloDualConeSelector< T >::selectCallback(), and CaloConeSelector< T >::selectCallback().

66  {
67  const double dR2(dR * dR);
68  const double eta(r.eta());
69  const double phi(r.phi());
70 
71  DetIdSet dss;
72 
73  if (0.000001 < dR) {
74  for (uint32_t i(0); i != m_validIds.size(); ++i) {
75  std::shared_ptr<const CaloCellGeometry> cell(getGeometry(m_validIds[i]));
76  if (nullptr != cell) {
77  const GlobalPoint& p(cell->getPosition());
78  const CCGFloat eta0(p.eta());
79  if (fabs(eta - eta0) < dR) {
80  const CCGFloat phi0(p.phi());
81  CCGFloat delp(fabs(phi - phi0));
82  if (delp > M_PI)
83  delp = 2 * M_PI - delp;
84  if (delp < dR) {
85  const CCGFloat dist2(reco::deltaR2(eta0, phi0, eta, phi));
86  if (dist2 < dR2)
87  dss.insert(m_validIds[i]);
88  }
89  }
90  }
91  }
92  }
93  return dss;
94 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::vector< DetId > m_validIds
CaloCellGeometry::CCGFloat CCGFloat
#define M_PI
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
T eta() const
Definition: PV3DBase.h:73
CaloSubdetectorGeometry::CellSet CaloSubdetectorGeometry::getCellSet ( const GlobalPoint r,
double  dR 
) const
virtual

Definition at line 96 of file CaloSubdetectorGeometry.cc.

References cells, getCells(), and getGeometry().

96  {
97  // stupid implementation not to be really used...
98  DetIdSet ids = getCells(r, dR);
99  CellSet cells;
100  cells.reserve(ids.size());
101  for (auto id : ids)
102  cells.emplace_back(getGeometry(id));
103  return cells;
104 }
std::vector< std::shared_ptr< const CaloCellGeometry > > CellSet
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
DetId CaloSubdetectorGeometry::getClosestCell ( const GlobalPoint r) const
virtual

Reimplemented in HGCalGeometry, FastTimeGeometry, EcalBarrelGeometry, EcalEndcapGeometry, HcalGeometry, EcalPreshowerGeometry, CastorGeometry, and HcalDDDGeometry.

Definition at line 44 of file CaloSubdetectorGeometry.cc.

References reco::deltaR2(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), getGeometry(), mps_fire::i, m_validIds, AlCaHLTBitMon_ParallelJobs::p, phi, and PV3DBase< T, PVType, FrameType >::phi().

Referenced by IsolatedTracksCone::analyze(), CaloTowerConstituentsMapBuilder::assignEEtoHE(), spr::chargeIsolation(), spr::chargeIsolationEcal(), spr::chargeIsolationHcal(), AlCaHOCalibProducer::fillHOStore(), spr::findDetIdCalo(), HoECalculator::getHoE(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), spr::propagateCALO(), spr::propagateCosmicCALO(), spr::propagateHCAL(), spr::propagateHCALBack(), and spr::propagateIdECAL().

44  {
45  const CCGFloat eta(r.eta());
46  const CCGFloat phi(r.phi());
47  uint32_t index(~0);
48  CCGFloat closest(1e9);
49 
50  for (uint32_t i(0); i != m_validIds.size(); ++i) {
51  std::shared_ptr<const CaloCellGeometry> cell(getGeometry(m_validIds[i]));
52  if (nullptr != cell) {
53  const GlobalPoint& p(cell->getPosition());
54  const CCGFloat eta0(p.eta());
55  const CCGFloat phi0(p.phi());
56  const CCGFloat dR2(reco::deltaR2(eta0, phi0, eta, phi));
57  if (dR2 < closest) {
58  closest = dR2;
59  index = i;
60  }
61  }
62  }
63  return (closest > 0.9e9 || (uint32_t)(~0) == index ? DetId(0) : m_validIds[index]);
64 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::vector< DetId > m_validIds
CaloCellGeometry::CCGFloat CCGFloat
Definition: DetId.h:17
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
T eta() const
Definition: PV3DBase.h:73
std::shared_ptr< const CaloCellGeometry > CaloSubdetectorGeometry::getGeometry ( const DetId id) const
virtual

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

Reimplemented in HGCalGeometry, FastTimeGeometry, CaloTowerGeometry, and HcalGeometry.

Definition at line 36 of file CaloSubdetectorGeometry.cc.

References cellGeomPtr().

Referenced by PreshowerHitMaker::addHit(), HcalSimHitsValidation::analyze(), HcalRecHitsValidation::analyze(), EcalTPGParamBuilder::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), CaloTowerConstituentsMapBuilder::assignEEtoHE(), EcalBoundaryInfoCalculator< EcalDetId >::boundaryRecHits(), CaloGeometryHelper::buildCrystalArray(), SuperClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_EnergyDepTopology(), PositionCalc::Calculate_Location(), ECAL2DPositionCalcWithDepthCorr::calculateAndSetPositionActual(), CaloCellCrossing::CaloCellCrossing(), CaloTowersCreationAlgo::convert(), EcalBarrelClusterFastTimer::correctTimeToVertex(), EcalClusterToolsT< noZS >::covariances(), DistanceToCell::DistanceToCell(), TrackDetMatchInfo::dumpGeometry(), EcalHitMaker::EcalHitMaker(), InvRingCalib::EERingDef(), HCALRecHitAnalyzer::FillGeometry(), HcalRecHitsValidation::fillRecHitsTmp(), EcalDeadCellBoundaryEnergyFilter::filter(), EgammaHLTPhase2ExtraProducer::filterRecHits(), EgammaHLTExtraProducer::filterRecHits(), EcalBoundaryInfoCalculator< EcalDetId >::gapRecHits(), getCells(), getCellSet(), EcalDeadCellTriggerPrimitiveFilter::getChannelStatusMaps(), EcalDeadCellDeltaRFilter::getChannelStatusMaps(), EcalEndcapGeometry::getClosestBarrelCells(), CaloGeometryHelper::getClosestCell(), CastorGeometry::getClosestCell(), getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), EcalPreshowerGeometry::getClosestCellInPlane(), CaloDetIdAssociator::getDetIdPoints(), HCaloDetIdAssociator::getDetIdPoints(), EcalClusterToolsT< noZS >::getEnergyDepTopology(), CaloGeometry::getGeometry(), FixedGridRhoProducerFastjetFromRecHit::getHitP4(), PFAnalysis::getHitPosition(), EcalHitMaker::getHits(), CaloGeometry::getPosition(), CaloDetIdAssociator::getPosition(), TrackDetMatchInfo::getPosition(), hgcal::RecHitTools::getScintDEtaDPhi(), EcalClusterCrackCorrection::getValue(), PFHBHERecHitCreator::importRecHits(), PFPSRecHitCreator::importRecHits(), PFHGCalRecHitCreator< DET, Layer, det, subdet >::importRecHits(), PFHFRecHitCreator::importRecHits(), PFEcalBarrelRecHitCreator::importRecHits(), PFEcalEndcapRecHitCreator::importRecHits(), CaloGeometryHelper::initialize(), EcalPreshowerGeometry::initializeParms(), CaloDetIdAssociator::insideElement(), HCaloDetIdAssociator::insideElement(), IslandClusterAlgo::makeClusters(), CosmicClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), HybridClusterAlgo::makeClusters(), HLTCaloObjInRegionsProducer< CaloObjType, CaloObjCollType >::makeFilteredColl(), PreshowerPhiClusterAlgo::makeOneCluster(), PreshowerClusterAlgo::makeOneCluster(), ticl::SeedingRegionByHF::makeRegions(), reco::makeSpecific(), EcalClusterToolsT< noZS >::meanClusterPosition(), DistanceToCell::operator()(), EcalBasicClusterLocalContCorrection::operator()(), HLTRechitInRegionsProducer< T1 >::produce(), HLTRecHitInAllL1RegionsProducer< RecHitType >::produce(), L1EGCrystalClusterEmulatorProducer::produce(), EcalRecHitWorkerRecover::run(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), EcalGeomPhiSymHelper::setup(), CaloHitResponse::timeOfFlight(), EcalTimeMapDigitizer::timeOfFlight(), ECAL2DPositionCalcWithDepthCorr::update(), and ValidateGeometry::validateCaloGeometry().

36  {
37  return cellGeomPtr(CaloGenericDetId(id).denseIndex());
38 }
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
virtual const CaloCellGeometry* CaloSubdetectorGeometry::getGeometryRawPtr ( uint32_t  index) const
protectedpure virtual
void CaloSubdetectorGeometry::getSummary ( CaloSubdetectorGeometry::TrVec tVec,
CaloSubdetectorGeometry::IVec iVec,
CaloSubdetectorGeometry::DimVec dVec,
CaloSubdetectorGeometry::IVec dinsVector 
) const
virtual

Reimplemented in HcalGeometry, HGCalGeometry, FastTimeGeometry, and CaloTowerGeometry.

Definition at line 118 of file CaloSubdetectorGeometry.cc.

References cms::cuda::assert(), SplitLinear::begin, cellGeomPtr(), runTauDisplay::gp, mps_fire::i, gpuVertexFinder::iv, isotrackApplyRegressor::k, m_validIds, gpuVertexFinder::nn, numberOfParametersPerShape(), numberOfShapes(), numberOfTransformParms(), convertSQLiteXML::ok, parVecVec(), MetAnalyzer::pv(), findQualityFiles::rr, and groupFilesInBlocks::tt.

121  {
122  tVec.reserve(m_validIds.size() * numberOfTransformParms());
123  iVec.reserve(numberOfShapes() == 1 ? 1 : m_validIds.size());
124  dVec.reserve(numberOfShapes() * numberOfParametersPerShape());
125 
126  for (const auto& pv : parVecVec()) {
127  for (float iv : pv) {
128  dVec.emplace_back(iv);
129  }
130  }
131 
132  for (uint32_t i(0); i != m_validIds.size(); ++i) {
133  Tr3D tr;
134  std::shared_ptr<const CaloCellGeometry> ptr(cellGeomPtr(i));
135  assert(nullptr != ptr);
136  ptr->getTransform(tr, (Pt3DVec*)nullptr);
137 
138  if (Tr3D() == tr) { // for preshower there is no rotation
139  const GlobalPoint& gp(ptr->getPosition());
140  tr = HepGeom::Translate3D(gp.x(), gp.y(), gp.z());
141  }
142 
143  const CLHEP::Hep3Vector tt(tr.getTranslation());
144  tVec.emplace_back(tt.x());
145  tVec.emplace_back(tt.y());
146  tVec.emplace_back(tt.z());
147  if (6 == numberOfTransformParms()) {
148  const CLHEP::HepRotation rr(tr.getRotation());
149  const ROOT::Math::Transform3D rtr(
150  rr.xx(), rr.xy(), rr.xz(), tt.x(), rr.yx(), rr.yy(), rr.yz(), tt.y(), rr.zx(), rr.zy(), rr.zz(), tt.z());
152  rtr.GetRotation(ea);
153  tVec.emplace_back(ea.Phi());
154  tVec.emplace_back(ea.Theta());
155  tVec.emplace_back(ea.Psi());
156  }
157 
158  const CCGFloat* par(ptr->param());
159 
160  unsigned int ishape(9999);
161  for (unsigned int ivv(0); ivv != parVecVec().size(); ++ivv) {
162  bool ok(true);
163  const CCGFloat* pv(&(*parVecVec()[ivv].begin()));
164  for (unsigned int k(0); k != numberOfParametersPerShape(); ++k) {
165  ok = ok && (fabs(par[k] - pv[k]) < 1.e-6);
166  }
167  if (ok) {
168  ishape = ivv;
169  break;
170  }
171  }
172  assert(9999 != ishape);
173 
174  const unsigned int nn((numberOfShapes() == 1) ? (unsigned int)1 : m_validIds.size());
175  if (iVec.size() < nn)
176  iVec.emplace_back(ishape);
177  }
178 }
int32_t *__restrict__ iv
virtual unsigned int numberOfParametersPerShape() const
assert(be >=bs)
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
virtual unsigned int numberOfShapes() const
std::vector< DetId > m_validIds
CaloCellGeometry::CCGFloat CCGFloat
AlgebraicVector EulerAngles
Definition: Definitions.h:34
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
int32_t *__restrict__ nn
virtual unsigned int numberOfTransformParms() const
const std::vector< DetId > & CaloSubdetectorGeometry::getValidDetIds ( DetId::Detector  det = DetId::Detector(0),
int  subdet = 0 
) const
virtual
unsigned int CaloSubdetectorGeometry::indexFor ( const DetId id) const
protectedvirtual

Reimplemented in HGCalGeometry, HcalGeometry, FastTimeGeometry, and CaloTowerGeometry.

Definition at line 254 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::denseIndex().

Referenced by deltaEta(), and deltaPhi().

254 { return CaloGenericDetId(id).denseIndex(); }
uint32_t denseIndex() const
virtual void CaloSubdetectorGeometry::initializeParms ( )
inlinevirtual

Reimplemented in HGCalGeometry, FastTimeGeometry, EcalEndcapGeometry, and EcalPreshowerGeometry.

Definition at line 100 of file CaloSubdetectorGeometry.h.

100 { return; }
virtual void CaloSubdetectorGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
pure virtual
virtual unsigned int CaloSubdetectorGeometry::numberOfParametersPerShape ( ) const
inlinevirtual
virtual unsigned int CaloSubdetectorGeometry::numberOfShapes ( ) const
inlinevirtual
virtual unsigned int CaloSubdetectorGeometry::numberOfTransformParms ( ) const
inlinevirtual
CaloSubdetectorGeometry& CaloSubdetectorGeometry::operator= ( const CaloSubdetectorGeometry )
delete
ParMgr* CaloSubdetectorGeometry::parMgr ( )
inline
const ParMgr* CaloSubdetectorGeometry::parMgrConst ( ) const
inline

Definition at line 87 of file CaloSubdetectorGeometry.h.

References m_parMgr.

87 { return m_parMgr; }
ParVecVec& CaloSubdetectorGeometry::parVecVec ( )
inline
const ParVecVec& CaloSubdetectorGeometry::parVecVec ( ) const
inline

Definition at line 90 of file CaloSubdetectorGeometry.h.

References m_parVecVec.

90 { return m_parVecVec; }
bool CaloSubdetectorGeometry::present ( const DetId id) const
virtual

is this detid present in the geometry?

Reimplemented in EcalBarrelGeometry, EcalEndcapGeometry, EcalPreshowerGeometry, HGCalGeometry, and FastTimeGeometry.

Definition at line 40 of file CaloSubdetectorGeometry.cc.

References spr::find(), gpuClustering::id, and m_validIds.

Referenced by EcalBarrelTopology::decrementIeta(), EcalBarrelTopology::decrementIphi(), EcalEndcapTopology::decrementIx(), EcalEndcapTopology::decrementIy(), PFAnalysis::getHitPosition(), EcalBarrelTopology::incrementIeta(), EcalBarrelTopology::incrementIphi(), EcalEndcapTopology::incrementIx(), EcalEndcapTopology::incrementIy(), and CaloGeometry::present().

40  {
41  return std::find(m_validIds.begin(), m_validIds.end(), id) != m_validIds.end();
42 }
uint16_t *__restrict__ id
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< DetId > m_validIds
unsigned int CaloSubdetectorGeometry::sizeForDenseIndex ( const DetId id) const
protectedvirtual

Reimplemented in HcalGeometry, and CaloTowerGeometry.

Definition at line 256 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::sizeForDenseIndexing().

Referenced by deltaEta(), and deltaPhi().

256  {
258 }
uint32_t sizeForDenseIndexing() const

Member Data Documentation

CaloCellGeometry::CornersMgr* CaloSubdetectorGeometry::m_cmgr
private
std::atomic<std::vector<CCGFloat>*> CaloSubdetectorGeometry::m_deltaEta
mutableprivate

Definition at line 126 of file CaloSubdetectorGeometry.h.

Referenced by deltaEta(), and ~CaloSubdetectorGeometry().

std::atomic<std::vector<CCGFloat>*> CaloSubdetectorGeometry::m_deltaPhi
mutableprivate

Definition at line 125 of file CaloSubdetectorGeometry.h.

Referenced by deltaPhi(), and ~CaloSubdetectorGeometry().

ParMgr* CaloSubdetectorGeometry::m_parMgr
private
ParVecVec CaloSubdetectorGeometry::m_parVecVec
protected

Definition at line 109 of file CaloSubdetectorGeometry.h.

Referenced by parVecVec().

bool CaloSubdetectorGeometry::m_sortedIds
private

Definition at line 122 of file CaloSubdetectorGeometry.h.

std::vector<DetId> CaloSubdetectorGeometry::m_validIds
protected