Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EcalPreshowerGeometry_h
0002 #define EcalPreshowerGeometry_h
0003 
0004 #include "Geometry/EcalCommonData/interface/EcalPreshowerNumberingScheme.h"
0005 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0006 #include "Geometry/CaloGeometry/interface/PreshowerStrip.h"
0007 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0008 #include "Geometry/Records/interface/EcalPreshowerGeometryRecord.h"
0009 #include "CondFormats/AlignmentRecord/interface/ESAlignmentRcd.h"
0010 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0011 #include "Geometry/Records/interface/PEcalPreshowerRcd.h"
0012 #include "Geometry/CaloGeometry/interface/CaloGenericDetId.h"
0013 #include <vector>
0014 
0015 class EcalPreshowerGeometry final : public CaloSubdetectorGeometry {
0016 public:
0017   typedef std::vector<PreshowerStrip> CellVec;
0018 
0019   typedef CaloCellGeometry::CCGFloat CCGFloat;
0020   typedef CaloCellGeometry::Pt3D Pt3D;
0021   typedef CaloCellGeometry::Pt3DVec Pt3DVec;
0022 
0023   typedef IdealGeometryRecord IdealRecord;
0024   typedef EcalPreshowerGeometryRecord AlignedRecord;
0025   typedef ESAlignmentRcd AlignmentRecord;
0026   typedef PEcalPreshowerRcd PGeometryRecord;
0027 
0028   typedef EcalPreshowerNumberingScheme NumberingScheme;
0029   typedef CaloSubdetectorGeometry::ParVec ParVec;
0030   typedef CaloSubdetectorGeometry::ParVecVec ParVecVec;
0031   typedef ESDetId DetIdType;
0032 
0033   enum { k_NumberOfCellsForCorners = ESDetId::kSizeForDenseIndexing };
0034 
0035   enum { k_NumberOfShapes = 4 };
0036 
0037   enum { k_NumberOfParametersPerShape = 4 };
0038 
0039   static std::string dbString() { return "PEcalPreshowerRcd"; }
0040 
0041   unsigned int numberOfShapes() const override { return k_NumberOfShapes; }
0042   unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }
0043 
0044   EcalPreshowerGeometry();
0045 
0046   /// The EcalPreshowerGeometry will delete all its cell geometries at destruction time
0047   ~EcalPreshowerGeometry() override;
0048 
0049   void setzPlanes(CCGFloat z1minus, CCGFloat z2minus, CCGFloat z1plus, CCGFloat z2plus);
0050 
0051   // Get closest cell
0052   DetId getClosestCell(const GlobalPoint& r) const override;
0053 
0054   // Get closest cell in arbitrary plane (1 or 2)
0055   virtual DetId getClosestCellInPlane(const GlobalPoint& r, int plane) const;
0056 
0057   void initializeParms() override;
0058   unsigned int numberOfTransformParms() const override { return 3; }
0059 
0060   static std::string hitString() { return "EcalHitsES"; }
0061 
0062   static std::string producerTag() { return "EcalPreshower"; }
0063 
0064   static unsigned int numberOfAlignments() { return 8; }
0065 
0066   static unsigned int alignmentTransformIndexLocal(const DetId& id);
0067 
0068   static unsigned int alignmentTransformIndexGlobal(const DetId& id);
0069 
0070   static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc);
0071 
0072   static void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
0073 
0074   void newCell(const GlobalPoint& f1,
0075                const GlobalPoint& f2,
0076                const GlobalPoint& f3,
0077                const CCGFloat* parm,
0078                const DetId& detId) override;
0079 
0080   /// is this detid present in the geometry?
0081   bool present(const DetId& id) const override {
0082     if (id == DetId(0))
0083       return false;
0084     // not needed???
0085     auto index = CaloGenericDetId(id).denseIndex();
0086     return index < m_cellVec.size();
0087   }
0088 
0089 protected:
0090   // Modify the RawPtr class
0091   const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override;
0092 
0093 private:
0094   const CCGFloat m_xWidWaf;
0095   const CCGFloat m_xInterLadGap;
0096   const CCGFloat m_xIntraLadGap;
0097 
0098   const CCGFloat m_yWidAct;
0099   const CCGFloat m_yCtrOff;
0100 
0101   CCGFloat m_zplane[4];
0102 
0103   CellVec m_cellVec;
0104 };
0105 
0106 #endif