00001 #ifndef EcalBarrelGeometry_h 00002 #define EcalBarrelGeometry_h 00003 00004 #include "Geometry/CaloGeometry/interface/EZArrayFL.h" 00005 #include "Geometry/EcalCommonData/interface/EcalBarrelNumberingScheme.h" 00006 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" 00007 #include "Geometry/CaloGeometry/interface/TruncatedPyramid.h" 00008 #include "Geometry/Records/interface/IdealGeometryRecord.h" 00009 #include "Geometry/Records/interface/EcalBarrelGeometryRecord.h" 00010 #include "CondFormats/AlignmentRecord/interface/EBAlignmentRcd.h" 00011 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" 00012 #include "DataFormats/EcalDetId/interface/EEDetId.h" 00013 #include "DataFormats/EcalDetId/interface/EBDetId.h" 00014 #include "Geometry/Records/interface/PEcalBarrelRcd.h" 00015 #include <vector> 00016 00017 class EcalBarrelGeometry : public CaloSubdetectorGeometry 00018 { 00019 public: 00020 00021 typedef std::vector<TruncatedPyramid> CellVec ; 00022 00023 typedef CaloCellGeometry::CCGFloat CCGFloat ; 00024 typedef CaloCellGeometry::Pt3D Pt3D ; 00025 typedef CaloCellGeometry::Pt3DVec Pt3DVec ; 00026 00027 typedef IdealGeometryRecord IdealRecord ; 00028 typedef EcalBarrelGeometryRecord AlignedRecord ; 00029 typedef EBAlignmentRcd AlignmentRecord ; 00030 typedef PEcalBarrelRcd PGeometryRecord ; 00031 00032 typedef EZArrayFL<EEDetId> OrderedListOfEEDetId ; // like an stl vector: begin(), end(), [i] 00033 00034 typedef std::vector<OrderedListOfEEDetId*> VecOrdListEEDetIdPtr ; 00035 00036 typedef EcalBarrelNumberingScheme NumberingScheme ; 00037 00038 typedef EBDetId DetIdType ; 00039 00040 enum { k_NumberOfCellsForCorners = EBDetId::kSizeForDenseIndexing } ; 00041 00042 enum { k_NumberOfShapes = 17 } ; 00043 00044 enum { k_NumberOfParametersPerShape = 11 } ; 00045 00046 static std::string dbString() { return "PEcalBarrelRcd" ; } 00047 00048 virtual unsigned int numberOfShapes() const { return k_NumberOfShapes ; } 00049 virtual unsigned int numberOfParametersPerShape() const { return k_NumberOfParametersPerShape ; } 00050 00051 EcalBarrelGeometry() ; 00052 00053 virtual ~EcalBarrelGeometry(); 00054 00055 int getNumXtalsPhiDirection() const { return _nnxtalPhi ; } 00056 00057 int getNumXtalsEtaDirection() const { return _nnxtalEta ; } 00058 00059 const std::vector<int>& getEtaBaskets() const { return _EtaBaskets ; } 00060 00061 int getBasketSizeInPhi() const { return _PhiBaskets ; } 00062 00063 void setNumXtalsPhiDirection( const int& nnxtalPhi ) { _nnxtalPhi=nnxtalPhi ; } 00064 00065 void setNumXtalsEtaDirection( const int& nnxtalEta ) { _nnxtalEta=nnxtalEta ; } 00066 00067 void setEtaBaskets( const std::vector<int>& EtaBaskets ) { _EtaBaskets=EtaBaskets ; } 00068 00069 void setBasketSizeInPhi( const int& PhiBaskets ) { _PhiBaskets=PhiBaskets ; } 00070 00071 const OrderedListOfEEDetId* getClosestEndcapCells( EBDetId id ) const ; 00072 00073 // Get closest cell, etc... 00074 virtual DetId getClosestCell( const GlobalPoint& r ) const ; 00075 00076 virtual CaloSubdetectorGeometry::DetIdSet getCells( const GlobalPoint& r, 00077 double dR ) const ; 00078 00079 CCGFloat avgRadiusXYFrontFaceCenter() const ; 00080 00081 static std::string hitString() { return "EcalHitsEB" ; } 00082 00083 static std::string producerTag() { return "EcalBarrel" ; } 00084 00085 static unsigned int numberOfAlignments() { return 36 ; } 00086 00087 static unsigned int alignmentTransformIndexLocal( const DetId& id ) ; 00088 00089 static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ; 00090 00091 static DetId detIdFromLocalAlignmentIndex( unsigned int iLoc ) ; 00092 00093 static void localCorners( Pt3DVec& lc , 00094 const CCGFloat* pv , 00095 unsigned int i , 00096 Pt3D& ref ) ; 00097 00098 virtual void newCell( const GlobalPoint& f1 , 00099 const GlobalPoint& f2 , 00100 const GlobalPoint& f3 , 00101 const CCGFloat* parm , 00102 const DetId& detId ) ; 00103 protected: 00104 00105 virtual const CaloCellGeometry* cellGeomPtr( uint32_t index ) const ; 00106 00107 private: 00108 00110 int _nnxtalEta; 00111 00113 int _nnxtalPhi; 00114 00119 std::vector<int> _EtaBaskets; 00120 00122 int _PhiBaskets; 00123 00124 mutable EZMgrFL<EEDetId>* m_borderMgr ; 00125 00126 mutable VecOrdListEEDetIdPtr* m_borderPtrVec ; 00127 00128 mutable CCGFloat m_radius ; 00129 00130 CellVec m_cellVec ; 00131 }; 00132 00133 00134 #endif