CMS 3D CMS Logo

HCaloDetIdAssociator Class Reference

#include <Calibration/Tools/interface/CaloDetIdAssociator.h>

Inheritance diagram for HCaloDetIdAssociator:

HDetIdAssociator HEcalDetIdAssociator HHcalDetIdAssociator

List of all members.

Public Member Functions

 HCaloDetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
 HCaloDetIdAssociator ()
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.

00027 :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.

00029      :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 HDetIdAssociator::check_setup(), Exception, and geometry_.

00035      {
00036         HDetIdAssociator::check_setup();
00037         if (geometry_==0) throw cms::Exception("CaloGeometry is not set");
00038      };

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_, CaloGeometry::getValidDetIds(), and it.

00044                                                {
00045       std::set<DetId> setOfValidIds;
00046       std::vector<DetId> vectOfValidIds = geometry_->getValidDetIds(DetId::Calo, 1);
00047       for(std::vector<DetId>::const_iterator it = vectOfValidIds.begin(); it != vectOfValidIds.end(); ++it)
00048          setOfValidIds.insert(*it);
00049 
00050       return setOfValidIds;
00051    };

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

Implements HDetIdAssociator.

Definition at line 53 of file CaloDetIdAssociator.h.

References geometry_, CaloCellGeometry::getCorners(), CaloSubdetectorGeometry::getGeometry(), getPosition(), CaloGeometry::getSubdetectorGeometry(), and LogDebug.

00053                                                                  {
00054       std::vector<GlobalPoint> points;
00055       if(! geometry_->getSubdetectorGeometry(id)){
00056          LogDebug("CaloDetIdAssociator") << "Cannot find sub-detector geometry for " << id.rawId() <<"\n";
00057       } else {
00058          if(! geometry_->getSubdetectorGeometry(id)->getGeometry(id)) {
00059             LogDebug("CaloDetIdAssociator") << "Cannot find CaloCell geometry for " << id.rawId() <<"\n";
00060          } else {
00061             const CaloCellGeometry::CornersVec& cor ( geometry_->getSubdetectorGeometry(id)->getGeometry(id)->getCorners() );
00062             points.assign( cor.begin(), cor.end() ) ;
00063             points.push_back(getPosition(id));
00064          }
00065       }
00066       
00067       return  points;
00068    };

virtual GlobalPoint HCaloDetIdAssociator::getPosition ( const DetId id  )  [inline, protected, virtual]

Implements HDetIdAssociator.

Definition at line 40 of file CaloDetIdAssociator.h.

References geometry_, CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), and CaloGeometry::getSubdetectorGeometry().

Referenced by getDetIdPoints().

00040                                                    {
00041       return geometry_->getSubdetectorGeometry(id)->getGeometry(id)->getPosition();
00042    };

virtual bool HCaloDetIdAssociator::insideElement ( const GlobalPoint point,
const DetId id 
) [inline, protected, virtual]

Implements HDetIdAssociator.

Definition at line 70 of file CaloDetIdAssociator.h.

References geometry_, CaloSubdetectorGeometry::getGeometry(), CaloGeometry::getSubdetectorGeometry(), and CaloCellGeometry::inside().

00070                                                                         {
00071       return  geometry_->getSubdetectorGeometry(id)->getGeometry(id)->inside(point);
00072    };

virtual void HCaloDetIdAssociator::setGeometry ( const CaloGeometry ptr  )  [inline, virtual]

Definition at line 31 of file CaloDetIdAssociator.h.

References geometry_.

Referenced by HTrackAssociator::fillCaloTowers(), HTrackAssociator::fillEcal(), HTrackAssociator::fillHcal(), and HTrackAssociator::fillHcalTowers().

00031 { geometry_ = ptr; };


Member Data Documentation

const CaloGeometry* HCaloDetIdAssociator::geometry_ [protected]

Definition at line 72 of file CaloDetIdAssociator.h.

Referenced by check_setup(), HEcalDetIdAssociator::getASetOfValidDetIds(), getASetOfValidDetIds(), HHcalDetIdAssociator::getASetOfValidDetIds(), getDetIdPoints(), getPosition(), insideElement(), and setGeometry().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:23:48 2009 for CMSSW by  doxygen 1.5.4