CbmRoot
Loading...
Searching...
No Matches
TrackingSetup.h
Go to the documentation of this file.
1/* Copyright (C) 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 "SubChain.h"
16
17#include <type_traits>
18
19// TODO: SZh 19.04.2024: Provide interfaces for other subsystems and redefine access
20
21namespace cbm::algo
22{
25 class TrackingSetup : public SubChain {
26 public:
28 TrackingSetup() = default;
29
31 TrackingSetup(const TrackingSetup&) = delete;
32
35
37 ~TrackingSetup() = default;
38
40 void Init();
41
45 template<fles::Subsystem DetID>
46 int GetTrackingStation(uint32_t address) const
47 {
48 if constexpr (DetID == fles::Subsystem::STS) {
49 return fSts.GetTrackingStation(address);
50 }
51 else if constexpr (DetID == fles::Subsystem::TRD) {
52 return fTrd.GetTrackingStation(address);
53 }
54 else if constexpr (DetID == fles::Subsystem::TOF) {
55 return fTof.GetTrackingStation(address);
56 }
57 return -1; // Default: no station is assigned, hit will be skept !
58 }
59
63 void Use(fles::Subsystem det, bool flag = true)
64 {
65 using fles::Subsystem;
66 switch (det) {
67 case Subsystem::STS: fbUseSts = flag; break;
68 case Subsystem::MVD: break;
69 case Subsystem::MUCH: break;
70 case Subsystem::TRD: fbUseTrd = flag; break;
71 case Subsystem::TOF: fbUseTof = flag; break;
72 default: break;
73 }
74 }
75
76 private:
80 bool fbUseSts = false;
81 bool fbUseTrd = false;
82 bool fbUseTof = false;
83 };
84} // namespace cbm::algo
A detector setup interface class for tracking input data initialization.
sts::TrackingInterface fSts
STS tracking interface.
void Init()
Initializer function.
trd::TrackingInterface fTrd
TRD tracking interface.
~TrackingSetup()=default
Destructor.
tof::TrackingInterface fTof
TOF tracking interface.
TrackingSetup(const TrackingSetup &)=delete
Copy constructor.
void Use(fles::Subsystem det, bool flag=true)
Set detector subsystem usage.
TrackingSetup()=default
Default constructor.
TrackingSetup(TrackingSetup &&)=delete
Move constructor.
int GetTrackingStation(uint32_t address) const
Returns tracking station index by the detector element address.
int GetTrackingStation(uint32_t address) const
Returns tracking station index by the TOF address.
int GetTrackingStation(uint32_t address) const
Returns tracking station index by the TOF address.
int GetTrackingStation(uint32_t address) const
Returns tracking station index by the TOF address.
A STS-parameter and geometry interface used for tracking input data initialization (header)
A TOF-parameter and geometry interface used for tracking input data initialization (header)
A TRD-parameter and geometry interface used for tracking input data initialization (header)