test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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),
22  lastReqDet_(DetId::Detector(0)),
23  lastReqSubdet_(0),
24  m_ownsTopology ( false ),
25  m_cellVec ( k_NumberOfCellsForCorners )
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  const CaloCellGeometry* 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 
93 const CaloCellGeometry*
95 {
96  const CaloCellGeometry* cell ( &m_cellVec[ index ] ) ;
97  return ( m_cellVec.size() < index ||
98  0 == cell->param() ? 0 : cell ) ;
99 }
100 
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
virtual ~ZdcGeometry()
Definition: ZdcGeometry.cc:28
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:34
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
Definition: ZdcGeometry.cc:77
assert(m_qm.get())
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: ZdcGeometry.h:20
std::vector< Pt3D > Pt3DVec
CaloCellGeometry::CCGFloat CCGFloat
const CCGFloat * param() const
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const
Definition: ZdcGeometry.cc:94
bool m_ownsTopology
Definition: ZdcGeometry.h:74
CaloCellGeometry::CCGFloat CCGFloat
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:71
uint32_t denseIndex() const
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:18
void addValidID(const DetId &id)
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
CaloCellGeometry::CornersMgr * cornersMgr()
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
volatile std::atomic< bool > shutdown_flag false
bool isZDC() const