CbmRoot
Loading...
Searching...
No Matches
TrackingDefs.h
Go to the documentation of this file.
1/* Copyright (C) 2023-2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#pragma once
11
12#include "CaEnumArray.h"
13#include "CbmDefs.h"
14#include "MicrosliceDescriptor.hpp" // For fles::Subsystem
15
16#include <tuple>
17
18namespace cbm::algo
19{
20 namespace mvd
21 {
22 class Hit;
23 }
24 namespace sts
25 {
26 struct Hit;
27 }
28 namespace much
29 {
30 class Hit;
31 }
32 namespace trd
33 {
34 class Hit;
35 }
36 namespace tof
37 {
38 struct Hit;
39 }
40
41 namespace ca
42 {
43 template<fles::Subsystem subsys>
45 {
46 if constexpr (subsys == fles::Subsystem::STS) {
47 return EDetectorID::kSts;
48 }
49 else if constexpr (subsys == fles::Subsystem::MVD) {
50 return EDetectorID::kMvd;
51 }
52 else if constexpr (subsys == fles::Subsystem::MUCH) {
53 return EDetectorID::kMuch;
54 }
55 else if constexpr (subsys == fles::Subsystem::TRD) {
56 return EDetectorID::kTrd;
57 }
58 if constexpr (subsys == fles::Subsystem::TOF) {
59 return EDetectorID::kTof;
60 }
61 else {
62 return EDetectorID::END;
63 }
64 }
65
66 template<EDetectorID detID>
67 constexpr fles::Subsystem ToFlesSubsystem()
68 {
69 if constexpr (detID == EDetectorID::kMvd) {
70 return fles::Subsystem::MVD;
71 }
72 else if constexpr (detID == EDetectorID::kSts) {
73 return fles::Subsystem::STS;
74 }
75 else if constexpr (detID == EDetectorID::kMuch) {
76 return fles::Subsystem::MUCH;
77 }
78 else if constexpr (detID == EDetectorID::kTrd) {
79 return fles::Subsystem::TRD;
80 }
81 else if constexpr (detID == EDetectorID::kTof) {
82 return fles::Subsystem::TOF;
83 }
84 else if constexpr (detID == EDetectorID::END) {
85 return fles::Subsystem::FLES; // Default ()
86 }
87 }
88
91 template<typename T>
93
96 template<class... Types>
98 template<EDetectorID DetID>
99 using at = std::tuple_element_t<static_cast<std::size_t>(DetID), std::tuple<Types...>>;
100 static constexpr std::size_t size = sizeof...(Types);
101 };
102
104 using MvdHit = ::cbm::algo::mvd::Hit;
106 using MuchHit = ::cbm::algo::much::Hit;
110
112 constexpr DetIdArray_t<const char*> kDetName = {{"MVD", "STS", "MUCH", "TRD", "TOF"}};
113
114 } // namespace ca
115} // namespace cbm::algo
Implementation of cbm::algo::ca::EnumArray class.
Class of arrays, which can be accessed by an enum class entry as an index.
A light-weight TRD hit class for online reconstruction, based on CbmTrdHit. .
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
::cbm::algo::mvd::Hit MvdHit
Hit vector types.
constexpr DetIdArray_t< const char * > kDetName
Detector subsystem names.
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.
Definition CbmDefs.h:176
constexpr fles::Subsystem ToFlesSubsystem()
constexpr EDetectorID FromFlesSubsystem()
::cbm::algo::much::Hit MuchHit
Array of types, indexed by EDetectorID.
static constexpr std::size_t size
std::tuple_element_t< static_cast< std::size_t >(DetID), std::tuple< Types... > > at