File indexing completed on 2023-10-25 09:39:06
0001 #ifndef GsfTrackReco_GsfTrackExtra_h
0002 #define GsfTrackReco_GsfTrackExtra_h
0003
0004
0005
0006 #include "DataFormats/Math/interface/Vector3D.h"
0007 #include "DataFormats/Math/interface/Point3D.h"
0008 #include "DataFormats/Math/interface/Vector.h"
0009
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
0019 enum { dimension = 5 };
0020
0021 typedef math::Vector<dimension>::type LocalParameterVector;
0022
0023 typedef math::Error<dimension>::type LocalCovarianceMatrix;
0024
0025 typedef math::XYZPoint Point;
0026
0027 typedef math::XYZVector Vector;
0028
0029
0030 GsfTrackExtra() {}
0031
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
0038 double outerStateLocalPzSign() const { return positiveOuterStatePz_ ? 1. : -1.; }
0039
0040 std::vector<double> outerStateWeights() const { return weights(outerStates_); }
0041
0042 std::vector<LocalParameterVector> outerStateLocalParameters() const { return parameters(outerStates_); }
0043
0044 std::vector<LocalCovarianceMatrix> outerStateCovariances() const { return covariances(outerStates_); }
0045
0046 double innerStateLocalPzSign() const { return positiveInnerStatePz_ ? 1. : -1.; }
0047
0048 std::vector<double> innerStateWeights() const { return weights(innerStates_); }
0049
0050 std::vector<LocalParameterVector> innerStateLocalParameters() const { return parameters(innerStates_); }
0051
0052 std::vector<LocalCovarianceMatrix> innerStateCovariances() const { return covariances(innerStates_); }
0053
0054 inline unsigned int tangentsSize() const { return tangents_.size(); }
0055
0056 const std::vector<GsfTangent>& tangents() const { return tangents_; }
0057
0058 const Point& tangentPosition(unsigned int index) const { return tangents_[index].position(); }
0059
0060 const Vector& tangentMomentum(unsigned int index) const { return tangents_[index].momentum(); }
0061
0062 Measurement1D tangentDeltaP(unsigned int index) const { return tangents_[index].deltaP(); }
0063
0064 private:
0065
0066 std::vector<double> weights(const std::vector<GsfComponent5D>& states) const;
0067
0068 std::vector<LocalParameterVector> parameters(const std::vector<GsfComponent5D>& states) const;
0069
0070 std::vector<LocalCovarianceMatrix> covariances(const std::vector<GsfComponent5D>& states) const;
0071
0072 private:
0073
0074 std::vector<GsfComponent5D> outerStates_;
0075
0076 bool positiveOuterStatePz_;
0077
0078 std::vector<GsfComponent5D> innerStates_;
0079
0080 bool positiveInnerStatePz_;
0081
0082 std::vector<GsfTangent> tangents_;
0083 };
0084
0085 }
0086
0087 #endif