8#include <tracking/ckf/svd/utilities/SVDMCUtil.h>
10#include <tracking/ckf/svd/entities/CKFToSVDState.h>
11#include <tracking/mcMatcher/TrackMatchLookUp.h>
12#include <tracking/dataobjects/RecoTrack.h>
13#include <svd/dataobjects/SVDCluster.h>
14#include <tracking/spacePointCreation/SpacePoint.h>
15#include <tracking/trackFindingCDC/utilities/Algorithms.h>
16#include <tracking/trackFindingCDC/numerics/WithWeight.h>
22 const auto isSameMCTrack = [&mcRecoTrack](
const RecoTrack & clusterRecoTrack) {
23 return &clusterRecoTrack == mcRecoTrack;
27 const std::string& mcRecoTrackStoreArrayName = mcRecoTrack->
getArrayName();
30 const auto& relatedMCTracksToCluster = relatedCluster.getRelationsTo<
RecoTrack>(mcRecoTrackStoreArrayName);
31 if (not TrackFindingCDC::any(relatedMCTracksToCluster, isSameMCTrack)) {
39 B2ASSERT(
"Invalid MC information", recoHitInformationOfHit);
46 const auto& itToFirstEntryInDetector = std::find_if(recoHitInformationList.begin(), recoHitInformationList.end(),
48 return hitInformation->getTrackingDetector() == detector;
50 const auto& itToFirstEntryAfterDetector = std::find_if(itToFirstEntryInDetector, recoHitInformationList.end(),
52 return hitInformation->getTrackingDetector() != detector;
55 if (itToFirstEntryAfterDetector == recoHitInformationList.end()) {
61 const auto* firstHitAfterDetector = *itToFirstEntryAfterDetector;
62 return firstHitAfterDetector->getSortingParameter() >= recoHitInformationOfHit->
getSortingParameter();
68 const auto hitIsCorrectSpecialisation = [
this, mcRecoTrack](
const SpacePoint * spacePoint) {
72 const unsigned int numberOfCorrectHits = std::count_if(hits.begin(), hits.end(), hitIsCorrectSpecialisation);
73 return numberOfCorrectHits;
78 const RecoTrack* seed = states.front()->getSeed();
80 B2ASSERT(
"Path without a seed?", seed);
82 if (states.size() <= 1) {
87 const std::string& seedTrackStoreArrayName = seed->getArrayName();
94 B2DEBUG(29,
"Seed is a fake");
98 std::vector<const SpacePoint*> spacePoints;
100 const SpacePoint* spacePoint = state->getHit();
102 spacePoints.push_back(spacePoint);
108 B2DEBUG(29,
"Have found " << numberOfCorrectHits <<
" correct out of " << spacePoints.size() <<
" hits");
109 return numberOfCorrectHits == spacePoints.size();
Specialized CKF State for extrapolating into the SVD.
unsigned int getNumberOfCorrectHits(const RecoTrack *mcRecoTrack, const std::vector< const SpacePoint * > &hits) const
How many of the given space points are also in the MC track? Runs hitIsCorrect on all of them.
bool allStatesCorrect(const std::vector< TrackFindingCDC::WithWeight< const CKFToPXDState * > > &states) const
Are all hits related to the same MC track the seed is related to?
bool hitIsCorrect(const RecoTrack *mcRecoTrack, const SpacePoint *spacePoint) const
Returns true, of the space point is related to the mc track and if it is on the first half.
This is the Reconstruction Event-Data Model Track.
RecoHitInformation * getRecoHitInformation(HitType *hit) const
Return the reco hit information for a generic hit from the storeArray.
std::vector< RecoHitInformation * > getRecoHitInformations(bool getSorted=false) const
Return a list of all RecoHitInformations associated with the RecoTrack.
std::string getArrayName() const
Get name of array this object is stored in, or "" if not found.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
A mixin class to attach a weight to an object.
Class to provide convenient methods to look up matching information between pattern recognition and M...
const RecoTrack * getRelatedMCRecoTrack(const RecoTrack &prRecoTrack) const
Looks for a related Monte Carlo track for the given pattern recognition track and return it if found.
Abstract base class for different kinds of events.