CMS 3D CMS Logo

ZdcGeometry.cc
Go to the documentation of this file.
6 #include <algorithm>
7 
11 
13  : theTopology(new ZdcTopology),
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 /*
31 DetId ZdcGeometry::getClosestCell(const GlobalPoint& r) const
32 {
33  DetId returnId ( 0 ) ;
34  const std::vector<DetId>& detIds ( getValidDetIds() ) ;
35  for( std::vector<DetId>::const_iterator it ( detIds.begin() ) ;
36  it != detIds.end(); ++it )
37  {
38  auto cell = ( getGeometry( *it ) ) ;
39  if( 0 != cell &&
40  cell->inside( r ) )
41  {
42  returnId = *it ;
43  break ;
44  }
45  }
46  return returnId ;
47 }
48 */
50  const CaloGenericDetId gid(id);
51 
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 
70  assert(cgid.isZDC());
71 
72  const unsigned int di(cgid.denseIndex());
73 
74  m_cellVec[di] = IdealZDCTrapezoid(f1, cornersMgr(), parm);
75  addValidID(detId);
76 }
77 
79  // Modify the RawPtr class
80  const CaloCellGeometry* cell(&m_cellVec[index]);
81  return (m_cellVec.size() < index || nullptr == cell->param() ? nullptr : cell);
82 }
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:49
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: ZdcGeometry.cc:59
CellVec m_cellVec
Definition: ZdcGeometry.h:70
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
Definition: ZdcGeometry.cc:78
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:9
CaloCellGeometry::CCGFloat CCGFloat
bool m_ownsTopology
Definition: ZdcGeometry.h:68
def pv(vc)
Definition: MetAnalyzer.py:7
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:65
~ZdcGeometry() override
Definition: ZdcGeometry.cc:26
Definition: DetId.h:17
CaloCellGeometry::CCGFloat CCGFloat
Definition: ZdcGeometry.cc:8
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:10
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
const CCGFloat * param() const
bool isZDC() const