CMS 3D CMS Logo

CastorGeometry.cc
Go to the documentation of this file.
5 #include "CastorGeometryData.h"
6 #include <algorithm>
7 
11 
13  : theTopology(new CastorTopology),
14  lastReqDet_(DetId::Detector(0)),
15  lastReqSubdet_(0),
16  m_ownsTopology(true),
17  m_cellVec(k_NumberOfCellsForCorners) {}
18 
20  : theTopology(topology),
21  lastReqDet_(DetId::Detector(0)),
22  lastReqSubdet_(0),
23  m_ownsTopology(false),
24  m_cellVec(k_NumberOfCellsForCorners) {}
25 
27  if (m_ownsTopology)
28  delete theTopology;
29 }
30 
32  DetId returnId(0);
33  const std::vector<DetId>& detIds(getValidDetIds());
34  for (auto detId : detIds) {
35  auto cell = getGeometry(detId);
36  if (nullptr != cell && cell->inside(r)) {
37  returnId = detId;
38  break;
39  }
40  }
41  return returnId;
42 }
43 
45  const CaloGenericDetId gid(id);
46 
47  assert(gid.isCastor());
48 
49  return 0;
50 }
51 
53  return (unsigned int)DetId::Calo - 1;
54 }
55 
56 void CastorGeometry::localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int /*i*/, Pt3D& ref) {
58 }
59 
61  const GlobalPoint& /*f2*/,
62  const GlobalPoint& /*f3*/,
63  const CCGFloat* parm,
64  const DetId& detId) {
65  const CaloGenericDetId cgid(detId);
66 
67  assert(cgid.isCastor());
68 
69  const unsigned int di(cgid.denseIndex());
70 
72  addValidID(detId);
73 }
74 
76  // Modify the RawPtr class
77  const CaloCellGeometry* cell(&m_cellVec[index]);
78  return (m_cellVec.size() < index || nullptr == cell->param() ? nullptr : cell);
79 }
DetId getClosestCell(const GlobalPoint &r) const override
uint32_t denseIndex() const
static unsigned int alignmentTransformIndexLocal(const DetId &id)
std::vector< Pt3D > Pt3DVec
assert(be >=bs)
CaloCellGeometry::CCGFloat CCGFloat
const CastorTopology * theTopology
def pv(vc)
Definition: MetAnalyzer.py:7
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
~CastorGeometry() override
CaloCellGeometry::CCGFloat CCGFloat
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: DetId.h:17
void addValidID(const DetId &id)
CaloCellGeometry::CornersMgr * cornersMgr()
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
CaloCellGeometry::Pt3D Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
bool isCastor() const
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
const CCGFloat * param() const