8#include <tracking/ckf/svd/findlets/RelationFromSVDTracksCreator.h>
10#include <tracking/spacePointCreation/SpacePointTrackCand.h>
11#include <tracking/dataobjects/RecoTrack.h>
12#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13#include <tracking/trackFindingCDC/utilities/ReversedRange.h>
15#include <framework/core/ModuleParamList.h>
33 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"vxdTracksStoreArrayName"),
35 "Store Array name for tracks coming from VXDTF2.");
36 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"cdcTracksStoreArrayName"),
38 "Store Array name for tracks coming from CDCTF.");
40 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"spacePointTrackCandidatesName"),
42 "Store Array name for the SpacePointTrackCandidates coming from VXDTF2.",
59 B2ASSERT(
"There should be a related SPTC!", spacePointTrackCand);
60 const std::vector<const SpacePoint*> spacePoints = spacePointTrackCand->
getSortedHits();
62 for (
const SpacePoint* spacePoint : TrackFindingCDC::reversedRange(spacePoints)) {
63 const auto hasSpacePoint = [spacePoint](
const CKFToSVDState & state) {
64 return state.getHit() == spacePoint;
67 const auto nextStateIterator = std::find_if(states.begin(), states.end(), hasSpacePoint);
68 B2ASSERT(
"State can not be none!", nextStateIterator != states.end());
74 relations.emplace_back(currentState, NAN, &nextState);
78 relations.emplace_back(&seedState, NAN, &nextState);
82 currentState = &nextState;
86 std::sort(relations.begin(), relations.end());
Specialized CKF State for extrapolating into the SVD.
void setRelatedSVDTrack(const RecoTrack *relatedSVDTrack)
Set the related SVD track, if we go along one of them (or a nullptr)
The Module parameter list class.
This is the Reconstruction Event-Data Model Track.
std::string m_param_spacePointTrackCandidateName
Store Array name of the space point track candidates coming from VXDTF2.
RelationFromSVDTracksCreator()
Construct this findlet and add the subfindlet as listener.
void apply(std::vector< CKFToSVDState > &seedStates, std::vector< CKFToSVDState > &states, std::vector< TrackFindingCDC::WeightedRelation< CKFToSVDState > > &relations) final
Create relations between seeds and hits or hits and hits.
std::string m_param_vxdTracksStoreArrayName
Store Array name coming from VXDTF2.
void initialize() final
Require the store array.
std::string m_param_cdcTracksStoreArrayName
Store Array name coming from CDCTF.
StoreArray< RecoTrack > m_vxdRecoTracks
Store Array of the VXD tracks to use.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters of the subfindlet.
~RelationFromSVDTracksCreator()
Default destructor.
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
Storage for (VXD) SpacePoint-based track candidates.
const std::vector< const Belle2::SpacePoint * > getSortedHits() const
get hits (space points) sorted by their respective sorting parameter
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
void initialize() override
Receive and dispatch signal before the start of the event processing.
Type for two related objects with a weight.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.