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::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 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...
 
void getSummary (TrVec &trVector, IVec &iVector, DimVec &dimVector) 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

virtual const CaloCellGeometrycellGeomPtr (uint32_t index) const =0
 

Static Protected Member Functions

static CCGFloat deltaR (const GlobalPoint &p1, const GlobalPoint &p2)
 

Protected Attributes

ParVecVec m_parVecVec
 
std::vector< DetIdm_validIds
 

Private Member Functions

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

Private Attributes

CaloCellGeometry::CornersMgrm_cmgr
 
std::vector< CCGFloat > * m_deltaEta
 
std::vector< CCGFloat > * m_deltaPhi
 
ParMgrm_parMgr
 
bool m_sortedIds
 

Detailed Description

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

Date:
2011/06/04 18:58:48
Revision:
1.27
Author
J. Mans - Minnesota

Definition at line 21 of file CaloSubdetectorGeometry.h.

Member Typedef Documentation

Definition at line 25 of file CaloSubdetectorGeometry.h.

Definition at line 27 of file CaloSubdetectorGeometry.h.

Definition at line 35 of file CaloSubdetectorGeometry.h.

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

Definition at line 34 of file CaloSubdetectorGeometry.h.

Definition at line 29 of file CaloSubdetectorGeometry.h.

Definition at line 30 of file CaloSubdetectorGeometry.h.

Definition at line 31 of file CaloSubdetectorGeometry.h.

Definition at line 33 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_sortedIds (false) ,
17  m_deltaPhi ( 0 ) ,
18  m_deltaEta ( 0 )
19 {}
CaloCellGeometry::CornersMgr * m_cmgr
std::vector< CCGFloat > * m_deltaEta
std::vector< CCGFloat > * m_deltaPhi
CaloSubdetectorGeometry::~CaloSubdetectorGeometry ( )
virtual

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

Definition at line 22 of file CaloSubdetectorGeometry.cc.

References m_cmgr, m_deltaEta, m_deltaPhi, and m_parMgr.

23 {
24  delete m_cmgr ;
25  delete m_parMgr ;
26  delete m_deltaPhi ;
27  delete m_deltaEta ;
28 }
CaloCellGeometry::CornersMgr * m_cmgr
std::vector< CCGFloat > * m_deltaEta
std::vector< CCGFloat > * m_deltaPhi
CaloSubdetectorGeometry::CaloSubdetectorGeometry ( const CaloSubdetectorGeometry )
private

avoid copies

Member Function Documentation

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

References cellGeomPtr(), CaloGenericDetId::denseIndex(), PV3DBase< T, PVType, FrameType >::eta(), CaloCellGeometry::getCorners(), i, m_deltaEta, and CaloGenericDetId::sizeForDenseIndexing().

261 {
262  const CaloGenericDetId cgId ( detId ) ;
263 
264  if( 0 == m_deltaEta )
265  {
266  const uint32_t kSize ( cgId.sizeForDenseIndexing() ) ;
267  m_deltaEta = new std::vector<CCGFloat> ( kSize ) ;
268  for( uint32_t i ( 0 ) ; i != kSize ; ++i )
269  {
270  const CaloCellGeometry* cellPtr ( cellGeomPtr( i ) ) ;
271  if( 0 != cellPtr )
272  {
273  const CaloCellGeometry& cell ( *cellPtr ) ;
274  const CCGFloat dEta1 ( fabs(
275  GlobalPoint( ( cell.getCorners()[0].x() +
276  cell.getCorners()[1].x() )/2. ,
277  ( cell.getCorners()[0].y() +
278  cell.getCorners()[1].y() )/2. ,
279  ( cell.getCorners()[0].z() +
280  cell.getCorners()[1].z() )/2. ).eta() -
281  GlobalPoint( ( cell.getCorners()[2].x() +
282  cell.getCorners()[3].x() )/2. ,
283  ( cell.getCorners()[2].y() +
284  cell.getCorners()[3].y() )/2. ,
285  ( cell.getCorners()[2].z() +
286  cell.getCorners()[3].z() )/2. ).eta() ) ) ;
287  const CCGFloat dEta2 ( fabs(
288  GlobalPoint( ( cell.getCorners()[0].x() +
289  cell.getCorners()[3].x() )/2. ,
290  ( cell.getCorners()[0].y() +
291  cell.getCorners()[3].y() )/2. ,
292  ( cell.getCorners()[0].z() +
293  cell.getCorners()[3].z() )/2. ).eta() -
294  GlobalPoint( ( cell.getCorners()[2].x() +
295  cell.getCorners()[1].x() )/2. ,
296  ( cell.getCorners()[2].y() +
297  cell.getCorners()[1].y() )/2. ,
298  ( cell.getCorners()[2].z() +
299  cell.getCorners()[1].z() )/2. ).eta() ) ) ;
300  (*m_deltaEta)[i] = dEta1>dEta2 ? dEta1 : dEta2 ;
301  }
302  }
303  }
304  return (*m_deltaEta)[ cgId.denseIndex() ] ;
305 }
int i
Definition: DBlmapReader.cc:9
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< CCGFloat > * m_deltaEta
CaloCellGeometry::CCGFloat CCGFloat
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const =0
T eta() const
Definition: PV3DBase.h:75
CCGFloat CaloSubdetectorGeometry::deltaPhi ( const DetId detId) const

Definition at line 210 of file CaloSubdetectorGeometry.cc.

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

211 {
212  const CaloGenericDetId cgId ( detId ) ;
213 
214  if( 0 == m_deltaPhi )
215  {
216  const uint32_t kSize ( cgId.sizeForDenseIndexing() ) ;
217  m_deltaPhi = new std::vector<CCGFloat> ( kSize ) ;
218  for( uint32_t i ( 0 ) ; i != kSize ; ++i )
219  {
220  const CaloCellGeometry* cellPtr ( cellGeomPtr( i ) ) ;
221  if( 0 != cellPtr )
222  {
223  const CaloCellGeometry& cell ( *cellPtr ) ;
224  CCGFloat dPhi1 ( fabs(
225  GlobalPoint( ( cell.getCorners()[0].x() +
226  cell.getCorners()[1].x() )/2. ,
227  ( cell.getCorners()[0].y() +
228  cell.getCorners()[1].y() )/2. ,
229  ( cell.getCorners()[0].z() +
230  cell.getCorners()[1].z() )/2. ).phi() -
231  GlobalPoint( ( cell.getCorners()[2].x() +
232  cell.getCorners()[3].x() )/2. ,
233  ( cell.getCorners()[2].y() +
234  cell.getCorners()[3].y() )/2. ,
235  ( cell.getCorners()[2].z() +
236  cell.getCorners()[3].z() )/2. ).phi() ) ) ;
237  CCGFloat dPhi2 ( fabs(
238  GlobalPoint( ( cell.getCorners()[0].x() +
239  cell.getCorners()[3].x() )/2. ,
240  ( cell.getCorners()[0].y() +
241  cell.getCorners()[3].y() )/2. ,
242  ( cell.getCorners()[0].z() +
243  cell.getCorners()[3].z() )/2. ).phi() -
244  GlobalPoint( ( cell.getCorners()[2].x() +
245  cell.getCorners()[1].x() )/2. ,
246  ( cell.getCorners()[2].y() +
247  cell.getCorners()[1].y() )/2. ,
248  ( cell.getCorners()[2].z() +
249  cell.getCorners()[1].z() )/2. ).phi() ) ) ;
250  if( M_PI < dPhi1 ) dPhi1 = fabs( dPhi1 - 2.*M_PI ) ;
251  if( M_PI < dPhi2 ) dPhi2 = fabs( dPhi2 - 2.*M_PI ) ;
252  (*m_deltaPhi)[i] = dPhi1>dPhi2 ? dPhi1 : dPhi2 ;
253  }
254  }
255  }
256  return (*m_deltaPhi)[ cgId.denseIndex() ] ;
257 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CaloCellGeometry::CCGFloat CCGFloat
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const =0
#define M_PI
Definition: BFit3D.cc:3
std::vector< CCGFloat > * m_deltaPhi
static CCGFloat CaloSubdetectorGeometry::deltaR ( const GlobalPoint p1,
const GlobalPoint p2 
)
inlinestaticprotected

Definition at line 106 of file CaloSubdetectorGeometry.h.

References reco::deltaR().

108  { return reco::deltaR( p1, p2 ) ; }
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
virtual void CaloSubdetectorGeometry::fillDefaultNamedParameters ( ) const
inlinevirtual

Definition at line 92 of file CaloSubdetectorGeometry.h.

References hitfit::return.

92 { return ; }
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 84 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(), EgammaRecHitIsolation::getSum_(), CaloConeSelector::select(), and CaloDualConeSelector::select().

86 {
87  const double dR2 ( dR*dR ) ;
88  const double eta ( r.eta() ) ;
89  const double phi ( r.phi() ) ;
90 
91  DetIdSet dss;
92 
93  if( 0.000001 < dR )
94  {
95  for( uint32_t i ( 0 ); i != m_validIds.size() ; ++i )
96  {
97  const CaloCellGeometry* cell ( getGeometry( m_validIds[i] ) ) ;
98  if( 0 != cell )
99  {
100  const GlobalPoint& p ( cell->getPosition() ) ;
101  const CCGFloat eta0 ( p.eta() ) ;
102  if( fabs( eta - eta0 ) < dR )
103  {
104  const CCGFloat phi0 ( p.phi() ) ;
105  CCGFloat delp ( fabs( phi - phi0 ) ) ;
106  if( delp > M_PI ) delp = 2*M_PI - delp ;
107  if( delp < dR )
108  {
109  const CCGFloat dist2 ( reco::deltaR2( eta0, phi0, eta, phi ) ) ;
110  if( dist2 < dR2 ) dss.insert( m_validIds[i] ) ;
111  }
112  }
113  }
114  }
115  }
116  return dss;
117 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
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(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:13
#define M_PI
Definition: BFit3D.cc:3
T eta() const
Definition: PV3DBase.h:75
Definition: DDAxes.h:10
DetId CaloSubdetectorGeometry::getClosestCell ( const GlobalPoint r) const
virtual

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

Definition at line 55 of file CaloSubdetectorGeometry.cc.

References reco::deltaR2(), PV3DBase< T, PVType, FrameType >::eta(), eta(), getGeometry(), CaloCellGeometry::getPosition(), i, getHLTprescales::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(), EcalShowerProperties::getEndpoints(), HoECalculator::getHoE(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), EcalShowerProperties::processEcalRecHits(), and spr::propagateCALO().

56 {
57  const CCGFloat eta ( r.eta() ) ;
58  const CCGFloat phi ( r.phi() ) ;
59  uint32_t index ( ~0 ) ;
60  CCGFloat closest ( 1e9 ) ;
61 
62  for( uint32_t i ( 0 ); i != m_validIds.size() ; ++i )
63  {
64  const CaloCellGeometry* cell ( getGeometry( m_validIds[ i ] ) ) ;
65  if( 0 != cell )
66  {
67  const GlobalPoint& p ( cell->getPosition() ) ;
68  const CCGFloat eta0 ( p.eta() ) ;
69  const CCGFloat phi0 ( p.phi() ) ;
70  const CCGFloat dR2 ( reco::deltaR2( eta0, phi0, eta, phi ) ) ;
71  if( dR2 < closest )
72  {
73  closest = dR2 ;
74  index = i ;
75  }
76  }
77  }
78  return ( closest > 0.9e9 ||
79  (uint32_t)(~0) == index ? DetId(0) :
80  m_validIds[index] ) ;
81 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
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(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:13
Definition: DetId.h:20
T eta() const
Definition: PV3DBase.h:75
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.

Definition at line 43 of file CaloSubdetectorGeometry.cc.

References cellGeomPtr().

Referenced by BetaCalculatorECAL::addStepToXtal(), EcalTPGParamBuilder::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), ggPFClusters::BasicClusterPFCandLink(), EcalBoundaryInfoCalculator< EcalDetId >::boundaryRecHits(), CaloRecoTauAlgorithm::buildCaloTau(), CaloGeometryHelper::buildCrystalArray(), SuperClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_EnergyDepTopology(), PositionCalc::Calculate_Location(), CaloCellCrossing::CaloCellCrossing(), ggPFClusters::ClusterWidth(), compEcalEnergySum(), compHcalEnergySum(), CaloTowersCreationAlgo::convert(), EcalClusterTools::covariances(), PFRecHitProducerECAL::createEcalRecHit(), PFRecHitProducerHCAL::createHcalRecHit(), PFRecHitProducerHO::createHORecHit(), PFRecHitProducerPS::createRecHits(), DistanceToCell::DistanceToCell(), EcalHitMaker::EcalHitMaker(), InvRingCalib::EERingDef(), HCALRecHitAnalyzer::FillGeometry(), EcalDeadCellBoundaryEnergyFilter::filter(), PFRecHitProducerECAL::findEcalRecHitGeometry(), PFRecHitProducerHO::findHORecHitGeometry(), EcalBoundaryInfoCalculator< EcalDetId >::gapRecHits(), HcalGeometry::getCells(), EcalEndcapGeometry::getCells(), getCells(), EcalBarrelGeometry::getCells(), EcalDeadCellTriggerPrimitiveFilter::getChannelStatusMaps(), EcalDeadCellDeltaRFilter::getChannelStatusMaps(), EcalEndcapGeometry::getClosestBarrelCells(), CaloGeometryHelper::getClosestCell(), CastorGeometry::getClosestCell(), HcalGeometry::getClosestCell(), getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), EcalPreshowerGeometry::getClosestCellInPlane(), HCaloDetIdAssociator::getDetIdPoints(), CaloDetIdAssociator::getDetIdPoints(), L2TauModularIsolationProducer::getECALHits(), L2TauIsolationProducer::getECALHits(), L2TauNarrowConeIsolationProducer::getECALHits(), EcalShowerProperties::getEndpoints(), EcalClusterTools::getEnergyDepTopology(), CaloGeometry::getGeometry(), ggPFESClusters::getLinkDist(), CaloGeometry::getPosition(), HCaloDetIdAssociator::getPosition(), CaloDetIdAssociator::getPosition(), EcalClusterLocalContCorrection::getValue(), EcalBasicClusterLocalContCorrection::getValue(), EcalClusterCrackCorrection::getValue(), EcalEndcapRecHitsMaker::init(), EcalBarrelRecHitsMaker::init(), PhotonFixCMS::initialise(), CaloGeometryHelper::initialize(), EcalRingCalibrationTools::initializeFromGeometry(), EcalPreshowerGeometry::initializeParms(), CaloDetIdAssociator::insideElement(), HCaloDetIdAssociator::insideElement(), ggPFClusters::localCoordsEB(), ggPFClusters::localCoordsEE(), IslandClusterAlgo::makeClusters(), CosmicClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), PreshowerClusterAlgo::makeOneCluster(), JetMaker::makeSpecific(), reco::makeSpecific(), EcalClusterTools::meanClusterPosition(), DistanceToCell::operator()(), present(), PlotEcalRecHits::printEcalRecHits(), PlotSimTracks::printSimTracks(), EcalShowerProperties::processEcalRecHits(), CastorEventDisplay::processEvent(), EcalRecHitWorkerRecover::run(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), EcalGeomPhiSymHelper::setup(), ggPFPhotons::SuperClusterSize(), CaloHitResponse::timeOfFlight(), and ValidateGeometry::validateCaloGeometry().

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

Definition at line 138 of file CaloSubdetectorGeometry.cc.

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

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

141 {
142  tVec.reserve( m_validIds.size()*numberOfTransformParms() ) ;
143  iVec.reserve( numberOfShapes()==1 ? 1 : m_validIds.size() ) ;
144  dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ;
145 
146  for( ParVecVec::const_iterator ivv ( parVecVec().begin() ) ; ivv != parVecVec().end() ; ++ivv )
147  {
148  const ParVec& pv ( *ivv ) ;
149  for( ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv )
150  {
151  dVec.push_back( *iv ) ;
152  }
153  }
154 
155  for( uint32_t i ( 0 ) ; i != m_validIds.size() ; ++i )
156  {
157  Tr3D tr ;
158  const CaloCellGeometry* ptr ( cellGeomPtr( i ) ) ;
159  assert( 0 != ptr ) ;
160  ptr->getTransform( tr, ( Pt3DVec* ) 0 ) ;
161 
162  if( Tr3D() == tr ) // for preshower there is no rotation
163  {
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.push_back( tt.x() ) ;
170  tVec.push_back( tt.y() ) ;
171  tVec.push_back( tt.z() ) ;
172  if( 6 == numberOfTransformParms() )
173  {
174  const CLHEP::HepRotation rr ( tr.getRotation() ) ;
175  const ROOT::Math::Transform3D rtr ( rr.xx(), rr.xy(), rr.xz(), tt.x(),
176  rr.yx(), rr.yy(), rr.yz(), tt.y(),
177  rr.zx(), rr.zy(), rr.zz(), tt.z() ) ;
179  rtr.GetRotation( ea ) ;
180  tVec.push_back( ea.Phi() ) ;
181  tVec.push_back( ea.Theta() ) ;
182  tVec.push_back( ea.Psi() ) ;
183  }
184 
185  const CCGFloat* par ( ptr->param() ) ;
186 
187  unsigned int ishape ( 9999 ) ;
188  for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv )
189  {
190  bool ok ( true ) ;
191  const CCGFloat* pv ( &(*parVecVec()[ivv].begin() ) ) ;
192  for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k )
193  {
194  ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ;
195  }
196  if( ok )
197  {
198  ishape = ivv ;
199  break ;
200  }
201  }
202  assert( 9999 != ishape ) ;
203 
204  const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : m_validIds.size() ) ;
205  if( iVec.size() < nn ) iVec.push_back( ishape ) ;
206  }
207 }
int i
Definition: DBlmapReader.cc:9
virtual unsigned int numberOfParametersPerShape() const
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
int k[5][pyjets_maxn]
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:31
virtual unsigned int numberOfTransformParms() const
const std::vector< DetId > & CaloSubdetectorGeometry::getValidDetIds ( DetId::Detector  det = DetId::Detector(0),
int  subdet = 0 
) const
virtual

Get a list of valid detector ids (for the given subdetector)

Note
The implementation in this class is relevant for SubdetectorGeometries which handle only a single subdetector at a time. It does not look at the det and subdet arguments.

Reimplemented in HcalGeometry, and HcalDDDGeometry.

Definition at line 31 of file CaloSubdetectorGeometry.cc.

References m_sortedIds, m_validIds, python.multivaluedict::sort(), and funct::true.

Referenced by testEcalTPGScale::analyze(), EcalTPGParamBuilder::analyze(), CaloGeometryHelper::buildCrystalArray(), CaloGeometryHelper::buildNeighbourArray(), PositionCalc::Calculate_Location(), CaloCellCrossing::CaloCellCrossing(), HcalRecHitsMaker::createVectorOfSubdetectorCells(), EcalPreshowerRecHitsMaker::createVectorsOfCells(), PFRecHitProducerECAL::ecalNeighbArray(), HcalGeometry::fillDetIds(), HCALRecHitAnalyzer::FillGeometry(), CastorGeometry::getClosestCell(), HcalDDDGeometry::getValidDetIds(), HcalGeometry::getValidDetIds(), PFRecHitProducerHO::hoNeighbArray(), EcalEndcapRecHitsMaker::init(), EcalBarrelRecHitsMaker::init(), EcalPreshowerGeometry::initializeParms(), EcalTPCondAnalyzer::printCRYSTAL(), CalorimetryManager::reconstruct(), EcalDigiProducer::updateGeometry(), and ValidateGeometry::validateCaloGeometry().

33 {
34  if( !m_sortedIds )
35  {
36  m_sortedIds = true ;
37  std::sort( m_validIds.begin(), m_validIds.end() ) ;
38  }
39  return m_validIds ;
40 }
std::vector< DetId > m_validIds
virtual void CaloSubdetectorGeometry::initializeParms ( )
inlinevirtual

Reimplemented in EcalEndcapGeometry, and EcalPreshowerGeometry.

Definition at line 98 of file CaloSubdetectorGeometry.h.

References hitfit::return.

98 { return ; }
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, CaloTowerGeometry, CastorGeometry, HcalGeometry, and ZdcGeometry.

Definition at line 89 of file CaloSubdetectorGeometry.h.

Referenced by getSummary().

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

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

Definition at line 88 of file CaloSubdetectorGeometry.h.

Referenced by getSummary().

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

Reimplemented in EcalPreshowerGeometry, and CastorGeometry.

Definition at line 90 of file CaloSubdetectorGeometry.h.

Referenced by getSummary().

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

Definition at line 83 of file CaloSubdetectorGeometry.h.

References m_parMgr.

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

Definition at line 86 of file CaloSubdetectorGeometry.h.

References m_parVecVec.

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

is this detid present in the geometry?

Definition at line 49 of file CaloSubdetectorGeometry.cc.

References getGeometry().

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

50 {
51  return ( 0 != getGeometry( id ) ) ;
52 }
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.

Member Data Documentation

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

Definition at line 125 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 124 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 104 of file CaloSubdetectorGeometry.h.

Referenced by parVecVec().

bool CaloSubdetectorGeometry::m_sortedIds
mutableprivate

Definition at line 122 of file CaloSubdetectorGeometry.h.

Referenced by getValidDetIds().

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