File indexing completed on 2024-04-06 12:14:50
0001 #ifndef GEOMETRY_HCALTOWERALGO_CALOTOWERGEOMETRY_H
0002 #define GEOMETRY_HCALTOWERALGO_CALOTOWERGEOMETRY_H 1
0003
0004 #include "Geometry/CaloGeometry/interface/IdealObliquePrism.h"
0005 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0006 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
0007 #include "Geometry/Records/interface/CaloTowerGeometryRecord.h"
0008 #include "Geometry/CaloTopology/interface/CaloTowerTopology.h"
0009
0010
0011
0012
0013
0014
0015
0016 class CaloTowerGeometry : public CaloSubdetectorGeometry {
0017 public:
0018 typedef std::vector<IdealObliquePrism> CellVec;
0019
0020 typedef CaloCellGeometry::CCGFloat CCGFloat;
0021 typedef CaloCellGeometry::Pt3D Pt3D;
0022 typedef CaloCellGeometry::Pt3DVec Pt3DVec;
0023
0024 typedef CaloTowerAlignmentRcd AlignmentRecord;
0025 typedef CaloTowerGeometryRecord AlignedRecord;
0026 typedef PCaloTowerRcd PGeometryRecord;
0027 typedef CaloTowerDetId DetIdType;
0028
0029 enum { k_NumberOfParametersPerShape = 5 };
0030
0031 static std::string dbString() { return "PCaloTowerRcd"; }
0032
0033 unsigned int numberOfShapes() const override { return k_NumberOfShapes; }
0034 unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }
0035 virtual unsigned int numberOfCellsForCorners() const { return k_NumberOfCellsForCorners; }
0036
0037 CaloTowerGeometry(const CaloTowerTopology* cttopo);
0038 ~CaloTowerGeometry() override;
0039
0040 static std::string producerTag() { return "TOWER"; }
0041
0042 static unsigned int numberOfAlignments() { return 0; }
0043 unsigned int alignmentTransformIndexLocal(const DetId& id);
0044 unsigned int alignmentTransformIndexGlobal(const DetId& id);
0045
0046 static void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
0047
0048 void newCell(const GlobalPoint& f1,
0049 const GlobalPoint& f2,
0050 const GlobalPoint& f3,
0051 const CCGFloat* parm,
0052 const DetId& detId) override;
0053
0054 std::shared_ptr<const CaloCellGeometry> getGeometry(const DetId& id) const override {
0055 return cellGeomPtr(m_cttopo->denseIndex(id));
0056 }
0057
0058 void getSummary(CaloSubdetectorGeometry::TrVec& trVector,
0059 CaloSubdetectorGeometry::IVec& iVector,
0060 CaloSubdetectorGeometry::DimVec& dimVector,
0061 CaloSubdetectorGeometry::IVec& dinsVector) const override;
0062
0063 protected:
0064 unsigned int indexFor(const DetId& id) const override { return m_cttopo->denseIndex(id); }
0065 unsigned int sizeForDenseIndex(const DetId& id) const override { return m_cttopo->sizeForDenseIndexing(); }
0066
0067
0068 const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override;
0069
0070 private:
0071 const CaloTowerTopology* m_cttopo;
0072 int k_NumberOfCellsForCorners;
0073 int k_NumberOfShapes;
0074 CellVec m_cellVec;
0075 CaloSubdetectorGeometry::IVec m_dins;
0076 };
0077
0078 #endif