ZdcGeometry

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
#ifndef Geometry_ForwardGeometry_ZdcGeometry_h
#define Geometry_ForwardGeometry_ZdcGeometry_h

#include "CondFormats/AlignmentRecord/interface/ZDCAlignmentRcd.h"
#include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/ForwardGeometry/interface/IdealZDCTrapezoid.h"
#include "Geometry/ForwardGeometry/interface/ZdcTopology.h"
#include "Geometry/Records/interface/ZDCGeometryRecord.h"
#include "Geometry/Records/interface/PZdcRcd.h"

class ZdcGeometry : public CaloSubdetectorGeometry {
public:
  typedef std::vector<IdealZDCTrapezoid> CellVec;

  typedef CaloCellGeometry::CCGFloat CCGFloat;
  typedef CaloCellGeometry::Pt3D Pt3D;
  typedef CaloCellGeometry::Pt3DVec Pt3DVec;
  typedef CaloCellGeometry::Tr3D Tr3D;

  typedef ZDCAlignmentRcd AlignmentRecord;
  typedef ZDCGeometryRecord AlignedRecord;
  typedef PZdcRcd PGeometryRecord;
  typedef HcalZDCDetId DetIdType;

  static constexpr int k_NumberOfCellsForCorners = HcalZDCDetId::kSizeForDenseIndexing;
  uint32_t k_NumberOfCellsForCornersN;

  static constexpr int k_NumberOfShapes = 3;

  static constexpr int k_NumberOfParametersPerShape = 4;

  static std::string dbString() { return "PZdcRcd"; }

  unsigned int numberOfShapes() const override { return k_NumberOfShapes; }
  unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }

  ZdcGeometry();

  explicit ZdcGeometry(const ZdcTopology* topology);
  ~ZdcGeometry() override;

  //      virtual DetId getClosestCell(const GlobalPoint& r) const ;

  static std::string producerTag() { return "ZDC"; }

  static unsigned int numberOfAlignments() { return 2; }

  static unsigned int alignmentTransformIndexLocal(const DetId& id);

  static unsigned int alignmentTransformIndexGlobal(const DetId& id);

  static void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);

  void newCell(const GlobalPoint& f1,
               const GlobalPoint& f2,
               const GlobalPoint& f3,
               const CCGFloat* parm,
               const DetId& detId) override;

  void getSummary(CaloSubdetectorGeometry::TrVec& tVec,
                  CaloSubdetectorGeometry::IVec& iVec,
                  CaloSubdetectorGeometry::DimVec& dVec,
                  CaloSubdetectorGeometry::IVec& dins) const override;

protected:
  unsigned int indexFor(const DetId& id) const override { return theTopology->detId2DenseIndex(id); }

  // Modify the RawPtr class
  CaloCellGeometryPtr getGeometryRawPtr(uint32_t index) const override;

private:
  const ZdcTopology* theTopology;
  mutable DetId::Detector lastReqDet_;
  mutable int lastReqSubdet_;
  bool m_ownsTopology;

  CellVec m_cellVec;
};

#endif  // Geometry_ForwardGeometry_ZdcGeometry_h