Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef _TRACKER_CURVILINEARTRAJECTORYPARAMETERS_H_
0002 #define _TRACKER_CURVILINEARTRAJECTORYPARAMETERS_H_
0003 
0004 #include "DataFormats/TrajectoryState/interface/TrackCharge.h"
0005 #include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
0006 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0007 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0008 
0009 #include <cmath>
0010 
0011 /** \class CurvilinearTrajectoryParameters
0012  * Class providing access to a set of relevant parameters of a trajectory in a Curvilinear frame. The set consists of the following paramters: \
0013  * q/p: charged particles: charge(plus or minus one) divided by magnitude of momentum
0014  *      neutral particles: inverse magnitude of momentum
0015  * lambda: the helix dip angle (pi/2 minus theta(polar angle)), defined in the global frame
0016  * phi: the angle of inclination with the global x-axis in the transverse (global xy) plane
0017  * xT: transverse position  in the global xy plane and it points left when looking into the direction of the track
0018  * yT: transverse position that forms a right-handed frame with xT and zT
0019  *
0020  * Note that the frame is tangent to the track at the point of definition, with Z_T parallel to the track
0021 */
0022 
0023 class CurvilinearTrajectoryParameters {
0024 public:
0025   /// default constructor
0026 
0027   CurvilinearTrajectoryParameters() {}
0028 
0029   /**Constructor from vector of parameters
0030    *Expects a vector of parameters as defined above. For charged particles he charge will be determined by\ the sign of the first element. For neutral particles the last argument should be false,
0031    *  in which case the charge of the first element will be neglected.
0032    *
0033    */
0034 
0035   CurvilinearTrajectoryParameters(const AlgebraicVector5& v, bool charged = true)
0036       : theQbp(charged ? v[0] : 0), thelambda(v[1]), thephi(v[2]), thexT(v[3]), theyT(v[4]) {}
0037 
0038   /**Constructor from vector of parameters
0039    *Expects a vector of parameters as defined above. For charged particles the charge will be determined by the sign of the first element. For neutral particles the last argument should be false, 
0040    *  in which case the charge of the first element will be neglected.
0041    *
0042    */
0043 
0044   /**Constructor from individual  curvilinear parameters
0045    *Expects parameters as defined above.
0046    */
0047 
0048   CurvilinearTrajectoryParameters(double aQbp, double alambda, double aphi, double axT, double ayT, bool charged = true)
0049       : theQbp(charged ? aQbp : 0), thelambda(alambda), thephi(aphi), thexT(axT), theyT(ayT) {}
0050 
0051   /**Constructor from a global vector, global point and track charge
0052    *
0053    */
0054   CurvilinearTrajectoryParameters(const GlobalPoint& aX, const GlobalVector& aP, TrackCharge aCharge);
0055 
0056   /// access to the charge
0057   TrackCharge charge() const { return (0 == Qbp()) ? 0 : (Qbp() > 0 ? 1 : -1); }
0058 
0059   /// access to the Signed Inverse momentum q/p (zero for neutrals)
0060   double signedInverseMomentum() const { return Qbp(); }
0061 
0062   /**Vector of parameters with signed inverse momentum.
0063    *
0064    *Vector of parameters as defined above, with the first element q/p.
0065    */
0066   AlgebraicVector5 vector() const { return AlgebraicVector5(theQbp, thelambda, thephi, thexT, theyT); }
0067 
0068   double Qbp() const { return theQbp; }
0069   double lambda() const { return thelambda; }
0070   double phi() const { return thephi; }
0071   double xT() const { return thexT; }
0072   double yT() const { return theyT; }
0073 
0074   bool updateP(double dP);
0075 
0076 private:
0077   double theQbp;
0078   double thelambda;
0079   double thephi;
0080   double thexT;
0081   double theyT;
0082 };
0083 
0084 #endif