14#include "FairDetector.h"
15#include "FairRunAna.h"
18#include "TGeoPhysicalNode.h"
25 : FairTask(
"CbmStsTrackingInterface")
27 if (!fpInstance) { fpInstance =
this; }
48 const TGeoPhysicalNode* node = sensor->
GetNode();
53 double angleF = param->
GetPar(8) * TMath::DegToRad();
54 double angleB = param->
GetPar(9) * TMath::DegToRad();
56 const TGeoHMatrix* matrix = node->GetMatrix();
59 TGeoRotation rot(*matrix);
61 Double_t local[3] = {TMath::Cos(angleF), TMath::Sin(angleF), 0.};
63 rot.LocalToMaster(local, global);
64 angleF = TMath::ATan2(global[1], global[0]);
67 Double_t local[3] = {TMath::Cos(angleB), TMath::Sin(angleB), 0.};
69 rot.LocalToMaster(local, global);
70 angleB = TMath::ATan2(global[1], global[0]);
74 return std::tuple(angleF, angleB);
88 if (!stsSetup->IsInit()) { stsSetup->Init(
nullptr); }
89 if (!stsSetup->IsModuleParsInit()) { stsSetup->SetModuleParameters(
fStsParSetModule); }
90 if (!stsSetup->IsSensorParsInit()) { stsSetup->SetSensorParameters(
fStsParSetSensor); }
96 for (
int iSt = 0; iSt < nStations; ++iSt) {
99 fvStationFullVolume.emplace_back(pStsStation->GetXmin(), pStsStation->GetXmax(), pStsStation->GetYmin(),
100 pStsStation->GetYmax(), pStsStation->GetZmin(), pStsStation->GetZmax());
103 fvStationFullVolume.emplace_back(pStsStation->GetXmin(), pStsStation->GetXmax(), pStsStation->GetYmin(),
104 pStsStation->GetYmax(), pStsStation->GetZ() - 2., pStsStation->GetZ() + 2.);
111 if (!this->
Check()) {
113 <<
"Some errors occurred in the tracking detector interface initialization for STS (see information above)";
132 auto runtimeDb = FairRunAna::Instance()->GetRuntimeDb();
137 LOG(fatal) <<
"CbmStsTrackingInterface::SetParContainers: error accessing to CbmStsParSetModule container";
140 LOG(fatal) <<
"CbmStsTrackingInterface::SetParContainers: error accessing to CbmStsParSetSensor container";
143 LOG(fatal) <<
"CbmStsTrackingInterface::SetParContainers: error accessing to CbmStsParSetSensorCond container";
ClassImp(CbmStsTrackingInterface) CbmStsTrackingInterface
Constructional parameters of a STS sensor.
Float_t GetPar(UInt_t index) const
Get a parameter.
Parameters container for CbmStsParModule.
Parameters container for CbmStsParSensorCond.
Parameters container for CbmStsParSensor.
Class representing an instance of a sensor in the CBM-STS.
const CbmStsParSensor * GetParams() const
Sensor parameters.
TGeoPhysicalNode * GetNode() const
CbmStsElement * GetElement(Int_t address, Int_t level)
Int_t GetNofStations() const
static CbmStsSetup * Instance()
CbmStsStation * GetStation(Int_t stationId) const
A CbmL1 subtask, which provides necessary methods for CA tracker to access the geometry and dataflow ...
CbmStsTrackingInterface()
Default constructor.
InitStatus ReInit() override
FairTask: ReInit method.
CbmStsParSetModule * fStsParSetModule
InitStatus Init() override
FairTask: Init method.
CbmStsParSetSensorCond * fStsParSetSensorCond
~CbmStsTrackingInterface()
Destructor.
void SetParContainers() override
FairTask: sets parameter containers up.
static CbmStsTrackingInterface * fpInstance
std::tuple< double, double > GetStereoAnglesSensor(int address) const override
Gets stereo angles of the two independent measured coordinates.
CbmStsParSetSensor * fStsParSetSensor
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.
static constexpr bool kLegacy
If use legacy tracking detector interface definition FIXME: Remove after testing.