Belle II Software  release-05-02-19
TrackOrienter Class Referenceabstract

Fixes the orientation of tracks by a simple heuristic. More...

#include <TrackOrienter.h>

Inheritance diagram for TrackOrienter:
Collaboration diagram for TrackOrienter:

Public Types

using IOTypes = std::tuple< AIOTypes... >
 Types that should be served to apply on invokation.
 
using IOVectors = std::tuple< std::vector< AIOTypes >... >
 Vector types that should be served to apply on invokation.
 

Public Member Functions

std::string getDescription () final
 Short description of the findlet.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters to a module.
 
void initialize () final
 Signals the beginning of the event processing.
 
void apply (const std::vector< CDCTrack > &inputTracks, std::vector< CDCTrack > &outputTracks) final
 Main algorithm applying the adjustment of the orientation. More...
 
virtual void exposeParameters (ModuleParamList *moduleParamList __attribute__((unused)), const std::string &prefix __attribute__((unused)))
 Forward prefixed parameters of this findlet to the module parameter list.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void beginRun () override
 Receive and dispatch signal for the beginning of a new run.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 

Protected Types

using ToVector = typename ToVectorImpl< T >::Type
 Short hand for ToRangeImpl.
 

Protected Member Functions

void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Private Types

using Super = Findlet< const CDCTrack, CDCTrack >
 Type of the base class.
 

Private Attributes

std::string m_param_trackOrientationString = ""
 Parameter: String that states the desired track orientation. More...
 
EPreferredDirection m_trackOrientation = EPreferredDirection::c_None
 Encoded desired track orientation. More...
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized = false
 Flag to keep track whether initialization happend before.
 
bool m_terminated = false
 Flag to keep track whether termination happend before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Fixes the orientation of tracks by a simple heuristic.

Definition at line 36 of file TrackOrienter.h.

Member Function Documentation

◆ apply()

void apply ( const std::vector< CDCTrack > &  inputTracks,
std::vector< CDCTrack > &  outputTracks 
)
final

Main algorithm applying the adjustment of the orientation.

Copy tracks to output fixing their orientation

Definition at line 54 of file TrackOrienter.cc.

56 {
58  if (m_trackOrientation == EPreferredDirection::c_None) {
59  // Copy the tracks unchanged.
60  outputTracks = inputTracks;
61 
62  } else if (m_trackOrientation == EPreferredDirection::c_Symmetric) {
63  outputTracks.reserve(2 * inputTracks.size());
64  for (const CDCTrack& track : inputTracks) {
65  outputTracks.push_back(track.reversed());
66  outputTracks.push_back(track);
67  }
68 
69  } else if (m_trackOrientation == EPreferredDirection::c_Curling) {
70  // Only make a copy for tracks that are curling inside the CDC
71  // Others fix to flighing outwards
72  outputTracks.reserve(1.5 * inputTracks.size());
73  for (const CDCTrack& track : inputTracks) {
74  const CDCTrajectory3D& startTrajectory3D = track.getStartTrajectory3D();
75  const CDCTrajectory2D startTrajectory2D = startTrajectory3D.getTrajectory2D();
76 
77  const CDCTrajectory3D& endTrajectory3D = track.getEndTrajectory3D();
78  const CDCTrajectory2D endTrajectory2D = endTrajectory3D.getTrajectory2D();
79  bool isFitted = startTrajectory2D.isFitted() and endTrajectory2D.isFitted();
80  bool isStartLeaver = (not endTrajectory2D.isCurler(1.1)) and startTrajectory2D.isOriginer();
81  bool isEndLeaver = (not startTrajectory2D.isCurler(1.1)) and endTrajectory2D.isOriginer();
82  // Trajectory is leaving the CDC starting in the inner volume
83  bool isLeaver = isFitted and (isStartLeaver or isEndLeaver);
84  if (isLeaver) {
85  // Fix to outwards flying
86  const CDCRecoHit3D& firstHit = track.front();
87  const CDCRecoHit3D& lastHit = track.back();
88  if (lastHit.getRecoPos2D().cylindricalR() < firstHit.getRecoPos2D().cylindricalR()) {
89  outputTracks.push_back(track.reversed());
90  } else {
91  outputTracks.push_back(track);
92  }
93  } else {
94  // Ambigious keep both options
95  outputTracks.push_back(track);
96  outputTracks.push_back(track.reversed());
97  }
98  }
99 
100  } else if (m_trackOrientation == EPreferredDirection::c_Outwards) {
101  outputTracks.reserve(inputTracks.size());
102  for (const CDCTrack& track : inputTracks) {
103  const CDCRecoHit3D& firstHit = track.front();
104  const CDCRecoHit3D& lastHit = track.back();
105  if (lastHit.getRecoPos2D().cylindricalR() < firstHit.getRecoPos2D().cylindricalR()) {
106  outputTracks.push_back(track.reversed());
107  } else {
108  outputTracks.push_back(track);
109  }
110  }
111 
112  } else if (m_trackOrientation == EPreferredDirection::c_Downwards) {
113  outputTracks.reserve(inputTracks.size());
114  for (const CDCTrack& track : inputTracks) {
115  const CDCRecoHit3D& firstHit = track.front();
116  const CDCRecoHit3D& lastHit = track.back();
117  if (lastHit.getRecoPos2D().y() > firstHit.getRecoPos2D().y()) {
118  outputTracks.push_back(track.reversed());
119  } else {
120  outputTracks.push_back(track);
121  }
122  }
123 
124  } else {
125  B2WARNING("Unexpected 'TrackOrientation' parameter of track finder module : '" <<
127  "'. No tracks are put out.");
128  }
129 }

Member Data Documentation

◆ m_param_trackOrientationString

std::string m_param_trackOrientationString = ""
private

Parameter: String that states the desired track orientation.

Valid orientations are "none" (unchanged), "outwards", "downwards", "symmetric", "curling"

Definition at line 60 of file TrackOrienter.h.

◆ m_trackOrientation

EPreferredDirection m_trackOrientation = EPreferredDirection::c_None
private

Encoded desired track orientation.

Valid orientations are "c_None" (unchanged), "c_Outwards", "c_Downwards", "c_Symmetric", "c_Curling",

Definition at line 66 of file TrackOrienter.h.


The documentation for this class was generated from the following files:
Belle2::TrackFindingCDC::TrackOrienter::m_param_trackOrientationString
std::string m_param_trackOrientationString
Parameter: String that states the desired track orientation.
Definition: TrackOrienter.h:60
Belle2::TrackFindingCDC::TrackOrienter::m_trackOrientation
EPreferredDirection m_trackOrientation
Encoded desired track orientation.
Definition: TrackOrienter.h:66