#include <CaloDetIdAssociator.h>
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< DetId > | getASetOfValidDetIds () |
virtual std::vector< GlobalPoint > | getDetIdPoints (const DetId &id) |
virtual GlobalPoint | getPosition (const DetId &id) |
virtual bool | insideElement (const GlobalPoint &point, const DetId &id) |
Protected Attributes | |
const CaloGeometry * | geometry_ |
Definition at line 25 of file CaloDetIdAssociator.h.
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){};
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] |
Implements HDetIdAssociator.
Definition at line 40 of file CaloDetIdAssociator.h.
References geometry_, CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), and CaloGeometry::getSubdetectorGeometry().
Referenced by getDetIdPoints().
{ return geometry_->getSubdetectorGeometry(id)->getGeometry(id)->getPosition(); };
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().
{ return geometry_->getSubdetectorGeometry(id)->getGeometry(id)->inside(point); };
virtual void HCaloDetIdAssociator::setGeometry | ( | const CaloGeometry * | ptr | ) | [inline, virtual] |
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().