Belle II Software development
AxialTrackHitMigrator.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/trackFindingCDC/findlets/minimal/AxialTrackHitMigrator.h>
9
10#include <tracking/trackFindingCDC/processing/AxialTrackUtil.h>
11
12#include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
13#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
14
15#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
16
17#include <framework/core/ModuleParamList.templateDetails.h>
18
19using namespace Belle2;
20using namespace TrackFindingCDC;
21
23{
24 return "Exchanges hits between axial tracks based on their distance to the respective "
25 "trajectory.";
26}
27
29 const std::string& prefix)
30{
31 moduleParamList->addParameter(prefixed(prefix, "dropDistance"),
33 "Distance for a hit to be removed.",
35
36 moduleParamList->addParameter(prefixed(prefix, "addDistance"),
38 "Distance for a hit to be added.",
40}
41
42void AxialTrackHitMigrator::apply(const std::vector<const CDCWireHit*>& axialWireHits,
43 std::vector<CDCTrack>& axialTracks)
44{
45 // First release some hits
46 for (CDCTrack& track : axialTracks) {
49 }
50
51 // Now add new ones
52 for (CDCTrack& track : axialTracks) {
53 if (track.size() < 5) continue;
56
59 }
60}
The Module parameter list class.
double m_param_addDistance
Parameter : Distance for a hit to be added.
std::string getDescription() final
Short description of the findlet.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
double m_param_dropDistance
Parameter : Distance for a hit to be removed.
void apply(const std::vector< const CDCWireHit * > &axialWireHits, std::vector< CDCTrack > &axialTracks) final
Do the hit migration.
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
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.
static void assignNewHitsToTrack(CDCTrack &track, const std::vector< const CDCWireHit * > &allAxialWireHits, double minimalDistance=0.2)
Assign new hits to the track basing on the distance from the hit to the track.
static void normalizeTrack(CDCTrack &track)
Refit and resort the track. Unmask all hits.
static void deleteHitsFarAwayFromTrajectory(CDCTrack &track, double maximumDistance=0.2)
Postprocessing: Delete axial hits that do not "match" to the given track.
static std::vector< CDCRecoHit3D > splitBack2BackTrack(CDCTrack &track)
Tries to split back-to-back tracks into two different tracks.