CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/DataFormats/GsfTrackReco/src/GsfTrackExtra.cc

Go to the documentation of this file.
00001 #include "DataFormats/GsfTrackReco/interface/GsfTrackExtra.h"
00002 using namespace reco;
00003 
00004 GsfTrackExtra::GsfTrackExtra( const std::vector<GsfComponent5D>& outerStates, 
00005                               const double& outerLocalPzSign,
00006                               const std::vector<GsfComponent5D>& innerStates, 
00007                               const double& innerLocalPzSign,
00008                               const std::vector<GsfTangent>& tangents)  :
00009   outerStates_(outerStates), positiveOuterStatePz_(outerLocalPzSign>0.),
00010   innerStates_(innerStates), positiveInnerStatePz_(innerLocalPzSign>0.),
00011   tangents_(tangents) {}
00012                                                                                                             
00013 std::vector<double> 
00014 GsfTrackExtra::weights (const std::vector<GsfComponent5D>& states) const
00015 {
00016   std::vector<double> result(states.size());
00017   std::vector<double>::iterator ir(result.begin());
00018   for ( std::vector<GsfComponent5D>::const_iterator i=states.begin();
00019         i!=states.end(); ++i ) {
00020     *(ir++) = (*i).weight();
00021   }
00022   return result;
00023 }
00024 
00025 std::vector<GsfTrackExtra::LocalParameterVector> 
00026 GsfTrackExtra::parameters (const std::vector<GsfComponent5D>& states) const
00027 {
00028   std::vector<LocalParameterVector> result(states.size());
00029   std::vector<LocalParameterVector>::iterator ir(result.begin());
00030   for ( std::vector<GsfComponent5D>::const_iterator i=states.begin();
00031         i!=states.end(); ++i ) {
00032     *(ir++) = (*i).parameters();
00033   }
00034   return result;
00035 }
00036 
00037 std::vector<GsfTrackExtra::LocalCovarianceMatrix> 
00038 GsfTrackExtra::covariances (const std::vector<GsfComponent5D>& states) const
00039 {
00040   std::vector<LocalCovarianceMatrix> result(states.size());
00041   std::vector<LocalCovarianceMatrix>::iterator ir(result.begin());
00042   for ( std::vector<GsfComponent5D>::const_iterator i=states.begin();
00043         i!=states.end(); ++i ) {
00044     (*i).covariance(*(ir++));
00045   }
00046   return result;
00047 }