Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:08:07

0001 #ifndef Geometry_ForwardGeometry_CastorGeometry_h
0002 #define Geometry_ForwardGeometry_CastorGeometry_h 1
0003 
0004 #include "CondFormats/AlignmentRecord/interface/CastorAlignmentRcd.h"
0005 #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h"
0006 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0007 #include "Geometry/ForwardGeometry/interface/IdealCastorTrapezoid.h"
0008 #include "Geometry/ForwardGeometry/interface/CastorTopology.h"
0009 #include "Geometry/Records/interface/CastorGeometryRecord.h"
0010 #include "Geometry/Records/interface/PCastorRcd.h"
0011 
0012 #include <vector>
0013 
0014 class CastorGeometry : public CaloSubdetectorGeometry {
0015 public:
0016   typedef std::vector<IdealCastorTrapezoid> CellVec;
0017 
0018   typedef CaloCellGeometry::CCGFloat CCGFloat;
0019   typedef CaloCellGeometry::Pt3D Pt3D;
0020   typedef CaloCellGeometry::Pt3DVec Pt3DVec;
0021   typedef CaloCellGeometry::Tr3D Tr3D;
0022 
0023   typedef CastorAlignmentRcd AlignmentRecord;
0024   typedef CastorGeometryRecord AlignedRecord;
0025   typedef PCastorRcd PGeometryRecord;
0026   typedef HcalCastorDetId DetIdType;
0027 
0028   enum { k_NumberOfCellsForCorners = HcalCastorDetId::kSizeForDenseIndexing };
0029 
0030   enum { k_NumberOfShapes = 4 };
0031 
0032   enum { k_NumberOfParametersPerShape = 6 };
0033 
0034   static std::string dbString() { return "PCastorRcd"; }
0035 
0036   unsigned int numberOfTransformParms() const override { return 3; }
0037 
0038   unsigned int numberOfShapes() const override { return k_NumberOfShapes; }
0039   unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }
0040 
0041   CastorGeometry();
0042 
0043   explicit CastorGeometry(const CastorTopology* topology);
0044   ~CastorGeometry() override;
0045 
0046   DetId getClosestCell(const GlobalPoint& r) const override;
0047 
0048   static std::string producerTag() { return "CASTOR"; }
0049 
0050   static unsigned int numberOfAlignments() { return 1; }
0051 
0052   static unsigned int alignmentTransformIndexLocal(const DetId& id);
0053 
0054   static unsigned int alignmentTransformIndexGlobal(const DetId& id);
0055 
0056   static void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
0057 
0058   void newCell(const GlobalPoint& f1,
0059                const GlobalPoint& f2,
0060                const GlobalPoint& f3,
0061                const CCGFloat* parm,
0062                const DetId& detId) override;
0063 
0064 protected:
0065   // Modify the RawPtr class
0066   const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override;
0067 
0068 private:
0069   const CastorTopology* theTopology;
0070   mutable DetId::Detector lastReqDet_;
0071   mutable int lastReqSubdet_;
0072   bool m_ownsTopology;
0073 
0074   CellVec m_cellVec;
0075 };
0076 
0077 #endif