Main Page
Namespaces
Classes
Package Documentation
FastSimulation
CaloGeometryTools
src
DistanceToCell.cc
Go to the documentation of this file.
1
#include "
FastSimulation/CaloGeometryTools/interface/DistanceToCell.h
"
2
3
#include "
Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h
"
4
#include "
Geometry/CaloGeometry/interface/CaloCellGeometry.h
"
5
6
DistanceToCell::DistanceToCell
():det_(0) {;}
7
8
DistanceToCell::DistanceToCell
(
const
DistanceToCell
& dist)
9
{
10
det_
= dist.
det_
;
11
pivotPosition_
= dist.
pivotPosition_
;
12
pivot_
= dist.
pivot_
;
13
}
14
15
DistanceToCell::DistanceToCell
(
const
CaloSubdetectorGeometry
* det,
const
DetId
& cell):
det_
(det),
pivot_
(cell)
16
{
17
pivotPosition_
=
det_
->
getGeometry
(
pivot_
)->
getPosition
();
18
}
19
20
bool
DistanceToCell::operator()
(
const
DetId
&
c1
,
const
DetId
& c2)
21
{
22
return
((
det_
->
getGeometry
(c1)->
getPosition
()-
pivotPosition_
).
mag2
()<
23
(
det_
->
getGeometry
(c2)->
getPosition
()-
pivotPosition_
).
mag2
());
24
}
CaloCellGeometry.h
CaloSubdetectorGeometry
Definition:
CaloSubdetectorGeometry.h:24
CaloCellGeometry::getPosition
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition:
CaloCellGeometry.h:84
CaloSubdetectorGeometry::getGeometry
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition:
CaloSubdetectorGeometry.cc:44
DistanceToCell::pivot_
DetId pivot_
Definition:
DistanceToCell.h:22
CaloSubdetectorGeometry.h
mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition:
Basic3DVectorLD.h:144
DistanceToCell::pivotPosition_
GlobalPoint pivotPosition_
Definition:
DistanceToCell.h:23
alignmentValidation.c1
c1
do drawing
Definition:
alignmentValidation.py:1023
DetId
Definition:
DetId.h:18
DistanceToCell
Definition:
DistanceToCell.h:11
DistanceToCell.h
DistanceToCell::det_
const CaloSubdetectorGeometry * det_
Definition:
DistanceToCell.h:21
DistanceToCell::DistanceToCell
DistanceToCell()
Definition:
DistanceToCell.cc:6
DistanceToCell::operator()
bool operator()(const DetId &c1, const DetId &c2)
Definition:
DistanceToCell.cc:20
Generated for CMSSW Reference Manual by
1.8.11