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

Member Typedef Documentation

Definition at line 29 of file CaloSubdetectorGeometry.h.

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

Definition at line 28 of file CaloSubdetectorGeometry.h.

Definition at line 31 of file CaloSubdetectorGeometry.h.

Definition at line 40 of file CaloSubdetectorGeometry.h.

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

Definition at line 39 of file CaloSubdetectorGeometry.h.

Definition at line 34 of file CaloSubdetectorGeometry.h.

Definition at line 35 of file CaloSubdetectorGeometry.h.

Definition at line 36 of file CaloSubdetectorGeometry.h.

Definition at line 38 of file CaloSubdetectorGeometry.h.

Constructor & Destructor Documentation

CaloSubdetectorGeometry::CaloSubdetectorGeometry ( )

Definition at line 15 of file CaloSubdetectorGeometry.cc.

15  :
16  m_parMgr ( nullptr ) ,
17  m_cmgr ( nullptr ) ,
18  m_deltaPhi (nullptr) ,
19  m_deltaEta (nullptr)
20 {}
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 23 of file CaloSubdetectorGeometry.cc.

References m_cmgr, m_deltaEta, m_deltaPhi, and m_parMgr.

24 {
25  delete m_cmgr ;
26  delete m_parMgr ;
27  if (m_deltaPhi) delete m_deltaPhi.load() ;
28  if (m_deltaEta) delete m_deltaEta.load() ;
29 }
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
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 303 of file CaloSubdetectorGeometry.cc.

References getGeometryRawPtr().

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

303  {
304  // Default version
305  auto ptr = getGeometryRawPtr(index);
306  static const auto do_not_delete = [](const void*){};
307  return ptr == nullptr ? nullptr : std::shared_ptr<const CaloCellGeometry>(ptr, do_not_delete);
308 }
virtual const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const =0
CaloCellGeometry::CornersMgr* CaloSubdetectorGeometry::cornersMgr ( )
inline
CCGFloat CaloSubdetectorGeometry::deltaEta ( const DetId detId) const

Definition at line 253 of file CaloSubdetectorGeometry.cc.

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

253  {
254 
255  if(!m_deltaEta.load(std::memory_order_acquire)) {
256  const uint32_t kSize ( sizeForDenseIndex(detId));
257  auto ptr = new std::vector<CCGFloat> ( kSize ) ;
258  for( uint32_t i ( 0 ) ; i != kSize ; ++i ) {
259  std::shared_ptr<const CaloCellGeometry> cellPtr ( cellGeomPtr( i ) ) ;
260  if( nullptr != cellPtr ) {
261  const CCGFloat dEta1(fabs(
262  GlobalPoint((cellPtr->getCorners()[0].x() +
263  cellPtr->getCorners()[1].x())/2.,
264  (cellPtr->getCorners()[0].y() +
265  cellPtr->getCorners()[1].y())/2.,
266  (cellPtr->getCorners()[0].z() +
267  cellPtr->getCorners()[1].z())/2.).eta() -
268  GlobalPoint((cellPtr->getCorners()[2].x() +
269  cellPtr->getCorners()[3].x())/2.,
270  (cellPtr->getCorners()[2].y() +
271  cellPtr->getCorners()[3].y())/2. ,
272  (cellPtr->getCorners()[2].z() +
273  cellPtr->getCorners()[3].z())/2.).eta() ) ) ;
274  const CCGFloat dEta2(fabs(
275  GlobalPoint((cellPtr->getCorners()[0].x() +
276  cellPtr->getCorners()[3].x())/2.,
277  (cellPtr->getCorners()[0].y() +
278  cellPtr->getCorners()[3].y())/2.,
279  (cellPtr->getCorners()[0].z() +
280  cellPtr->getCorners()[3].z())/2.).eta() -
281  GlobalPoint((cellPtr->getCorners()[2].x() +
282  cellPtr->getCorners()[1].x())/2.,
283  (cellPtr->getCorners()[2].y() +
284  cellPtr->getCorners()[1].y())/2.,
285  (cellPtr->getCorners()[2].z() +
286  cellPtr->getCorners()[1].z())/2.).eta() ) ) ;
287  (*ptr)[i] = dEta1>dEta2 ? dEta1 : dEta2 ;
288  }
289  }
290  std::vector<CCGFloat>* expect = nullptr;
291  bool exchanged = m_deltaEta.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
292  if (!exchanged) delete ptr;
293  }
294  return (*m_deltaEta.load(std::memory_order_acquire))[ indexFor(detId)];
295 }
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:76
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 205 of file CaloSubdetectorGeometry.cc.

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

205  {
206  const CaloGenericDetId cgId ( detId ) ;
207 
208  if(!m_deltaPhi.load(std::memory_order_acquire)) {
209  const uint32_t kSize ( sizeForDenseIndex(detId));
210  auto ptr = new std::vector<CCGFloat>(kSize);
211  for( uint32_t i ( 0 ) ; i != kSize ; ++i ) {
212  std::shared_ptr<const CaloCellGeometry> cellPtr ( cellGeomPtr( i ) ) ;
213  if( nullptr != cellPtr ) {
214  CCGFloat dPhi1 (fabs(
215  GlobalPoint((cellPtr->getCorners()[0].x() +
216  cellPtr->getCorners()[1].x() )/2.,
217  (cellPtr->getCorners()[0].y() +
218  cellPtr->getCorners()[1].y() )/2.,
219  (cellPtr->getCorners()[0].z() +
220  cellPtr->getCorners()[1].z() )/2.).phi() -
221  GlobalPoint((cellPtr->getCorners()[2].x() +
222  cellPtr->getCorners()[3].x() )/2.,
223  (cellPtr->getCorners()[2].y() +
224  cellPtr->getCorners()[3].y() )/2.,
225  (cellPtr->getCorners()[2].z() +
226  cellPtr->getCorners()[3].z() )/2.).phi() ) ) ;
227  CCGFloat dPhi2 (fabs(
228  GlobalPoint((cellPtr->getCorners()[0].x() +
229  cellPtr->getCorners()[3].x() )/2.,
230  (cellPtr->getCorners()[0].y() +
231  cellPtr->getCorners()[3].y() )/2.,
232  (cellPtr->getCorners()[0].z() +
233  cellPtr->getCorners()[3].z() )/2. ).phi() -
234  GlobalPoint((cellPtr->getCorners()[2].x() +
235  cellPtr->getCorners()[1].x() )/2.,
236  (cellPtr->getCorners()[2].y() +
237  cellPtr->getCorners()[1].y() )/2.,
238  (cellPtr->getCorners()[2].z() +
239  cellPtr->getCorners()[1].z() )/2.).phi() ) ) ;
240  if( M_PI < dPhi1 ) dPhi1 = fabs( dPhi1 - 2.*M_PI ) ;
241  if( M_PI < dPhi2 ) dPhi2 = fabs( dPhi2 - 2.*M_PI ) ;
242  (*ptr)[i] = dPhi1>dPhi2 ? dPhi1 : dPhi2 ;
243  }
244  }
245  std::vector<CCGFloat>* expect = nullptr;
246  bool exchanged = m_deltaPhi.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
247  if (!exchanged) delete ptr;
248  }
249  return (*m_deltaPhi.load(std::memory_order_acquire))[ indexFor(detId) ] ;
250 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
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 120 of file CaloSubdetectorGeometry.h.

References addValidID(), and reco::deltaR().

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

Definition at line 101 of file CaloSubdetectorGeometry.h.

References getSummary(), and reco::return().

101 { return ; }
return(e1-e2)*(e1-e2)+dp *dp
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 82 of file CaloSubdetectorGeometry.cc.

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

82  {
83  const double dR2 ( dR*dR ) ;
84  const double eta ( r.eta() ) ;
85  const double phi ( r.phi() ) ;
86 
87  DetIdSet dss;
88 
89  if( 0.000001 < dR )
90  {
91  for( uint32_t i ( 0 ); i != m_validIds.size() ; ++i )
92  {
93  std::shared_ptr<const CaloCellGeometry> cell ( getGeometry( m_validIds[i] ) ) ;
94  if( nullptr != cell )
95  {
96  const GlobalPoint& p ( cell->getPosition() ) ;
97  const CCGFloat eta0 ( p.eta() ) ;
98  if( fabs( eta - eta0 ) < dR )
99  {
100  const CCGFloat phi0 ( p.phi() ) ;
101  CCGFloat delp ( fabs( phi - phi0 ) ) ;
102  if( delp > M_PI ) delp = 2*M_PI - delp ;
103  if( delp < dR )
104  {
105  const CCGFloat dist2 ( reco::deltaR2( eta0, phi0, eta, phi ) ) ;
106  if( dist2 < dR2 ) dss.insert( m_validIds[i] ) ;
107  }
108  }
109  }
110  }
111  }
112  return dss;
113 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< DetId > m_validIds
CaloCellGeometry::CCGFloat CCGFloat
#define M_PI
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.
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
T eta() const
Definition: PV3DBase.h:76
CaloSubdetectorGeometry::CellSet CaloSubdetectorGeometry::getCellSet ( const GlobalPoint r,
double  dR 
) const
virtual

Definition at line 116 of file CaloSubdetectorGeometry.cc.

References getCells(), getGeometry(), and electrons_cff::ids.

116  {
117  // stupid implementation not to be really used...
118  DetIdSet ids = getCells(r, dR);
119  CellSet cells; cells.reserve(ids.size());
120  for ( auto id : ids) cells.emplace_back(getGeometry(id));
121  return cells;
122 }
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.
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 57 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(), CaloRecoTauAlgorithm::buildCaloTau(), spr::chargeIsolation(), spr::chargeIsolationEcal(), spr::chargeIsolationHcal(), AlCaHOCalibProducer::fillHOStore(), spr::findDetIdCalo(), CaloGeometryHelper::getClosestCell(), HoECalculator::getHoE(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), spr::propagateCALO(), spr::propagateCosmicCALO(), spr::propagateHCAL(), spr::propagateHCALBack(), and spr::propagateIdECAL().

57  {
58  const CCGFloat eta ( r.eta() ) ;
59  const CCGFloat phi ( r.phi() ) ;
60  uint32_t index ( ~0 ) ;
61  CCGFloat closest ( 1e9 ) ;
62 
63  for( uint32_t i ( 0 ); i != m_validIds.size() ; ++i ) {
64  std::shared_ptr<const CaloCellGeometry> cell ( getGeometry( m_validIds[ i ] ) ) ;
65  if( nullptr != cell ) {
66  const GlobalPoint& p ( cell->getPosition() ) ;
67  const CCGFloat eta0 ( p.eta() ) ;
68  const CCGFloat phi0 ( p.phi() ) ;
69  const CCGFloat dR2 ( reco::deltaR2( eta0, phi0, eta, phi ) ) ;
70  if( dR2 < closest ) {
71  closest = dR2 ;
72  index = i ;
73  }
74  }
75  }
76  return ( closest > 0.9e9 ||
77  (uint32_t)(~0) == index ? DetId(0) :
78  m_validIds[index] ) ;
79 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< DetId > m_validIds
CaloCellGeometry::CCGFloat CCGFloat
Definition: DetId.h:18
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.
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
T eta() const
Definition: PV3DBase.h:76
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 46 of file CaloSubdetectorGeometry.cc.

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< EcalDetId >::boundaryRecHits(), CaloRecoTauAlgorithm::buildCaloTau(), 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(), PFCTRecHitProducer::createHcalRecHit(), DistanceToCell::DistanceToCell(), TrackDetMatchInfo::dumpGeometry(), EcalHitMaker::EcalHitMaker(), InvRingCalib::EERingDef(), HCALRecHitAnalyzer::FillGeometry(), ECALRecHitAnalyzer::FillGeometry(), GlobalRecHitsAnalyzer::fillHCal(), GlobalRecHitsProducer::fillHCal(), EcalDeadCellBoundaryEnergyFilter::filter(), 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(), EcalHitMaker::getHits(), hgcal::RecHitTools::getPosition(), CaloGeometry::getPosition(), CaloDetIdAssociator::getPosition(), TrackDetMatchInfo::getPosition(), EcalClusterLocalContCorrection::getValue(), EcalBasicClusterLocalContCorrection::getValue(), EcalClusterCrackCorrection::getValue(), PFHBHERecHitCreator::importRecHits(), PFPSRecHitCreator::importRecHits(), PFEcalBarrelRecHitCreator::importRecHits(), PFHFRecHitCreator::importRecHits(), PFEcalEndcapRecHitCreator::importRecHits(), PFHBHERecHitCreatorMaxSample::importRecHits(), PhotonFixCMS::initialise(), CaloGeometryHelper::initialize(), EcalPreshowerGeometry::initializeParms(), CaloDetIdAssociator::insideElement(), HCaloDetIdAssociator::insideElement(), IslandClusterAlgo::makeClusters(), CosmicClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), HybridClusterAlgo::makeClusters(), HLTCaloObjInRegionsProducer< CaloObjType, CaloObjCollType >::makeFilteredColl(), PreshowerPhiClusterAlgo::makeOneCluster(), PreshowerClusterAlgo::makeOneCluster(), reco::makeSpecific(), EcalClusterToolsT< noZS >::meanClusterPosition(), DistanceToCell::operator()(), HLTRechitInRegionsProducer< T1 >::produce(), JetCrystalsAssociator::produce(), HLTRecHitInAllL1RegionsProducer< RecHitType >::produce(), EcalRecHitWorkerRecover::run(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), EcalGeomPhiSymHelper::setup(), CaloHitResponse::timeOfFlight(), EcalTimeMapDigitizer::timeOfFlight(), ECAL2DPositionCalcWithDepthCorr::update(), and ValidateGeometry::validateCaloGeometry().

47 {
48  return cellGeomPtr(CaloGenericDetId(id).denseIndex());
49 }
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 143 of file CaloSubdetectorGeometry.cc.

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

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

146  {
147  tVec.reserve( m_validIds.size()*numberOfTransformParms() ) ;
148  iVec.reserve( numberOfShapes()==1 ? 1 : m_validIds.size() ) ;
149  dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ;
150 
151  for(const auto & pv : parVecVec()) {
152  for(float iv : pv) {
153  dVec.emplace_back( iv ) ;
154  }
155  }
156 
157  for( uint32_t i ( 0 ) ; i != m_validIds.size() ; ++i ) {
158  Tr3D tr ;
159  std::shared_ptr<const CaloCellGeometry> ptr ( cellGeomPtr( i ) ) ;
160  assert( nullptr != ptr ) ;
161  ptr->getTransform( tr, ( Pt3DVec* ) nullptr ) ;
162 
163  if( Tr3D() == tr ) {// for preshower there is no rotation
164  const GlobalPoint& gp ( ptr->getPosition() ) ;
165  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ;
166  }
167 
168  const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ;
169  tVec.emplace_back( tt.x() ) ;
170  tVec.emplace_back( tt.y() ) ;
171  tVec.emplace_back( tt.z() ) ;
172  if( 6 == numberOfTransformParms() ) {
173  const CLHEP::HepRotation rr ( tr.getRotation() ) ;
174  const ROOT::Math::Transform3D rtr ( rr.xx(), rr.xy(), rr.xz(), tt.x(),
175  rr.yx(), rr.yy(), rr.yz(), tt.y(),
176  rr.zx(), rr.zy(), rr.zz(), tt.z() ) ;
178  rtr.GetRotation( ea ) ;
179  tVec.emplace_back( ea.Phi() ) ;
180  tVec.emplace_back( ea.Theta() ) ;
181  tVec.emplace_back( ea.Psi() ) ;
182  }
183 
184  const CCGFloat* par ( ptr->param() ) ;
185 
186  unsigned int ishape ( 9999 ) ;
187  for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv ) {
188  bool ok ( true ) ;
189  const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ;
190  for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k ) {
191  ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ;
192  }
193  if( ok ) {
194  ishape = ivv ;
195  break ;
196  }
197  }
198  assert( 9999 != ishape ) ;
199 
200  const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_validIds.size() ) ;
201  if( iVec.size() < nn ) iVec.emplace_back( ishape ) ;
202  }
203 }
virtual unsigned int numberOfParametersPerShape() const
CaloCellGeometry::Tr3D Tr3D
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
virtual unsigned int numberOfShapes() const
std::vector< DetId > m_validIds
def pv(vc)
Definition: MetAnalyzer.py:6
CaloCellGeometry::CCGFloat CCGFloat
int k[5][pyjets_maxn]
AlgebraicVector EulerAngles
Definition: Definitions.h:36
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
#define begin
Definition: vmac.h:32
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
virtual void CaloSubdetectorGeometry::initializeParms ( )
inlinevirtual

Reimplemented in HGCalGeometry, FastTimeGeometry, EcalEndcapGeometry, and EcalPreshowerGeometry.

Definition at line 108 of file CaloSubdetectorGeometry.h.

References cellGeomPtr(), getGeometryRawPtr(), indexFor(), reco::return(), and sizeForDenseIndex().

108 { return ; }
return(e1-e2)*(e1-e2)+dp *dp
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 92 of file CaloSubdetectorGeometry.h.

References m_parMgr.

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

Definition at line 95 of file CaloSubdetectorGeometry.h.

References m_parVecVec.

95 { 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 52 of file CaloSubdetectorGeometry.cc.

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

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

52  {
53  return std::find(m_validIds.begin(),m_validIds.end(),id)!=m_validIds.end();
54 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< DetId > m_validIds
unsigned int CaloSubdetectorGeometry::sizeForDenseIndex ( const DetId id) const
protectedvirtual

Member Data Documentation

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

Definition at line 138 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 137 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 118 of file CaloSubdetectorGeometry.h.

Referenced by parVecVec().

bool CaloSubdetectorGeometry::m_sortedIds
private

Definition at line 134 of file CaloSubdetectorGeometry.h.

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