CMS 3D CMS Logo

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

CastorGeometry Class Reference

#include <CastorGeometry.h>

Inheritance diagram for CastorGeometry:
CaloSubdetectorGeometry

List of all members.

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 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)
virtual unsigned int numberOfParametersPerShape () const
virtual unsigned int numberOfShapes () const
virtual unsigned int numberOfTransformParms () const
virtual ~CastorGeometry ()

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

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

Definition at line 22 of file CastorGeometry.h.

anonymous enum
Enumerator:
k_NumberOfShapes 

Definition at line 24 of file CastorGeometry.h.

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

CastorGeometry::CastorGeometry ( const CastorTopology topology) [explicit]

Definition at line 16 of file CastorGeometry.cc.

CastorGeometry::~CastorGeometry ( ) [virtual]

Definition at line 25 of file CastorGeometry.cc.

References m_ownsTopology, and theTopology.

{
   if( m_ownsTopology ) delete theTopology ;
}

Member Function Documentation

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

Definition at line 101 of file CastorGeometry.cc.

References DetId::Calo.

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

Definition at line 91 of file CastorGeometry.cc.

References CaloGenericDetId::isCastor().

{
   const CaloGenericDetId gid ( id ) ;

   assert( gid.isCastor() ) ;

   return 0 ;
}
static std::string CastorGeometry::dbString ( ) [inline, static]

Definition at line 28 of file CastorGeometry.h.

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

{
   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 > & 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, ExpressReco_HICollisions_FallBack::id, 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 > > CastorGeometry::localCorners ( const double *  pv,
unsigned int  i,
HepGeom::Point3D< double > &  ref 
) [static]
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().

{
   const CaloGenericDetId cgid ( detId ) ;
   
   assert( cgid.isCastor() ) ;

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

Definition at line 48 of file CastorGeometry.h.

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

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 33 of file CastorGeometry.h.

References k_NumberOfParametersPerShape.

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 32 of file CastorGeometry.h.

References k_NumberOfShapes.

{ return k_NumberOfShapes ; }
virtual unsigned int CastorGeometry::numberOfTransformParms ( ) const [inline, virtual]

Reimplemented from CaloSubdetectorGeometry.

Definition at line 30 of file CastorGeometry.h.

{ return 3 ; }
static std::string CastorGeometry::producerTag ( ) [inline, static]

Member Data Documentation

Definition at line 68 of file CastorGeometry.h.

Referenced by getValidDetIds().

int CastorGeometry::lastReqSubdet_ [mutable, private]

Definition at line 69 of file CastorGeometry.h.

Referenced by getValidDetIds().

Definition at line 71 of file CastorGeometry.h.

Referenced by ~CastorGeometry().

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

Reimplemented from CaloSubdetectorGeometry.

Definition at line 70 of file CastorGeometry.h.

Referenced by getValidDetIds().

Definition at line 67 of file CastorGeometry.h.

Referenced by ~CastorGeometry().