15#include "FairDetector.h"
16#include "FairRunAna.h"
28 : FairTask(
"CbmTofTrackingInterface")
48 static_assert(std::is_trivially_copyable_v<VolumeInfo> ==
true);
52 LOG(info) <<
"Create DigiPar";
61 std::vector<int> nTofStationModules(nStations, 0);
69 auto vRpcPaths{
CollectNodes(
"tof",
"counter",
"", gGeoManager->GetTopNode())};
70 std::regex rpcPattern{
"module_(\\d+)_(\\d+)/gas_box_(\\d+)/counter_(\\d+)"};
71 for (
const auto& rpcPath : vRpcPaths) {
73 std::string line{rpcPath.Data()};
74 if (std::regex_search(line, match, rpcPattern)) {
75 int iSmType{std::stoi(match[1])};
76 int iSm{std::stoi(match[2])};
77 int iRpc{std::stoi(match[4])};
80 if (5 == iSmType || iStation < 0) {
85 gGeoManager->cd(rpcPath);
86 auto vCellPaths{
CollectNodes(
"tof",
"cell", rpcPath(0, rpcPath.Last(
'/')), gGeoManager->GetCurrentNode())};
87 for (
const auto& cellPath : vCellPaths) {
99 fTofStationZMax.resize(nStations, std::numeric_limits<double>::lowest());
107 if (
nullptr == pChannelInfo) {
108 LOG(warn) << fName <<
": CbmTofCell object is not defined for iSmType = " << iSmType <<
", iSm = " << iSm
109 <<
", iRpc = " << iRpc;
114 auto chPosZ{pChannelInfo->GetZ()};
132 nTofStationModules[iStation] += 1;
138 for (
int iSt{0}; iSt < nStations; ++iSt) {
141 station.fXmin = -100.;
142 station.fXmax = +100.;
143 station.fYmin = -100.;
144 station.fYmax = +100.;
152 if (!this->
Check()) {
154 <<
"Some errors occurred in the tracking detector interface initialization for TOF (see information above)";
174 auto runtimeDb = FairRunAna::Instance()->GetRuntimeDb();
178 LOG(fatal) <<
"CbmTofTrackingInterface::SetParContainers: error accessing to CbmTofDigiPar container";
181 LOG(fatal) <<
"CbmTofTrackingInterface::SetParContainers: error accessing to CbmTofDigiBdfPar container";
183 runtimeDb->initContainers(FairRunAna::Instance()->GetRunId());
ClassImp(CbmTofTrackingInterface) CbmTofTrackingInterface
static uint32_t GetUniqueAddress(uint32_t Sm, uint32_t Rpc, uint32_t Channel, uint32_t Side=0, uint32_t SmType=0, uint32_t RpcType=0)
Parameters class for the CBM ToF digitizer using beam data distributions.
Int_t GetNbSmTypes() const
Int_t GetNbSm(Int_t iSmType) const
Int_t GetNbRpc(Int_t iSmType) const
Int_t GetNbTrackingStations() const
Int_t GetTrackingStation(Int_t iSmType, Int_t iSm, Int_t iRpc) const
CbmTofCell * GetCell(Int_t i)
std::vector< double > fTofStationZ
Centers of TOF stations along z-axis [cm].
void SetParContainers() override
FairTask: sets parameter containers up.
InitStatus Init() override
FairTask: Init method.
CbmTofTrackingInterface()
Default constructor.
static CbmTofTrackingInterface * fpInstance
Instance of the class.
std::vector< double > fTofStationZMin
Lower bounds of TOF stations along z-axis [cm].
std::vector< double > fTofStationZMax
Upper bounds of TOF stations along z-axis [cm].
CbmTofDigiBdfPar * fDigiBdfPar
~CbmTofTrackingInterface()
Destructor.
InitStatus ReInit() override
FairTask: ReInit method.
std::vector< VolumeInfo > fvStationFullVolume
Geometric properties of each station passive volume.
VolumeInfo ReadVolume(const TString &path)
Creates volume info from a geo node provided by path.
std::vector< VolumeInfo > fvStationActiveVolume
Geometric properties of each station active volume.
std::vector< TString > CollectNodes(const TString &detector, const TString &component, const TString &path, TGeoNode *pNode)
Collects paths of the components.
bool Check() const
Checks detector interface: boundary conditions of the parameters.
static constexpr bool kLegacy
If use legacy tracking detector interface definition FIXME: Remove after testing.