CMS 3D CMS Logo

SimpleDiskBounds.cc
Go to the documentation of this file.
1 
2 
5 #include <algorithm>
6 #include <cmath>
7 
8 SimpleDiskBounds::SimpleDiskBounds(float rmin, float rmax, float zmin, float zmax)
9  : theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax) {
10  if (theRmin > theRmax)
12  if (theZmin > theZmax)
14 }
15 
16 bool SimpleDiskBounds::inside(const Local2DPoint& p, const LocalError& err) const { return Bounds::inside(p, err); }
17 
18 Bounds* SimpleDiskBounds::clone() const { return new SimpleDiskBounds(*this); }
19 
20 bool SimpleDiskBounds::inside(const Local3DPoint& p, const LocalError& err, float scale) const {
21  if (p.z() < theZmin || p.z() > theZmax)
22  return false; // check the easy part first
23 
24  double perp2 = p.perp2();
25  double perp = sqrt(perp2);
26  if (perp2 == 0)
27  return scale * scale * (err.xx() + err.xy()) > theRmin * theRmin;
28 
29  // rotated error along p.x(),p.y()
30  // equivalent to (but faster than) err.rotate(p.x(),p.y()).xx()
31  // since we don't need all matrix elements
32  float deltaR = scale * sqrt(p.x() * p.x() / perp2 * err.xx() - 2 * p.x() * p.y() / perp2 * err.xy() +
33  p.y() * p.y() / perp2 * err.yy());
34  return perp > std::max(theRmin - deltaR, 0.f) && perp < theRmax + deltaR;
35 }
Point2DBase< float, LocalTag >
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Bounds
Definition: Bounds.h:18
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
SimpleDiskBounds::clone
Bounds * clone() const override
Definition: SimpleDiskBounds.cc:18
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
Bounds::inside
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
LocalError.h
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SimpleDiskBounds::theZmax
float theZmax
Definition: SimpleDiskBounds.h:44
Point3DBase< float, LocalTag >
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
runTheMatrix.err
err
Definition: runTheMatrix.py:288
SimpleDiskBounds::SimpleDiskBounds
SimpleDiskBounds(float rmin, float rmax, float zmin, float zmax)
Construct the bounds from min and max R and Z in LOCAL coordinates.
Definition: SimpleDiskBounds.cc:8
LocalError
Definition: LocalError.h:12
SimpleDiskBounds::theZmin
float theZmin
Definition: SimpleDiskBounds.h:43
SimpleDiskBounds::theRmin
float theRmin
Definition: SimpleDiskBounds.h:41
SimpleDiskBounds::theRmax
float theRmax
Definition: SimpleDiskBounds.h:42
perp2
T perp2() const
Squared magnitude of transverse component.
Definition: Basic3DVectorLD.h:130
SimpleDiskBounds::inside
bool inside(const Local3DPoint &p) const override
Determine if the point is inside the bounds.
Definition: SimpleDiskBounds.h:20
SimpleDiskBounds.h