Belle II Software development
SVDHoughTracking.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#include <tracking/vxdHoughTracking/findlets/SVDHoughTracking.h>
9#include <tracking/vxdHoughTracking/findlets/RawTrackCandCleaner.icc.h>
10#include <tracking/vxdHoughTracking/utilities/SVDHoughTrackingHelpers.h>
11#include <tracking/spacePointCreation/SpacePointTrackCand.h>
12#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13#include <framework/logging/Logger.h>
14#include <framework/core/ModuleParamList.h>
15
16using namespace Belle2;
17using namespace TrackFindingCDC;
18using namespace vxdHoughTracking;
19
21
23{
31}
32
33void SVDHoughTracking::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
34{
35 Super::exposeParameters(moduleParamList, prefix);
36
37 m_spacePointLoaderAndPreparer.exposeParameters(moduleParamList, prefix);
39 m_singleHouthSpaceInterceptFinder.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix, "simple"));
40 m_rawTCCleaner.exposeParameters(moduleParamList, prefix);
41 m_overlapResolver.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix, "finalOverlapResolver"));
42 m_recoTrackStorer.exposeParameters(moduleParamList, prefix);
43 m_roiFinder.exposeParameters(moduleParamList, prefix);
44
45 moduleParamList->getParameter<std::string>("relationFilter").setDefaultValue("angleAndTime");
46 moduleParamList->getParameter<std::string>("twoHitFilter").setDefaultValue("twoHitVirtualIPQI");
47 moduleParamList->getParameter<std::string>("threeHitFilter").setDefaultValue("qualityIndicator");
48 moduleParamList->getParameter<std::string>("fourHitFilter").setDefaultValue("qualityIndicator");
49 moduleParamList->getParameter<std::string>("fiveHitFilter").setDefaultValue("qualityIndicator");
50
51 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "useMultiHoughSpaceInterceptFinding"),
53 "Use Hough spaces working on a subset of hits (=true), or just one Hough space working on all hits at the same time (=false)?",
55}
56
58{
60
61 // If the capacity of a std::vector is too large, start with a fresh one.
62 // Since std::vector.shrink() or std::vector.shrink_to_fit() not necessarily reduce the capacity in the desired way,
63 // create a temporary vector of the same type and swap them to use the vector at the new location afterwards.
64 checkResizeClear<const SpacePoint*>(m_spacePointVector, 5000);
65 checkResizeClear<VXDHoughState>(m_vxdHoughStates, 5000);
66 checkResizeClear<std::vector<VXDHoughState*>>(m_rawTrackCandidates, 500);
67 checkResizeClear<SpacePointTrackCand>(m_trackCandidates, 500);
68
69}
70
72{
74 B2DEBUG(29, "m_vxdHoughStates.size(): " << m_vxdHoughStates.size());
75
78 } else {
80 }
81 B2DEBUG(29, "m_rawTrackCandidates.size: " << m_rawTrackCandidates.size());
82
84
85 // sort by number of hits in the track candidate and by the QI
86 std::sort(m_trackCandidates.begin(), m_trackCandidates.end(),
87 [](const SpacePointTrackCand & a, const SpacePointTrackCand & b) {
88 return ((a.getNHits() > b.getNHits()) or
89 (a.getNHits() == b.getNHits() and a.getQualityIndicator() > b.getQualityIndicator()));
90 });
91
93
95
96 // A check if or if not ROIs shall be calculated is performed within the m_roiFinder findlet to
97 // avoid creation and registration of the ROIs and PXDIntercept StoreArrays
98 // such that StoreArrays with the same name can be registered elsewhere.
100}
The Module parameter list class.
Storage for (VXD) SpacePoint-based track candidates.
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 exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
void apply(std::vector< VXDHoughState > &hits, std::vector< std::vector< VXDHoughState * > > &rawTrackCandidates) override
Load in the prepared hits and create track candidates for further processing like hit filtering and f...
void apply(const std::vector< SpacePointTrackCand > &finalTracks) override
Function to call all the sub-findlets.
Definition: ROIFinder.cc:179
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
Definition: ROIFinder.cc:33
void apply(std::vector< SpacePointTrackCand > &finishedResults, const std::vector< const SpacePoint * > &spacePoints) override
Store the finishey SpacePointTrackCands into RecoTracks and tag the SpacePoints.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
SpacePointLoaderAndPreparer m_spacePointLoaderAndPreparer
Findlets:
MultiHoughSpaceFastInterceptFinder m_multiHouthSpaceInterceptFinder
Hough Space intercept finder.
std::vector< VXDHoughState > m_vxdHoughStates
Vector containing the cached hit information.
RawTrackCandCleaner< VXDHoughState > m_rawTCCleaner
Raw track candidate cleaner.
std::vector< const SpacePoint * > m_spacePointVector
Container to share data between findlets.
SingleHoughSpaceFastInterceptFinder m_singleHouthSpaceInterceptFinder
Simple Hough Space intercept finder.
TrackCandidateOverlapResolver m_overlapResolver
Resolve hit overlaps in track candidates.
std::vector< SpacePointTrackCand > m_trackCandidates
A track candidate is a vector of SpacePoint, and in each event multple track candidates will be creat...
SVDHoughTracking()
Constructor for adding the subfindlets.
void beginEvent() override
Clear the object pools.
std::vector< std::vector< VXDHoughState * > > m_rawTrackCandidates
Vector containint raw track candidates.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
RecoTrackStorer m_recoTrackStorer
Store tracks as RecoTracks.
void apply() override
Function to call all the sub-findlets.
bool m_useMultiHoughSpaceInterceptFinding
Use the elaborate FastInterceptFinder2D with multiple Hough spaces (true) or the simple one with just...
ROIFinder m_roiFinder
ROIFinder findlet, calculates PXD intercepts and ROIs.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
void apply(std::vector< VXDHoughState > &hits, std::vector< std::vector< VXDHoughState * > > &rawTrackCandidates) override
Load in the prepared hits and create track candidates for further processing like hit filtering and f...
void apply(std::vector< const SpacePoint * > &spacePoints, std::vector< VXDHoughState > &hits) override
Load the SVD SpacePoints and create a VXDHoughState object for each hit.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
void apply(std::vector< SpacePointTrackCand > &spacePointTrackCandsToResolve) override
Reject bad SpacePointTrackCands and bad hits inside the remaining.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
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.