46 std::vector<const genfit::KalmanFitterInfo*> kalmanFitterInfos;
47 kalmanFitterInfos.reserve(recoHitInformations.size());
49 int n_no_trackPoint = 0;
50 int n_no_KalmanFitterInfo = 0;
54 const genfit::KalmanFitterInfo* kalmanFitterInfo = trackPoint->getKalmanFitterInfo();
55 if (kalmanFitterInfo) {
56 kalmanFitterInfos.push_back(kalmanFitterInfo);
58 n_no_KalmanFitterInfo++;
64 m_variables.at(
"N_Hits_without_TrackPoint") = n_no_trackPoint;
65 m_variables.at(
"N_TrackPoints_without_KalmanFitterInfo") = n_no_KalmanFitterInfo;
69 const auto hitHasKalmanInfoAndIsFromDetector =
70 [&recoTrack,
this](
const auto & recoHitInformation,
73 and (recoHitInformation->getTrackingDetector() == trackingDetector));
75 const auto hitHasKalmanInfoAndIsFromCDC = std::bind(hitHasKalmanInfoAndIsFromDetector,
76 std::placeholders::_1,
77 RecoHitInformation::c_CDC);
78 const auto hitHasKalmanInfoAndIsFromSVD = std::bind(hitHasKalmanInfoAndIsFromDetector,
79 std::placeholders::_1,
80 RecoHitInformation::c_SVD);
83 const auto firstHitWithCDCKalmanInfoIter = std::find_if(recoHitInformations.begin(),
84 recoHitInformations.end(),
85 hitHasKalmanInfoAndIsFromCDC);
86 std::optional<float> weight_firstCDCHit;
87 std::optional<float> smoothedChi2_firstCDCHit;
88 if (firstHitWithCDCKalmanInfoIter != recoHitInformations.end()) {
89 const genfit::KalmanFitterInfo* kalmanFitterInfo = this->
getKalmanFitterInfo(recoTrack, *firstHitWithCDCKalmanInfoIter);
90 weight_firstCDCHit = kalmanFitterInfo->getWeights().front();
97 const auto lastHitWithSVDKalmanInfoIter = std::find_if(recoHitInformations.rbegin(),
98 recoHitInformations.rend(),
99 hitHasKalmanInfoAndIsFromSVD);
100 std::optional<float> weight_lastSVDHit;
101 std::optional<float> smoothedChi2_lastSVDHit;
102 if (lastHitWithSVDKalmanInfoIter != recoHitInformations.rend()) {
103 const genfit::KalmanFitterInfo* kalmanFitterInfo = this->
getKalmanFitterInfo(recoTrack, *lastHitWithSVDKalmanInfoIter);
104 weight_lastSVDHit = kalmanFitterInfo->getWeights().front();
110 std::vector<float> fitWeights;
111 std::vector<float> chi2Values;
112 fitWeights.reserve(kalmanFitterInfos.size());
113 chi2Values.reserve(kalmanFitterInfos.size());
114 for (
const auto& kalmanFitterInfo : kalmanFitterInfos) {
115 fitWeights.push_back(kalmanFitterInfo->getWeights().front());
119 setStats(
"smoothedChi2", chi2Values);