CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DistanceToCell.cc
Go to the documentation of this file.
2 
5 
7 
9 {
10  det_= dist.det_;
12  pivot_= dist.pivot_;
13 }
14 
15 DistanceToCell::DistanceToCell(const CaloSubdetectorGeometry * det,const DetId& cell):det_(det),pivot_(cell)
16 {
18 }
19 
20 bool DistanceToCell::operator() (const DetId & c1, const DetId & c2)
21 {
22  return ((det_->getGeometry(c1)->getPosition()-pivotPosition_).mag2()<
24 }
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
GlobalPoint pivotPosition_
Definition: DetId.h:18
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
const CaloSubdetectorGeometry * det_
bool operator()(const DetId &c1, const DetId &c2)