CMS 3D CMS Logo

DistanceToCell.cc
Go to the documentation of this file.
2 
6 
8 
10 {
11  det_= dist.det_;
13  pivot_= dist.pivot_;
14 }
15 
17 {
18  pivotPosition_ = (cell.det() == DetId::Hcal) ?
19  ((HcalGeometry*)(det_))->getPosition(cell) :
21 }
22 
23 bool DistanceToCell::operator() (const DetId & c1, const DetId & c2)
24 {
25  bool ok = (c1.det() == DetId::Hcal) ?
26  ((((HcalGeometry*)(det_))->getPosition(c1)-pivotPosition_).mag2()<
27  (((HcalGeometry*)(det_))->getPosition(c2)-pivotPosition_).mag2()) :
30  return ok;
31 }
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
#define nullptr
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
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
const CaloSubdetectorGeometry * det_
bool operator()(const DetId &c1, const DetId &c2)