CMS 3D CMS Logo

HcalGeometry.h
Go to the documentation of this file.
1 #ifndef HcalGeometry_h
2 #define HcalGeometry_h
3 
5 
13 
16 
19 
20 public:
23 
24  typedef std::vector<IdealObliquePrism> HBCellVec;
25  typedef std::vector<IdealObliquePrism> HECellVec;
26  typedef std::vector<IdealObliquePrism> HOCellVec;
27  typedef std::vector<IdealZPrism> HFCellVec;
28 
32 
37 
39 
40  static std::string dbString() { return "PHcalRcd"; }
41 
42  unsigned int numberOfShapes() const override { return m_topology.getNumberOfShapes(); }
43  unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }
44 
45  explicit HcalGeometry(const HcalTopology& topology);
46 
48  ~HcalGeometry() override;
49 
50  const std::vector<DetId>& getValidDetIds(DetId::Detector det = DetId::Detector(0), int subdet = 0) const override;
51 
52  std::shared_ptr<const CaloCellGeometry> getGeometry(const DetId& id) const override;
53 
54  DetId getClosestCell(const GlobalPoint& r) const override;
55  DetId getClosestCell(const GlobalPoint& r, bool ignoreCorrect) const;
56 
57  CaloSubdetectorGeometry::DetIdSet getCells(const GlobalPoint& r, double dR) const override;
58 
59  GlobalPoint getPosition(const DetId& id) const;
60  GlobalPoint getPosition(uint32_t id, bool type) const;
61  GlobalPoint getBackPosition(const DetId& id) const;
62  GlobalPoint getBackPosition(uint32_t id, bool type) const;
64 
65  static std::string producerTag() { return "HCAL"; }
66 
67  static unsigned int numberOfBarrelAlignments() { return 36; }
68 
69  static unsigned int numberOfEndcapAlignments() { return 36; }
70 
71  static unsigned int numberOfForwardAlignments() { return 36; }
72 
73  static unsigned int numberOfOuterAlignments() { return 60; }
74 
75  unsigned int getHxSize(const int type) const;
76 
77  static unsigned int numberOfAlignments() {
80  }
81 
82  static unsigned int alignmentBarrelIndexLocal(const DetId& id);
83  static unsigned int alignmentEndcapIndexLocal(const DetId& id);
84  static unsigned int alignmentForwardIndexLocal(const DetId& id);
85  static unsigned int alignmentOuterIndexLocal(const DetId& id);
86  static unsigned int alignmentTransformIndexLocal(const DetId& id);
87 
88  static unsigned int alignmentBarEndForIndexLocal(const DetId& id, unsigned int nD);
89 
90  static unsigned int alignmentTransformIndexGlobal(const DetId& id);
91 
92  static DetId detIdFromLocalAlignmentIndex(unsigned int i);
93  static DetId detIdFromBarrelAlignmentIndex(unsigned int i);
94  static DetId detIdFromEndcapAlignmentIndex(unsigned int i);
95  static DetId detIdFromForwardAlignmentIndex(unsigned int i);
96  static DetId detIdFromOuterAlignmentIndex(unsigned int i);
97 
98  void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
99 
100  void newCell(const GlobalPoint& f1,
101  const GlobalPoint& f2,
102  const GlobalPoint& f3,
103  const CCGFloat* parm,
104  const DetId& detId) override;
105 
109  CaloSubdetectorGeometry::IVec& dinsVector) const override;
110 
111  const HcalTopology& topology() const { return m_topology; }
112 
113 protected:
114  unsigned int indexFor(const DetId& id) const override { return m_topology.detId2denseId(id); }
115  unsigned int sizeForDenseIndex(const DetId& id) const override { return m_topology.ncells(); }
116 
117  // Modify the RawPtr class
118  const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override;
119 
120 private:
121  // Base clas for getting geometry
122  std::shared_ptr<const CaloCellGeometry> getGeometryBase(const DetId& id) const {
124  }
125 
126  //returns din
127  unsigned int newCellImpl(
128  const GlobalPoint& f1, const GlobalPoint& f2, const GlobalPoint& f3, const CCGFloat* parm, const DetId& detId);
129 
130  //can only be used by friend classes, to ensure sorting is done at the end
131  void newCellFast(
132  const GlobalPoint& f1, const GlobalPoint& f2, const GlobalPoint& f3, const CCGFloat* parm, const DetId& detId);
133 
134  void increaseReserve(unsigned int extra);
135  void sortValidIds();
136 
137  void fillDetIds() const;
138 
139  void init();
140 
142  int etaRing(HcalSubdetector bc, double abseta) const;
143  int phiBin(HcalSubdetector bc, int etaring, double phi) const;
144  DetId correctId(const DetId& id) const;
145 
148 
155 
160 };
161 
162 #endif
IdealObliquePrism.h
CaloCellGeometry::Pt3DVec
std::vector< Pt3D > Pt3DVec
Definition: CaloCellGeometry.h:55
HcalGeometry::getGeometryRawPtr
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
Definition: HcalGeometry.cc:493
HcalGeometry::increaseReserve
void increaseReserve(unsigned int extra)
Definition: HcalGeometry.cc:589
HcalGeometry::sizeForDenseIndex
unsigned int sizeForDenseIndex(const DetId &id) const override
Definition: HcalGeometry.h:115
HcalGeometry::m_mergePosition
bool m_mergePosition
Definition: HcalGeometry.h:147
mps_fire.i
i
Definition: mps_fire.py:428
HcalGeometry::Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: HcalGeometry.h:30
HcalGeometry::numberOfAlignments
static unsigned int numberOfAlignments()
Definition: HcalGeometry.h:77
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
HcalGeometry::producerTag
static std::string producerTag()
Definition: HcalGeometry.h:65
HcalGeometry::AlignmentRecord
HcalAlignmentRcd AlignmentRecord
Definition: HcalGeometry.h:33
CaloSubdetectorGeometry::DetIdSet
std::set< DetId > DetIdSet
Definition: CaloSubdetectorGeometry.h:27
HcalGeometry::DetIdType
HcalDetId DetIdType
Definition: HcalGeometry.h:36
CaloSubdetectorGeometry::DimVec
std::vector< CCGFloat > DimVec
Definition: CaloSubdetectorGeometry.h:35
HcalGeometry::Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HcalGeometry.h:31
HcalGeometry::newCellImpl
unsigned int newCellImpl(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
Definition: HcalGeometry.cc:448
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
HcalTopology
Definition: HcalTopology.h:26
HcalFlexiHardcodeGeometryLoader
Definition: HcalFlexiHardcodeGeometryLoader.h:18
CaloSubdetectorGeometry::TrVec
std::vector< CCGFloat > TrVec
Definition: CaloSubdetectorGeometry.h:33
HcalGeometry::m_hfCellVec
HFCellVec m_hfCellVec
Definition: HcalGeometry.h:159
HcalGeometry::m_hbCellVec
HBCellVec m_hbCellVec
Definition: HcalGeometry.h:156
HcalGeometry::init
void init()
Definition: HcalGeometry.cc:24
HcalGeometry::newCellFast
void newCellFast(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
Definition: HcalGeometry.cc:485
HcalAlignmentRcd.h
HcalGeometry::alignmentBarrelIndexLocal
static unsigned int alignmentBarrelIndexLocal(const DetId &id)
Definition: HcalGeometry.cc:390
HcalGeometry::alignmentTransformIndexLocal
static unsigned int alignmentTransformIndexLocal(const DetId &id)
Definition: HcalGeometry.cc:413
HcalGeometry::alignmentEndcapIndexLocal
static unsigned int alignmentEndcapIndexLocal(const DetId &id)
Definition: HcalGeometry.cc:394
CaloSubdetectorGeometry::IVec
std::vector< unsigned int > IVec
Definition: CaloSubdetectorGeometry.h:34
EZArrayFL< GlobalPoint >
HcalGeometry::numberOfBarrelAlignments
static unsigned int numberOfBarrelAlignments()
Definition: HcalGeometry.h:67
HcalGeometry::HOCellVec
std::vector< IdealObliquePrism > HOCellVec
Definition: HcalGeometry.h:26
HcalGeometry::indexFor
unsigned int indexFor(const DetId &id) const override
Definition: HcalGeometry.h:114
HcalGeometry::detIdFromBarrelAlignmentIndex
static DetId detIdFromBarrelAlignmentIndex(unsigned int i)
Definition: HcalGeometry.cc:338
HcalGeometry::m_hoCellVec
HOCellVec m_hoCellVec
Definition: HcalGeometry.h:158
HcalGeometry::getValidDetIds
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
Definition: HcalGeometry.cc:76
HcalGeometry::numberOfParametersPerShape
unsigned int numberOfParametersPerShape() const override
Definition: HcalGeometry.h:43
HcalGeometry::m_topology
const HcalTopology & m_topology
Definition: HcalGeometry.h:146
HcalGeometry::numberOfOuterAlignments
static unsigned int numberOfOuterAlignments()
Definition: HcalGeometry.h:73
HcalGeometry::m_emptyIds
edm::AtomicPtrCache< std::vector< DetId > > m_emptyIds
Definition: HcalGeometry.h:153
HcalGeometry::sortValidIds
void sortValidIds()
Definition: HcalGeometry.cc:591
Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: CaloCellGeometry.cc:5
HcalAlignmentRcd
Definition: HcalAlignmentRcd.h:21
DetId
Definition: DetId.h:17
HcalGeometry::getBackPosition
GlobalPoint getBackPosition(const DetId &id) const
Definition: HcalGeometry.cc:208
HcalGeometry::getSummary
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
Definition: HcalGeometry.cc:512
HcalGeometry::HECellVec
std::vector< IdealObliquePrism > HECellVec
Definition: HcalGeometry.h:25
HcalGeometry::detIdFromForwardAlignmentIndex
static DetId detIdFromForwardAlignmentIndex(unsigned int i)
Definition: HcalGeometry.cc:352
IdealZPrism.h
HcalGeometry::phiBin
int phiBin(HcalSubdetector bc, int etaring, double phi) const
Definition: HcalGeometry.cc:258
Point3DBase< float, GlobalTag >
HcalGeometry::alignmentOuterIndexLocal
static unsigned int alignmentOuterIndexLocal(const DetId &id)
Definition: HcalGeometry.cc:402
HcalTopology::detId2denseId
unsigned int detId2denseId(const DetId &id) const override
return a linear packed id
Definition: HcalTopology.cc:1518
CaloCellGeometry::Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: CaloCellGeometry.h:54
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalGeometry::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: HcalGeometry.h:29
HcalGeometry::getGeometry
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const override
Get the cell geometry of a given detector id. Should return false if not found.
Definition: HcalGeometry.cc:89
HcalGeometryRecord
Definition: HcalGeometryRecord.h:23
HcalGeometry::PGeometryRecord
PHcalRcd PGeometryRecord
Definition: HcalGeometry.h:35
CaloSubdetectorGeometry.h
HcalGeometry::HBCellVec
std::vector< IdealObliquePrism > HBCellVec
Definition: HcalGeometry.h:24
edm::AtomicPtrCache
Definition: AtomicPtrCache.h:38
HcalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HcalGeometry.cc:179
HcalGeometry::getCorners
CaloCellGeometry::CornersVec getCorners(const DetId &id) const
Definition: HcalGeometry.cc:239
HcalGeometry::m_heCellVec
HECellVec m_heCellVec
Definition: HcalGeometry.h:157
CaloCellGeometry
Definition: CaloCellGeometry.h:50
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HcalDetId.h
HcalGeometry::dbString
static std::string dbString()
Definition: HcalGeometry.h:40
PHcalRcd
Definition: PHcalRcd.h:5
HcalDetId
Definition: HcalDetId.h:12
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
HcalGeometry::newCell
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
Definition: HcalGeometry.cc:477
HcalGeometry::fillDetIds
void fillDetIds() const
Definition: HcalGeometry.cc:40
HcalGeometry::HcalGeometryPlan1Tester
friend class HcalGeometryPlan1Tester
Definition: HcalGeometry.h:18
HcalGeometry::k_NumberOfParametersPerShape
Definition: HcalGeometry.h:38
DetId::Detector
Detector
Definition: DetId.h:24
HcalGeometry::alignmentTransformIndexGlobal
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
Definition: HcalGeometry.cc:436
AtomicPtrCache.h
HcalGeometry::numberOfForwardAlignments
static unsigned int numberOfForwardAlignments()
Definition: HcalGeometry.h:71
HcalGeometry::m_dins
CaloSubdetectorGeometry::IVec m_dins
Definition: HcalGeometry.h:154
HcalGeometry::alignmentForwardIndexLocal
static unsigned int alignmentForwardIndexLocal(const DetId &id)
Definition: HcalGeometry.cc:398
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalGeometry::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: HcalGeometry.cc:262
DDAxes::phi
HcalGeometry::alignmentBarEndForIndexLocal
static unsigned int alignmentBarEndForIndexLocal(const DetId &id, unsigned int nD)
Definition: HcalGeometry.cc:381
HcalGeometry::HcalGeometry
HcalGeometry(const HcalTopology &topology)
Definition: HcalGeometry.cc:17
HcalTopology.h
HcalGeometry::m_hbIds
edm::AtomicPtrCache< std::vector< DetId > > m_hbIds
Definition: HcalGeometry.h:149
HcalGeometry::m_hoIds
edm::AtomicPtrCache< std::vector< DetId > > m_hoIds
Definition: HcalGeometry.h:151
HcalGeometry::detIdFromLocalAlignmentIndex
static DetId detIdFromLocalAlignmentIndex(unsigned int i)
Definition: HcalGeometry.cc:367
HcalTopology::getNumberOfShapes
unsigned int getNumberOfShapes() const
Definition: HcalTopology.h:161
HcalHardcodeGeometryLoader
Definition: HcalHardcodeGeometryLoader.h:17
HcalGeometry::numberOfEndcapAlignments
static unsigned int numberOfEndcapAlignments()
Definition: HcalGeometry.h:69
HcalGeometry::localCorners
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: HcalGeometry.cc:438
HcalGeometry::getHxSize
unsigned int getHxSize(const int type) const
Definition: HcalGeometry.cc:321
HcalTopology::ncells
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
Definition: HcalTopology.cc:1686
HcalGeometry::etaRing
int etaRing(HcalSubdetector bc, double abseta) const
helper methods for getClosestCell
Definition: HcalGeometry.cc:256
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
HcalGeometry::AlignedRecord
HcalGeometryRecord AlignedRecord
Definition: HcalGeometry.h:34
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: CaloCellGeometry.cc:6
HcalGeometry::topology
const HcalTopology & topology() const
Definition: HcalGeometry.h:111
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
HcalGeometry::HFCellVec
std::vector< IdealZPrism > HFCellVec
Definition: HcalGeometry.h:27
HcalGeometry::~HcalGeometry
~HcalGeometry() override
The HcalGeometry will delete all its cell geometries at destruction time.
Definition: HcalGeometry.cc:22
HcalGeometry::getGeometryBase
std::shared_ptr< const CaloCellGeometry > getGeometryBase(const DetId &id) const
Definition: HcalGeometry.h:122
HcalGeometryRecord.h
CaloSubdetectorGeometry::cellGeomPtr
virtual std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const
Definition: CaloSubdetectorGeometry.cc:260
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
HcalGeometry::m_heIds
edm::AtomicPtrCache< std::vector< DetId > > m_heIds
Definition: HcalGeometry.h:150
HcalGeometry::detIdFromOuterAlignmentIndex
static DetId detIdFromOuterAlignmentIndex(unsigned int i)
Definition: HcalGeometry.cc:359
HcalGeometry
Definition: HcalGeometry.h:17
HcalGeometry::m_hfIds
edm::AtomicPtrCache< std::vector< DetId > > m_hfIds
Definition: HcalGeometry.h:152
HcalGeometry::correctId
DetId correctId(const DetId &id) const
Definition: HcalGeometry.cc:580
HcalGeometry::numberOfShapes
unsigned int numberOfShapes() const override
Definition: HcalGeometry.h:42
HcalGeometry::detIdFromEndcapAlignmentIndex
static DetId detIdFromEndcapAlignmentIndex(unsigned int i)
Definition: HcalGeometry.cc:345
HcalGeometry::getClosestCell
DetId getClosestCell(const GlobalPoint &r) const override
Definition: HcalGeometry.cc:107