CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/DataFormats/GsfTrackReco/interface/GsfTrackExtra.h

Go to the documentation of this file.
00001 #ifndef GsfTrackReco_GsfTrackExtra_h
00002 #define GsfTrackReco_GsfTrackExtra_h
00003 
00006 #include "DataFormats/Math/interface/Vector3D.h"
00007 #include "DataFormats/Math/interface/Point3D.h"
00008 #include "DataFormats/Math/interface/Vector.h"
00009 // #include "DataFormats/Math/interface/Error.h"
00010 #include "DataFormats/GsfTrackReco/interface/GsfComponent5D.h"
00011 #include "DataFormats/GsfTrackReco/interface/GsfTangent.h"
00012 
00013 #include <iostream>
00014 
00015 namespace reco {
00016   class GsfTrackExtra {
00017   public:
00019     enum { dimension = 5 };
00021     typedef math::Vector<dimension>::type LocalParameterVector;
00023     typedef math::Error<dimension>::type LocalCovarianceMatrix;
00025     typedef math::XYZPoint Point;
00027     typedef math::XYZVector Vector;
00028 
00030     GsfTrackExtra() { }
00032     GsfTrackExtra( const std::vector<GsfComponent5D>& outerStates,
00033                    const double& outerLocalPzSign, 
00034                    const std::vector<GsfComponent5D>& innerStates, 
00035                    const double& innerLocalPzSign,
00036                    const std::vector<GsfTangent>& tangents);
00038     double outerStateLocalPzSign() const {return positiveOuterStatePz_ ? 1. : -1.;}
00040     std::vector<double> outerStateWeights() const { return weights(outerStates_); }
00042     std::vector<LocalParameterVector> outerStateLocalParameters() const { 
00043       return parameters(outerStates_); 
00044     }
00046     std::vector<LocalCovarianceMatrix> outerStateCovariances() const {
00047       return covariances(outerStates_);
00048     }
00050     double innerStateLocalPzSign() const {return positiveInnerStatePz_ ? 1. : -1.;}
00052     std::vector<double> innerStateWeights() const { return weights(innerStates_); }
00054     std::vector<LocalParameterVector> innerStateLocalParameters() const { 
00055       return parameters(innerStates_); 
00056     }
00058     std::vector<LocalCovarianceMatrix> innerStateCovariances() const {
00059       return covariances(innerStates_);
00060     }
00062     inline unsigned int tangentsSize() const {return tangents_.size();}
00064     const std::vector<GsfTangent>& tangents() const {
00065       return tangents_;
00066     }
00068     const Point& tangentPosition (unsigned int index) const {
00069       return tangents_[index].position();
00070     }
00072     const Vector& tangentMomentum (unsigned int index) const {
00073       return tangents_[index].momentum();
00074     }
00076     Measurement1D tangentDeltaP (unsigned int index) const {
00077       return tangents_[index].deltaP();
00078     }
00079 
00080   private:
00082     std::vector<double> weights (const std::vector<GsfComponent5D>& states) const;
00084     std::vector<LocalParameterVector> parameters (const std::vector<GsfComponent5D>& states) const;
00086     std::vector<LocalCovarianceMatrix> covariances (const std::vector<GsfComponent5D>& states) const;
00087     
00088   private:
00090     std::vector<GsfComponent5D> outerStates_;
00092     bool positiveOuterStatePz_;
00094     std::vector<GsfComponent5D> innerStates_;
00096     bool positiveInnerStatePz_;
00098     std::vector<GsfTangent> tangents_;
00099   };
00100 
00101 }
00102 
00103 #endif