Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:39:06

0001 #ifndef GsfTrackReco_GsfTrackExtra_h
0002 #define GsfTrackReco_GsfTrackExtra_h
0003 /** Extension of a GSF track providing multi-states
0004  * at the inner- and outermost measurement
0005  */
0006 #include "DataFormats/Math/interface/Vector3D.h"
0007 #include "DataFormats/Math/interface/Point3D.h"
0008 #include "DataFormats/Math/interface/Vector.h"
0009 // #include "DataFormats/Math/interface/Error.h"
0010 #include "DataFormats/GsfTrackReco/interface/GsfComponent5D.h"
0011 #include "DataFormats/GsfTrackReco/interface/GsfTangent.h"
0012 
0013 #include <iostream>
0014 
0015 namespace reco {
0016   class GsfTrackExtra {
0017   public:
0018     /// parameter dimension
0019     enum { dimension = 5 };
0020     /// local parameter vector
0021     typedef math::Vector<dimension>::type LocalParameterVector;
0022     /// local covariance matrix
0023     typedef math::Error<dimension>::type LocalCovarianceMatrix;
0024     /// point in the space
0025     typedef math::XYZPoint Point;
0026     /// spatial vector
0027     typedef math::XYZVector Vector;
0028 
0029     /// default constructor
0030     GsfTrackExtra() {}
0031     /// constructor from outermost position and momentum
0032     GsfTrackExtra(const std::vector<GsfComponent5D>& outerStates,
0033                   const double& outerLocalPzSign,
0034                   const std::vector<GsfComponent5D>& innerStates,
0035                   const double& innerLocalPzSign,
0036                   const std::vector<GsfTangent>& tangents);
0037     /// sign of local P_z at outermost state
0038     double outerStateLocalPzSign() const { return positiveOuterStatePz_ ? 1. : -1.; }
0039     /// weights at outermost state
0040     std::vector<double> outerStateWeights() const { return weights(outerStates_); }
0041     /// local parameters at outermost state
0042     std::vector<LocalParameterVector> outerStateLocalParameters() const { return parameters(outerStates_); }
0043     /// local covariance matrices at outermost state
0044     std::vector<LocalCovarianceMatrix> outerStateCovariances() const { return covariances(outerStates_); }
0045     /// sign of local P_z at innermost state
0046     double innerStateLocalPzSign() const { return positiveInnerStatePz_ ? 1. : -1.; }
0047     /// weights at innermost state
0048     std::vector<double> innerStateWeights() const { return weights(innerStates_); }
0049     /// local parameters at innermost state
0050     std::vector<LocalParameterVector> innerStateLocalParameters() const { return parameters(innerStates_); }
0051     /// local covariance matrices at innermost state
0052     std::vector<LocalCovarianceMatrix> innerStateCovariances() const { return covariances(innerStates_); }
0053     /// number of objects with information for tangents to the electron track
0054     inline unsigned int tangentsSize() const { return tangents_.size(); }
0055     /// access to tangent information
0056     const std::vector<GsfTangent>& tangents() const { return tangents_; }
0057     /// global position for tangent
0058     const Point& tangentPosition(unsigned int index) const { return tangents_[index].position(); }
0059     /// global momentum for tangent
0060     const Vector& tangentMomentum(unsigned int index) const { return tangents_[index].momentum(); }
0061     /// deltaP for tangent
0062     Measurement1D tangentDeltaP(unsigned int index) const { return tangents_[index].deltaP(); }
0063 
0064   private:
0065     /// extract weights from states
0066     std::vector<double> weights(const std::vector<GsfComponent5D>& states) const;
0067     /// extract parameters from states
0068     std::vector<LocalParameterVector> parameters(const std::vector<GsfComponent5D>& states) const;
0069     /// extract covariance matrices from states
0070     std::vector<LocalCovarianceMatrix> covariances(const std::vector<GsfComponent5D>& states) const;
0071 
0072   private:
0073     /// states at outermost point
0074     std::vector<GsfComponent5D> outerStates_;
0075     /// positive sign of P_z(local) at outermost State?
0076     bool positiveOuterStatePz_;
0077     /// states at innermost point
0078     std::vector<GsfComponent5D> innerStates_;
0079     /// positive sign of P_z(local) at innermost State?
0080     bool positiveInnerStatePz_;
0081     /// information for tangents
0082     std::vector<GsfTangent> tangents_;
0083   };
0084 
0085 }  // namespace reco
0086 
0087 #endif