File indexing completed on 2024-04-06 12:04:16
0001 #include "DataFormats/GsfTrackReco/interface/GsfTrackExtra.h"
0002 using namespace reco;
0003
0004 GsfTrackExtra::GsfTrackExtra(const std::vector<GsfComponent5D>& outerStates,
0005 const double& outerLocalPzSign,
0006 const std::vector<GsfComponent5D>& innerStates,
0007 const double& innerLocalPzSign,
0008 const std::vector<GsfTangent>& tangents)
0009 : outerStates_(outerStates),
0010 positiveOuterStatePz_(outerLocalPzSign > 0.),
0011 innerStates_(innerStates),
0012 positiveInnerStatePz_(innerLocalPzSign > 0.),
0013 tangents_(tangents) {}
0014
0015 std::vector<double> GsfTrackExtra::weights(const std::vector<GsfComponent5D>& states) const {
0016 std::vector<double> result(states.size());
0017 std::vector<double>::iterator ir(result.begin());
0018 for (std::vector<GsfComponent5D>::const_iterator i = states.begin(); i != states.end(); ++i) {
0019 *(ir++) = (*i).weight();
0020 }
0021 return result;
0022 }
0023
0024 std::vector<GsfTrackExtra::LocalParameterVector> GsfTrackExtra::parameters(
0025 const std::vector<GsfComponent5D>& states) const {
0026 std::vector<LocalParameterVector> result(states.size());
0027 std::vector<LocalParameterVector>::iterator ir(result.begin());
0028 for (std::vector<GsfComponent5D>::const_iterator i = states.begin(); i != states.end(); ++i) {
0029 *(ir++) = (*i).parameters();
0030 }
0031 return result;
0032 }
0033
0034 std::vector<GsfTrackExtra::LocalCovarianceMatrix> GsfTrackExtra::covariances(
0035 const std::vector<GsfComponent5D>& states) const {
0036 std::vector<LocalCovarianceMatrix> result(states.size());
0037 std::vector<LocalCovarianceMatrix>::iterator ir(result.begin());
0038 for (std::vector<GsfComponent5D>::const_iterator i = states.begin(); i != states.end(); ++i) {
0039 (*i).covariance(*(ir++));
0040 }
0041 return result;
0042 }