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 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 CaloCellGeometrygetGeometry (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 CaloCellGeometrycellGeomPtr (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

◆ CCGFloat

Definition at line 25 of file CaloSubdetectorGeometry.h.

◆ CellSet

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

Definition at line 24 of file CaloSubdetectorGeometry.h.

◆ DetIdSet

Definition at line 27 of file CaloSubdetectorGeometry.h.

◆ DimVec

Definition at line 35 of file CaloSubdetectorGeometry.h.

◆ IVec

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

Definition at line 34 of file CaloSubdetectorGeometry.h.

◆ ParMgr

Definition at line 29 of file CaloSubdetectorGeometry.h.

◆ ParVec

Definition at line 30 of file CaloSubdetectorGeometry.h.

◆ ParVecVec

Definition at line 31 of file CaloSubdetectorGeometry.h.

◆ TrVec

Definition at line 33 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) {}

◆ ~CaloSubdetectorGeometry()

CaloSubdetectorGeometry::~CaloSubdetectorGeometry ( )
virtual

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

Definition at line 18 of file CaloSubdetectorGeometry.cc.

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 }

References m_cmgr, m_deltaEta, m_deltaPhi, and m_parMgr.

◆ 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()

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.

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 }

References getGeometryRawPtr().

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

◆ cornersMgr()

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

◆ deltaEta()

CCGFloat CaloSubdetectorGeometry::deltaEta ( const DetId detId) const

Definition at line 220 of file CaloSubdetectorGeometry.cc.

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 }

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

◆ deltaPhi()

CCGFloat CaloSubdetectorGeometry::deltaPhi ( const DetId detId) const

Definition at line 180 of file CaloSubdetectorGeometry.cc.

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 }

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

◆ deltaR()

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

Definition at line 111 of file CaloSubdetectorGeometry.h.

111 { return reco::deltaR(p1, p2); }

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

◆ fillDefaultNamedParameters()

virtual void CaloSubdetectorGeometry::fillDefaultNamedParameters ( ) const
inlinevirtual

Definition at line 96 of file CaloSubdetectorGeometry.h.

96 { 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, FastTimeGeometry, EcalBarrelGeometry, EcalEndcapGeometry, and HcalGeometry.

Definition at line 66 of file CaloSubdetectorGeometry.cc.

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 }

References reco::deltaR2(), HGC3DClusterGenMatchSelector_cfi::dR, 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< HBHERecHit >::selectCallback(), and CaloConeSelector< T >::selectCallback().

◆ getCellSet()

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

Definition at line 96 of file CaloSubdetectorGeometry.cc.

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 }

References postprocess-scan-build::cells, HGC3DClusterGenMatchSelector_cfi::dR, getCells(), getGeometry(), and alignCSCRings::r.

◆ getClosestCell()

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.

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 }

References reco::deltaR2(), 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(), AlCaHOCalibProducer::fillHOStore(), spr::findDetIdCalo(), BetaCalculatorECAL::getDetailedTrackLengthInXtals(), HoECalculator::getHoE(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), spr::propagateCALO(), spr::propagateCosmicCALO(), spr::propagateHCAL(), spr::propagateHCALBack(), and spr::propagateIdECAL().

◆ getGeometry()

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.

36  {
37  return cellGeomPtr(CaloGenericDetId(id).denseIndex());
38 }

References cellGeomPtr().

Referenced by PreshowerHitMaker::addHit(), BetaCalculatorECAL::addStepToXtal(), EcalEBTrigPrimAnalyzer::analyze(), EcalTrigPrimAnalyzer::analyze(), PhiSymmetryCalibration::analyze(), EcalTPGParamBuilder::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), HGCalHitValidation::analyzeHGCalRecHit(), CaloTowerConstituentsMapBuilder::assignEEtoHE(), EcalBoundaryInfoCalculator< EBDetId >::boundaryRecHits(), CaloGeometryHelper::buildCrystalArray(), SuperClusterShapeAlgo::Calculate_Covariances(), PositionCalc::Calculate_Location(), ECAL2DPositionCalcWithDepthCorr::calculateAndSetPositionActual(), CaloCellCrossing::CaloCellCrossing(), CaloTowersCreationAlgo::convert(), EcalBarrelClusterFastTimer::correctTimeToVertex(), EcalClusterToolsT< noZS >::covariances(), DistanceToCell::DistanceToCell(), TrackDetMatchInfo::dumpGeometry(), EcalHitMaker::EcalHitMaker(), InvRingCalib::EERingDef(), HCALRecHitAnalyzer::FillGeometry(), ECALRecHitAnalyzer::FillGeometry(), EcalDeadCellBoundaryEnergyFilter::filter(), EcalBoundaryInfoCalculator< EBDetId >::gapRecHits(), getCells(), getCellSet(), EcalDeadCellTriggerPrimitiveFilter::getChannelStatusMaps(), EcalDeadCellDeltaRFilter::getChannelStatusMaps(), EcalEndcapGeometry::getClosestBarrelCells(), CaloGeometryHelper::getClosestCell(), CastorGeometry::getClosestCell(), getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), EcalPreshowerGeometry::getClosestCellInPlane(), BetaCalculatorECAL::getDetailedTrackLengthInXtals(), HCaloDetIdAssociator::getDetIdPoints(), EcalClusterToolsT< noZS >::getEnergyDepTopology(), PFAnalysis::getHitPosition(), EcalHitMaker::getHits(), CaloDetIdAssociator::getPosition(), TrackDetMatchInfo::getPosition(), PFHBHERecHitCreator::importRecHits(), PFPSRecHitCreator::importRecHits(), PFHFRecHitCreator::importRecHits(), PFEcalBarrelRecHitCreator::importRecHits(), PFEcalEndcapRecHitCreator::importRecHits(), PhotonFixCMS::initialise(), CaloGeometryHelper::initialize(), EcalPreshowerGeometry::initializeParms(), CaloDetIdAssociator::insideElement(), HCaloDetIdAssociator::insideElement(), IslandClusterAlgo::makeClusters(), CosmicClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), PreshowerPhiClusterAlgo::makeOneCluster(), PreshowerClusterAlgo::makeOneCluster(), reco::makeSpecific(), EcalClusterToolsT< noZS >::meanClusterPosition(), DistanceToCell::operator()(), HLTRechitInRegionsProducer< T1 >::produce(), L1EGCrystalClusterEmulatorProducer::produce(), EcalRecHitWorkerRecover::run(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), EcalGeomPhiSymHelper::setup(), CaloHitResponse::timeOfFlight(), EcalTimeMapDigitizer::timeOfFlight(), and ECAL2DPositionCalcWithDepthCorr::update().

◆ getGeometryRawPtr()

virtual const CaloCellGeometry* 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, FastTimeGeometry, and CaloTowerGeometry.

Definition at line 118 of file CaloSubdetectorGeometry.cc.

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 }

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

◆ 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, FastTimeGeometry, and CaloTowerGeometry.

Definition at line 254 of file CaloSubdetectorGeometry.cc.

254 { return CaloGenericDetId(id).denseIndex(); }

References CaloGenericDetId::denseIndex().

Referenced by deltaEta(), and deltaPhi().

◆ initializeParms()

virtual void CaloSubdetectorGeometry::initializeParms ( )
inlinevirtual

Reimplemented in HGCalGeometry, FastTimeGeometry, EcalEndcapGeometry, and EcalPreshowerGeometry.

Definition at line 100 of file CaloSubdetectorGeometry.h.

100 { 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 87 of file CaloSubdetectorGeometry.h.

87 { return m_parMgr; }

References m_parMgr.

◆ parVecVec() [1/2]

ParVecVec& CaloSubdetectorGeometry::parVecVec ( )
inline

◆ parVecVec() [2/2]

const ParVecVec& CaloSubdetectorGeometry::parVecVec ( ) const
inline

Definition at line 90 of file CaloSubdetectorGeometry.h.

90 { return m_parVecVec; }

References 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 256 of file CaloSubdetectorGeometry.cc.

256  {
258 }

References CaloGenericDetId::sizeForDenseIndexing().

Referenced by deltaEta(), and deltaPhi().

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 126 of file CaloSubdetectorGeometry.h.

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

◆ m_deltaPhi

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

Definition at line 125 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 109 of file CaloSubdetectorGeometry.h.

Referenced by parVecVec().

◆ m_sortedIds

bool CaloSubdetectorGeometry::m_sortedIds
private

Definition at line 122 of file CaloSubdetectorGeometry.h.

◆ m_validIds

std::vector<DetId> CaloSubdetectorGeometry::m_validIds
protected
CaloSubdetectorGeometry::numberOfParametersPerShape
virtual unsigned int numberOfParametersPerShape() const
Definition: CaloSubdetectorGeometry.h:93
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CaloSubdetectorGeometry::m_cmgr
CaloCellGeometry::CornersMgr * m_cmgr
Definition: CaloSubdetectorGeometry.h:120
CaloGenericDetId
Definition: CaloGenericDetId.h:12
CaloSubdetectorGeometry::DetIdSet
std::set< DetId > DetIdSet
Definition: CaloSubdetectorGeometry.h:27
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
CaloCellGeometry::k_cornerSize
static constexpr unsigned int k_cornerSize
Definition: CaloCellGeometry.h:64
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
cms::cuda::assert
assert(be >=bs)
CaloSubdetectorGeometry::numberOfTransformParms
virtual unsigned int numberOfTransformParms() const
Definition: CaloSubdetectorGeometry.h:94
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
CaloSubdetectorGeometry::numberOfShapes
virtual unsigned int numberOfShapes() const
Definition: CaloSubdetectorGeometry.h:92
DetId
Definition: DetId.h:17
CaloSubdetectorGeometry::getCells
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
Definition: CaloSubdetectorGeometry.cc:66
PVValHelper::eta
Definition: PVValidationHelpers.h:69
CaloSubdetectorGeometry::CellSet
std::vector< std::shared_ptr< const CaloCellGeometry > > CellSet
Definition: CaloSubdetectorGeometry.h:24
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
CaloSubdetectorGeometry::m_validIds
std::vector< DetId > m_validIds
Definition: CaloSubdetectorGeometry.h:115
CaloSubdetectorGeometry::m_deltaPhi
std::atomic< std::vector< CCGFloat > * > m_deltaPhi
Definition: CaloSubdetectorGeometry.h:125
p2
double p2[4]
Definition: TauolaWrapper.h:90
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloCellGeometry.cc:7
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
CaloGenericDetId::sizeForDenseIndexing
uint32_t sizeForDenseIndexing() const
Definition: CaloGenericDetId.cc:40
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
CaloCellGeometry::CornersMgr
EZMgrFL< GlobalPoint > CornersMgr
Definition: CaloCellGeometry.h:58
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
p1
double p1[4]
Definition: TauolaWrapper.h:89
CaloSubdetectorGeometry::m_parMgr
ParMgr * m_parMgr
Definition: CaloSubdetectorGeometry.h:118
CaloSubdetectorGeometry::getGeometry
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.
Definition: CaloSubdetectorGeometry.cc:36
align::EulerAngles
AlgebraicVector EulerAngles
Definition: Definitions.h:34
CaloSubdetectorGeometry::indexFor
virtual unsigned int indexFor(const DetId &id) const
Definition: CaloSubdetectorGeometry.cc:254
alignCSCRings.r
r
Definition: alignCSCRings.py:93
groupFilesInBlocks.nn
nn
Definition: groupFilesInBlocks.py:150
DDAxes::phi
CaloGenericDetId::denseIndex
uint32_t denseIndex() const
Definition: CaloGenericDetId.cc:24
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloSubdetectorGeometry.cc:11
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
CaloSubdetectorGeometry::ParMgr
CaloCellGeometry::ParMgr ParMgr
Definition: CaloSubdetectorGeometry.h:29
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: CaloCellGeometry.cc:6
CaloSubdetectorGeometry::getGeometryRawPtr
virtual const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const =0
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
CaloSubdetectorGeometry::parVecVec
ParVecVec & parVecVec()
Definition: CaloSubdetectorGeometry.h:89
CaloSubdetectorGeometry::cellGeomPtr
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
Definition: CaloSubdetectorGeometry.cc:260
CaloSubdetectorGeometry::m_deltaEta
std::atomic< std::vector< CCGFloat > * > m_deltaEta
Definition: CaloSubdetectorGeometry.h:126
CaloSubdetectorGeometry::sizeForDenseIndex
virtual unsigned int sizeForDenseIndex(const DetId &id) const
Definition: CaloSubdetectorGeometry.cc:256
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
CaloSubdetectorGeometry::m_parVecVec
ParVecVec m_parVecVec
Definition: CaloSubdetectorGeometry.h:109