CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FreeTrajectoryState.cc
Go to the documentation of this file.
4 
6 
8 
10 
11 #include <cmath>
12 #include <sstream>
13 
14 // void bPoint(){}
15 
17  std::stringstream form;
18  form << "FreeTrajectoryState: attempt to access errors when none available"
19  << "\nCurvilinear error valid/values :" << theCurvilinearError.valid() << "\n"
21  edm::LogWarning("FreeTrajectoryState") << "(was exception) " << form.str();
22  // throw TrajectoryStateException(form.str());
23  // bPoint();
24 }
25 
26 // implementation of non-trivial methods of FreeTrajectoryState
27 
28 // Warning: these methods violate constness
29 
30 // convert curvilinear errors to cartesian
33  const AlgebraicMatrix65& jac = curv2Cart.jacobian();
34 
35  aCartesianError = ROOT::Math::Similarity(jac, theCurvilinearError.matrix());
36 }
37 
38 // convert cartesian errors to curvilinear
41  const AlgebraicMatrix56& jac = cart2Curv.jacobian();
42 
43  theCurvilinearError = ROOT::Math::Similarity(jac, aCartesianError.matrix());
44 }
45 
46 void FreeTrajectoryState::rescaleError(double factor) {
47  if UNLIKELY (!hasError())
48  return;
49  bool zeroField = (parameters().magneticField().nominalValue() == 0);
50  if UNLIKELY (zeroField)
51  theCurvilinearError.zeroFieldScaling(factor * factor);
52  else
53  theCurvilinearError *= (factor * factor);
54 }
const GlobalTrajectoryParameters & parameters() const
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
const AlgebraicMatrix56 & jacobian() const
CurvilinearTrajectoryError theCurvilinearError
ROOT::Math::SMatrix< double, 5, 6, ROOT::Math::MatRepStd< double, 5, 6 > > AlgebraicMatrix56
GlobalTrajectoryParameters theGlobalParameters
void createCurvilinearError(CartesianTrajectoryError const &aCartesianError) const
const AlgebraicSymMatrix66 & matrix() const
void rescaleError(double factor)
const AlgebraicMatrix65 & jacobian() const
void createCartesianError(CartesianTrajectoryError &aCartesianError) const
const AlgebraicSymMatrix55 & matrix() const
const MagneticField & magneticField() const
ROOT::Math::SMatrix< double, 6, 5, ROOT::Math::MatRepStd< double, 6, 5 > > AlgebraicMatrix65
#define UNLIKELY(x)
Definition: Likely.h:21
Log< level::Warning, false > LogWarning