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  enum { 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  const CaloCellGeometry* 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
CaloCellGeometry::Pt3DVec
std::vector< Pt3D > Pt3DVec
Definition: CaloCellGeometry.h:55
EcalEndcapGeometry::getNumberOfCrystalPerModule
int getNumberOfCrystalPerModule() const
Definition: EcalEndcapGeometry.h:58
EcalEndcapGeometry::alignmentTransformIndexGlobal
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
Definition: EcalEndcapGeometry.cc:66
EZArrayFL.h
DDAxes::y
EcalEndcapGeometry::zeP
CCGFloat zeP
Definition: EcalEndcapGeometry.h:113
mps_fire.i
i
Definition: mps_fire.py:355
EcalEndcapGeometry::VecOrdListEBDetIdPtr
std::vector< OrderedListOfEBDetId * > VecOrdListEBDetIdPtr
Definition: EcalEndcapGeometry.h:35
EcalEndcapGeometry::Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: EcalEndcapGeometry.h:26
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
EcalEndcapGeometry::Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: EcalEndcapGeometry.h:25
PEcalEndcapRcd
Definition: PEcalEndcapRcd.h:5
EcalEndcapGeometry::gId
EEDetId gId(float x, float y, float z) const
Definition: EcalEndcapGeometry.cc:186
CaloSubdetectorGeometry::DetIdSet
std::set< DetId > DetIdSet
Definition: CaloSubdetectorGeometry.h:27
EcalEndcapGeometry::NumberingScheme
EcalEndcapNumberingScheme NumberingScheme
Definition: EcalEndcapGeometry.h:37
EcalEndcapGeometry
Definition: EcalEndcapGeometry.h:20
EcalEndcapGeometry::newCell
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
Definition: EcalEndcapGeometry.cc:422
EcalEndcapGeometry::m_avgZ
CCGFloat m_avgZ
Definition: EcalEndcapGeometry.h:128
EcalEndcapGeometry::getGeometryRawPtr
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
Definition: EcalEndcapGeometry.cc:444
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
EBDetId.h
EEDetId.h
EEAlignmentRcd
Definition: EEAlignmentRcd.h:6
EcalEndcapGeometryRecord
Definition: EcalEndcapGeometryRecord.h:23
EcalEndcapGeometry::_nnmods
int _nnmods
number of modules
Definition: EcalEndcapGeometry.h:108
TruncatedPyramid
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code.
Definition: TruncatedPyramid.h:19
EcalEndcapGeometry::hitString
static std::string hitString()
Definition: EcalEndcapGeometry.h:75
DDAxes::x
EcalEndcapGeometry::localCorners
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: EcalEndcapGeometry.cc:418
EcalEndcapGeometry::OrderedListOfEBDetId
EZArrayFL< EBDetId > OrderedListOfEBDetId
Definition: EcalEndcapGeometry.h:33
EZArrayFL
Definition: EZArrayFL.h:20
EcalEndcapGeometry::present
bool present(const DetId &id) const override
is this detid present in the geometry?
Definition: EcalEndcapGeometry.cc:450
EcalEndcapGeometry::m_del
CCGFloat m_del
Definition: EcalEndcapGeometry.h:115
EcalEndcapGeometry::CellVec
std::vector< TruncatedPyramid > CellVec
Definition: EcalEndcapGeometry.h:22
EcalEndcapGeometry::myPhi
static int myPhi(int i)
Definition: EcalEndcapGeometry.h:102
Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: CaloCellGeometry.cc:5
DetId
Definition: DetId.h:17
CaloSubdetectorGeometry::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloSubdetectorGeometry.h:25
EcalEndcapGeometry::numberOfParametersPerShape
unsigned int numberOfParametersPerShape() const override
Definition: EcalEndcapGeometry.h:50
EEDetId::kSizeForDenseIndexing
Definition: EEDetId.h:329
EcalEndcapGeometry::k_NumberOfShapes
Definition: EcalEndcapGeometry.h:43
EcalEndcapGeometry::m_yhi
CCGFloat m_yhi[2]
Definition: EcalEndcapGeometry.h:115
EcalEndcapGeometry::m_cellVec
CellVec m_cellVec
Definition: EcalEndcapGeometry.h:131
DDAxes::z
EcalEndcapGeometry::m_xhi
CCGFloat m_xhi[2]
Definition: EcalEndcapGeometry.h:115
EcalEndcapGeometry::EcalEndcapGeometry
EcalEndcapGeometry()
Definition: EcalEndcapGeometry.cc:14
Point3DBase< float, GlobalTag >
CaloCellGeometry::Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: CaloCellGeometry.h:54
EEDetId
Definition: EEDetId.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcapGeometry::m_wref
CCGFloat m_wref
Definition: EcalEndcapGeometry.h:115
EcalEndcapGeometry::~EcalEndcapGeometry
~EcalEndcapGeometry() override
Definition: EcalEndcapGeometry.cc:41
EcalEndcapGeometry::AlignmentRecord
EEAlignmentRcd AlignmentRecord
Definition: EcalEndcapGeometry.h:30
CaloSubdetectorGeometry.h
EcalEndcapGeometry::m_borderPtrVec
std::atomic< VecOrdListEBDetIdPtr * > m_borderPtrVec
Definition: EcalEndcapGeometry.h:126
EcalEndcapGeometry::k_NumberOfParametersPerShape
Definition: EcalEndcapGeometry.h:45
EcalEndcapGeometry::m_ylo
CCGFloat m_ylo[2]
Definition: EcalEndcapGeometry.h:115
EcalEndcapGeometry::numberOfAlignments
static unsigned int numberOfAlignments()
Definition: EcalEndcapGeometry.h:79
EcalEndcapGeometry::initializeParms
void initializeParms() override
Definition: EcalEndcapGeometry.cc:70
CaloCellGeometry
Definition: CaloCellGeometry.h:50
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
EcalEndcapGeometry::setNumberOfCrystalPerModule
void setNumberOfCrystalPerModule(const int nncrys)
Definition: EcalEndcapGeometry.h:62
thread_safety_macros.h
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
EcalEndcapGeometry::AlignedRecord
EcalEndcapGeometryRecord AlignedRecord
Definition: EcalEndcapGeometry.h:29
EcalEndcapGeometry::DetIdType
EEDetId DetIdType
Definition: EcalEndcapGeometry.h:39
PEcalEndcapRcd.h
EcalEndcapGeometry::k_NumberOfCellsForCorners
Definition: EcalEndcapGeometry.h:41
IdealGeometryRecord.h
EcalEndcapGeometry::xindex
unsigned int xindex(CCGFloat x, CCGFloat z) const
Definition: EcalEndcapGeometry.cc:172
EcalEndcapGeometry::zeN
CCGFloat zeN
Definition: EcalEndcapGeometry.h:113
EcalEndcapGeometry::PGeometryRecord
PEcalEndcapRcd PGeometryRecord
Definition: EcalEndcapGeometry.h:31
alignCSCRings.r
r
Definition: alignCSCRings.py:93
EcalEndcapGeometry::m_yoff
CCGFloat m_yoff[2]
Definition: EcalEndcapGeometry.h:115
EcalEndcapGeometry::getClosestBarrelCells
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
Definition: EcalEndcapGeometry.cc:372
EcalEndcapGeometry::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: EcalEndcapGeometry.h:24
EcalEndcapGeometry::producerTag
static std::string producerTag()
Definition: EcalEndcapGeometry.h:77
EEAlignmentRcd.h
EcalEndcapGeometry::yindex
unsigned int yindex(CCGFloat y, CCGFloat z) const
Definition: EcalEndcapGeometry.cc:179
EcalEndcapGeometry::dbString
static std::string dbString()
Definition: EcalEndcapGeometry.h:47
EcalEndcapGeometryRecord.h
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: CaloCellGeometry.cc:6
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
EcalEndcapGeometry::getNumberOfModules
int getNumberOfModules() const
Definition: EcalEndcapGeometry.h:56
EcalEndcapNumberingScheme
Definition: EcalEndcapNumberingScheme.h:10
EcalEndcapGeometry::avgAbsZFrontFaceCenter
CCGFloat avgAbsZFrontFaceCenter() const
Definition: EcalEndcapGeometry.cc:429
EcalEndcapGeometry::m_xlo
CCGFloat m_xlo[2]
Definition: EcalEndcapGeometry.h:115
EcalEndcapNumberingScheme.h
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
EcalEndcapGeometry::getCells
CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
Definition: EcalEndcapGeometry.cc:307
EcalEndcapGeometry::setNumberOfModules
void setNumberOfModules(const int nnmods)
Definition: EcalEndcapGeometry.h:60
EcalEndcapGeometry::m_check
std::atomic< bool > m_check
Definition: EcalEndcapGeometry.h:129
EcalEndcapGeometry::m_nref
unsigned int m_nref
Definition: EcalEndcapGeometry.h:117
EcalEndcapGeometry::m_xoff
CCGFloat m_xoff[2]
Definition: EcalEndcapGeometry.h:115
CMS_THREAD_GUARD
#define CMS_THREAD_GUARD(_var_)
Definition: thread_safety_macros.h:6
EcalEndcapGeometry::getClosestCell
DetId getClosestCell(const GlobalPoint &r) const override
Definition: EcalEndcapGeometry.cc:210
EcalEndcapGeometry::m_borderMgr
std::atomic< EZMgrFL< EBDetId > * > m_borderMgr
Definition: EcalEndcapGeometry.h:124
EcalEndcapGeometry::detIdFromLocalAlignmentIndex
static DetId detIdFromLocalAlignmentIndex(unsigned int iLoc)
Definition: EcalEndcapGeometry.cc:62
EcalEndcapGeometry::alignmentTransformIndexLocal
static unsigned int alignmentTransformIndexLocal(const DetId &id)
Definition: EcalEndcapGeometry.cc:53
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
EcalEndcapGeometry::_nncrys
int _nncrys
number of crystals per module
Definition: EcalEndcapGeometry.h:111
EcalEndcapGeometry::numberOfShapes
unsigned int numberOfShapes() const override
Definition: EcalEndcapGeometry.h:49
EcalEndcapGeometry::IdealRecord
IdealGeometryRecord IdealRecord
Definition: EcalEndcapGeometry.h:28