CMS 3D CMS Logo

EcalEndcapGeometry.h
Go to the documentation of this file.
1 #ifndef EcalEndcapGeometry_h
2 #define EcalEndcapGeometry_h
3 
14 #include <vector>
15 #include <map>
16 #include <atomic>
17 
18 class TruncatedPyramid;
19 
21 public:
22  typedef std::vector<TruncatedPyramid> CellVec;
23 
27 
32 
33  typedef EZArrayFL<EBDetId> OrderedListOfEBDetId; // like an stl vector: begin(), end(), [i]
34 
35  typedef std::vector<OrderedListOfEBDetId*> VecOrdListEBDetIdPtr;
36 
38 
39  typedef EEDetId DetIdType;
40 
42 
43  static constexpr int k_NumberOfShapes = 1;
44 
46 
47  static std::string dbString() { return "PEcalEndcapRcd"; }
48 
49  unsigned int numberOfShapes() const override { return k_NumberOfShapes; }
50  unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }
51 
53 
54  ~EcalEndcapGeometry() override;
55 
56  int getNumberOfModules() const { return _nnmods; }
57 
58  int getNumberOfCrystalPerModule() const { return _nncrys; }
59 
60  void setNumberOfModules(const int nnmods) { _nnmods = nnmods; }
61 
62  void setNumberOfCrystalPerModule(const int nncrys) { _nncrys = nncrys; }
63 
65 
66  // Get closest cell, etc...
67  DetId getClosestCell(const GlobalPoint& r) const override;
68 
69  CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint& r, double dR) const override;
70 
71  void initializeParms() override;
72 
73  CCGFloat avgAbsZFrontFaceCenter() const; // average over both endcaps. Positive!
74 
75  static std::string hitString() { return "EcalHitsEE"; }
76 
77  static std::string producerTag() { return "EcalEndcap"; }
78 
79  static unsigned int numberOfAlignments() { return 4; }
80 
81  static unsigned int alignmentTransformIndexLocal(const DetId& id);
82 
83  static unsigned int alignmentTransformIndexGlobal(const DetId& id);
84 
85  static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc);
86 
87  static void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
88 
89  void newCell(const GlobalPoint& f1,
90  const GlobalPoint& f2,
91  const GlobalPoint& f3,
92  const CCGFloat* parm,
93  const DetId& detId) override;
94 
95  bool present(const DetId& id) const override;
96 
97 protected:
98  // Modify the RawPtr class
99  CaloCellGeometryPtr getGeometryRawPtr(uint32_t index) const override;
100 
101 private:
102  static int myPhi(int i) {
103  i += 720;
104  return (1 + (i - 1) % 360);
105  }
106 
108  int _nnmods;
109 
111  int _nncrys;
112 
114 
115  CCGFloat m_wref, m_xlo[2], m_xhi[2], m_ylo[2], m_yhi[2], m_xoff[2], m_yoff[2], m_del;
116 
117  unsigned int m_nref;
118 
119  unsigned int xindex(CCGFloat x, CCGFloat z) const;
120  unsigned int yindex(CCGFloat y, CCGFloat z) const;
121 
122  EEDetId gId(float x, float y, float z) const;
123 
124  mutable std::atomic<EZMgrFL<EBDetId>*> m_borderMgr;
125 
126  mutable std::atomic<VecOrdListEBDetIdPtr*> m_borderPtrVec;
127 
129  mutable std::atomic<bool> m_check;
130 
132 };
133 
134 #endif
int _nncrys
number of crystals per module
static constexpr int kSizeForDenseIndexing
Definition: EEDetId.h:328
void setNumberOfCrystalPerModule(const int nncrys)
static constexpr int k_NumberOfShapes
~EcalEndcapGeometry() override
static constexpr int k_NumberOfCellsForCorners
static unsigned int numberOfAlignments()
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
CaloCellGeometry::Pt3D Pt3D
static std::string producerTag()
std::vector< Pt3D > Pt3DVec
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
CaloCellGeometry::CCGFloat CCGFloat
void setNumberOfModules(const int nnmods)
std::atomic< EZMgrFL< EBDetId > * > m_borderMgr
int getNumberOfCrystalPerModule() const
static unsigned int alignmentTransformIndexLocal(const DetId &id)
unsigned int numberOfParametersPerShape() const override
CaloCellGeometry::CCGFloat CCGFloat
std::atomic< VecOrdListEBDetIdPtr * > m_borderPtrVec
CCGFloat avgAbsZFrontFaceCenter() const
CaloCellGeometry::Pt3DVec Pt3DVec
bool present(const DetId &id) const override
is this detid present in the geometry?
unsigned int yindex(CCGFloat y, CCGFloat z) const
#define CMS_THREAD_GUARD(_var_)
std::vector< OrderedListOfEBDetId * > VecOrdListEBDetIdPtr
CaloCellGeometry::CCGFloat CCGFloat
std::vector< TruncatedPyramid > CellVec
unsigned int xindex(CCGFloat x, CCGFloat z) const
EEDetId gId(float x, float y, float z) const
EcalEndcapNumberingScheme NumberingScheme
EEAlignmentRcd AlignmentRecord
unsigned int numberOfShapes() const override
int _nnmods
number of modules
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:17
EcalEndcapGeometryRecord AlignedRecord
static int myPhi(int i)
CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
std::atomic< bool > m_check
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
DetId getClosestCell(const GlobalPoint &r) const override
IdealGeometryRecord IdealRecord
CaloCellGeometryPtr getGeometryRawPtr(uint32_t index) const override
static std::string hitString()
EZArrayFL< EBDetId > OrderedListOfEBDetId
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
int getNumberOfModules() const
static std::string dbString()
static constexpr int k_NumberOfParametersPerShape
PEcalEndcapRcd PGeometryRecord
void initializeParms() override