CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PerigeeTrajectoryParameters.h
Go to the documentation of this file.
1 #ifndef PerigeeTrajectoryParameters_H
2 #define PerigeeTrajectoryParameters_H
3 
15 
17 {
18 
19 public:
20 
22 
23  explicit PerigeeTrajectoryParameters(const AlgebraicVector &aVector, bool charged = true):
24  theCurv(aVector[0]), theTheta(aVector[1]), thePhi(aVector[2]),
25  theTip(aVector[3]), theLip(aVector[4]), theVector(asSVector<5>(aVector)),
27  {
28  if ( charged )
29  theCharge = theCurv>0 ? -1 : 1;
30  else
31  theCharge = 0;
32  }
33 
34  explicit PerigeeTrajectoryParameters(const AlgebraicVector5 &aVector, bool charged = true):
35  theCurv(aVector[0]), theTheta(aVector[1]), thePhi(aVector[2]),
36  theTip(aVector[3]), theLip(aVector[4]), theVector(aVector),
38  {
39  if ( charged )
40  theCharge = theCurv>0 ? -1 : 1;
41  else
42  theCharge = 0;
43  }
44 
45  PerigeeTrajectoryParameters(double aCurv, double aTheta, double aPhi,
46  double aTip, double aLip, bool charged = true):
47  theCurv(aCurv), theTheta(aTheta), thePhi(aPhi), theTip(aTip), theLip(aLip),
49  {
50  if ( charged )
51  theCharge = theCurv>0 ? -1 : 1;
52  else
53  theCharge = 0;
54  }
55 
60  TrackCharge charge() const {return theCharge;}
61 
66  double transverseCurvature() const {return ((charge()!=0)?theCurv:0.);}
67 
72  double theta() const {return theTheta;}
73 
78  double phi() const {return thePhi;}
79 
84  double transverseImpactParameter() const {return theTip;}
85 
90  double longitudinalImpactParameter() const {return theLip;}
91 
98  const AlgebraicVector vector_old() const { return asHepVector(theVector); }
99 
100  const AlgebraicVector5 & vector() const
101  {
102  if (!vectorIsAvailable) {
103  //theVector = AlgebraicVector5();
104  theVector[0] = theCurv;
105  theVector[1] = theTheta;
106  theVector[2] = thePhi;
107  theVector[3] = theTip;
108  theVector[4] = theLip;
109  vectorIsAvailable = true;
110  }
111  return theVector;
112  }
113 
114 
115 private:
119  mutable bool vectorIsAvailable;
120 
121 };
122 #endif
const AlgebraicVector5 & vector() const
const AlgebraicVector vector_old() const
PerigeeTrajectoryParameters(const AlgebraicVector &aVector, bool charged=true)
int TrackCharge
Definition: TrackCharge.h:4
CLHEP::HepVector AlgebraicVector
ROOT::Math::SVector< double, 5 > AlgebraicVector5
ROOT::Math::SVector< double, N1 > asSVector(const CLHEP::HepVector &m)
Definition: Migration.h:39
PerigeeTrajectoryParameters(const AlgebraicVector5 &aVector, bool charged=true)
PerigeeTrajectoryParameters(double aCurv, double aTheta, double aPhi, double aTip, double aLip, bool charged=true)
CLHEP::HepVector asHepVector(const ROOT::Math::SVector< double, N > &v)
Definition: Migration.h:43