CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes

ZdcGeometry Class Reference

#include <ZdcGeometry.h>

Inheritance diagram for ZdcGeometry:
CaloSubdetectorGeometry

List of all members.

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

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

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
Enumerator:
k_NumberOfCellsForCorners 

Definition at line 20 of file ZdcGeometry.h.

anonymous enum
Enumerator:
k_NumberOfShapes 

Definition at line 22 of file ZdcGeometry.h.

{ k_NumberOfShapes = 3 } ;
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.

ZdcGeometry::ZdcGeometry ( const ZdcTopology topology) [explicit]

Definition at line 16 of file ZdcGeometry.cc.

ZdcGeometry::~ZdcGeometry ( ) [virtual]

Definition at line 24 of file ZdcGeometry.cc.

References m_ownsTopology, and theTopology.

{
   if( m_ownsTopology ) delete theTopology ;
}

Member Function Documentation

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

Definition at line 93 of file ZdcGeometry.cc.

References DetId::Calo.

{
   return (unsigned int)DetId::Calo - 1 ;
}
unsigned int ZdcGeometry::alignmentTransformIndexLocal ( const DetId id) [static]

Definition at line 83 of file ZdcGeometry.cc.

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

{
   const CaloGenericDetId gid ( id ) ;

   assert( gid.isZDC() ) ;

   return ( 0 > HcalZDCDetId( id ).zside() ? 0 : 1 ) ;
}
static std::string ZdcGeometry::dbString ( ) [inline, static]

Definition at line 26 of file ZdcGeometry.h.

{ 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().

{
   DetId returnId ( 0 ) ;
   const std::vector<DetId>& detIds ( getValidDetIds() ) ;
   for( std::vector<DetId>::const_iterator it ( detIds.begin() ) ;
        it != detIds.end(); ++it )
   {
      const CaloCellGeometry& cell ( *getGeometry( *it ) ) ;
      if( cell.inside( r ) )
      {
         returnId = *it ;
         break ;
      }
   }
   return returnId ;
}
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().

{
   const std::vector<DetId>& baseIds ( CaloSubdetectorGeometry::getValidDetIds() ) ;
   if( det    == DetId::Detector( 0 ) &&
       subdet == 0                        )
   {
      return baseIds ;
   }
   
   if( lastReqDet_    != det    ||
       lastReqSubdet_ != subdet    ) 
   {
      lastReqDet_     = det    ;
      lastReqSubdet_  = subdet ;
      m_validIds.clear();
      m_validIds.reserve( baseIds.size() ) ;
   }

   if( m_validIds.empty() ) 
   {
      for( unsigned int i ( 0 ) ; i != baseIds.size() ; ++i ) 
      {
         const DetId id ( baseIds[i] );
         if( id.det()      == det    &&
             id.subdetId() == subdet    )
         { 
            m_validIds.push_back( id ) ;
         }
      }
      std::sort(m_validIds.begin(),m_validIds.end());
   }
   return m_validIds;
}
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().

{
   return ( calogeom::IdealZDCTrapezoid::localCorners( pv, 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().

{
   const CaloGenericDetId cgid ( detId ) ;

   assert( cgid.isZDC() ) ;

   return ( new calogeom::IdealZDCTrapezoid( f1, mgr, parm ) ) ;
}
static unsigned int ZdcGeometry::numberOfAlignments ( ) [inline, static]

Definition at line 44 of file ZdcGeometry.h.

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

{ return 2 ; }
virtual unsigned int ZdcGeometry::numberOfParametersPerShape ( ) const [inline, virtual]

Reimplemented from CaloSubdetectorGeometry.

Definition at line 29 of file ZdcGeometry.h.

References k_NumberOfParametersPerShape.

virtual unsigned int ZdcGeometry::numberOfShapes ( ) const [inline, virtual]

Reimplemented from CaloSubdetectorGeometry.

Definition at line 28 of file ZdcGeometry.h.

References k_NumberOfShapes.

{ return k_NumberOfShapes ; }
static std::string ZdcGeometry::producerTag ( ) [inline, static]

Member Data Documentation

Definition at line 64 of file ZdcGeometry.h.

Referenced by getValidDetIds().

int ZdcGeometry::lastReqSubdet_ [mutable, private]

Definition at line 65 of file ZdcGeometry.h.

Referenced by getValidDetIds().

Definition at line 67 of file ZdcGeometry.h.

Referenced by ~ZdcGeometry().

std::vector<DetId> ZdcGeometry::m_validIds [mutable, private]

Reimplemented from CaloSubdetectorGeometry.

Definition at line 66 of file ZdcGeometry.h.

Referenced by getValidDetIds().

Definition at line 63 of file ZdcGeometry.h.

Referenced by ~ZdcGeometry().