Go to the documentation of this file.00001 #ifndef GEOMETRY_CALOGEOMETRY_CALOSUBDETECTORGEOMETRY_H
00002 #define GEOMETRY_CALOGEOMETRY_CALOSUBDETECTORGEOMETRY_H 1
00003
00004 #include <vector>
00005 #include <set>
00006 #include "DataFormats/DetId/interface/DetId.h"
00007 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00008 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00009 #include "DataFormats/Math/interface/deltaR.h"
00010
00011 #include "FWCore/Utilities/interface/GCC11Compatibility.h"
00012
00013
00024 class CaloSubdetectorGeometry {
00025
00026 public:
00027 typedef std::vector<CaloCellGeometry const *> CellSet;
00028 typedef CaloCellGeometry::CCGFloat CCGFloat ;
00029
00030 typedef std::set<DetId> DetIdSet;
00031
00032
00033 typedef CaloCellGeometry::ParMgr ParMgr ;
00034 typedef CaloCellGeometry::ParVec ParVec ;
00035 typedef CaloCellGeometry::ParVecVec ParVecVec ;
00036
00037 typedef std::vector<CCGFloat> TrVec ;
00038 typedef std::vector<unsigned int> IVec ;
00039 typedef std::vector<CCGFloat> DimVec ;
00040
00041 CaloSubdetectorGeometry() ;
00042
00044 virtual ~CaloSubdetectorGeometry();
00045
00046 virtual void newCell( const GlobalPoint& f1 ,
00047 const GlobalPoint& f2 ,
00048 const GlobalPoint& f3 ,
00049 const CCGFloat* parm ,
00050 const DetId& detId ) = 0 ;
00051
00053 virtual bool present( const DetId& id ) const;
00054
00056 virtual const CaloCellGeometry* getGeometry( const DetId& id ) const ;
00057
00062 virtual const std::vector<DetId>& getValidDetIds( DetId::Detector det = DetId::Detector(0) ,
00063 int subdet = 0 ) const ;
00064
00065
00066 virtual DetId getClosestCell( const GlobalPoint& r ) const ;
00067
00074 virtual DetIdSet getCells( const GlobalPoint& r, double dR ) const ;
00075 virtual CellSet getCellSet( const GlobalPoint& r, double dR ) const ;
00076
00077 CCGFloat deltaPhi( const DetId& detId ) const ;
00078
00079 CCGFloat deltaEta( const DetId& detId ) const ;
00080
00081 void allocateCorners( CaloCellGeometry::CornersVec::size_type n ) ;
00082
00083 CaloCellGeometry::CornersMgr* cornersMgr() { return m_cmgr ; }
00084
00085 void allocatePar( ParVec::size_type n, unsigned int m ) ;
00086
00087 ParMgr* parMgr() { return m_parMgr ; }
00088 const ParMgr* parMgrConst() const { return m_parMgr ; }
00089
00090 ParVecVec& parVecVec() { return m_parVecVec ; }
00091 const ParVecVec& parVecVec() const { return m_parVecVec ; }
00092
00093 virtual unsigned int numberOfShapes() const { return 1 ; }
00094 virtual unsigned int numberOfParametersPerShape() const { return 1 ; }
00095 virtual unsigned int numberOfTransformParms() const { return 6 ; }
00096
00097 virtual void fillDefaultNamedParameters() const { return ; }
00098
00099 void getSummary( TrVec& trVector,
00100 IVec& iVector,
00101 DimVec& dimVector ) const ;
00102
00103 virtual void initializeParms() { return ; }
00104
00105 protected:
00106
00107 virtual unsigned int indexFor(const DetId& id) const;
00108 virtual unsigned int sizeForDenseIndex(const DetId& id) const;
00109
00110 virtual const CaloCellGeometry* cellGeomPtr( uint32_t index ) const = 0 ;
00111
00112 ParVecVec m_parVecVec ;
00113
00114 static CCGFloat deltaR( const GlobalPoint& p1,
00115 const GlobalPoint& p2 )
00116 { return reco::deltaR( p1, p2 ) ; }
00117
00118 mutable std::vector<DetId> m_validIds ;
00119
00120 private:
00121
00122 ParMgr* m_parMgr ;
00123
00124 CaloCellGeometry::CornersMgr* m_cmgr ;
00125
00127 CaloSubdetectorGeometry( const CaloSubdetectorGeometry& ) ;
00128 CaloSubdetectorGeometry& operator=( const CaloSubdetectorGeometry& ) ;
00129
00130 mutable bool m_sortedIds ;
00131
00132 mutable std::vector<CCGFloat>* m_deltaPhi ;
00133 mutable std::vector<CCGFloat>* m_deltaEta ;
00134 };
00135
00136
00137 #endif