15#include "FairDetector.h"
16#include "FairRunAna.h"
17#include "TGeoManager.h"
29 : FairTask(
"CbmTrdTrackingInterface")
31 if (!fpInstance) { fpInstance =
this; }
47 LOG(fatal) <<
"CbmTrdTrackingInterface::Init: error accessing the TRD module for address " << address
48 <<
" (failed dynamic cast to CbmTrdParModDigi)";
52 return std::tuple(TMath::Pi() / 2., 0.);
54 return std::tuple(0., TMath::Pi() / 2.);
62 if (!trdHit) { LOG(fatal) <<
"CbmTrdTrackingInterface::GetHitRange: input hit is not of type CbmTrdHit"; }
84 return std::tuple(rangeX, rangeY, rangeT);
93 auto vLayerPaths{
CollectNodes(
"trd",
"layer",
"", gGeoManager->GetTopNode())};
98 std::regex stationPattern{
"layer(\\d+)_(\\d+)"};
99 for (
const auto& layerPath : vLayerPaths) {
101 std::string line{layerPath.Data()};
102 if (std::regex_search(line, match, stationPattern)) {
103 int iStation{std::stoi(match[1]) - 1};
105 gGeoManager->cd(layerPath);
106 auto vGasPaths{
CollectNodes(
"trd",
"gas", layerPath(0, layerPath.Last(
'/')), gGeoManager->GetCurrentNode())};
107 for (
const auto& gasPath : vGasPaths) {
116 auto topNodes = gGeoManager->GetTopNode()->GetNodes();
117 for (
int iTopNode = 0; iTopNode < topNodes->GetEntriesFast(); ++iTopNode) {
118 auto topNode =
static_cast<TGeoNode*
>(topNodes->At(iTopNode));
119 if (TString(topNode->GetName()).Contains(
"trd")) {
120 auto layers = topNode->GetNodes();
121 for (
int iLayer = 0; iLayer < layers->GetEntriesFast(); ++iLayer) {
122 auto layer =
static_cast<TGeoNode*
>(layers->At(iLayer));
123 if (TString(layer->GetName()).Contains(
"layer")) {
132 for (
int iSt = 0; iSt < nStations; ++iSt) {
133 const auto* pModulePar = GetTrdModulePar(iSt);
135 pModulePar->GetX() - pModulePar->GetSizeX(), pModulePar->GetX() + pModulePar->GetSizeX(),
136 pModulePar->GetY() - pModulePar->GetSizeY(), pModulePar->GetY() + pModulePar->GetSizeY(),
137 pModulePar->GetZ() - pModulePar->GetSizeZ(), pModulePar->GetZ() + pModulePar->GetSizeZ());
145 LOG(fatal) <<
"CbmTrdTrackingInterface::Init: error accessing the TRD tracking station " << iSt
146 <<
" (failed dynamic cast to CbmTrdParModDigi)";
151 if (!this->
Check()) {
153 <<
"Some errors occurred in the tracking detector interface initialization for TRD (see information above)";
172 auto runtimeDb = FairRunAna::Instance()->GetRuntimeDb();
175 LOG(fatal) <<
"CbmTrdTrackingInterface::SetParContainers: error accessing to CbmTrdParSetDigi container";
Class for hits in TRD detector.
ClassImp(CbmTrdTrackingInterface) CbmTrdTrackingInterface
friend fvec sqrt(const fvec &a)
int32_t GetAddress() const
int GetNtrackingStations() const
Gets actual number of stations, provided by the current geometry setup.
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.
virtual std::tuple< double, double, double > GetHitRanges(const CbmPixelHit &hit) const
Gets x,y,t ranges of a CbmPixelHit.
data class for a reconstructed Energy-4D measurement in the TRD
bool GetClassType() const
Definition of chamber gain conversion for one TRD module.
Int_t GetOrientation() const
virtual Int_t GetModuleId(Int_t i) const
virtual const CbmTrdParMod * GetModulePar(Int_t detId) const
A CbmL1 subtask, which provides necessary methods for CA tracker to access the geometry and dataflow ...
CbmTrdTrackingInterface()
Default constructor.
~CbmTrdTrackingInterface()
Destructor.
CbmTrdParSetDigi * fTrdDigiPar
InitStatus Init() override
FairTask: Init method.
InitStatus ReInit() override
FairTask: ReInit method.
static CbmTrdTrackingInterface * fpInstance
Instance of the class.
std::tuple< double, double > GetStereoAnglesSensor(int address) const override
Gets stereo angles of the two independent measured coordinates.
void SetParContainers() override
FairTask: sets parameter containers up.
std::tuple< double, double, double > GetHitRanges(const CbmPixelHit &hit) const override
Gets x,y,t ranges of a CbmTrdHit.