CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonNavigableLayer.cc
Go to the documentation of this file.
1 
18 
19 /* Collaborating Class Header */
25 /* C++ Headers */
26 #include <algorithm>
27 
28 
29 using namespace std;
30 
31 extern float calculateEta(float r, float z) {
32  if ( z > 0 ) return -log((tan(atan(r/z)/2.)));
33  return log(-(tan(atan(r/z)/2.)));
34 
35 }
36 
38 {
39  float z = fts.position().z();
40  float r = fts.position().perp();
41  float eta;
42  if ( z>0 ) eta = -log((tan(atan(r/z)/2.)));
43  else 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 ) eta_max = calculateEta(r, z+spread);
57  else eta_max = calculateEta(r, z-spread);
58 
59  spread = std::min(0.07, fabs(eta_max-eta));
60 
61  MuonEtaRange range(eta+spread,eta-spread);
62 
63  spread = 0.07;
64  // special treatment for special geometry in overlap region
65 
66  if ( eta > 1.0 && eta < 1.1 ) range = MuonEtaRange(eta+3.0*spread,eta-spread);
67  if ( eta < -1.0 && eta > -1.1 ) range = MuonEtaRange(eta+spread,eta-3.0*spread);
68 
69  return range;
70 }
71 
73 
74  return (fts.position().basicVector().dot(fts.momentum().basicVector())>0);
75 
76 }
77 
T perp() const
Definition: PV3DBase.h:72
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
const CurvilinearTrajectoryError & curvilinearError() const
bool isInsideOut(const FreeTrajectoryState &fts) const
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
T min(T a, T b)
Definition: MathUtil.h:58
GlobalVector momentum() const
GlobalPoint position() const
float calculateEta(float r, float z)
const AlgebraicSymMatrix55 & matrix() const
MuonEtaRange trackingRange(const FreeTrajectoryState &fts) const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
T dot(const Basic3DVector &rh) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.