diff --git a/core/detectors/sts/CbmStsStation.cxx b/core/detectors/sts/CbmStsStation.cxx index 0f08e6d115de0bb34fe6dcd815a03951bbfabc19..ab754e98e209cf75713dfff633cd27e04abf50ab 100644 --- a/core/detectors/sts/CbmStsStation.cxx +++ b/core/detectors/sts/CbmStsStation.cxx @@ -36,11 +36,12 @@ using std::stringstream; // ----- Default constructor ------------------------------------------- CbmStsStation::CbmStsStation() : TNamed() - , fZ(0.) , fXmin(0.) , fXmax(0.) , fYmin(0.) , fYmax(0.) + , fZmin(0.) + , fZmax(0.) , fSensorD(0.) , fSensorRot(0.) , fNofSensors(0) @@ -56,11 +57,12 @@ CbmStsStation::CbmStsStation() // ----- Standard constructor ------------------------------------------ CbmStsStation::CbmStsStation(const char* name, const char* title, TGeoPhysicalNode* node) : TNamed(name, title) - , fZ(0.) , fXmin(0.) , fXmax(0.) , fYmin(0.) , fYmax(0.) + , fZmin(0.) + , fZmax(0.) , fSensorD(0.) , fSensorRot(0.) , fNofSensors(0) @@ -97,8 +99,8 @@ void CbmStsStation::CheckSensorProperties() { Int_t nSensors = 0; // sensor counter - Double_t zMin = 999999.; // sensor z minimum - Double_t zMax = -999999.; // sensor z maximum + fZmin = 999999.; // sensor z minimum + fZmax = -999999.; // sensor z maximum // --- Loop over ladders for (UInt_t iLad = 0; iLad < fLadders.size(); iLad++) { @@ -126,12 +128,12 @@ void CbmStsStation::CheckSensorProperties() Double_t global[3]; // sensor centre, global c.s. sensorNode->GetMatrix()->LocalToMaster(local, global); if (!nSensors) { // first sensor - zMin = global[2]; - zMax = global[2]; + fZmin = global[2]; + fZmax = global[2]; } else { - zMin = TMath::Min(zMin, global[2]); - zMax = TMath::Max(zMax, global[2]); + fZmin = TMath::Min(fZmin, global[2]); + fZmax = TMath::Max(fZmax, global[2]); } // Get sensor thickness @@ -149,8 +151,9 @@ void CbmStsStation::CheckSensorProperties() } // # half-ladders } // # ladders - fZ = 0.5 * (zMin + zMax); fNofSensors = nSensors; + fZmin -= fSensorD * 0.5; + fZmax += fSensorD * 0.5; } // ------------------------------------------------------------------------- @@ -256,7 +259,7 @@ void CbmStsStation::Init() string CbmStsStation::ToString() const { stringstream ss; - ss << GetName() << ": " << fNofSensors << " sensors, z = " << fZ << " cm, x = " << fXmin << " to " << fXmax + ss << GetName() << ": " << fNofSensors << " sensors, z = " << GetZ() << " cm, x = " << fXmin << " to " << fXmax << " cm, y = " << fYmin << " to " << fYmax << " cm " << "\n\t\t" << " rotation " << fSensorRot * 180. / 3.1415927 << " degrees," diff --git a/core/detectors/sts/CbmStsStation.h b/core/detectors/sts/CbmStsStation.h index b1dbd7c5f687ccc077ebd14222e9905900e8293b..2f6fab4f0bd3ada2911ec8078720d2f1836ab56f 100644 --- a/core/detectors/sts/CbmStsStation.h +++ b/core/detectors/sts/CbmStsStation.h @@ -126,7 +126,17 @@ public: ** ** Calculated from the sensor positions (mean between min z and max z) **/ - Double_t GetZ() const { return fZ; } + Double_t GetZ() const { return 0.5 * (fZmin + fZmax); } + + /** + * @brief Gets maximal z-coordinate of the tracking station in global C.S. (including sensor half-thickness) [cm] + * */ + Double_t GetZmax() const { return fZmax; } + + /** + * @brief Gets minimal z-coordinate of the tracking station in global C.S. (including sensor half-thickness) [cm] + * */ + Double_t GetZmin() const { return fZmin; } /** @brief Initialise the station parameters **/ @@ -138,11 +148,12 @@ public: private: - Double_t fZ; ///< z position of station [cm] Double_t fXmin; ///< minimal x coordinate [cm] Double_t fXmax; ///< maximal x coordinate [cm] Double_t fYmin; ///< minimal y coordinate [cm] Double_t fYmax; ///< maximal y coordinate [cm] + Double_t fZmin; ///< minimal z coordinate [cm] + Double_t fZmax; ///< maximal z coordinate [cm] Double_t fSensorD; ///< thickness of sensors [cm] Double_t fSensorRot; ///< Rotation of first sensor in global c.s. [rad] Int_t fNofSensors; ///< Number of sensors in station diff --git a/core/detectors/sts/CbmStsTrackingInterface.cxx b/core/detectors/sts/CbmStsTrackingInterface.cxx index 2eb761ccc11bc02fbcc97ff39736382d1a797ebd..e9c063c81e157a41d5a205497c12394d6e0cfb43 100644 --- a/core/detectors/sts/CbmStsTrackingInterface.cxx +++ b/core/detectors/sts/CbmStsTrackingInterface.cxx @@ -96,9 +96,9 @@ InitStatus CbmStsTrackingInterface::Init() for (int iSt = 0; iSt < nStations; ++iSt) { const auto* pStsStation{CbmStsSetup::Instance()->GetStation(iSt)}; if constexpr (kDebugGeoDefined) { - fvStations.emplace_back(pStsStation->GetZ(), pStsStation->GetZ() - pStsStation->GetSensorD(), - pStsStation->GetZ() + pStsStation->GetSensorD(), pStsStation->GetXmin(), - pStsStation->GetXmax(), pStsStation->GetYmin(), pStsStation->GetYmax()); + fvStations.emplace_back(pStsStation->GetZ(), pStsStation->GetZmin(), pStsStation->GetZmax(), + pStsStation->GetXmin(), pStsStation->GetXmax(), pStsStation->GetYmin(), + pStsStation->GetYmax()); } else { fvStations.emplace_back(pStsStation->GetZ(),