CMS 3D CMS Logo

DiskSectorBounds.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 
6  // transform to system with local frame situated at disk center
7  // and rotated x/y axis
8  Local3DPoint tmp(p.y() + theOffset, -p.x(), p.z());
9 
10  return ((tmp.z() >= theZmin) & (tmp.z() <= theZmax) & (tmp.perp2() >= theRmin * theRmin) &
11  (tmp.perp2() <= theRmax * theRmax)) &&
12  (std::abs(tmp.barePhi()) <= thePhiExtH);
13 }
14 
15 bool DiskSectorBounds::inside(const Local3DPoint& p, const LocalError& err, float scale) const {
16  if ((p.z() < theZmin) | (p.z() > theZmax))
17  return false;
18 
19  Local2DPoint tmp(p.x(), p.y() + theOffset);
20  auto perp2 = tmp.mag2();
21  auto perp = std::sqrt(perp2);
22 
23  // this is not really correct, should consider also the angle of the error ellipse
24  if (perp2 == 0)
25  return scale * scale * err.yy() > theRmin * theRmin;
26 
27  LocalError tmpErr(err.xx(), err.xy(), err.yy());
28  LocalError rotatedErr = tmpErr.rotate(tmp.x(), tmp.y());
29  // x direction in this system is now r, phi is y
30 
31  float deltaR = scale * std::sqrt(rotatedErr.xx());
32  float deltaPhi = std::atan(scale * std::sqrt(rotatedErr.yy() / perp2));
33 
34  float tmpPhi = std::acos(tmp.y() / perp);
35 
36  // the previous code (tmpPhi <= thePhiExt + deltaPhi) was wrong
37  return ((perp >= std::max(theRmin - deltaR, 0.f)) & (perp <= theRmax + deltaR)) && (tmpPhi <= thePhiExtH + deltaPhi);
38 }
Point2DBase< float, LocalTag >
DiskSectorBounds::inside
bool inside(const Local3DPoint &p) const override
Determine if the point is inside the bounds.
Definition: DiskSectorBounds.cc:5
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Point3DBase< float, LocalTag >
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
LocalError
Definition: LocalError.h:12
LocalError::rotate
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:37
perp2
T perp2() const
Squared magnitude of transverse component.
Definition: Basic3DVectorLD.h:130
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
DiskSectorBounds.h
std
Definition: JetResolutionObject.h:76
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22