Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:40

0001 #ifndef PerigeeTrajectoryParameters_H
0002 #define PerigeeTrajectoryParameters_H
0003 /**
0004  *  Class providing access to the <i> Perigee</i> parameters of a trajectory.
0005  *  These parameters consist of <BR>
0006  *  rho : charged particles: transverse curvature (signed) <BR>
0007  *        neutral particles: inverse magnitude of transverse momentum <BR>
0008  *  theta, phi,
0009  *  transverse impact parameter (signed), longitudinal i.p.
0010  */
0011 
0012 #include "DataFormats/TrajectoryState/interface/TrackCharge.h"
0013 #include "DataFormats/Math/interface/Vector.h"
0014 #include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
0015 
0016 class PerigeeTrajectoryParameters {
0017 public:
0018   PerigeeTrajectoryParameters() {}
0019 
0020   explicit PerigeeTrajectoryParameters(const AlgebraicVector5 &aVector, bool charged = true) : theVector(aVector) {
0021     if (charged)
0022       theCharge = theVector[0] > 0 ? -1 : 1;
0023     else
0024       theCharge = 0;
0025   }
0026 
0027   PerigeeTrajectoryParameters(double aCurv, double aTheta, double aPhi, double aTip, double aLip, bool charged = true) {
0028     theVector[0] = aCurv;
0029     theVector[1] = aTheta;
0030     theVector[2] = aPhi;
0031     theVector[3] = aTip;
0032     theVector[4] = aLip;
0033 
0034     if (charged)
0035       theCharge = aCurv > 0 ? -1 : 1;
0036     else
0037       theCharge = 0;
0038   }
0039 
0040   /**
0041    * The charge
0042    */
0043 
0044   TrackCharge charge() const { return theCharge; }
0045 
0046   /**
0047    * The signed transverse curvature
0048    */
0049 
0050   double transverseCurvature() const { return ((charge() != 0) ? theVector[0] : 0.); }
0051 
0052   /**
0053    * The theta angle
0054    */
0055 
0056   double theta() const { return theVector[1]; }
0057 
0058   /**
0059    * The phi angle
0060    */
0061 
0062   double phi() const { return theVector[2]; }
0063 
0064   /**
0065    * The (signed) transverse impact parameter
0066    */
0067 
0068   double transverseImpactParameter() const { return theVector[3]; }
0069 
0070   /**
0071    * The longitudinal impact parameter
0072    */
0073 
0074   double longitudinalImpactParameter() const { return theVector[4]; }
0075 
0076   /**
0077    * returns the perigee parameters as a vector.
0078    * The order of the parameters are: <BR>
0079    *  transverse curvature (signed), theta, phi,
0080    *  transverse impact parameter (signed), longitudinal i.p.
0081    */
0082   const AlgebraicVector5 &vector() const { return theVector; }
0083 
0084 private:
0085   AlgebraicVector5 theVector;
0086   TrackCharge theCharge;
0087 };
0088 #endif