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 {}
19 
21  theTopology(topology),
23  lastReqSubdet_(0),
26 {}
27 
29 {
30  if( m_ownsTopology ) delete theTopology ;
31 }
32 /*
33 DetId ZdcGeometry::getClosestCell(const GlobalPoint& r) const
34 {
35  DetId returnId ( 0 ) ;
36  const std::vector<DetId>& detIds ( getValidDetIds() ) ;
37  for( std::vector<DetId>::const_iterator it ( detIds.begin() ) ;
38  it != detIds.end(); ++it )
39  {
40  auto cell = ( getGeometry( *it ) ) ;
41  if( 0 != cell &&
42  cell->inside( r ) )
43  {
44  returnId = *it ;
45  break ;
46  }
47  }
48  return returnId ;
49 }
50 */
51 unsigned int
53 {
54  const CaloGenericDetId gid ( id ) ;
55 
56  assert( gid.isZDC() ) ;
57 
58  return ( 0 > HcalZDCDetId( id ).zside() ? 0 : 1 ) ;
59 }
60 
61 unsigned int
63 {
64  return (unsigned int)DetId::Calo - 1 ;
65 }
66 
67 void
69  const CCGFloat* pv ,
70  unsigned int /*i*/ ,
71  Pt3D& ref )
72 {
73  IdealZDCTrapezoid::localCorners( lc, pv, ref ) ;
74 }
75 
76 void
78  const GlobalPoint& /*f2*/ ,
79  const GlobalPoint& /*f3*/ ,
80  const CCGFloat* parm ,
81  const DetId& detId )
82 {
83  const CaloGenericDetId cgid ( detId ) ;
84 
85  assert( cgid.isZDC() ) ;
86 
87  const unsigned int di ( cgid.denseIndex() ) ;
88 
89  m_cellVec[ di ] = IdealZDCTrapezoid( f1, cornersMgr(), parm ) ;
90  addValidID( detId ) ;
91 }
92 
94  // Modify the RawPtr class
95  const CaloCellGeometry* cell(&m_cellVec[index]);
96  return (m_cellVec.size() < index ||
97  nullptr == cell->param() ? nullptr : cell);
98 }
99 
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
Definition: ZdcGeometry.cc:77
static unsigned int alignmentTransformIndexLocal(const DetId &id)
Definition: ZdcGeometry.cc:52
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: ZdcGeometry.cc:68
CellVec m_cellVec
Definition: ZdcGeometry.h:76
CaloTopology const * topology(0)
CaloCellGeometry::Pt3D Pt3D
Definition: ZdcGeometry.h:19
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
Definition: ZdcGeometry.cc:62
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: ZdcGeometry.h:20
std::vector< Pt3D > Pt3DVec
CaloCellGeometry::Pt3D Pt3D
Definition: ZdcGeometry.cc:9
CaloCellGeometry::CCGFloat CCGFloat
const CCGFloat * param() const
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
Definition: ZdcGeometry.cc:93
bool m_ownsTopology
Definition: ZdcGeometry.h:74
def pv(vc)
Definition: MetAnalyzer.py:6
DetId::Detector lastReqDet_
Definition: ZdcGeometry.h:72
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:71
~ZdcGeometry() override
Definition: ZdcGeometry.cc:28
uint32_t denseIndex() const
Definition: DetId.h:18
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 lastReqSubdet_
Definition: ZdcGeometry.h:73
bool isZDC() const