Project
Loading...
Searching...
No Matches
TraversalTestSupport.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_ITSMFT_TRACKING_TEST_TRAVERSALTESTSUPPORT_H_
13#define ALICEO2_ITSMFT_TRACKING_TEST_TRAVERSALTESTSUPPORT_H_
14
15#include <stdexcept>
16
19
21{
22
23// Test-only access to the Tracker-owned initialization transaction and
24// explicit backend stages. The caller owns the span buffer for the returned view.
26 static IterationContext prepare(Tracker& tracker, TimeFrame& frame, int iteration,
27 std::array<gsl::span<const GlobalMeasurement>, MaxLayoutSurfaces>& measurementSpans)
28 {
29 const auto* configuration = iteration < 0 ? nullptr : tracker.getIterationConfiguration(static_cast<std::size_t>(iteration));
30 if (configuration == nullptr || !tracker.isConfiguredFor(frame)) {
31 throw std::out_of_range{"test traversal iteration"};
32 }
33 auto& scratch = frame.getScratch();
34 auto layerGlobalMeasurements = tracker.prepareTimeFrame(frame, measurementSpans);
35 IterationContext view{iteration,
36 frame,
37 scratch,
38 configuration->getTopologyView(frame.getDetectorConfiguration().getSurfaceCatalog()),
39 *configuration,
40 layerGlobalMeasurements,
41 frame.getBz()};
42 tracker.initializeIteration(view);
43 return view;
44 }
45
46 static void computeTracklets(TrackerTraits& traits, IterationContext& view, int vertex)
47 {
48 traits.computeLayerTracklets(view, view.iteration, vertex);
49 }
50
51 static void computeCells(TrackerTraits& traits, IterationContext& view)
52 {
53 traits.computeLayerCells(view, view.iteration);
54 }
55
56 static void findNeighbours(TrackerTraits& traits, IterationContext& view)
57 {
58 traits.findCellsNeighbours(view, view.iteration);
59 }
60
61 static bool buildTrackSeed(TrackerTraits& traits, IterationContext& view,
62 int cellPathId, const Triplet& cell,
64 {
65 return traits.buildTrackSeed(view, cellPathId, cell, output);
66 }
67
68 static void findRoads(TrackerTraits& traits, IterationContext& view)
69 {
70 traits.findRoads(view, view.iteration);
71 }
72
73 static void computeTracksMClabels(Tracker& tracker, TimeFrame& frame)
74 {
75 tracker.computeTracksMClabels(frame);
76 }
77
78 static void configureBeamPosition(Tracker& tracker, TimeFrame& frame)
79 {
80 tracker.configureBeamPosition(frame);
81 }
82};
83
84} // namespace o2::itsmft::tracking
85
86#endif
uint64_t vertex
Definition RawEventData.h:9
Tracker orchestrator.
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
GPU-portable whole-track seed for common CA tracking.
const IterationConfiguration * getIterationConfiguration(std::size_t iteration) const noexcept
Definition Tracker.h:66
bool isConfiguredFor(const TimeFrame &frame) const noexcept
Definition Tracker.cxx:490
constexpr uint32_t MaxLayoutSurfaces
Definition IdTypes.h:70
TimeFrameScratch & getScratch()
static void findRoads(TrackerTraits &traits, IterationContext &view)
static IterationContext prepare(Tracker &tracker, TimeFrame &frame, int iteration, std::array< gsl::span< const GlobalMeasurement >, MaxLayoutSurfaces > &measurementSpans)
static void configureBeamPosition(Tracker &tracker, TimeFrame &frame)
static void computeCells(TrackerTraits &traits, IterationContext &view)
static void computeTracksMClabels(Tracker &tracker, TimeFrame &frame)
static bool buildTrackSeed(TrackerTraits &traits, IterationContext &view, int cellPathId, const Triplet &cell, TrackSeed &output)
static void computeTracklets(TrackerTraits &traits, IterationContext &view, int vertex)
static void findNeighbours(TrackerTraits &traits, IterationContext &view)