9 #include <tracking/ckf/pxd/findlets/CKFToPXDFindlet.h>
11 #include <tracking/ckf/general/findlets/StateCreator.icc.h>
12 #include <tracking/ckf/general/findlets/CKFRelationCreator.icc.h>
13 #include <tracking/ckf/general/findlets/StateCreatorWithReversal.icc.h>
14 #include <tracking/ckf/general/findlets/TreeSearcher.icc.h>
15 #include <tracking/ckf/general/findlets/OverlapResolver.icc.h>
16 #include <tracking/ckf/general/findlets/SpacePointTagger.icc.h>
17 #include <tracking/ckf/general/findlets/ResultStorer.icc.h>
18 #include <tracking/ckf/general/utilities/Helpers.h>
20 #include <tracking/ckf/pxd/entities/CKFToPXDResult.h>
21 #include <tracking/ckf/pxd/entities/CKFToPXDState.h>
23 #include <tracking/dataobjects/RecoTrack.h>
24 #include <tracking/spacePointCreation/SpacePoint.h>
25 #include <pxd/dataobjects/PXDCluster.h>
27 #include <framework/core/ModuleParamList.h>
30 using namespace TrackFindingCDC;
36 addProcessingSignalListener(&m_dataHandler);
37 addProcessingSignalListener(&m_hitsLoader);
38 addProcessingSignalListener(&m_stateCreatorFromTracks);
39 addProcessingSignalListener(&m_stateCreatorFromHits);
40 addProcessingSignalListener(&m_relationCreator);
41 addProcessingSignalListener(&m_treeSearchFindlet);
42 addProcessingSignalListener(&m_overlapResolver);
43 addProcessingSignalListener(&m_spacePointTagger);
44 addProcessingSignalListener(&m_resultStorer);
49 Super::exposeParameters(moduleParamList, prefix);
51 m_dataHandler.exposeParameters(moduleParamList, prefix);
52 m_hitsLoader.exposeParameters(moduleParamList, prefix);
53 m_stateCreatorFromTracks.exposeParameters(moduleParamList, prefix);
54 m_stateCreatorFromHits.exposeParameters(moduleParamList, prefix);
55 m_relationCreator.exposeParameters(moduleParamList, prefix);
56 m_treeSearchFindlet.exposeParameters(moduleParamList, prefix);
57 m_overlapResolver.exposeParameters(moduleParamList, prefix);
58 m_spacePointTagger.exposeParameters(moduleParamList, prefix);
59 m_resultStorer.exposeParameters(moduleParamList, prefix);
61 moduleParamList->
addParameter(
"minimalHitRequirement", m_param_minimalHitRequirement,
62 "Minimal Hit requirement for the results (counted in space points)",
63 m_param_minimalHitRequirement);
64 moduleParamList->
addParameter(
"onlyUseTracksWithSVD", m_param_onlyUseTracksWithSVD,
65 "Only use tracks which have an SVD hit associated.",
66 m_param_onlyUseTracksWithSVD);
67 moduleParamList->
addParameter(
"reverseSeedState", m_param_reverseSeed,
"Reverse the seed.", m_param_reverseSeed);
70 moduleParamList->
getParameter<std::string>(
"advanceHighFilter").setDefaultValue(
"advance");
71 moduleParamList->
getParameter<std::string>(
"updateHighFilter").setDefaultValue(
"fit");
73 moduleParamList->
getParameter<std::string>(
"firstHighFilter").setDefaultValue(
"mva_with_direction_check");
74 moduleParamList->
getParameter<std::string>(
"secondHighFilter").setDefaultValue(
"mva");
75 moduleParamList->
getParameter<std::string>(
"thirdHighFilter").setDefaultValue(
"mva");
77 moduleParamList->
getParameter<
bool>(
"useAssignedHits").setDefaultValue(
false);
79 moduleParamList->
getParameter<std::string>(
"hitFilter").setDefaultValue(
"sensor");
80 moduleParamList->
getParameter<std::string>(
"seedFilter").setDefaultValue(
"sensor");
81 moduleParamList->
getParameter<std::string>(
"preSeedFilter").setDefaultValue(
"loose");
82 moduleParamList->
getParameter<std::string>(
"preHitFilter").setDefaultValue(
"loose");
84 moduleParamList->
getParameter<std::string>(
"hitsSpacePointsStoreArrayName").setDefaultValue(
"PXDSpacePoints");
86 moduleParamList->
getParameter<std::string>(
"filter").setDefaultValue(
"mva");
97 m_recoTracksVector.clear();
98 checkResizeClear<const SpacePoint*>(m_spacePointVector, 2000);
100 m_seedStates.clear();
101 checkResizeClear<CKFToPXDState>(m_states, 2000);
103 checkResizeClear<TrackFindingCDC::WeightedRelation<CKFToPXDState>>(m_relations, 2000);
106 m_filteredResults.clear();
111 m_dataHandler.apply(m_recoTracksVector);
112 m_hitsLoader.apply(m_spacePointVector);
114 if (m_spacePointVector.empty() or m_recoTracksVector.empty()) {
119 const auto notFromPXD = [](
const SpacePoint * spacePoint) {
122 TrackFindingCDC::erase_remove_if(m_spacePointVector, notFromPXD);
124 if (m_param_onlyUseTracksWithSVD) {
125 const auto hasNoSVD = [
this](
const RecoTrack * recoTrack) {
126 const auto& svdHitList = recoTrack->getSortedSVDHitList();
127 if (svdHitList.empty())
return true;
129 return m_param_reverseSeed ? svdHitList.back()->getSensorID().getLayerNumber() > 4
130 : svdHitList.front()->getSensorID().getLayerNumber() > 4;
132 TrackFindingCDC::erase_remove_if(m_recoTracksVector, hasNoSVD);
135 B2DEBUG(29,
"Now have " << m_spacePointVector.size() <<
" hits.");
137 m_stateCreatorFromTracks.apply(m_recoTracksVector, m_seedStates);
138 m_stateCreatorFromHits.apply(m_spacePointVector, m_states);
139 m_relationCreator.apply(m_seedStates, m_states, m_relations);
141 B2DEBUG(29,
"Created " << m_relations.size() <<
" relations.");
143 m_treeSearchFindlet.apply(m_seedStates, m_states, m_relations, m_results);
145 B2DEBUG(29,
"Having found " << m_results.size() <<
" results before overlap check");
148 return result.getHits().size() < m_param_minimalHitRequirement;
150 TrackFindingCDC::erase_remove_if(m_results, hasLowHitNumber);
152 m_overlapResolver.apply(m_results, m_filteredResults);
154 B2DEBUG(29,
"Having found " << m_filteredResults.size() <<
" results");
156 m_resultStorer.apply(m_filteredResults);
157 m_spacePointTagger.apply(m_filteredResults, m_spacePointVector);
CKFToPXDFindlet()
Constructor, for setting module description and parameters.
void beginEvent() override
Clear the object pools.
~CKFToPXDFindlet()
Default desctructor.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
void apply() override
Do the tree search.
The Module parameter list class.
This is the Reconstruction Event-Data Model Track.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
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.