CMS 3D CMS Logo

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

#include <CaloSubdetectorGeometry.h>

Inheritance diagram for CaloSubdetectorGeometry:
CaloTowerGeometry CastorGeometry EcalBarrelGeometry EcalEndcapGeometry EcalPreshowerGeometry EcalTBHodoscopeGeometry HcalDDDGeometry HcalGeometry 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 ()
 
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
 
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
 

Private Member Functions

 CaloSubdetectorGeometry (const CaloSubdetectorGeometry &)
 avoid copies More...
 
CaloSubdetectorGeometryoperator= (const CaloSubdetectorGeometry &)
 

Private Attributes

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

Detailed Description

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

Revision:
1.32
Author
J. Mans - Minnesota

Definition at line 26 of file CaloSubdetectorGeometry.h.

Member Typedef Documentation

Definition at line 30 of file CaloSubdetectorGeometry.h.

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

Definition at line 29 of file CaloSubdetectorGeometry.h.

Definition at line 32 of file CaloSubdetectorGeometry.h.

Definition at line 41 of file CaloSubdetectorGeometry.h.

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

Definition at line 40 of file CaloSubdetectorGeometry.h.

Definition at line 35 of file CaloSubdetectorGeometry.h.

Definition at line 36 of file CaloSubdetectorGeometry.h.

Definition at line 37 of file CaloSubdetectorGeometry.h.

Definition at line 39 of file CaloSubdetectorGeometry.h.

Constructor & Destructor Documentation

CaloSubdetectorGeometry::CaloSubdetectorGeometry ( )

Definition at line 13 of file CaloSubdetectorGeometry.cc.

13  :
14  m_parMgr ( 0 ) ,
15  m_cmgr ( 0 ) ,
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 )
private

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

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

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

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

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

References reco::deltaR().

119  { return reco::deltaR( p1, p2 ) ; }
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
virtual void CaloSubdetectorGeometry::fillDefaultNamedParameters ( ) const
inlinevirtual

Definition at line 99 of file CaloSubdetectorGeometry.h.

References mathSSE::return().

99 { return ; }
return((rh^lh)&mask)
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 EcalBarrelGeometry, EcalEndcapGeometry, and HcalGeometry.

Definition at line 85 of file CaloSubdetectorGeometry.cc.

References reco::deltaR2(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, PV3DBase< T, PVType, FrameType >::eta(), eta(), getGeometry(), CaloCellGeometry::getPosition(), 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( 0 != 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 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
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
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
#define M_PI
T eta() const
Definition: PV3DBase.h:76
Definition: DDAxes.h:10
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.push_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 EcalBarrelGeometry, EcalEndcapGeometry, EcalPreshowerGeometry, CastorGeometry, HcalGeometry, and HcalDDDGeometry.

Definition at line 56 of file CaloSubdetectorGeometry.cc.

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

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

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( 0 != 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 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
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
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
Definition: DetId.h:18
T eta() const
Definition: PV3DBase.h:76
Definition: DDAxes.h:10
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.

Definition at line 44 of file CaloSubdetectorGeometry.cc.

References cellGeomPtr().

Referenced by PreshowerHitMaker::addHit(), BetaCalculatorECAL::addStepToXtal(), EcalTPGParamBuilder::analyze(), DiJetAnalyzer::analyze(), GammaJetAnalysis::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), 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(), EcalClusterToolsT< noZS >::covariances(), PFCTRecHitProducer::createHcalRecHit(), DistanceToCell::DistanceToCell(), EcalHitMaker::EcalHitMaker(), InvRingCalib::EERingDef(), MuonCaloDistanceProducer::fillDistanceMap(), HCALRecHitAnalyzer::FillGeometry(), EcalDeadCellBoundaryEnergyFilter::filter(), EcalBoundaryInfoCalculator< EcalDetId >::gapRecHits(), getCells(), getCellSet(), EcalDeadCellTriggerPrimitiveFilter::getChannelStatusMaps(), EcalDeadCellDeltaRFilter::getChannelStatusMaps(), EcalEndcapGeometry::getClosestBarrelCells(), CaloGeometryHelper::getClosestCell(), CastorGeometry::getClosestCell(), getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), EcalPreshowerGeometry::getClosestCellInPlane(), HCaloDetIdAssociator::getDetIdPoints(), CaloDetIdAssociator::getDetIdPoints(), L2TauModularIsolationProducer::getECALHits(), L2TauIsolationProducer::getECALHits(), L2TauNarrowConeIsolationProducer::getECALHits(), EcalClusterToolsT< noZS >::getEnergyDepTopology(), CaloGeometry::getGeometry(), EcalHitMaker::getHits(), CaloGeometry::getPosition(), HCaloDetIdAssociator::getPosition(), CaloDetIdAssociator::getPosition(), EcalClusterLocalContCorrection::getValue(), EcalBasicClusterLocalContCorrection::getValue(), EcalClusterCrackCorrection::getValue(), CalorimetryManager::HDShowerSimulation(), PFHBHERecHitCreator::importRecHits(), PFPSRecHitCreator::importRecHits(), PFHFRecHitCreator::importRecHits(), PFHBHERecHitCreatorMaxSample::importRecHits(), EcalBarrelRecHitsMaker::init(), EcalEndcapRecHitsMaker::init(), PhotonFixCMS::initialise(), CaloGeometryHelper::initialize(), EcalRingCalibrationTools::initializeFromGeometry(), EcalPreshowerGeometry::initializeParms(), CaloDetIdAssociator::insideElement(), HCaloDetIdAssociator::insideElement(), IslandClusterAlgo::makeClusters(), CosmicClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), PreshowerPhiClusterAlgo::makeOneCluster(), PreshowerClusterAlgo::makeOneCluster(), reco::makeSpecific(), EcalClusterToolsT< noZS >::meanClusterPosition(), DistanceToCell::operator()(), present(), HcalHitRelabeller::process(), HLTRecHitInAllL1RegionsProducer< RecHitType >::produce(), CalorimetryManager::reconstructHCAL(), EcalRecHitWorkerRecover::run(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), EcalGeomPhiSymHelper::setup(), CaloHitResponse::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.

Definition at line 148 of file CaloSubdetectorGeometry.cc.

References assert(), begin, EZArrayFL< T >::begin(), cellGeomPtr(), EZArrayFL< T >::end(), CaloCellGeometry::getPosition(), CaloCellGeometry::getTransform(), i, relval_steps::k, m_validIds, numberOfParametersPerShape(), numberOfShapes(), numberOfTransformParms(), convertSQLiteXML::ok, CaloCellGeometry::param(), parVecVec(), MetAnalyzer::pv(), findQualityFiles::rr, and groupFilesInBlocks::tt.

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

Reimplemented in HcalGeometry.

Definition at line 324 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::denseIndex().

Referenced by deltaEta(), and deltaPhi().

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

Reimplemented in EcalEndcapGeometry, and EcalPreshowerGeometry.

Definition at line 106 of file CaloSubdetectorGeometry.h.

References mathSSE::return().

106 { return ; }
return((rh^lh)&mask)
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

Reimplemented in EcalEndcapGeometry, EcalBarrelGeometry, EcalPreshowerGeometry, CastorGeometry, CaloTowerGeometry, HcalGeometry, and ZdcGeometry.

Definition at line 96 of file CaloSubdetectorGeometry.h.

Referenced by getSummary().

96 { return 1 ; }
virtual unsigned int CaloSubdetectorGeometry::numberOfShapes ( ) const
inlinevirtual
virtual unsigned int CaloSubdetectorGeometry::numberOfTransformParms ( ) const
inlinevirtual

Reimplemented in EcalPreshowerGeometry, and CastorGeometry.

Definition at line 97 of file CaloSubdetectorGeometry.h.

Referenced by getSummary(), and HcalGeometry::getSummary().

97 { return 6 ; }
CaloSubdetectorGeometry& CaloSubdetectorGeometry::operator= ( const CaloSubdetectorGeometry )
private
ParMgr* CaloSubdetectorGeometry::parMgr ( )
inline
const ParMgr* CaloSubdetectorGeometry::parMgrConst ( ) const
inline

Definition at line 90 of file CaloSubdetectorGeometry.h.

References m_parMgr.

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

Definition at line 93 of file CaloSubdetectorGeometry.h.

References m_parVecVec.

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

is this detid present in the geometry?

Definition at line 50 of file CaloSubdetectorGeometry.cc.

References getGeometry().

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

51 {
52  return ( 0 != 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

Reimplemented in HcalGeometry.

Definition at line 326 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::sizeForDenseIndexing().

Referenced by deltaEta(), and deltaPhi().

326 { return CaloGenericDetId(id).sizeForDenseIndexing(); }
uint32_t sizeForDenseIndexing() const

Member Data Documentation

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

Definition at line 137 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 136 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 115 of file CaloSubdetectorGeometry.h.

Referenced by parVecVec().

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