CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
CastorGeometry Class Reference

#include <CastorGeometry.h>

Inheritance diagram for CastorGeometry:
CaloSubdetectorGeometry

Public Types

enum  { k_NumberOfCellsForCorners = HcalCastorDetId::kSizeForDenseIndexing }
 
enum  { k_NumberOfShapes = 4 }
 
enum  { k_NumberOfParametersPerShape = 6 }
 
typedef CastorGeometryRecord AlignedRecord
 
typedef CastorAlignmentRcd AlignmentRecord
 
typedef HcalCastorDetId DetIdType
 
typedef PCastorRcd PGeometryRecord
 
- Public Types inherited from CaloSubdetectorGeometry
typedef std::vector< const
CaloCellGeometry * > 
CellCont
 
typedef std::set< DetIdDetIdSet
 
typedef std::vector< double > DimVec
 
typedef std::vector< unsigned int > IVec
 
typedef CaloCellGeometry::ParMgr ParMgr
 
typedef CaloCellGeometry::ParVec ParVec
 
typedef CaloCellGeometry::ParVecVec ParVecVec
 
typedef std::vector< double > TrVec
 

Public Member Functions

 CastorGeometry ()
 
 CastorGeometry (const CastorTopology *topology)
 
virtual DetId getClosestCell (const GlobalPoint &r) 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) More...
 
virtual unsigned int numberOfParametersPerShape () const
 
virtual unsigned int numberOfShapes () const
 
virtual unsigned int numberOfTransformParms () const
 
virtual ~CastorGeometry ()
 
- Public Member Functions inherited from CaloSubdetectorGeometry
void addCell (const DetId &id, CaloCellGeometry *ccg)
 Add a cell to the geometry. More...
 
void allocateCorners (CaloCellGeometry::CornersVec::size_type n)
 
void allocatePar (ParVec::size_type n, unsigned int m)
 
 CaloSubdetectorGeometry ()
 
const CellContcellGeometries () const
 the cells More...
 
CaloCellGeometry::CornersMgrcornersMgr ()
 
double deltaEta (const DetId &detId) const
 
double deltaPhi (const DetId &detId) const
 
virtual void fillDefaultNamedParameters () const
 
virtual DetIdSet getCells (const GlobalPoint &r, double dR) const
 Get a list of all cells within a dR of the given cell. More...
 
virtual const CaloCellGeometrygetGeometry (const DetId &id) const
 Get the cell geometry of a given detector id. Should return false if not found. More...
 
void getSummary (TrVec &trVector, IVec &iVector, DimVec &dimVector) const
 
virtual void initializeParms ()
 
ParMgrparMgr ()
 
const ParMgrparMgrConst () const
 
ParVecVecparVecVec ()
 
const ParVecVecparVecVec () const
 
virtual bool present (const DetId &id) const
 is this detid present in the geometry? More...
 
virtual ~CaloSubdetectorGeometry ()
 The base class DOES assume that it owns the CaloCellGeometry objects. More...
 

Static Public Member Functions

static unsigned int alignmentTransformIndexGlobal (const DetId &id)
 
static unsigned int alignmentTransformIndexLocal (const DetId &id)
 
static std::string dbString ()
 
static std::vector
< HepGeom::Point3D< double > > 
localCorners (const double *pv, unsigned int i, HepGeom::Point3D< double > &ref)
 
static CaloCellGeometrynewCell (const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, CaloCellGeometry::CornersMgr *mgr, const double *parm, const DetId &detId)
 
static unsigned int numberOfAlignments ()
 
static std::string producerTag ()
 

Private Attributes

DetId::Detector lastReqDet_
 
int lastReqSubdet_
 
bool m_ownsTopology
 
std::vector< DetIdm_validIds
 
const CastorTopologytheTopology
 

Additional Inherited Members

- Static Protected Member Functions inherited from CaloSubdetectorGeometry
static double deltaR (const GlobalPoint &p1, const GlobalPoint &p2)
 
- Protected Attributes inherited from CaloSubdetectorGeometry
ParVecVec m_parVecVec
 

Detailed Description

Definition at line 13 of file CastorGeometry.h.

Member Typedef Documentation

Definition at line 18 of file CastorGeometry.h.

Definition at line 17 of file CastorGeometry.h.

Definition at line 20 of file CastorGeometry.h.

Definition at line 19 of file CastorGeometry.h.

Member Enumeration Documentation

anonymous enum
anonymous enum
Enumerator
k_NumberOfShapes 

Definition at line 24 of file CastorGeometry.h.

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 26 of file CastorGeometry.h.

Constructor & Destructor Documentation

CastorGeometry::CastorGeometry ( )

Definition at line 8 of file CastorGeometry.cc.

8  :
11  lastReqSubdet_(0),
12  m_ownsTopology ( true )
13 {
14 }
DetId::Detector lastReqDet_
const CastorTopology * theTopology
Detector
Definition: DetId.h:26
CastorGeometry::CastorGeometry ( const CastorTopology topology)
explicit

Definition at line 16 of file CastorGeometry.cc.

16  :
17  theTopology(topology),
19  lastReqSubdet_(0),
20  m_ownsTopology ( false )
21 {
22 }
DetId::Detector lastReqDet_
const CastorTopology * theTopology
Detector
Definition: DetId.h:26
CastorGeometry::~CastorGeometry ( )
virtual

Definition at line 25 of file CastorGeometry.cc.

References m_ownsTopology, and theTopology.

26 {
27  if( m_ownsTopology ) delete theTopology ;
28 }
const CastorTopology * theTopology

Member Function Documentation

unsigned int CastorGeometry::alignmentTransformIndexGlobal ( const DetId id)
static

Definition at line 101 of file CastorGeometry.cc.

References DetId::Calo.

102 {
103  return (unsigned int)DetId::Calo - 1 ;
104 }
unsigned int CastorGeometry::alignmentTransformIndexLocal ( const DetId id)
static

Definition at line 91 of file CastorGeometry.cc.

References CaloGenericDetId::isCastor().

92 {
93  const CaloGenericDetId gid ( id ) ;
94 
95  assert( gid.isCastor() ) ;
96 
97  return 0 ;
98 }
static std::string CastorGeometry::dbString ( )
inlinestatic

Definition at line 28 of file CastorGeometry.h.

28 { return "PCastorRcd" ; }
DetId CastorGeometry::getClosestCell ( const GlobalPoint r) const
virtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 71 of file CastorGeometry.cc.

References CaloSubdetectorGeometry::getGeometry(), getValidDetIds(), and CaloCellGeometry::inside().

72 {
73  DetId returnId ( 0 ) ;
74  const std::vector<DetId>& detIds ( getValidDetIds() ) ;
75  for( std::vector<DetId>::const_iterator it ( detIds.begin() ) ;
76  it != detIds.end(); ++it )
77  {
78  const CaloCellGeometry& cell ( *getGeometry( *it ) ) ;
79  if( cell.inside( r ) )
80  {
81  returnId = *it ;
82  break ;
83  }
84  }
85  return returnId ;
86 }
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition: DetId.h:20
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)
const std::vector< DetId > & CastorGeometry::getValidDetIds ( DetId::Detector  det = DetId::Detector(0),
int  subdet = 0 
) const
virtual

Get a list of valid detector ids (for the given subdetector)

Note
The implementation in this class is relevant for SubdetectorGeometries which handle only a single subdetector at a time. It does not look at the det and subdet arguments.

Reimplemented from CaloSubdetectorGeometry.

Definition at line 31 of file CastorGeometry.cc.

References CaloSubdetectorGeometry::getValidDetIds(), i, lastReqDet_, lastReqSubdet_, m_validIds, and python.multivaluedict::sort().

Referenced by getClosestCell().

33 {
34  const std::vector<DetId>& baseIds ( CaloSubdetectorGeometry::getValidDetIds() ) ;
35  if( det == DetId::Detector( 0 ) &&
36  subdet == 0 )
37  {
38  return baseIds ;
39  }
40 
41  if( lastReqDet_ != det ||
42  lastReqSubdet_ != subdet )
43  {
44  lastReqDet_ = det ;
45  lastReqSubdet_ = subdet ;
46  m_validIds.clear();
47  m_validIds.reserve( baseIds.size() ) ;
48  }
49 
50  if( m_validIds.empty() )
51  {
52  for( unsigned int i ( 0 ) ; i != baseIds.size() ; ++i )
53  {
54  const DetId id ( baseIds[i] );
55  if( id.det() == det &&
56  id.subdetId() == subdet )
57  {
58  m_validIds.push_back( id ) ;
59  }
60  }
61  std::sort(m_validIds.begin(),m_validIds.end());
62  }
63  return m_validIds;
64 }
int i
Definition: DBlmapReader.cc:9
DetId::Detector lastReqDet_
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)
Definition: DetId.h:20
Detector
Definition: DetId.h:26
std::vector< DetId > m_validIds
std::vector< HepGeom::Point3D< double > > CastorGeometry::localCorners ( const double *  pv,
unsigned int  i,
HepGeom::Point3D< double > &  ref 
)
static

Definition at line 107 of file CastorGeometry.cc.

References calogeom::IdealCastorTrapezoid::localCorners().

110 {
111  return ( calogeom::IdealCastorTrapezoid::localCorners( pv, ref ) ) ;
112 }
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
CaloCellGeometry * CastorGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
CaloCellGeometry::CornersMgr mgr,
const double *  parm,
const DetId detId 
)
static

Definition at line 115 of file CastorGeometry.cc.

References CaloGenericDetId::isCastor().

121 {
122  const CaloGenericDetId cgid ( detId ) ;
123 
124  assert( cgid.isCastor() ) ;
125 
126  return ( new calogeom::IdealCastorTrapezoid( f1, mgr, parm ) ) ;
127 }
static unsigned int CastorGeometry::numberOfAlignments ( )
inlinestatic

Definition at line 48 of file CastorGeometry.h.

Referenced by FakeCaloAlignmentEP::produceCastorAli(), and TestCaloAlignmentEP::produceCastorAli().

48 { return 1 ; }
virtual unsigned int CastorGeometry::numberOfParametersPerShape ( ) const
inlinevirtual
virtual unsigned int CastorGeometry::numberOfShapes ( ) const
inlinevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 32 of file CastorGeometry.h.

References k_NumberOfShapes.

virtual unsigned int CastorGeometry::numberOfTransformParms ( ) const
inlinevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 30 of file CastorGeometry.h.

30 { return 3 ; }
static std::string CastorGeometry::producerTag ( )
inlinestatic

Member Data Documentation

DetId::Detector CastorGeometry::lastReqDet_
mutableprivate

Definition at line 68 of file CastorGeometry.h.

Referenced by getValidDetIds().

int CastorGeometry::lastReqSubdet_
mutableprivate

Definition at line 69 of file CastorGeometry.h.

Referenced by getValidDetIds().

bool CastorGeometry::m_ownsTopology
private

Definition at line 71 of file CastorGeometry.h.

Referenced by ~CastorGeometry().

std::vector<DetId> CastorGeometry::m_validIds
mutableprivate

Definition at line 70 of file CastorGeometry.h.

Referenced by getValidDetIds().

const CastorTopology* CastorGeometry::theTopology
private

Definition at line 67 of file CastorGeometry.h.

Referenced by ~CastorGeometry().