CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Geometry/EcalAlgo/interface/EcalBarrelGeometry.h

Go to the documentation of this file.
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/Records/interface/IdealGeometryRecord.h"
00008 #include "Geometry/Records/interface/EcalBarrelGeometryRecord.h"
00009 #include "CondFormats/AlignmentRecord/interface/EBAlignmentRcd.h"
00010 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00011 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00012 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00013 #include "Geometry/Records/interface/PEcalBarrelRcd.h"
00014 #include <vector>
00015 
00016 class EcalBarrelGeometry : public CaloSubdetectorGeometry 
00017 {
00018    public:
00019 
00020       typedef IdealGeometryRecord      IdealRecord   ;
00021       typedef EcalBarrelGeometryRecord AlignedRecord ;
00022       typedef EBAlignmentRcd           AlignmentRecord ;
00023       typedef PEcalBarrelRcd           PGeometryRecord ;
00024 
00025       typedef EZArrayFL<EEDetId> OrderedListOfEEDetId ; // like an stl vector: begin(), end(), [i]
00026 
00027       typedef std::vector<OrderedListOfEEDetId*>  VecOrdListEEDetIdPtr ;
00028 
00029       typedef EcalBarrelNumberingScheme NumberingScheme ;
00030 
00031       typedef EBDetId DetIdType ;
00032 
00033       enum { k_NumberOfCellsForCorners = EBDetId::kSizeForDenseIndexing } ;
00034 
00035       enum { k_NumberOfShapes = 17 } ;
00036 
00037       enum { k_NumberOfParametersPerShape = 11 } ;
00038 
00039       static std::string dbString() { return "PEcalBarrelRcd" ; }
00040 
00041       virtual unsigned int numberOfShapes() const { return k_NumberOfShapes ; }
00042       virtual unsigned int numberOfParametersPerShape() const { return k_NumberOfParametersPerShape ; }
00043 
00044       EcalBarrelGeometry() ;
00045   
00046       virtual ~EcalBarrelGeometry();
00047 
00048       int getNumXtalsPhiDirection()           const { return _nnxtalPhi ; }
00049 
00050       int getNumXtalsEtaDirection()           const { return _nnxtalEta ; }
00051 
00052       const std::vector<int>& getEtaBaskets() const { return _EtaBaskets ; }
00053 
00054       int getBasketSizeInPhi()                const { return _PhiBaskets ; }  
00055 
00056       void setNumXtalsPhiDirection( const int& nnxtalPhi )     { _nnxtalPhi=nnxtalPhi ; }
00057 
00058       void setNumXtalsEtaDirection( const int& nnxtalEta )     { _nnxtalEta=nnxtalEta ; }
00059 
00060       void setEtaBaskets( const std::vector<int>& EtaBaskets ) { _EtaBaskets=EtaBaskets ; }
00061 
00062       void setBasketSizeInPhi( const int& PhiBaskets )         { _PhiBaskets=PhiBaskets ; }
00063 
00064       const OrderedListOfEEDetId* getClosestEndcapCells( EBDetId id ) const ;
00065 
00066       // Get closest cell, etc...
00067       virtual DetId getClosestCell( const GlobalPoint& r ) const ;
00068 
00069       virtual CaloSubdetectorGeometry::DetIdSet getCells( const GlobalPoint& r,
00070                                                           double             dR ) const ;
00071 
00072       double avgRadiusXYFrontFaceCenter() const ;
00073 
00074       static std::string hitString() { return "EcalHitsEB" ; }
00075 
00076       static std::string producerTag() { return "EcalBarrel" ; }
00077 
00078       static unsigned int numberOfAlignments() { return 36 ; }
00079 
00080       static unsigned int alignmentTransformIndexLocal( const DetId& id ) ;
00081 
00082       static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ;
00083 
00084       static DetId detIdFromLocalAlignmentIndex( unsigned int iLoc ) ;
00085 
00086       static std::vector<HepGeom::Point3D<double> > localCorners( const double* pv, 
00087                                                    unsigned int  i,
00088                                                    HepGeom::Point3D<double> &   ref ) ;
00089 
00090       static CaloCellGeometry* newCell( const GlobalPoint& f1 ,
00091                                         const GlobalPoint& f2 ,
00092                                         const GlobalPoint& f3 ,
00093                                         CaloCellGeometry::CornersMgr* mgr,
00094                                         const double*      parm ,
00095                                         const DetId&       detId ) ;
00096                                         
00097    private:
00099       int _nnxtalEta;
00100   
00102       int _nnxtalPhi;
00103   
00108       std::vector<int> _EtaBaskets;
00109       
00111       int _PhiBaskets;
00112 
00113       mutable EZMgrFL<EEDetId>*     m_borderMgr ;
00114 
00115       mutable VecOrdListEEDetIdPtr* m_borderPtrVec ;
00116 
00117       mutable double m_radius ;
00118 };
00119 
00120 
00121 #endif
00122