Belle II Software development
CKFToSVDSeedFindlet.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <tracking/ckf/svd/findlets/CKFToSVDSeedFindlet.h>
10
11#include <tracking/ckf/general/findlets/StateCreator.icc.h>
12#include <tracking/ckf/general/findlets/TreeSearcher.icc.h>
13#include <tracking/ckf/general/findlets/StateRejecter.icc.h>
14#include <tracking/ckf/general/findlets/StateCreatorWithReversal.icc.h>
15
16#include <tracking/trackFindingCDC/utilities/ParameterVariant.h>
17
18#include <framework/core/ModuleParamList.h>
19
20using namespace Belle2;
21using namespace TrackFindingCDC;
22
24
26{
36}
37
38void CKFToSVDSeedFindlet::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
39{
40 Super::exposeParameters(moduleParamList, prefix);
41
42 m_dataHandler.exposeParameters(moduleParamList, prefix);
43 m_hitsLoader.exposeParameters(moduleParamList, prefix);
44 m_stateCreatorFromTracks.exposeParameters(moduleParamList, prefix);
45 m_stateCreatorFromHits.exposeParameters(moduleParamList, prefix);
46 m_relationCreator.exposeParameters(moduleParamList, prefix);
47 m_treeSearchFindlet.exposeParameters(moduleParamList, prefix);
48 m_bestMatchSelector.exposeParameters(moduleParamList, prefix);
49 m_recoTrackRelator.exposeParameters(moduleParamList, prefix);
50 m_relationApplier.exposeParameters(moduleParamList, prefix);
51
52 moduleParamList->addParameter("minimalHitRequirement", m_param_minimalHitRequirement,
53 "Minimal Hit requirement for the results (counted in space points)",
55
56 moduleParamList->getParameter<std::string>("firstHighFilter").setDefaultValue("non_ip_crossing");
57 moduleParamList->getParameter<std::string>("advanceHighFilter").setDefaultValue("advance");
58 moduleParamList->getParameter<std::string>("secondHighFilter").setDefaultValue("all");
59 moduleParamList->getParameter<std::string>("updateHighFilter").setDefaultValue("fit");
60 moduleParamList->getParameter<std::string>("thirdHighFilter").setDefaultValue("all");
61
62 moduleParamList->getParameter<std::string>("hitsSpacePointsStoreArrayName").setDefaultValue("SVDSpacePoints");
63
64 moduleParamList->getParameter<bool>("endEarly").setDefaultValue(false);
65}
66
68{
70
72 m_spacePointVector.clear();
73
74 m_seedStates.clear();
75 m_states.clear();
76 m_relations.clear();
77
78 m_results.clear();
79
80 m_relationsCDCToSVD.clear();
81}
82
84{
87
88 if (m_spacePointVector.empty() or m_cdcRecoTrackVector.empty()) {
89 return;
90 }
91
94
96 B2DEBUG(29, "Created " << m_relations.size() << " relations.");
97
99 B2DEBUG(29, "Having found " << m_results.size() << " results before overlap check");
100
101 const auto hasLowHitNumber = [this](const CKFResult<RecoTrack, SpacePoint>& result) {
102 return result.getHits().size() < m_param_minimalHitRequirement;
103 };
104 TrackFindingCDC::erase_remove_if(m_results, hasLowHitNumber);
105 B2DEBUG(29, "After filtering: Having found " << m_results.size() << " results before overlap check");
106
110}
Object for temporary storage of a CKF tree search result.
Definition: CKFResult.h:30
RecoTrackRelator m_recoTrackRelator
Findlet transforming the hit results to track relations.
std::vector< TrackFindingCDC::WeightedRelation< const RecoTrack, const RecoTrack > > m_relationsCDCToSVD
Relations between CDC tracks and SVD tracks.
~CKFToSVDSeedFindlet()
Default destructor.
unsigned int m_param_minimalHitRequirement
Minimal hit requirement for the results (counted in number of space points)
std::vector< CKFToSVDState > m_states
States for the hits.
TrackLoader m_dataHandler
Findlet for retrieving the cdc tracks and writing the result out.
RelationFromSVDTracksCreator m_relationCreator
Relation Creator.
std::vector< const SpacePoint * > m_spacePointVector
Pointers to the (const) SpacePoints as a vector.
TreeSearcher< CKFToSVDState, SVDStateRejecter, CKFToSVDResult > m_treeSearchFindlet
Findlet doing the main work: the tree finding.
StateCreatorWithReversal< CKFToSVDState > m_stateCreatorFromTracks
Findlet for creating states out of tracks.
SpacePointLoader m_hitsLoader
Findlet for loading the space points.
CKFToSVDSeedFindlet()
Constructor, for setting module description and parameters.
std::vector< RecoTrack * > m_cdcRecoTrackVector
Pointers to the CDC Reco tracks as a vector.
RelationApplier m_relationApplier
Copy the result relations to the store array.
std::vector< CKFToSVDResult > m_results
Vector for storing the results.
TrackFindingCDC::BestMatchSelector< const RecoTrack, const RecoTrack > m_bestMatchSelector
Greedy filter for the relations between SVD and CDC Reco Tracks.
void beginEvent() override
Clear the object pools.
std::vector< CKFToSVDState > m_seedStates
States for the tracks.
StateCreator< const SpacePoint, CKFToSVDState > m_stateCreatorFromHits
Findlet for creating states out of hits.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters (also of the sub findlets).
void apply() override
Do the track merging.
std::vector< TrackFindingCDC::WeightedRelation< CKFToSVDState > > m_relations
Relations between states.
The Module parameter list class.
void apply(const std::vector< CKFToSVDResult > &results, std::vector< TrackFindingCDC::WeightedRelation< const RecoTrack, const RecoTrack > > &relationsCDCToSVD) final
Create relations between tracks from the results (applying a filter)
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters of the sub findlet.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose parameters.
void apply(const std::vector< TrackFindingCDC::WeightedRelation< const RecoTrack, const RecoTrack > > &relationsCDCToSVD) final
Copy the relations to the store array.
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.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters of the subfindlet.
void apply(std::vector< const SpacePoint * > &spacePoints) final
Do the space point retrieval.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
void beginEvent() override
Receive and dispatch signal for the start of a new event.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
void apply(std::vector< RecoTrack * > &seeds) override
Load in the reco tracks and the hits.
Definition: TrackLoader.cc:68
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
Definition: TrackLoader.cc:24
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.