CMS 3D CMS Logo

MTDNavigableLayer.cc
Go to the documentation of this file.
1 
18 
19 /* Collaborating Class Header */
25 /* C++ Headers */
26 #include <algorithm>
27 
28 using namespace std;
29 
30 extern float calculateEta(float r, float z) {
31  if (z > 0)
32  return -log((tan(atan(r / z) / 2.)));
33  return log(-(tan(atan(r / z) / 2.)));
34 }
35 
37  float z = fts.position().z();
38  float r = fts.position().perp();
39  float eta;
40  if (z > 0)
41  eta = -log((tan(atan(r / z) / 2.)));
42  else
43  eta = log(-(tan(atan(r / z) / 2.)));
44 
45  double theta = atan(r / z);
46 
47  double spread = 5.0 * sqrt(fts.curvilinearError().matrix()(2, 2)) / fabs(sin(theta)); //5*sigma(eta)
48 
49  //C.L.: this spread could be too large to use.
50  // convert it to a smaller one by assuming a virtual radius
51  // that transforms the error on angle to error on z axis.
52  // not accurate, but works!
53 
54  double eta_max = 0;
55 
56  if (z > 0)
57  eta_max = calculateEta(r, z + spread);
58  else
59  eta_max = calculateEta(r, z - spread);
60 
61  spread = std::min(0.07, fabs(eta_max - eta));
62 
63  MTDEtaRange range(eta + spread, eta - spread);
64 
65  spread = 0.07;
66  // special treatment for special geometry in overlap region
67 
68  if (eta > 1.0 && eta < 1.1)
69  range = MTDEtaRange(eta + 3.0 * spread, eta - spread);
70  if (eta < -1.0 && eta > -1.1)
71  range = MTDEtaRange(eta + spread, eta - 3.0 * spread);
72 
73  return range;
74 }
75 
77  return (fts.position().basicVector().dot(fts.momentum().basicVector()) > 0);
78 }
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
MessageLogger.h
MTDNavigableLayer::trackingRange
MTDEtaRange trackingRange(const FreeTrajectoryState &fts) const
Definition: MTDNavigableLayer.cc:36
min
T min(T a, T b)
Definition: MathUtil.h:58
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
MTDEtaRange
Definition: MTDEtaRange.h:15
calculateEta
float calculateEta(float r, float z)
Definition: MTDNavigableLayer.cc:30
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
MTDDetLayerMap.h
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
MTDNavigableLayer::isInsideOut
bool isInsideOut(const FreeTrajectoryState &fts) const
Definition: MTDNavigableLayer.cc:76
PVValHelper::eta
Definition: PVValidationHelpers.h:69
FreeTrajectoryState::curvilinearError
const CurvilinearTrajectoryError & curvilinearError() const
Definition: FreeTrajectoryState.h:89
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Basic3DVector::dot
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
Definition: extBasic3DVector.h:189
MTDNavigableLayer.h
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
distMuonTCMETValueMapProducer_cff.eta_max
eta_max
Definition: distMuonTCMETValueMapProducer_cff.py:9
BarrelDetLayer.h
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
alignCSCRings.r
r
Definition: alignCSCRings.py:93
std
Definition: JetResolutionObject.h:76
MTDEtaRange.h
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
DetLayer.h
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
CurvilinearTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: CurvilinearTrajectoryError.h:61