CbmRoot
Loading...
Searching...
No Matches
CbmMvdTrackingInterface.cxx
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov, Sergei Zharko [committer] */
4
5/***************************************************************************************************
6 * @file CbmMvdTrackingInterface.cxx
7 * @brief Input data and parameters interface from MVD subsystem used in L1 tracker (definition)
8 * @since 31.05.2022
9 * @author S.Zharko <s.zharko@gsi.de>
10 ***************************************************************************************************/
11
13
14#include "CbmMvdDetector.h"
15#include "CbmMvdPoint.h"
16#include "CbmMvdSensor.h"
17
18#include <Logger.h>
19
21
22 // ---------------------------------------------------------------------------------------------------------------------
23 //
25 : FairTask("CbmMvdTrackingInterface")
26{
27 if (!fpInstance) { fpInstance = this; }
28}
29
30// ---------------------------------------------------------------------------------------------------------------------
31//
36
37// ---------------------------------------------------------------------------------------------------------------------
38//
40{
42
43 if (!fMvdStationPar) { return kFATAL; }
44
45 fvStationFullVolume.clear();
46 // FIXME: Provide station parameters from geometry definition (seems to be unavailable)
47 int nStations{fMvdStationPar->GetStationCount()};
48 fvStationFullVolume.reserve(nStations);
49 for (int iSt = 0; iSt < nStations; ++iSt) {
54 }
56
57 // Check the validity of the parameters
58 if (!this->Check()) {
59 LOG(error)
60 << "Some errors occurred in the tracking detector interface initialization for MVD (see information above)";
61 return kFATAL;
62 }
63
64 return kSUCCESS;
65}
66
67// ---------------------------------------------------------------------------------------------------------------------
68//
70{
71 this->SetParContainers();
72 return Init();
73}
74
75// ---------------------------------------------------------------------------------------------------------------------
76//
78
79// ---------------------------------------------------------------------------------------------------------------------
80//
81int CbmMvdTrackingInterface::GetTrackingStationIndex(const FairMCPoint* point) const
82{
83 const CbmMvdPoint* mvdPoint = [&] {
84 if constexpr (kUseDynamicCast) { return dynamic_cast<const CbmMvdPoint*>(point); }
85 else {
86 return static_cast<const CbmMvdPoint*>(point);
87 }
88 }();
89 assert(mvdPoint);
90 const CbmMvdSensor* sensor = CbmMvdDetector::Instance()->GetSensorMap()[mvdPoint->GetDetectorID()];
91 assert(sensor);
92 return sensor->GetStationNr();
93}
ClassImp(CbmMvdTrackingInterface) CbmMvdTrackingInterface
std::map< int, CbmMvdSensor * > & GetSensorMap()
static CbmMvdDetector * Instance()
CbmMvdStationPar * GetParameterFile()
Int_t GetStationNr() const
Int_t GetStationCount() const
Double_t GetHeight(Int_t stationNumber) const
Double_t GetZPosition(Int_t stationNumber) const
Double_t GetWidth(Int_t stationNumber) const
Double_t GetZThickness(Int_t stationNumber) const
CbmMvdTrackingInterface.
static CbmMvdTrackingInterface * fpInstance
Instance of the class.
InitStatus Init() override
FairTask: Init method.
void SetParContainers() override
FairTask: sets parameter containers up.
int GetTrackingStationIndex(const CbmHit *hit) const override
Gets a tracking station of a CbmHit.
const CbmMvdStationPar * fMvdStationPar
Pointer to the Mvd station parameters.
InitStatus ReInit() override
FairTask: ReInit method.
CbmMvdTrackingInterface()
Default constructor.
std::vector< VolumeInfo > fvStationFullVolume
Geometric properties of each station passive volume.
std::vector< VolumeInfo > fvStationActiveVolume
Geometric properties of each station active volume.
bool Check() const
Checks detector interface: boundary conditions of the parameters.