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 | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
CaloSubdetectorGeometry Class Reference

#include <CaloSubdetectorGeometry.h>

Inheritance diagram for CaloSubdetectorGeometry:
CaloTowerGeometry CastorGeometry EcalBarrelGeometry EcalEndcapGeometry EcalPreshowerGeometry HcalDDDGeometry HcalGeometry ZdcGeometry

Public Types

typedef std::vector< const
CaloCellGeometry * > 
CellCont
 
typedef std::set< DetIdDetIdSet
 
typedef std::vector< double > DimVec
 
typedef std::vector< unsigned int > IVec
 
typedef CaloCellGeometry::ParMgr ParMgr
 
typedef CaloCellGeometry::ParVec ParVec
 
typedef CaloCellGeometry::ParVecVec ParVecVec
 
typedef std::vector< double > TrVec
 

Public Member Functions

void addCell (const DetId &id, CaloCellGeometry *ccg)
 Add a cell to the geometry. More...
 
void allocateCorners (CaloCellGeometry::CornersVec::size_type n)
 
void allocatePar (ParVec::size_type n, unsigned int m)
 
 CaloSubdetectorGeometry ()
 
const CellContcellGeometries () const
 the cells More...
 
CaloCellGeometry::CornersMgrcornersMgr ()
 
double deltaEta (const DetId &detId) const
 
double 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 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...
 

Static Protected Member Functions

static double 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

CellCont m_cellG
 
CaloCellGeometry::CornersMgrm_cmgr
 
std::vector< double > * m_deltaEta
 
std::vector< double > * m_deltaPhi
 
ParMgrm_parMgr
 
bool m_sortedIds
 
std::vector< DetIdm_validIds
 

Detailed Description

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

Date:
2009/08/25 21:10:52
Revision:
1.23
Author
J. Mans - Minnesota

Definition at line 21 of file CaloSubdetectorGeometry.h.

Member Typedef Documentation

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

Definition at line 25 of file CaloSubdetectorGeometry.h.

Definition at line 27 of file CaloSubdetectorGeometry.h.

typedef std::vector<double> CaloSubdetectorGeometry::DimVec

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.

typedef std::vector<double> CaloSubdetectorGeometry::TrVec

Definition at line 33 of file CaloSubdetectorGeometry.h.

Constructor & Destructor Documentation

CaloSubdetectorGeometry::CaloSubdetectorGeometry ( )

Definition at line 7 of file CaloSubdetectorGeometry.cc.

7  :
8  m_parMgr ( 0 ) ,
9  m_cmgr ( 0 ) ,
10  m_sortedIds (false) ,
11  m_deltaPhi ( 0 ) ,
12  m_deltaEta ( 0 )
13 {
14 }
CaloCellGeometry::CornersMgr * m_cmgr
std::vector< double > * m_deltaEta
std::vector< double > * m_deltaPhi
CaloSubdetectorGeometry::~CaloSubdetectorGeometry ( )
virtual

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

Definition at line 17 of file CaloSubdetectorGeometry.cc.

References i, m_cellG, m_cmgr, m_deltaEta, m_deltaPhi, and m_parMgr.

18 {
19  for( CellCont::iterator i ( m_cellG.begin() );
20  i!=m_cellG.end(); ++i )
21  {
22  delete *i ;
23  }
24 
25  delete m_cmgr ; // must delete *after* geometries!
26  delete m_parMgr ;
27  delete m_deltaPhi ;
28  delete m_deltaEta ;
29 }
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::CornersMgr * m_cmgr
std::vector< double > * m_deltaEta
std::vector< double > * m_deltaPhi
CaloSubdetectorGeometry::CaloSubdetectorGeometry ( const CaloSubdetectorGeometry )
private

avoid copies

Member Function Documentation

void CaloSubdetectorGeometry::addCell ( const DetId id,
CaloCellGeometry ccg 
)

Add a cell to the geometry.

Definition at line 32 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::denseIndex(), getHLTprescales::index, m_cellG, and m_validIds.

Referenced by CastorHardcodeGeometryLoader::fill(), ZdcHardcodeGeometryLoader::fill(), HcalHardcodeGeometryLoader::fill(), HcalDDDGeometryLoader::fill(), CaloTowerHardcodeGeometryLoader::load(), and EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry().

34 {
35  const CaloGenericDetId cdid ( id ) ;
36 /* if( cdid.validDetId() )
37  {
38 */
39  const uint32_t index ( cdid.denseIndex() ) ;
40 
41 /*
42  if( cdid.rawId() == CaloGenericDetId( cdid.det(),
43  cdid.subdetId(),
44  index ) ) // double check all is ok
45  {
46  if( index >= m_cellG.size() ) std::cout<<" Index ="<< index<< ", but len = "<<m_cellG.size() <<std::endl ;
47 */
48  m_cellG[ index ] = ccg ;
49  m_validIds.push_back( id ) ;
50 /* }
51  else
52  {
53  std::cout<<"Bad index in CaloSubdetectorGeometry.cc: "<< index
54  <<", id="<<cdid<< std::endl ;
55  }
56  }
57  else
58  {
59  std::cout<<"Bad id in CaloSubdetectorGeometry.cc: "<<cdid<<std::endl ;
60  }*/
61 }
std::vector< DetId > m_validIds
void CaloSubdetectorGeometry::allocateCorners ( CaloCellGeometry::CornersVec::size_type  n)
void CaloSubdetectorGeometry::allocatePar ( ParVec::size_type  n,
unsigned int  m 
)
const CellCont& CaloSubdetectorGeometry::cellGeometries ( ) const
inline
CaloCellGeometry::CornersMgr* CaloSubdetectorGeometry::cornersMgr ( )
inline
double CaloSubdetectorGeometry::deltaEta ( const DetId detId) const

Definition at line 299 of file CaloSubdetectorGeometry.cc.

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

300 {
301  const CaloGenericDetId cgId ( detId ) ;
302 
303  if( 0 == m_deltaEta )
304  {
305  const uint32_t kSize ( cgId.sizeForDenseIndexing() ) ;
306  m_deltaEta = new std::vector<double> ( kSize ) ;
307  for( uint32_t i ( 0 ) ; i != kSize ; ++i )
308  {
309  const CaloCellGeometry& cell ( *cellGeometries()[ i ] ) ;
310  const double dEta1 ( fabs(
311  GlobalPoint( ( cell.getCorners()[0].x() +
312  cell.getCorners()[1].x() )/2. ,
313  ( cell.getCorners()[0].y() +
314  cell.getCorners()[1].y() )/2. ,
315  ( cell.getCorners()[0].z() +
316  cell.getCorners()[1].z() )/2. ).eta() -
317  GlobalPoint( ( cell.getCorners()[2].x() +
318  cell.getCorners()[3].x() )/2. ,
319  ( cell.getCorners()[2].y() +
320  cell.getCorners()[3].y() )/2. ,
321  ( cell.getCorners()[2].z() +
322  cell.getCorners()[3].z() )/2. ).eta() ) ) ;
323  const double dEta2 ( fabs(
324  GlobalPoint( ( cell.getCorners()[0].x() +
325  cell.getCorners()[3].x() )/2. ,
326  ( cell.getCorners()[0].y() +
327  cell.getCorners()[3].y() )/2. ,
328  ( cell.getCorners()[0].z() +
329  cell.getCorners()[3].z() )/2. ).eta() -
330  GlobalPoint( ( cell.getCorners()[2].x() +
331  cell.getCorners()[1].x() )/2. ,
332  ( cell.getCorners()[2].y() +
333  cell.getCorners()[1].y() )/2. ,
334  ( cell.getCorners()[2].z() +
335  cell.getCorners()[1].z() )/2. ).eta() ) ) ;
336  (*m_deltaEta)[i] = dEta1>dEta2 ? dEta1 : dEta2 ;
337  }
338  }
339  return (*m_deltaEta)[ cgId.denseIndex() ] ;
340 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > * m_deltaEta
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const CellCont & cellGeometries() const
the cells
T eta() const
Definition: PV3DBase.h:70
double CaloSubdetectorGeometry::deltaPhi ( const DetId detId) const

Definition at line 253 of file CaloSubdetectorGeometry.cc.

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

254 {
255  const CaloGenericDetId cgId ( detId ) ;
256 
257  if( 0 == m_deltaPhi )
258  {
259  const uint32_t kSize ( cgId.sizeForDenseIndexing() ) ;
260  m_deltaPhi = new std::vector<double> ( kSize ) ;
261  for( uint32_t i ( 0 ) ; i != kSize ; ++i )
262  {
263  const CaloCellGeometry& cell ( *cellGeometries()[ i ] ) ;
264  double dPhi1 ( fabs(
265  GlobalPoint( ( cell.getCorners()[0].x() +
266  cell.getCorners()[1].x() )/2. ,
267  ( cell.getCorners()[0].y() +
268  cell.getCorners()[1].y() )/2. ,
269  ( cell.getCorners()[0].z() +
270  cell.getCorners()[1].z() )/2. ).phi() -
271  GlobalPoint( ( cell.getCorners()[2].x() +
272  cell.getCorners()[3].x() )/2. ,
273  ( cell.getCorners()[2].y() +
274  cell.getCorners()[3].y() )/2. ,
275  ( cell.getCorners()[2].z() +
276  cell.getCorners()[3].z() )/2. ).phi() ) ) ;
277  double dPhi2 ( fabs(
278  GlobalPoint( ( cell.getCorners()[0].x() +
279  cell.getCorners()[3].x() )/2. ,
280  ( cell.getCorners()[0].y() +
281  cell.getCorners()[3].y() )/2. ,
282  ( cell.getCorners()[0].z() +
283  cell.getCorners()[3].z() )/2. ).phi() -
284  GlobalPoint( ( cell.getCorners()[2].x() +
285  cell.getCorners()[1].x() )/2. ,
286  ( cell.getCorners()[2].y() +
287  cell.getCorners()[1].y() )/2. ,
288  ( cell.getCorners()[2].z() +
289  cell.getCorners()[1].z() )/2. ).phi() ) ) ;
290  if( M_PI < dPhi1 ) dPhi1 = fabs( dPhi1 - 2.*M_PI ) ;
291  if( M_PI < dPhi2 ) dPhi2 = fabs( dPhi2 - 2.*M_PI ) ;
292  (*m_deltaPhi)[i] = dPhi1>dPhi2 ? dPhi1 : dPhi2 ;
293  }
294  }
295  return (*m_deltaPhi)[ cgId.denseIndex() ] ;
296 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const CellCont & cellGeometries() const
the cells
#define M_PI
Definition: BFit3D.cc:3
std::vector< double > * m_deltaPhi
static double CaloSubdetectorGeometry::deltaR ( const GlobalPoint p1,
const GlobalPoint p2 
)
inlinestaticprotected

Definition at line 108 of file CaloSubdetectorGeometry.h.

References reco::deltaR().

110  { 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 96 of file CaloSubdetectorGeometry.h.

References mathSSE::return().

96 { 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 122 of file CaloSubdetectorGeometry.cc.

References begin, cellGeometries(), reco::deltaR2(), PV3DBase< T, PVType, FrameType >::eta(), eta(), i, m_cellG, M_PI, m_validIds, L1TEmulatorMonitor_cff::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().

124 {
125  const double dR2 ( dR*dR ) ;
126  const double eta ( r.eta() ) ;
127  const double phi ( r.phi() ) ;
128 
129  DetIdSet dss;
130 
131  CellCont::const_iterator cBeg ( cellGeometries().begin() ) ;
132  if( 0.000001 < dR )
133  {
134  for( CellCont::const_iterator i ( m_cellG.begin() );
135  i != m_cellG.end() ; ++i )
136  {
137  if( 0 != *i )
138  {
139  const GlobalPoint& p ( (*i)->getPosition() ) ;
140  const double eta0 ( p.eta() ) ;
141  if( fabs( eta - eta0 ) < dR )
142  {
143  const double phi0 ( p.phi() ) ;
144  double delp ( fabs( phi - phi0 ) ) ;
145  if( delp > M_PI ) delp = 2*M_PI - delp ;
146  if( delp < dR )
147  {
148  const double dist2 ( reco::deltaR2( eta0, phi0, eta, phi ) ) ;
149  const DetId tid ( m_validIds.front() ) ;
150  if( dist2 < dR2 ) dss.insert( CaloGenericDetId( tid.det(),
151  tid.subdetId(),
152  i - cBeg ) ) ;
153  }
154  }
155  }
156  }
157  }
158  return dss;
159 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
T eta() const
const CellCont & cellGeometries() const
the cells
std::vector< DetId > m_validIds
double deltaR2(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:13
Definition: DetId.h:20
#define M_PI
Definition: BFit3D.cc:3
T eta() const
Definition: PV3DBase.h:70
#define begin
Definition: vmac.h:31
Definition: DDAxes.h:10
DetId CaloSubdetectorGeometry::getClosestCell ( const GlobalPoint r) const
virtual

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

Definition at line 89 of file CaloSubdetectorGeometry.cc.

References begin, cellGeometries(), reco::deltaR2(), PV3DBase< T, PVType, FrameType >::eta(), eta(), i, getHLTprescales::index, m_cellG, m_validIds, L1TEmulatorMonitor_cff::p, phi, and PV3DBase< T, PVType, FrameType >::phi().

Referenced by HcalCorrPFCalculation::analyze(), ValidIsoTrkCalib::analyze(), IsolatedTracksCone::analyze(), HcalIsoTrkAnalyzer::analyze(), spr::chargeIsolation(), spr::chargeIsolationHcal(), spr::findDetIdCalo(), CaloGeometryHelper::getClosestCell(), EcalShowerProperties::getEndpoints(), HoECalculator::getHoE(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), EcalShowerProperties::processEcalRecHits(), and spr::propagateCALO().

90 {
91  const double eta ( r.eta() ) ;
92  const double phi ( r.phi() ) ;
93  uint32_t index ( ~0 ) ;
94  double closest ( 1e9 ) ;
95 
96  CellCont::const_iterator cBeg ( cellGeometries().begin() ) ;
97  for( CellCont::const_iterator i ( cBeg );
98  i != m_cellG.end() ; ++i )
99  {
100  if( 0 != *i )
101  {
102  const GlobalPoint& p ( (*i)->getPosition() ) ;
103  const double eta0 ( p.eta() ) ;
104  const double phi0 ( p.phi() ) ;
105  const double dR2 ( reco::deltaR2( eta0, phi0, eta, phi ) ) ;
106  if( dR2 < closest )
107  {
108  closest = dR2 ;
109  index = i - cBeg ;
110  }
111  }
112  }
113  const DetId tid ( m_validIds.front() ) ;
114  return ( closest > 0.9e9 ||
115  (uint32_t)(~0) == index ? DetId(0) :
116  CaloGenericDetId( tid.det(),
117  tid.subdetId(),
118  index ) ) ;
119 }
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
T eta() const
const CellCont & cellGeometries() const
the cells
std::vector< DetId > m_validIds
double deltaR2(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:13
Definition: DetId.h:20
T eta() const
Definition: PV3DBase.h:70
#define begin
Definition: vmac.h:31
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 76 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::denseIndex(), and m_cellG.

Referenced by BetaCalculatorECAL::addStepToXtal(), EcalTPGParamBuilder::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), CaloRecoTauAlgorithm::buildCaloTau(), CaloGeometryHelper::buildCrystalArray(), SuperClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_Covariances(), ClusterShapeAlgo::Calculate_EnergyDepTopology(), PositionCalc::Calculate_Location(), CaloCellCrossing::CaloCellCrossing(), compEcalEnergySum(), compHcalEnergySum(), CaloTowersCreationAlgo::convert(), EcalClusterTools::covariances(), PFRecHitProducerECAL::createEcalRecHit(), PFRecHitProducerHCAL::createHcalRecHit(), PFRecHitProducerPS::createRecHits(), DistanceToCell::DistanceToCell(), EcalHitMaker::EcalHitMaker(), InvRingCalib::EERingDef(), HCALRecHitAnalyzer::FillGeometry(), PFRecHitProducerECAL::findEcalRecHitGeometry(), HcalGeometry::getCells(), EcalEndcapGeometry::getCells(), EcalBarrelGeometry::getCells(), EcalEndcapGeometry::getClosestBarrelCells(), CaloGeometryHelper::getClosestCell(), ZdcGeometry::getClosestCell(), HcalGeometry::getClosestCell(), CastorGeometry::getClosestCell(), EcalEndcapGeometry::getClosestCell(), EcalBarrelGeometry::getClosestCell(), HCaloDetIdAssociator::getDetIdPoints(), CaloDetIdAssociator::getDetIdPoints(), L2TauModularIsolationProducer::getECALHits(), L2TauIsolationProducer::getECALHits(), L2TauNarrowConeIsolationProducer::getECALHits(), EcalShowerProperties::getEndpoints(), EcalClusterTools::getEnergyDepTopology(), CaloGeometry::getGeometry(), CaloGeometry::getPosition(), HCaloDetIdAssociator::getPosition(), CaloDetIdAssociator::getPosition(), EcalClusterLocalContCorrection::getValue(), EcalClusterCrackCorrection::getValue(), EcalBarrelRecHitsMaker::init(), EcalEndcapRecHitsMaker::init(), CaloGeometryHelper::initialize(), EcalRingCalibrationTools::initializeFromGeometry(), CaloDetIdAssociator::insideElement(), HCaloDetIdAssociator::insideElement(), IslandClusterAlgo::makeClusters(), CosmicClusterAlgo::makeClusters(), Multi5x5ClusterAlgo::makeClusters(), PreshowerClusterAlgo::makeOneCluster(), JetMaker::makeSpecific(), reco::makeSpecific(), EcalClusterTools::meanClusterPosition(), DistanceToCell::operator()(), PlotEcalRecHits::printEcalRecHits(), PlotSimTracks::printSimTracks(), EcalShowerProperties::processEcalRecHits(), CastorEventDisplay::processEvent(), EcalRecHitWorkerRecover::run(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), EcalGeomPhiSymHelper::setup(), CaloHitResponse::timeOfFlight(), and ValidateGeometry::validateCaloGeometry().

77 {
78  return m_cellG[ CaloGenericDetId( id ).denseIndex() ] ;
79 }
uint32_t denseIndex() const
void CaloSubdetectorGeometry::getSummary ( CaloSubdetectorGeometry::TrVec tVec,
CaloSubdetectorGeometry::IVec iVec,
CaloSubdetectorGeometry::DimVec dVec 
) const

Definition at line 183 of file CaloSubdetectorGeometry.cc.

References begin, EZArrayFL< T >::begin(), cellGeometries(), EZArrayFL< T >::end(), i, gen::k, numberOfParametersPerShape(), numberOfShapes(), numberOfTransformParms(), convertSQLiteXML::ok, Gflash::par, parVecVec(), and findQualityFiles::size.

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

186 {
187  tVec.reserve( cellGeometries().size()*numberOfTransformParms() ) ;
188  iVec.reserve( numberOfShapes()==1 ? 1 : cellGeometries().size() ) ;
189  dVec.reserve( numberOfShapes()*numberOfParametersPerShape() ) ;
190 
191  for( ParVecVec::const_iterator ivv ( parVecVec().begin() ) ; ivv != parVecVec().end() ; ++ivv )
192  {
193  const ParVec& pv ( *ivv ) ;
194  for( ParVec::const_iterator iv ( pv.begin() ) ; iv != pv.end() ; ++iv )
195  {
196  dVec.push_back( *iv ) ;
197  }
198  }
199 
200  for( CellCont::const_iterator i ( cellGeometries().begin() ) ;
201  i != cellGeometries().end() ; ++i )
202  {
203  HepGeom::Transform3D tr ( (*i)->getTransform( ( std::vector<HepGeom::Point3D<double> >* ) 0 ) ) ;
204 
205  if( HepGeom::Transform3D() == tr ) // for preshower there is no rotation
206  {
207  const GlobalPoint& gp ( (*i)->getPosition() ) ;
208  tr = HepGeom::Translate3D( gp.x(), gp.y(), gp.z() ) ;
209  }
210 
211  const CLHEP::Hep3Vector tt ( tr.getTranslation() ) ;
212  tVec.push_back( tt.x() ) ;
213  tVec.push_back( tt.y() ) ;
214  tVec.push_back( tt.z() ) ;
215  if( 6 == numberOfTransformParms() )
216  {
217  const CLHEP::HepRotation rr ( tr.getRotation() ) ;
218  const ROOT::Math::Transform3D rtr ( rr.xx(), rr.xy(), rr.xz(), tt.x(),
219  rr.yx(), rr.yy(), rr.yz(), tt.y(),
220  rr.zx(), rr.zy(), rr.zz(), tt.z() ) ;
222  rtr.GetRotation( ea ) ;
223  tVec.push_back( ea.Phi() ) ;
224  tVec.push_back( ea.Theta() ) ;
225  tVec.push_back( ea.Psi() ) ;
226  }
227 
228  const double* par ( (*i)->param() ) ;
229 
230  unsigned int ishape ( 9999 ) ;
231  for( unsigned int ivv ( 0 ) ; ivv != parVecVec().size() ; ++ivv )
232  {
233  bool ok ( true ) ;
234  const double* pv ( &(*parVecVec()[ivv].begin() ) ) ;
235  for( unsigned int k ( 0 ) ; k != numberOfParametersPerShape() ; ++k )
236  {
237  ok = ok && ( fabs( par[k] - pv[k] ) < 1.e-6 ) ;
238  }
239  if( ok )
240  {
241  ishape = ivv ;
242  break ;
243  }
244  }
245  assert( 9999 != ishape ) ;
246 
247  const unsigned int nn (( numberOfShapes()==1) ? (unsigned int)1 : cellGeometries().size() ) ;
248  if( iVec.size() < nn ) iVec.push_back( ishape ) ;
249  }
250 }
int i
Definition: DBlmapReader.cc:9
virtual unsigned int numberOfParametersPerShape() const
virtual unsigned int numberOfShapes() const
const CellCont & cellGeometries() const
the cells
CaloCellGeometry::ParVec ParVec
int k[5][pyjets_maxn]
AlgebraicVector EulerAngles
Definition: Definitions.h:36
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
#define begin
Definition: vmac.h:31
virtual unsigned int numberOfTransformParms() const
tuple size
Write out results.
const double par[8 *NPar][4]
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 CastorGeometry, HcalGeometry, ZdcGeometry, and HcalDDDGeometry.

Definition at line 64 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(), CaloCellCrossing::CaloCellCrossing(), HcalRecHitsMaker::createVectorOfSubdetectorCells(), EcalPreshowerRecHitsMaker::createVectorsOfCells(), PFRecHitProducerECAL::ecalNeighbArray(), HcalGeometry::fillDetIds(), HCALRecHitAnalyzer::FillGeometry(), HcalDDDGeometry::getValidDetIds(), ZdcGeometry::getValidDetIds(), HcalGeometry::getValidDetIds(), CastorGeometry::getValidDetIds(), EcalBarrelRecHitsMaker::init(), EcalEndcapRecHitsMaker::init(), EcalPreshowerGeometry::initializeParms(), EcalTPCondAnalyzer::printCRYSTAL(), CalorimetryManager::reconstruct(), EcalDigiProducer::updateGeometry(), and ValidateGeometry::validateCaloGeometry().

66 {
67  if( !m_sortedIds )
68  {
69  m_sortedIds = true ;
70  std::sort( m_validIds.begin(), m_validIds.end() ) ;
71  }
72  return m_validIds ;
73 }
std::vector< DetId > m_validIds
virtual void CaloSubdetectorGeometry::initializeParms ( )
inlinevirtual

Reimplemented in EcalEndcapGeometry, and EcalPreshowerGeometry.

Definition at line 102 of file CaloSubdetectorGeometry.h.

References mathSSE::return().

102 { return ; }
return((rh^lh)&mask)
virtual unsigned int CaloSubdetectorGeometry::numberOfParametersPerShape ( ) const
inlinevirtual

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

Definition at line 93 of file CaloSubdetectorGeometry.h.

Referenced by getSummary().

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

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

Definition at line 92 of file CaloSubdetectorGeometry.h.

Referenced by getSummary().

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

Reimplemented in EcalPreshowerGeometry, and CastorGeometry.

Definition at line 94 of file CaloSubdetectorGeometry.h.

Referenced by getSummary().

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

Definition at line 87 of file CaloSubdetectorGeometry.h.

References m_parMgr.

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

Definition at line 90 of file CaloSubdetectorGeometry.h.

References m_parVecVec.

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

is this detid present in the geometry?

Definition at line 82 of file CaloSubdetectorGeometry.cc.

References CaloGenericDetId::denseIndex(), and m_cellG.

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

83 {
84 // return m_cellG.find( id ) != m_cellG.end() ;
85  return 0 != m_cellG[ CaloGenericDetId( id ).denseIndex() ] ;
86 }
uint32_t denseIndex() const

Member Data Documentation

CellCont CaloSubdetectorGeometry::m_cellG
private
CaloCellGeometry::CornersMgr* CaloSubdetectorGeometry::m_cmgr
private
std::vector<double>* CaloSubdetectorGeometry::m_deltaEta
mutableprivate

Definition at line 129 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 128 of file CaloSubdetectorGeometry.h.

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

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

Definition at line 106 of file CaloSubdetectorGeometry.h.

Referenced by parVecVec().

bool CaloSubdetectorGeometry::m_sortedIds
mutableprivate

Definition at line 124 of file CaloSubdetectorGeometry.h.

Referenced by getValidDetIds().

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