Belle II Software  release-05-01-25
CKFToPXDResult.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/pxd/entities/CKFToPXDResult.h>
12 
13 #include <tracking/trackFindingCDC/utilities/ReversedRange.h>
14 
15 #include <tracking/dataobjects/RecoTrack.h>
16 #include <tracking/spacePointCreation/SpacePoint.h>
17 #include <pxd/dataobjects/PXDCluster.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 
28 {
29  unsigned int sortingParameter = 0;
30  for (const SpacePoint* spacePoint : TrackFindingCDC::reversedRange(getHits())) {
31  RelationVector<PXDCluster> relatedClusters = spacePoint->getRelationsTo<PXDCluster>();
32  for (const PXDCluster& cluster : relatedClusters) {
33  recoTrack.addPXDHit(&cluster, sortingParameter, Belle2::RecoHitInformation::c_SVDtoPXDCKF);
34  sortingParameter++;
35  }
36  }
37 }
Belle2::SpacePoint
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Definition: SpacePoint.h:52
Belle2::CKFResult< RecoTrack, SpacePoint >
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
Belle2::CKFToPXDResult::addToRecoTrack
void addToRecoTrack(RecoTrack &recoTrack) const
Called in the exporter findlet for adding this to a already created reco track.
Definition: CKFToPXDResult.cc:27
Belle2::RelationVector
Class for type safe access to objects that are referred to in relations.
Definition: DataStore.h:38
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXDCluster
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:41
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::CKFToPXDResult::CKFToPXDResult
CKFToPXDResult(const std::vector< TrackFindingCDC::WithWeight< const CKFToPXDState * >> &path)
Constructor using a path.
Definition: CKFToPXDResult.cc:21
Belle2::RecoTrack::addPXDHit
bool addPXDHit(const UsedPXDHit *pxdHit, const unsigned int sortingParameter, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a pxd hit with the given information to the reco track.
Definition: RecoTrack.h:255