CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalEtaPhiRegion.cc
Go to the documentation of this file.
2 
3 EcalEtaPhiRegion::EcalEtaPhiRegion(double etaLow, double etaHigh, double phiLow, double phiHigh):
4  etaLow_(etaLow),etaHigh_(etaHigh),phiLow_(phiLow),phiHigh_(phiHigh)
5 {
6  // put phi in range -pi to pi
7  if(phiLow_ > Geom::pi()) phiLow_ -= Geom::twoPi();
8  if(phiLow_ < -Geom::pi()) phiLow_ += Geom::twoPi();
10  if(phiHigh_ < -Geom::pi()) phiHigh_ += Geom::twoPi();
11 }
12 
14 
15  double phi = position.phi();
16  double phihightemp = phiHigh_;
17 
18  if(phihightemp<phiLow_) phihightemp += Geom::twoPi();
19 
20  // put phi in range -pi to pi
21  if(phi > Geom::pi()) phi -= Geom::twoPi();
22  if(phi < -Geom::pi()) phi += Geom::twoPi();
23  if(phi<phiLow_) phi += Geom::twoPi();
24 
25 
26  return (position.eta() > etaLow_ && position.eta() < etaHigh_ &&
27  phi > phiLow_ && phi < phihightemp);
28 
29 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
bool inRegion(const GlobalPoint &position) const
T eta() const
Definition: PV3DBase.h:75
double pi()
Definition: Pi.h:31
static int position[264][3]
Definition: ReadPGInfo.cc:509
double twoPi()
Definition: Pi.h:32
EcalEtaPhiRegion(double etaLow, double etaHigh, double phiLow, double phiHigh)
Definition: DDAxes.h:10