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
ZdcGeometry Class Reference

#include <ZdcGeometry.h>

Inheritance diagram for ZdcGeometry:
CaloSubdetectorGeometry

Public Types

enum  { k_NumberOfCellsForCorners = HcalZDCDetId::kSizeForDenseIndexing }
 
enum  { k_NumberOfShapes = 3 }
 
enum  { k_NumberOfParametersPerShape = 4 }
 
typedef ZDCGeometryRecord AlignedRecord
 
typedef ZDCAlignmentRcd AlignmentRecord
 
typedef HcalZDCDetId DetIdType
 
typedef PZdcRcd 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

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
 
 ZdcGeometry ()
 
 ZdcGeometry (const ZdcTopology *topology)
 
virtual ~ZdcGeometry ()
 
- 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 ()
 
virtual unsigned int numberOfTransformParms () const
 
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 ZdcTopologytheTopology
 

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 11 of file ZdcGeometry.h.

Member Typedef Documentation

Definition at line 16 of file ZdcGeometry.h.

Definition at line 15 of file ZdcGeometry.h.

Definition at line 18 of file ZdcGeometry.h.

Definition at line 17 of file ZdcGeometry.h.

Member Enumeration Documentation

anonymous enum
anonymous enum
Enumerator
k_NumberOfShapes 

Definition at line 22 of file ZdcGeometry.h.

anonymous enum
Enumerator
k_NumberOfParametersPerShape 

Definition at line 24 of file ZdcGeometry.h.

Constructor & Destructor Documentation

ZdcGeometry::ZdcGeometry ( )

Definition at line 8 of file ZdcGeometry.cc.

8  :
11  lastReqSubdet_(0),
12  m_ownsTopology ( true )
13 {
14 }
bool m_ownsTopology
Definition: ZdcGeometry.h:67
DetId::Detector lastReqDet_
Definition: ZdcGeometry.h:64
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:63
Detector
Definition: DetId.h:26
int lastReqSubdet_
Definition: ZdcGeometry.h:65
ZdcGeometry::ZdcGeometry ( const ZdcTopology topology)
explicit

Definition at line 16 of file ZdcGeometry.cc.

16  :
17  theTopology(topology),
19  lastReqSubdet_(0),
20  m_ownsTopology ( false )
21 {
22 }
bool m_ownsTopology
Definition: ZdcGeometry.h:67
DetId::Detector lastReqDet_
Definition: ZdcGeometry.h:64
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:63
Detector
Definition: DetId.h:26
int lastReqSubdet_
Definition: ZdcGeometry.h:65
ZdcGeometry::~ZdcGeometry ( )
virtual

Definition at line 24 of file ZdcGeometry.cc.

References m_ownsTopology, and theTopology.

25 {
26  if( m_ownsTopology ) delete theTopology ;
27 }
bool m_ownsTopology
Definition: ZdcGeometry.h:67
const ZdcTopology * theTopology
Definition: ZdcGeometry.h:63

Member Function Documentation

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

Definition at line 93 of file ZdcGeometry.cc.

References DetId::Calo.

94 {
95  return (unsigned int)DetId::Calo - 1 ;
96 }
unsigned int ZdcGeometry::alignmentTransformIndexLocal ( const DetId id)
static

Definition at line 83 of file ZdcGeometry.cc.

References CaloGenericDetId::isZDC(), and HcalZDCDetId::zside().

84 {
85  const CaloGenericDetId gid ( id ) ;
86 
87  assert( gid.isZDC() ) ;
88 
89  return ( 0 > HcalZDCDetId( id ).zside() ? 0 : 1 ) ;
90 }
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:36
static std::string ZdcGeometry::dbString ( )
inlinestatic

Definition at line 26 of file ZdcGeometry.h.

26 { return "PZdcRcd" ; }
DetId ZdcGeometry::getClosestCell ( const GlobalPoint r) const
virtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 65 of file ZdcGeometry.cc.

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

66 {
67  DetId returnId ( 0 ) ;
68  const std::vector<DetId>& detIds ( getValidDetIds() ) ;
69  for( std::vector<DetId>::const_iterator it ( detIds.begin() ) ;
70  it != detIds.end(); ++it )
71  {
72  const CaloCellGeometry& cell ( *getGeometry( *it ) ) ;
73  if( cell.inside( r ) )
74  {
75  returnId = *it ;
76  break ;
77  }
78  }
79  return returnId ;
80 }
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)
Definition: ZdcGeometry.cc:30
const std::vector< DetId > & ZdcGeometry::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 30 of file ZdcGeometry.cc.

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

Referenced by getClosestCell().

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

Definition at line 99 of file ZdcGeometry.cc.

References calogeom::IdealZDCTrapezoid::localCorners().

102 {
103  return ( calogeom::IdealZDCTrapezoid::localCorners( pv, ref ) ) ;
104 }
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
CaloCellGeometry * ZdcGeometry::newCell ( const GlobalPoint f1,
const GlobalPoint f2,
const GlobalPoint f3,
CaloCellGeometry::CornersMgr mgr,
const double *  parm,
const DetId detId 
)
static

Definition at line 107 of file ZdcGeometry.cc.

References CaloGenericDetId::isZDC().

113 {
114  const CaloGenericDetId cgid ( detId ) ;
115 
116  assert( cgid.isZDC() ) ;
117 
118  return ( new calogeom::IdealZDCTrapezoid( f1, mgr, parm ) ) ;
119 }
static unsigned int ZdcGeometry::numberOfAlignments ( )
inlinestatic

Definition at line 44 of file ZdcGeometry.h.

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

44 { return 2 ; }
virtual unsigned int ZdcGeometry::numberOfParametersPerShape ( ) const
inlinevirtual
virtual unsigned int ZdcGeometry::numberOfShapes ( ) const
inlinevirtual

Reimplemented from CaloSubdetectorGeometry.

Definition at line 28 of file ZdcGeometry.h.

References k_NumberOfShapes.

static std::string ZdcGeometry::producerTag ( )
inlinestatic

Member Data Documentation

DetId::Detector ZdcGeometry::lastReqDet_
mutableprivate

Definition at line 64 of file ZdcGeometry.h.

Referenced by getValidDetIds().

int ZdcGeometry::lastReqSubdet_
mutableprivate

Definition at line 65 of file ZdcGeometry.h.

Referenced by getValidDetIds().

bool ZdcGeometry::m_ownsTopology
private

Definition at line 67 of file ZdcGeometry.h.

Referenced by ~ZdcGeometry().

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

Definition at line 66 of file ZdcGeometry.h.

Referenced by getValidDetIds().

const ZdcTopology* ZdcGeometry::theTopology
private

Definition at line 63 of file ZdcGeometry.h.

Referenced by ~ZdcGeometry().