Belle II Software  release-05-01-25
CKFToSVDResult.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <tracking/ckf/svd/entities/CKFToSVDResult.h>
12 
13 #include <tracking/trackFindingCDC/utilities/ReversedRange.h>
14 
15 #include <tracking/dataobjects/RecoTrack.h>
16 #include <tracking/spacePointCreation/SpacePoint.h>
17 #include <svd/dataobjects/SVDCluster.h>
18 
19 using namespace Belle2;
20 
22  Super(path, path.back()->getMeasuredStateOnPlane())
23 {
24  B2ASSERT("Path should not be empty", not path.empty());
25 
26  for (const TrackFindingCDC::WithWeight<const CKFToSVDState*>& state : path) {
27  const RecoTrack* relatedSVDTrack = state->getRelatedSVDTrack();
29  B2ASSERT("There is a state with a different VXD track in it!", m_relatedSVDRecoTrack == relatedSVDTrack);
30  } else {
31  m_relatedSVDRecoTrack = relatedSVDTrack;
32  }
33  }
34 }
35 
37 {
38  unsigned int sortingParameter = 0;
39  for (const SpacePoint* spacePoint : TrackFindingCDC::reversedRange(getHits())) {
40  RelationVector<SVDCluster> relatedClusters = spacePoint->getRelationsTo<SVDCluster>();
41  for (const SVDCluster& cluster : relatedClusters) {
42  recoTrack.addSVDHit(&cluster, sortingParameter, Belle2::RecoHitInformation::c_CDCtoSVDCKF);
43  sortingParameter++;
44  }
45  }
46 }
47 
49 {
50  return m_relatedSVDRecoTrack;
51 }
Belle2::CKFToSVDResult::getRelatedSVDRecoTrack
const RecoTrack * getRelatedSVDRecoTrack() const
Return the related SVD track, if we go along one of them.
Definition: CKFToSVDResult.cc:48
Belle2::SpacePoint
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Definition: SpacePoint.h:52
Belle2::CKFResult< RecoTrack, SpacePoint >
Belle2::CKFToSVDResult::CKFToSVDResult
CKFToSVDResult(const std::vector< TrackFindingCDC::WithWeight< const CKFToSVDState * >> &path)
Constructor using a path.
Definition: CKFToSVDResult.cc:21
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
Belle2::RelationVector
Class for type safe access to objects that are referred to in relations.
Definition: DataStore.h:38
Belle2::RecoTrack::addSVDHit
bool addSVDHit(const UsedSVDHit *svdHit, const unsigned int sortingParameter, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a svd hit with the given information to the reco track.
Definition: RecoTrack.h:269
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CKFResult< RecoTrack, SpacePoint >::getHits
const std::vector< const SpacePoint * > & getHits() const
Getter for the stored hits.
Definition: CKFResult.h:85
Belle2::TrackFindingCDC::WithWeight
A mixin class to attach a weight to an object.
Definition: WithWeight.h:34
Belle2::SVDCluster
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:38
Belle2::CKFToSVDResult::addToRecoTrack
void addToRecoTrack(RecoTrack &recoTrack) const
Called in the exporter findlet for adding this to a already created reco track.
Definition: CKFToSVDResult.cc:36
Belle2::CKFToSVDResult::m_relatedSVDRecoTrack
const RecoTrack * m_relatedSVDRecoTrack
The related SVD track, if we go along one of them (or a nullptr)
Definition: CKFToSVDResult.h:49