CMS 3D CMS Logo

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 HcalDDDGeometry HcalGeometry HGCalGeometry HGCalTBGeometry ZdcGeometry

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
using CellMayOwnPtr = CaloCellGeometryMayOwnPtr
 
using CellPtr = CaloCellGeometryPtr
 
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 CellMayOwnPtr 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 bool valid (const DetId &id) const
 
virtual ~CaloSubdetectorGeometry ()
 The base class DOES assume that it owns the CaloCellGeometry objects. More...
 

Protected Member Functions

void addValidID (const DetId &id)
 
virtual CellPtr cellGeomPtr (uint32_t index) const
 
virtual CellPtr getGeometryRawPtr (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 25 of file CaloSubdetectorGeometry.h.

Member Typedef Documentation

◆ CCGFloat

Definition at line 28 of file CaloSubdetectorGeometry.h.

◆ CellMayOwnPtr

Definition at line 41 of file CaloSubdetectorGeometry.h.

◆ CellPtr

Definition at line 40 of file CaloSubdetectorGeometry.h.

◆ CellSet

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

Definition at line 27 of file CaloSubdetectorGeometry.h.

◆ DetIdSet

Definition at line 30 of file CaloSubdetectorGeometry.h.

◆ DimVec

Definition at line 38 of file CaloSubdetectorGeometry.h.

◆ IVec

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

Definition at line 37 of file CaloSubdetectorGeometry.h.

◆ ParMgr

Definition at line 32 of file CaloSubdetectorGeometry.h.

◆ ParVec

Definition at line 33 of file CaloSubdetectorGeometry.h.

◆ ParVecVec

Definition at line 34 of file CaloSubdetectorGeometry.h.

◆ TrVec

Definition at line 36 of file CaloSubdetectorGeometry.h.

Constructor & Destructor Documentation

◆ CaloSubdetectorGeometry() [1/2]

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::~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() [2/2]

CaloSubdetectorGeometry::CaloSubdetectorGeometry ( const CaloSubdetectorGeometry )
delete

avoid copies

Member Function Documentation

◆ addValidID()

void CaloSubdetectorGeometry::addValidID ( const DetId id)
protected

◆ allocateCorners()

void CaloSubdetectorGeometry::allocateCorners ( CaloCellGeometry::CornersVec::size_type  n)

◆ allocatePar()

void CaloSubdetectorGeometry::allocatePar ( ParVec::size_type  n,
unsigned int  m 
)

◆ cellGeomPtr()

CaloSubdetectorGeometry::CellPtr CaloSubdetectorGeometry::cellGeomPtr ( uint32_t  index) const
protectedvirtual

◆ cornersMgr()

CaloCellGeometry::CornersMgr* CaloSubdetectorGeometry::cornersMgr ( )
inline

◆ deltaEta()

CCGFloat CaloSubdetectorGeometry::deltaEta ( const DetId detId) const

Definition at line 221 of file CaloSubdetectorGeometry.cc.

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

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

◆ deltaPhi()

CCGFloat CaloSubdetectorGeometry::deltaPhi ( const DetId detId) const

Definition at line 181 of file CaloSubdetectorGeometry.cc.

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

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

◆ deltaR()

static CCGFloat CaloSubdetectorGeometry::deltaR ( const GlobalPoint p1,
const GlobalPoint p2 
)
inlinestaticprotected

Definition at line 121 of file CaloSubdetectorGeometry.h.

References reco::deltaR(), LaserDQM_cfg::p1, and SiStripOfflineCRack_cfg::p2.

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

◆ fillDefaultNamedParameters()

virtual void CaloSubdetectorGeometry::fillDefaultNamedParameters ( ) const
inlinevirtual

Definition at line 102 of file CaloSubdetectorGeometry.h.

102 { return; }

◆ getCells()

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, HGCalTBGeometry, EcalBarrelGeometry, EcalEndcapGeometry, and HcalGeometry.

Definition at line 66 of file CaloSubdetectorGeometry.cc.

References reco::deltaR2(), HGC3DClusterGenMatchSelector_cfi::dR, ALPAKA_ACCELERATOR_NAMESPACE::dR2(), PVValHelper::eta, getGeometry(), mps_fire::i, M_PI, m_validIds, AlCaHLTBitMon_ParallelJobs::p, phi, and alignCSCRings::r.

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  auto 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 }
virtual CellMayOwnPtr getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
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

◆ getCellSet()

CaloSubdetectorGeometry::CellSet CaloSubdetectorGeometry::getCellSet ( const GlobalPoint r,
double  dR 
) const
virtual

Definition at line 96 of file CaloSubdetectorGeometry.cc.

References hgcalTBTopologyTester_cfi::cells, HGC3DClusterGenMatchSelector_cfi::dR, getCells(), getGeometry(), and alignCSCRings::r.

96  {
97  // stupid implementation not to be really used...
98  DetIdSet ids = getCells(r, dR);
99  CellSet cells;
100  cells.reserve(ids.size());
101  static const auto do_not_delete = [](const void*) {};
102  for (auto id : ids)
103  cells.emplace_back(std::shared_ptr<CaloCellGeometry const>(getGeometry(id).get(), do_not_delete));
104  return cells;
105 }
virtual CellMayOwnPtr getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
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.

◆ getClosestCell()

DetId CaloSubdetectorGeometry::getClosestCell ( const GlobalPoint r) const
virtual

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

Definition at line 44 of file CaloSubdetectorGeometry.cc.

References pv::closest(), reco::deltaR2(), ALPAKA_ACCELERATOR_NAMESPACE::dR2(), PVValHelper::eta, getGeometry(), mps_fire::i, m_validIds, AlCaHLTBitMon_ParallelJobs::p, phi, and alignCSCRings::r.

Referenced by IsolatedTracksCone::analyze(), CaloTowerConstituentsMapBuilder::assignEEtoHE(), spr::chargeIsolation(), spr::chargeIsolationEcal(), spr::chargeIsolationHcal(), reco::EcalClustersGraph::clusterPosition(), AlCaHOCalibProducer::fillHOStore(), spr::findDetIdCalo(), 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  auto 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 }
virtual CellMayOwnPtr getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
int closest(std::vector< int > const &vec, int value)
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
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

◆ getGeometry()

CaloSubdetectorGeometry::CellMayOwnPtr 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, HGCalTBGeometry, CaloTowerGeometry, and HcalGeometry.

Definition at line 36 of file CaloSubdetectorGeometry.cc.

References cellGeomPtr().

Referenced by DRNCorrectionProducerT< T >::acquire(), PreshowerHitMaker::addHit(), EcalEBTrigPrimAnalyzer::analyze(), HcalSimHitsValidation::analyze(), HcalRecHitsValidation::analyze(), EcalTPGParamBuilder::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), CaloTowerConstituentsMapBuilder::assignEEtoHE(), EcalBoundaryInfoCalculator< EBDetId >::boundaryRecHits(), CaloGeometryHelper::buildCrystalArray(), SuperClusterShapeAlgo::Calculate_Covariances(), PositionCalc::Calculate_Location(), ECAL2DPositionCalcWithDepthCorr::calculateAndSetPositionActual(), CaloCellCrossing::CaloCellCrossing(), reco::EcalClustersGraph::computeCovariances(), CaloTowersCreationAlgo::convert(), EcalBarrelClusterFastTimer::correctTimeToVertex(), EcalClusterToolsT< noZS >::covariances(), DistanceToCell::DistanceToCell(), TrackDetMatchInfo::dumpGeometry(), EcalHitMaker::EcalHitMaker(), InvRingCalib::EERingDef(), HCALRecHitAnalyzer::FillGeometry(), ECALRecHitAnalyzer::FillGeometry(), HcalRecHitsValidation::fillRecHitsTmp(), EcalDeadCellBoundaryEnergyFilter::filter(), EcalBoundaryInfoCalculator< EBDetId >::gapRecHits(), getCells(), getCellSet(), EcalDeadCellTriggerPrimitiveFilter::getChannelStatusMaps(), EcalDeadCellDeltaRFilter::getChannelStatusMaps(), EcalEndcapGeometry::getClosestBarrelCells(), CaloGeometryHelper::getClosestCell(), CastorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), getClosestCell(), EcalBarrelGeometry::getClosestCell(), EcalPreshowerGeometry::getClosestCellInPlane(), HCaloDetIdAssociator::getDetIdPoints(), DisappearingMuonsSkimming::getECALIsolation(), EcalClusterToolsT< noZS >::getEnergyDepTopology(), PFAnalysis::getHitPosition(), EcalHitMaker::getHits(), CaloDetIdAssociator::getPosition(), TrackDetMatchInfo::getPosition(), hgcal::RecHitTools::getScintDEtaDPhi(), PFHBHERecHitCreator::importRecHits(), PFPSRecHitCreator::importRecHits(), PFHFRecHitCreator::importRecHits(), PFEcalBarrelRecHitCreator::importRecHits(), PFEcalEndcapRecHitCreator::importRecHits(), CaloGeometryHelper::initialize(), EcalPreshowerGeometry::initializeParms(), CaloDetIdAssociator::insideElement(), HCaloDetIdAssociator::insideElement(), IslandClusterAlgo::makeClusters(), CosmicClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), PreshowerPhiClusterAlgo::makeOneCluster(), PreshowerClusterAlgo::makeOneCluster(), ticl::SeedingRegionByHF::makeRegions(), reco::makeSpecific(), EcalClusterToolsT< noZS >::meanClusterPosition(), DistanceToCell::operator()(), ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitTopologyESProducer< CAL >::produce(), Phase2L1CaloEGammaEmulator::produce(), HLTRechitInRegionsProducer< T1 >::produce(), L1EGCrystalClusterEmulatorProducer::produce(), EcalRecHitWorkerRecover::run(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), EcalGeomPhiSymHelper::setup(), CaloHitResponse::timeOfFlight(), EcalTimeMapDigitizer::timeOfFlight(), and ECAL2DPositionCalcWithDepthCorr::update().

36  {
37  return CellMayOwnPtr(cellGeomPtr(CaloGenericDetId(id).denseIndex()));
38 }
CaloCellGeometryMayOwnPtr CellMayOwnPtr
virtual CellPtr cellGeomPtr(uint32_t index) const

◆ getGeometryRawPtr()

virtual CellPtr CaloSubdetectorGeometry::getGeometryRawPtr ( uint32_t  index) const
protectedpure virtual

◆ getSummary()

void CaloSubdetectorGeometry::getSummary ( CaloSubdetectorGeometry::TrVec tVec,
CaloSubdetectorGeometry::IVec iVec,
CaloSubdetectorGeometry::DimVec dVec,
CaloSubdetectorGeometry::IVec dinsVector 
) const
virtual

Reimplemented in HcalGeometry, HGCalGeometry, HGCalTBGeometry, ZdcGeometry, and CaloTowerGeometry.

Definition at line 119 of file CaloSubdetectorGeometry.cc.

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

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

◆ getValidDetIds()

const std::vector< DetId > & CaloSubdetectorGeometry::getValidDetIds ( DetId::Detector  det = DetId::Detector(0),
int  subdet = 0 
) const
virtual

◆ indexFor()

unsigned int CaloSubdetectorGeometry::indexFor ( const DetId id) const
protectedvirtual

Reimplemented in HGCalGeometry, HcalGeometry, HGCalTBGeometry, ZdcGeometry, and CaloTowerGeometry.

Definition at line 255 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::denseIndex().

Referenced by deltaEta(), and deltaPhi().

255 { return CaloGenericDetId(id).denseIndex(); }
uint32_t denseIndex() const

◆ initializeParms()

virtual void CaloSubdetectorGeometry::initializeParms ( )
inlinevirtual

Reimplemented in HGCalGeometry, HGCalTBGeometry, EcalEndcapGeometry, and EcalPreshowerGeometry.

Definition at line 106 of file CaloSubdetectorGeometry.h.

106 { return; }

◆ newCell()

virtual void CaloSubdetectorGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
const CCGFloat parm,
const DetId detId 
)
pure virtual

◆ numberOfParametersPerShape()

virtual unsigned int CaloSubdetectorGeometry::numberOfParametersPerShape ( ) const
inlinevirtual

◆ numberOfShapes()

virtual unsigned int CaloSubdetectorGeometry::numberOfShapes ( ) const
inlinevirtual

◆ numberOfTransformParms()

virtual unsigned int CaloSubdetectorGeometry::numberOfTransformParms ( ) const
inlinevirtual

◆ operator=()

CaloSubdetectorGeometry& CaloSubdetectorGeometry::operator= ( const CaloSubdetectorGeometry )
delete

◆ parMgr()

ParMgr* CaloSubdetectorGeometry::parMgr ( )
inline

◆ parMgrConst()

const ParMgr* CaloSubdetectorGeometry::parMgrConst ( ) const
inline

Definition at line 93 of file CaloSubdetectorGeometry.h.

References m_parMgr.

93 { return m_parMgr; }

◆ parVecVec() [1/2]

ParVecVec& CaloSubdetectorGeometry::parVecVec ( )
inline

◆ parVecVec() [2/2]

const ParVecVec& CaloSubdetectorGeometry::parVecVec ( ) const
inline

Definition at line 96 of file CaloSubdetectorGeometry.h.

References m_parVecVec.

96 { return m_parVecVec; }

◆ present()

bool CaloSubdetectorGeometry::present ( const DetId id) const
virtual

◆ sizeForDenseIndex()

unsigned int CaloSubdetectorGeometry::sizeForDenseIndex ( const DetId id) const
protectedvirtual

Reimplemented in HcalGeometry, and CaloTowerGeometry.

Definition at line 257 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::sizeForDenseIndexing().

Referenced by deltaEta(), and deltaPhi().

257  {
259 }
uint32_t sizeForDenseIndexing() const

◆ valid()

virtual bool CaloSubdetectorGeometry::valid ( const DetId id) const
inlinevirtual

Definition at line 108 of file CaloSubdetectorGeometry.h.

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

108  {
109  return (std::find(m_validIds.begin(), m_validIds.end(), id) != m_validIds.end());
110  }
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

Member Data Documentation

◆ m_cmgr

CaloCellGeometry::CornersMgr* CaloSubdetectorGeometry::m_cmgr
private

◆ m_deltaEta

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

Definition at line 136 of file CaloSubdetectorGeometry.h.

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

◆ m_deltaPhi

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

Definition at line 135 of file CaloSubdetectorGeometry.h.

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

◆ m_parMgr

ParMgr* CaloSubdetectorGeometry::m_parMgr
private

◆ m_parVecVec

ParVecVec CaloSubdetectorGeometry::m_parVecVec
protected

Definition at line 119 of file CaloSubdetectorGeometry.h.

Referenced by parVecVec().

◆ m_sortedIds

bool CaloSubdetectorGeometry::m_sortedIds
private

Definition at line 132 of file CaloSubdetectorGeometry.h.

◆ m_validIds

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