CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {}
19 
21  theTopology(topology),
22  lastReqDet_(DetId::Detector(0)),
23  lastReqSubdet_(0),
24  m_ownsTopology ( false ),
25  m_cellVec ( k_NumberOfCellsForCorners )
26 {}
27 
28 
30 {
31  if( m_ownsTopology ) delete theTopology ;
32 }
33 
34 DetId
36 {
37  DetId returnId ( 0 ) ;
38  const std::vector<DetId>& detIds ( getValidDetIds() ) ;
39  for( std::vector<DetId>::const_iterator it ( detIds.begin() ) ;
40  it != detIds.end(); ++it )
41  {
42  const CaloCellGeometry* cell ( getGeometry( *it ) ) ;
43  if( 0 != cell &&
44  cell->inside( r ) )
45  {
46  returnId = *it ;
47  break ;
48  }
49  }
50  return returnId ;
51 }
52 
53 
54 
55 unsigned int
57 {
58  const CaloGenericDetId gid ( id ) ;
59 
60  assert( gid.isCastor() ) ;
61 
62  return 0 ;
63 }
64 
65 unsigned int
67 {
68  return (unsigned int)DetId::Calo - 1 ;
69 }
70 
71 void
73  const CCGFloat* pv ,
74  unsigned int /*i*/,
75  Pt3D& ref )
76 {
77  IdealCastorTrapezoid::localCorners( lc, pv, ref ) ;
78 }
79 
80 void
82  const GlobalPoint& /*f2*/ ,
83  const GlobalPoint& /*f3*/ ,
84  const CCGFloat* parm ,
85  const DetId& detId )
86 {
87  const CaloGenericDetId cgid ( detId ) ;
88 
89  assert( cgid.isCastor() ) ;
90 
91  const unsigned int di ( cgid.denseIndex() ) ;
92 
93  m_cellVec[ di ] = IdealCastorTrapezoid( f1, cornersMgr(), parm ) ;
94  addValidID( detId ) ;
95 }
96 
97 const CaloCellGeometry*
99 {
100  const CaloCellGeometry* cell ( &m_cellVec[ index ] ) ;
101  return ( m_cellVec.size() < index ||
102  0 == cell->param() ? 0 : cell ) ;
103 }
CaloTopology const * topology(0)
virtual ~CastorGeometry()
bool isCastor() const
static unsigned int alignmentTransformIndexLocal(const DetId &id)
std::vector< Pt3D > Pt3DVec
CaloCellGeometry::CCGFloat CCGFloat
virtual const CaloCellGeometry * cellGeomPtr(uint32_t index) const
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)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const CastorTopology * theTopology
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
const CCGFloat * param() const
CaloCellGeometry::CCGFloat CCGFloat
uint32_t denseIndex() const
CaloCellGeometry::Pt3D Pt3D
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: DetId.h:18
bool inside(const GlobalPoint &point) const
Returns true if the specified point is inside this cell.
void addValidID(const DetId &id)
CaloCellGeometry::CornersMgr * cornersMgr()
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
CaloCellGeometry::Pt3D Pt3D
static void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
static unsigned int alignmentTransformIndexGlobal(const DetId &id)
volatile std::atomic< bool > shutdown_flag false
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
virtual DetId getClosestCell(const GlobalPoint &r) const