CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
HCaloDetIdAssociator Class Reference

#include <CaloDetIdAssociator.h>

Inheritance diagram for HCaloDetIdAssociator:
HDetIdAssociator HEcalDetIdAssociator HHcalDetIdAssociator

Public Member Functions

 HCaloDetIdAssociator ()
 
 HCaloDetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
 
virtual void setGeometry (const CaloGeometry *ptr)
 
- Public Member Functions inherited from HDetIdAssociator
virtual std::set< DetIdgetCrossedDetIds (const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory)
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &, const int idR=0)
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &point, const double dR=0)
 
virtual std::set< DetIdgetDetIdsInACone (const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory, const double)
 
virtual std::set< DetIdgetMaxEDetId (const std::set< DetId > &, edm::Handle< CaloTowerCollection > caloTowers)
 
virtual std::set< DetIdgetMaxEDetId (const std::set< DetId > &, edm::Handle< HBHERecHitCollection > recHits)
 
virtual std::vector< GlobalPointgetTrajectory (const FreeTrajectoryState &, const std::vector< GlobalPoint > &)
 
 HDetIdAssociator ()
 
 HDetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
 
virtual int iEta (const GlobalPoint &)
 
virtual int iPhi (const GlobalPoint &)
 
virtual void setPropagator (Propagator *ptr)
 
virtual ~HDetIdAssociator ()
 

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 Member Functions inherited from HDetIdAssociator
virtual void buildMap ()
 
virtual bool nearElement (const GlobalPoint &point, const DetId &id, const double distance)
 

Protected Attributes

const CaloGeometrygeometry_
 
- Protected Attributes inherited from HDetIdAssociator
const double etaBinSize_
 
PropagatorivProp_
 
const int nEta_
 
const int nPhi_
 
std::vector< std::vector
< std::set< DetId > > > * 
theMap_
 

Detailed Description

Definition at line 25 of file CaloDetIdAssociator.h.

Constructor & Destructor Documentation

HCaloDetIdAssociator::HCaloDetIdAssociator ( )
inline

Definition at line 27 of file CaloDetIdAssociator.h.

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

Definition at line 28 of file CaloDetIdAssociator.h.

29  :HDetIdAssociator(nPhi, nEta, etaBinSize),geometry_(0){};
const CaloGeometry * geometry_

Member Function Documentation

virtual void HCaloDetIdAssociator::check_setup ( )
inlineprotectedvirtual

Reimplemented from HDetIdAssociator.

Definition at line 34 of file CaloDetIdAssociator.h.

References HDetIdAssociator::check_setup(), edm::hlt::Exception, and geometry_.

35  {
37  if (geometry_==0) throw cms::Exception("CaloGeometry is not set");
38  };
virtual void check_setup()
const CaloGeometry * geometry_
virtual std::set<DetId> HCaloDetIdAssociator::getASetOfValidDetIds ( )
inlineprotectedvirtual

Implements HDetIdAssociator.

Reimplemented in HHcalDetIdAssociator, and HEcalDetIdAssociator.

Definition at line 44 of file CaloDetIdAssociator.h.

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

44  {
45  std::set<DetId> setOfValidIds;
46  const std::vector<DetId>& vectOfValidIds = geometry_->getValidDetIds(DetId::Calo, 1);
47  for(std::vector<DetId>::const_iterator it = vectOfValidIds.begin(); it != vectOfValidIds.end(); ++it)
48  setOfValidIds.insert(*it);
49 
50  return setOfValidIds;
51  };
const CaloGeometry * geometry_
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:90
virtual std::vector<GlobalPoint> HCaloDetIdAssociator::getDetIdPoints ( const DetId id)
inlineprotectedvirtual

Implements HDetIdAssociator.

Definition at line 53 of file CaloDetIdAssociator.h.

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

53  {
54  std::vector<GlobalPoint> points;
56  LogDebug("CaloDetIdAssociator") << "Cannot find sub-detector geometry for " << id.rawId() <<"\n";
57  } else {
59  LogDebug("CaloDetIdAssociator") << "Cannot find CaloCell geometry for " << id.rawId() <<"\n";
60  } else {
62  points.assign( cor.begin(), cor.end() ) ;
63  points.push_back(getPosition(id));
64  }
65  }
66 
67  return points;
68  };
#define LogDebug(id)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const CaloGeometry * geometry_
virtual GlobalPoint getPosition(const DetId &id)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
void assign(const T &t=T())
Definition: EZArrayFL.h:57
const CornersVec & getCorners() const
Returns the corner points of this cell&#39;s volume.
virtual GlobalPoint HCaloDetIdAssociator::getPosition ( const DetId id)
inlineprotectedvirtual

Implements HDetIdAssociator.

Definition at line 40 of file CaloDetIdAssociator.h.

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

Referenced by getDetIdPoints().

40  {
42  };
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const CaloGeometry * geometry_
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual bool HCaloDetIdAssociator::insideElement ( const GlobalPoint point,
const DetId id 
)
inlineprotectedvirtual

Implements HDetIdAssociator.

Definition at line 70 of file CaloDetIdAssociator.h.

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

70  {
71  return geometry_->getSubdetectorGeometry(id)->getGeometry(id)->inside(point);
72  };
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const CaloGeometry * geometry_
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
bool inside(const GlobalPoint &point) const
Returns true if the specified point is inside this cell.
virtual void HCaloDetIdAssociator::setGeometry ( const CaloGeometry ptr)
inlinevirtual

Definition at line 31 of file CaloDetIdAssociator.h.

References geometry_.

31 { geometry_ = ptr; };
const CaloGeometry * geometry_

Member Data Documentation

const CaloGeometry* HCaloDetIdAssociator::geometry_
protected