CMS 3D CMS Logo

ZdcGeometry.cc
Go to the documentation of this file.
7 #include <algorithm>
8 
12 
14  : theTopology(new ZdcTopology),
15  lastReqDet_(DetId::Detector(0)),
16  lastReqSubdet_(0),
17  m_ownsTopology(true),
18  m_cellVec(k_NumberOfCellsForCorners) {}
19 
21  : theTopology(topology),
22  lastReqDet_(DetId::Detector(0)),
23  lastReqSubdet_(0),
24  m_ownsTopology(false),
25  m_cellVec(k_NumberOfCellsForCorners) {}
26 
28  if (m_ownsTopology)
29  delete theTopology;
30 }
31 /*
32 DetId ZdcGeometry::getClosestCell(const GlobalPoint& r) const
33 {
34  DetId returnId ( 0 ) ;
35  const std::vector<DetId>& detIds ( getValidDetIds() ) ;
36  for( std::vector<DetId>::const_iterator it ( detIds.begin() ) ;
37  it != detIds.end(); ++it )
38  {
39  auto cell = ( getGeometry( *it ) ) ;
40  if( 0 != cell &&
41  cell->inside( r ) )
42  {
43  returnId = *it ;
44  break ;
45  }
46  }
47  return returnId ;
48 }
49 */
51  const CaloGenericDetId gid(id);
52  assert(gid.isZDC());
53 
54  return (0 > HcalZDCDetId(id).zside() ? 0 : 1);
55 }
56 
57 unsigned int ZdcGeometry::alignmentTransformIndexGlobal(const DetId& /*id*/) { return (unsigned int)DetId::Calo - 1; }
58 
59 void ZdcGeometry::localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int /*i*/, Pt3D& ref) {
61 }
62 
64  const GlobalPoint& /*f2*/,
65  const GlobalPoint& /*f3*/,
66  const CCGFloat* parm,
67  const DetId& detId) {
68  const CaloGenericDetId cgid(detId);
69  assert(cgid.isZDC());
70 
71  const unsigned int di(cgid.denseIndex());
72 
73  m_cellVec[di] = IdealZDCTrapezoid(f1, cornersMgr(), parm);
75 }
76 
78  // Modify the RawPtr class
79  if (m_cellVec.size() < index)
80  return nullptr;
81  const CaloCellGeometry* cell(&m_cellVec[index]);
82  return (((cell == nullptr) || (nullptr == cell->param())) ? nullptr : cell);
83 }
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
Definition: ZdcGeometry.cc:63
static unsigned int alignmentTransformIndexLocal(const DetId &id)
Definition: ZdcGeometry.cc:50
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: ZdcGeometry.cc:59
CellVec m_cellVec
Definition: ZdcGeometry.h:72
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
Definition: ZdcGeometry.cc:77
CaloCellGeometry::Pt3D Pt3D
Definition: ZdcGeometry.h:17
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
Definition: ZdcGeometry.cc:57
uint32_t denseIndex() const
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: ZdcGeometry.h:18
std::vector< Pt3D > Pt3DVec
assert(be >=bs)
CaloCellGeometry::Pt3D Pt3D
Definition: ZdcGeometry.cc:10
CaloCellGeometry::CCGFloat CCGFloat
bool m_ownsTopology
Definition: ZdcGeometry.h:70
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:67
~ZdcGeometry() override
Definition: ZdcGeometry.cc:27
Definition: DetId.h:17
CaloCellGeometry::CCGFloat CCGFloat
Definition: ZdcGeometry.cc:9
void addValidID(const DetId &id)
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
CaloCellGeometry::CornersMgr * cornersMgr()
HepGeom::Point3D< CCGFloat > Pt3D
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: ZdcGeometry.cc:11
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:82
const CCGFloat * param() const
bool isZDC() const