CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

HCaloDetIdAssociator Class Reference

#include <CaloDetIdAssociator.h>

Inheritance diagram for HCaloDetIdAssociator:
HDetIdAssociator HEcalDetIdAssociator HHcalDetIdAssociator

List of all members.

Public Member Functions

 HCaloDetIdAssociator ()
 HCaloDetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
virtual void setGeometry (const CaloGeometry *ptr)

Protected Member Functions

virtual void check_setup ()
virtual std::set< DetIdgetASetOfValidDetIds ()
virtual std::vector< GlobalPointgetDetIdPoints (const DetId &id)
virtual GlobalPoint getPosition (const DetId &id)
virtual bool insideElement (const GlobalPoint &point, const DetId &id)

Protected Attributes

const CaloGeometrygeometry_

Detailed Description

Definition at line 25 of file CaloDetIdAssociator.h.


Constructor & Destructor Documentation

HCaloDetIdAssociator::HCaloDetIdAssociator ( ) [inline]

Definition at line 27 of file CaloDetIdAssociator.h.

:HDetIdAssociator(72, 70 ,0.087),geometry_(0){};
HCaloDetIdAssociator::HCaloDetIdAssociator ( const int  nPhi,
const int  nEta,
const double  etaBinSize 
) [inline]

Definition at line 28 of file CaloDetIdAssociator.h.

     :HDetIdAssociator(nPhi, nEta, etaBinSize),geometry_(0){};

Member Function Documentation

virtual void HCaloDetIdAssociator::check_setup ( ) [inline, protected, virtual]

Reimplemented from HDetIdAssociator.

Definition at line 34 of file CaloDetIdAssociator.h.

References Exception, and geometry_.

     {
        HDetIdAssociator::check_setup();
        if (geometry_==0) throw cms::Exception("CaloGeometry is not set");
     };
virtual std::set<DetId> HCaloDetIdAssociator::getASetOfValidDetIds ( ) [inline, protected, virtual]

Implements HDetIdAssociator.

Reimplemented in HEcalDetIdAssociator, and HHcalDetIdAssociator.

Definition at line 44 of file CaloDetIdAssociator.h.

References DetId::Calo, geometry_, and CaloGeometry::getValidDetIds().

                                               {
      std::set<DetId> setOfValidIds;
      const std::vector<DetId>& vectOfValidIds = geometry_->getValidDetIds(DetId::Calo, 1);
      for(std::vector<DetId>::const_iterator it = vectOfValidIds.begin(); it != vectOfValidIds.end(); ++it)
         setOfValidIds.insert(*it);

      return setOfValidIds;
   };
virtual std::vector<GlobalPoint> HCaloDetIdAssociator::getDetIdPoints ( const DetId id) [inline, protected, virtual]

Implements HDetIdAssociator.

Definition at line 53 of file CaloDetIdAssociator.h.

References EZArrayFL< T >::assign(), geometry_, CaloCellGeometry::getCorners(), CaloSubdetectorGeometry::getGeometry(), getPosition(), CaloGeometry::getSubdetectorGeometry(), and LogDebug.

                                                                 {
      std::vector<GlobalPoint> points;
      if(! geometry_->getSubdetectorGeometry(id)){
         LogDebug("CaloDetIdAssociator") << "Cannot find sub-detector geometry for " << id.rawId() <<"\n";
      } else {
         if(! geometry_->getSubdetectorGeometry(id)->getGeometry(id)) {
            LogDebug("CaloDetIdAssociator") << "Cannot find CaloCell geometry for " << id.rawId() <<"\n";
         } else {
            const CaloCellGeometry::CornersVec& cor ( geometry_->getSubdetectorGeometry(id)->getGeometry(id)->getCorners() );
            points.assign( cor.begin(), cor.end() ) ;
            points.push_back(getPosition(id));
         }
      }
      
      return  points;
   };
virtual GlobalPoint HCaloDetIdAssociator::getPosition ( const DetId id) [inline, protected, virtual]
virtual bool HCaloDetIdAssociator::insideElement ( const GlobalPoint point,
const DetId id 
) [inline, protected, virtual]
virtual void HCaloDetIdAssociator::setGeometry ( const CaloGeometry ptr) [inline, virtual]

Definition at line 31 of file CaloDetIdAssociator.h.

References geometry_.

{ geometry_ = ptr; };

Member Data Documentation