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< CaloCellGeometry const * > 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 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 const CaloCellGeometrycellGeomPtr (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 24 of file CaloSubdetectorGeometry.h.

Member Typedef Documentation

Definition at line 28 of file CaloSubdetectorGeometry.h.

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

Definition at line 27 of file CaloSubdetectorGeometry.h.

Definition at line 30 of file CaloSubdetectorGeometry.h.

Definition at line 39 of file CaloSubdetectorGeometry.h.

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

Definition at line 38 of file CaloSubdetectorGeometry.h.

Definition at line 33 of file CaloSubdetectorGeometry.h.

Definition at line 34 of file CaloSubdetectorGeometry.h.

Definition at line 35 of file CaloSubdetectorGeometry.h.

Definition at line 37 of file CaloSubdetectorGeometry.h.

Constructor & Destructor Documentation

CaloSubdetectorGeometry::CaloSubdetectorGeometry ( )

Definition at line 13 of file CaloSubdetectorGeometry.cc.

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

References m_cmgr, m_deltaEta, m_deltaPhi, and m_parMgr.

22 {
23  delete m_cmgr ;
24  delete m_parMgr ;
25  if (m_deltaPhi) delete m_deltaPhi.load() ;
26  if (m_deltaEta) delete m_deltaEta.load() ;
27 }
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 
)
virtual const CaloCellGeometry* CaloSubdetectorGeometry::cellGeomPtr ( uint32_t  index) const
protectedpure virtual
CaloCellGeometry::CornersMgr* CaloSubdetectorGeometry::cornersMgr ( )
inline
CCGFloat CaloSubdetectorGeometry::deltaEta ( const DetId detId) const

Definition at line 273 of file CaloSubdetectorGeometry.cc.

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

274 {
275 
276  if(!m_deltaEta.load(std::memory_order_acquire))
277  {
278  const uint32_t kSize ( sizeForDenseIndex(detId));
279  auto ptr = new std::vector<CCGFloat> ( kSize ) ;
280  for( uint32_t i ( 0 ) ; i != kSize ; ++i )
281  {
282  const CaloCellGeometry* cellPtr ( cellGeomPtr( i ) ) ;
283  if( nullptr != cellPtr )
284  {
285  const CaloCellGeometry& cell ( *cellPtr ) ;
286  const CCGFloat dEta1 ( fabs(
287  GlobalPoint( ( cell.getCorners()[0].x() +
288  cell.getCorners()[1].x() )/2. ,
289  ( cell.getCorners()[0].y() +
290  cell.getCorners()[1].y() )/2. ,
291  ( cell.getCorners()[0].z() +
292  cell.getCorners()[1].z() )/2. ).eta() -
293  GlobalPoint( ( cell.getCorners()[2].x() +
294  cell.getCorners()[3].x() )/2. ,
295  ( cell.getCorners()[2].y() +
296  cell.getCorners()[3].y() )/2. ,
297  ( cell.getCorners()[2].z() +
298  cell.getCorners()[3].z() )/2. ).eta() ) ) ;
299  const CCGFloat dEta2 ( fabs(
300  GlobalPoint( ( cell.getCorners()[0].x() +
301  cell.getCorners()[3].x() )/2. ,
302  ( cell.getCorners()[0].y() +
303  cell.getCorners()[3].y() )/2. ,
304  ( cell.getCorners()[0].z() +
305  cell.getCorners()[3].z() )/2. ).eta() -
306  GlobalPoint( ( cell.getCorners()[2].x() +
307  cell.getCorners()[1].x() )/2. ,
308  ( cell.getCorners()[2].y() +
309  cell.getCorners()[1].y() )/2. ,
310  ( cell.getCorners()[2].z() +
311  cell.getCorners()[1].z() )/2. ).eta() ) ) ;
312  (*ptr)[i] = dEta1>dEta2 ? dEta1 : dEta2 ;
313  }
314  }
315  std::vector<CCGFloat>* expect = nullptr;
316  bool exchanged = m_deltaEta.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
317  if (!exchanged) delete ptr;
318  }
319  return (*m_deltaEta.load(std::memory_order_acquire))[ indexFor(detId)];
320 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CaloCellGeometry::CCGFloat CCGFloat
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const =0
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 220 of file CaloSubdetectorGeometry.cc.

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

221 {
222  const CaloGenericDetId cgId ( detId ) ;
223 
224  if(!m_deltaPhi.load(std::memory_order_acquire))
225  {
226  const uint32_t kSize ( sizeForDenseIndex(detId));
227  auto ptr = new std::vector<CCGFloat>(kSize);
228  for( uint32_t i ( 0 ) ; i != kSize ; ++i )
229  {
230  const CaloCellGeometry* cellPtr ( cellGeomPtr( i ) ) ;
231  if( nullptr != cellPtr )
232  {
233  const CaloCellGeometry& cell ( *cellPtr ) ;
234  CCGFloat dPhi1 ( fabs(
235  GlobalPoint( ( cell.getCorners()[0].x() +
236  cell.getCorners()[1].x() )/2. ,
237  ( cell.getCorners()[0].y() +
238  cell.getCorners()[1].y() )/2. ,
239  ( cell.getCorners()[0].z() +
240  cell.getCorners()[1].z() )/2. ).phi() -
241  GlobalPoint( ( cell.getCorners()[2].x() +
242  cell.getCorners()[3].x() )/2. ,
243  ( cell.getCorners()[2].y() +
244  cell.getCorners()[3].y() )/2. ,
245  ( cell.getCorners()[2].z() +
246  cell.getCorners()[3].z() )/2. ).phi() ) ) ;
247  CCGFloat dPhi2 ( fabs(
248  GlobalPoint( ( cell.getCorners()[0].x() +
249  cell.getCorners()[3].x() )/2. ,
250  ( cell.getCorners()[0].y() +
251  cell.getCorners()[3].y() )/2. ,
252  ( cell.getCorners()[0].z() +
253  cell.getCorners()[3].z() )/2. ).phi() -
254  GlobalPoint( ( cell.getCorners()[2].x() +
255  cell.getCorners()[1].x() )/2. ,
256  ( cell.getCorners()[2].y() +
257  cell.getCorners()[1].y() )/2. ,
258  ( cell.getCorners()[2].z() +
259  cell.getCorners()[1].z() )/2. ).phi() ) ) ;
260  if( M_PI < dPhi1 ) dPhi1 = fabs( dPhi1 - 2.*M_PI ) ;
261  if( M_PI < dPhi2 ) dPhi2 = fabs( dPhi2 - 2.*M_PI ) ;
262  (*ptr)[i] = dPhi1>dPhi2 ? dPhi1 : dPhi2 ;
263  }
264  }
265  std::vector<CCGFloat>* expect = nullptr;
266  bool exchanged = m_deltaPhi.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
267  if (!exchanged) delete ptr;
268  }
269  return (*m_deltaPhi.load(std::memory_order_acquire))[ indexFor(detId) ] ;
270 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::atomic< std::vector< CCGFloat > * > m_deltaPhi
CaloCellGeometry::CCGFloat CCGFloat
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const =0
#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 118 of file CaloSubdetectorGeometry.h.

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

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

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

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

Definition at line 85 of file CaloSubdetectorGeometry.cc.

References reco::deltaR2(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), getGeometry(), CaloCellGeometry::getPosition(), 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().

87 {
88  const double dR2 ( dR*dR ) ;
89  const double eta ( r.eta() ) ;
90  const double phi ( r.phi() ) ;
91 
92  DetIdSet dss;
93 
94  if( 0.000001 < dR )
95  {
96  for( uint32_t i ( 0 ); i != m_validIds.size() ; ++i )
97  {
98  const CaloCellGeometry* cell ( getGeometry( m_validIds[i] ) ) ;
99  if( nullptr != cell )
100  {
101  const GlobalPoint& p ( cell->getPosition() ) ;
102  const CCGFloat eta0 ( p.eta() ) ;
103  if( fabs( eta - eta0 ) < dR )
104  {
105  const CCGFloat phi0 ( p.phi() ) ;
106  CCGFloat delp ( fabs( phi - phi0 ) ) ;
107  if( delp > M_PI ) delp = 2*M_PI - delp ;
108  if( delp < dR )
109  {
110  const CCGFloat dist2 ( reco::deltaR2( eta0, phi0, eta, phi ) ) ;
111  if( dist2 < dR2 ) dss.insert( m_validIds[i] ) ;
112  }
113  }
114  }
115  }
116  }
117  return dss;
118 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
std::vector< DetId > m_validIds
CaloCellGeometry::CCGFloat CCGFloat
#define M_PI
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 121 of file CaloSubdetectorGeometry.cc.

References getCells(), and getGeometry().

121  {
122  // stupid implementation not to be really used...
123  DetIdSet ids = getCells(r, dR);
124  CellSet cells; cells.reserve(ids.size());
125  for ( auto id : ids) cells.emplace_back(getGeometry(id));
126  return cells;
127 }
std::vector< CaloCellGeometry const * > CellSet
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
DetId CaloSubdetectorGeometry::getClosestCell ( const GlobalPoint r) const
virtual

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

Definition at line 56 of file CaloSubdetectorGeometry.cc.

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

Referenced by IsolatedTracksCone::analyze(), spr::chargeIsolation(), spr::chargeIsolationHcal(), AlCaHOCalibProducer::fillHOStore(), spr::findDetIdCalo(), CaloGeometryHelper::getClosestCell(), HoECalculator::getHoE(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), spr::propagateCALO(), spr::propagateCosmicCALO(), and spr::propagateHCALBack().

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  {
65  const CaloCellGeometry* cell ( getGeometry( m_validIds[ i ] ) ) ;
66  if( nullptr != cell )
67  {
68  const GlobalPoint& p ( cell->getPosition() ) ;
69  const CCGFloat eta0 ( p.eta() ) ;
70  const CCGFloat phi0 ( p.phi() ) ;
71  const CCGFloat dR2 ( reco::deltaR2( eta0, phi0, eta, phi ) ) ;
72  if( dR2 < closest )
73  {
74  closest = dR2 ;
75  index = i ;
76  }
77  }
78  }
79  return ( closest > 0.9e9 ||
80  (uint32_t)(~0) == index ? DetId(0) :
81  m_validIds[index] ) ;
82 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
std::vector< DetId > m_validIds
CaloCellGeometry::CCGFloat CCGFloat
Definition: DetId.h:18
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
T eta() const
Definition: PV3DBase.h:76
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 HcalGeometry, CaloTowerGeometry, FastTimeGeometry, and HGCalGeometry.

Definition at line 44 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(), 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(), EcalEndcapGeometry::getClosestCell(), 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(), CalorimetryManager::HDShowerSimulation(), 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(), HLTCaloObjInRegionsProducer< CaloObjType, CaloObjCollType >::makeFilteredColl(), PreshowerPhiClusterAlgo::makeOneCluster(), PreshowerClusterAlgo::makeOneCluster(), reco::makeSpecific(), EcalClusterToolsT< noZS >::meanClusterPosition(), DistanceToCell::operator()(), present(), JetCrystalsAssociator::produce(), HLTRecHitInAllL1RegionsProducer< RecHitType >::produce(), CalorimetryManager::reconstructHCAL(), EcalRecHitWorkerRecover::run(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), EcalGeomPhiSymHelper::setup(), CaloHitResponse::timeOfFlight(), EcalTimeMapDigitizer::timeOfFlight(), ECAL2DPositionCalcWithDepthCorr::update(), and ValidateGeometry::validateCaloGeometry().

45 {
46  return cellGeomPtr( CaloGenericDetId( id ).denseIndex() ) ;
47 }
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const =0
void CaloSubdetectorGeometry::getSummary ( CaloSubdetectorGeometry::TrVec tVec,
CaloSubdetectorGeometry::IVec iVec,
CaloSubdetectorGeometry::DimVec dVec,
CaloSubdetectorGeometry::IVec dinsVector 
) const
virtual

Reimplemented in HcalGeometry, CaloTowerGeometry, FastTimeGeometry, and HGCalGeometry.

Definition at line 148 of file CaloSubdetectorGeometry.cc.

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

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

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

Definition at line 107 of file CaloSubdetectorGeometry.h.

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

107 { 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 91 of file CaloSubdetectorGeometry.h.

References m_parMgr.

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

Definition at line 94 of file CaloSubdetectorGeometry.h.

References m_parVecVec.

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

is this detid present in the geometry?

Reimplemented in EcalPreshowerGeometry.

Definition at line 50 of file CaloSubdetectorGeometry.cc.

References getGeometry().

Referenced by spr::extraIds(), EcalBarrelGeometry::getClosestCell(), and CaloGeometry::present().

51 {
52  return ( nullptr != getGeometry( id ) ) ;
53 }
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
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 136 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 135 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 116 of file CaloSubdetectorGeometry.h.

Referenced by parVecVec().

bool CaloSubdetectorGeometry::m_sortedIds
private

Definition at line 132 of file CaloSubdetectorGeometry.h.

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