Belle II Software  release-05-01-25
TrackCreatorSegmentTripleAutomaton.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/findlets/minimal/TrackCreatorSegmentTripleAutomaton.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
13 #include <tracking/trackFindingCDC/eventdata/tracks/CDCSegmentTriple.h>
14 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
15 
16 #include <tracking/trackFindingCDC/ca/Path.h>
17 
18 #include <tracking/trackFindingCDC/utilities/WeightedRelation.h>
19 
20 using namespace Belle2;
21 using namespace TrackFindingCDC;
22 
24 {
25  return "Constructs tracks by extraction of segment triple paths in a cellular automaton.";
26 }
27 
28 void TrackCreatorSegmentTripleAutomaton::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
29 {
30  m_cellularPathFinder.exposeParameters(moduleParamList, prefix);
31 }
32 
33 void TrackCreatorSegmentTripleAutomaton::apply(const std::vector<CDCSegmentTriple>& inputSegmentTriples,
34  const std::vector<WeightedRelation<const CDCSegmentTriple>>& inputSegmentTripleRelations,
35  std::vector<CDCTrack>& outputTracks)
36 {
37  // Obtain the segment triples as pointers
38  std::vector<const CDCSegmentTriple*> segmentTriplePtrs =
39  as_pointers<const CDCSegmentTriple>(inputSegmentTriples);
40 
41  m_segmentTriplePaths.clear();
42  m_cellularPathFinder.apply(segmentTriplePtrs, inputSegmentTripleRelations, m_segmentTriplePaths);
43 
44  // Reduce to plain tracks
45  for (const Path<const CDCSegmentTriple>& segmentTriplePath : m_segmentTriplePaths) {
46  outputTracks.push_back(CDCTrack::condense(segmentTriplePath));
47  for (const CDCSegmentTriple* segmentTriple : segmentTriplePath) {
48  segmentTriple->getStartSegment()->getAutomatonCell().setTakenFlag();
49  segmentTriple->getMiddleSegment()->getAutomatonCell().setTakenFlag();
50  segmentTriple->getEndSegment()->getAutomatonCell().setTakenFlag();
51  }
52  }
53 }
Belle2::TrackFindingCDC::TrackCreatorSegmentTripleAutomaton::exposeParameters
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
Definition: TrackCreatorSegmentTripleAutomaton.cc:28
Belle2::TrackFindingCDC::TrackCreatorSegmentTripleAutomaton::m_cellularPathFinder
MultipassCellularPathFinder< const CDCSegmentTriple > m_cellularPathFinder
Instance of the cellular automaton path finder.
Definition: TrackCreatorSegmentTripleAutomaton.h:64
Belle2::TrackFindingCDC::CDCTrack::condense
static CDCTrack condense(const Path< const CDCTrack > &trackPath)
Concats several tracks from a path.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::TrackCreatorSegmentTripleAutomaton::m_segmentTriplePaths
std::vector< Path< const CDCSegmentTriple > > m_segmentTriplePaths
Memory for the segment triple paths generated from the graph.
Definition: TrackCreatorSegmentTripleAutomaton.h:68
Belle2::TrackFindingCDC::TrackCreatorSegmentTripleAutomaton::getDescription
std::string getDescription() final
Short description of the findlet.
Definition: TrackCreatorSegmentTripleAutomaton.cc:23
Belle2::TrackFindingCDC::TrackCreatorSegmentTripleAutomaton::apply
void apply(const std::vector< CDCSegmentTriple > &inputSegmentTriples, const std::vector< WeightedRelation< const CDCSegmentTriple >> &inputSegmentTripleRelations, std::vector< CDCTrack > &outputTracks) final
Main function of the segment finding by the cellular automaton.
Definition: TrackCreatorSegmentTripleAutomaton.cc:33
Belle2::TrackFindingCDC::WeightedRelation
Type for two related objects with a weight.
Definition: CDCSegment2D.h:36
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::TrackFindingCDC::CDCSegmentTriple
Class representing a triple of reconstructed segements in adjacent superlayer.
Definition: CDCSegmentTriple.h:42