Skip to content
Snippets Groups Projects
Commit e6aa1b21 authored by Sergei Zharko's avatar Sergei Zharko Committed by Sergei Zharko
Browse files

CbmStsStation: the z-reference field is replaced with the coordinates of the...

CbmStsStation: the z-reference field is replaced with the coordinates of the lower and upper bounds of a station
parent 1fc7ac3d
No related branches found
No related tags found
1 merge request!1917Update of tracking detector interfaces
...@@ -36,11 +36,12 @@ using std::stringstream; ...@@ -36,11 +36,12 @@ using std::stringstream;
// ----- Default constructor ------------------------------------------- // ----- Default constructor -------------------------------------------
CbmStsStation::CbmStsStation() CbmStsStation::CbmStsStation()
: TNamed() : TNamed()
, fZ(0.)
, fXmin(0.) , fXmin(0.)
, fXmax(0.) , fXmax(0.)
, fYmin(0.) , fYmin(0.)
, fYmax(0.) , fYmax(0.)
, fZmin(0.)
, fZmax(0.)
, fSensorD(0.) , fSensorD(0.)
, fSensorRot(0.) , fSensorRot(0.)
, fNofSensors(0) , fNofSensors(0)
...@@ -56,11 +57,12 @@ CbmStsStation::CbmStsStation() ...@@ -56,11 +57,12 @@ CbmStsStation::CbmStsStation()
// ----- Standard constructor ------------------------------------------ // ----- Standard constructor ------------------------------------------
CbmStsStation::CbmStsStation(const char* name, const char* title, TGeoPhysicalNode* node) CbmStsStation::CbmStsStation(const char* name, const char* title, TGeoPhysicalNode* node)
: TNamed(name, title) : TNamed(name, title)
, fZ(0.)
, fXmin(0.) , fXmin(0.)
, fXmax(0.) , fXmax(0.)
, fYmin(0.) , fYmin(0.)
, fYmax(0.) , fYmax(0.)
, fZmin(0.)
, fZmax(0.)
, fSensorD(0.) , fSensorD(0.)
, fSensorRot(0.) , fSensorRot(0.)
, fNofSensors(0) , fNofSensors(0)
...@@ -97,8 +99,8 @@ void CbmStsStation::CheckSensorProperties() ...@@ -97,8 +99,8 @@ void CbmStsStation::CheckSensorProperties()
{ {
Int_t nSensors = 0; // sensor counter Int_t nSensors = 0; // sensor counter
Double_t zMin = 999999.; // sensor z minimum fZmin = 999999.; // sensor z minimum
Double_t zMax = -999999.; // sensor z maximum fZmax = -999999.; // sensor z maximum
// --- Loop over ladders // --- Loop over ladders
for (UInt_t iLad = 0; iLad < fLadders.size(); iLad++) { for (UInt_t iLad = 0; iLad < fLadders.size(); iLad++) {
...@@ -126,12 +128,12 @@ void CbmStsStation::CheckSensorProperties() ...@@ -126,12 +128,12 @@ void CbmStsStation::CheckSensorProperties()
Double_t global[3]; // sensor centre, global c.s. Double_t global[3]; // sensor centre, global c.s.
sensorNode->GetMatrix()->LocalToMaster(local, global); sensorNode->GetMatrix()->LocalToMaster(local, global);
if (!nSensors) { // first sensor if (!nSensors) { // first sensor
zMin = global[2]; fZmin = global[2];
zMax = global[2]; fZmax = global[2];
} }
else { else {
zMin = TMath::Min(zMin, global[2]); fZmin = TMath::Min(fZmin, global[2]);
zMax = TMath::Max(zMax, global[2]); fZmax = TMath::Max(fZmax, global[2]);
} }
// Get sensor thickness // Get sensor thickness
...@@ -149,8 +151,9 @@ void CbmStsStation::CheckSensorProperties() ...@@ -149,8 +151,9 @@ void CbmStsStation::CheckSensorProperties()
} // # half-ladders } // # half-ladders
} // # ladders } // # ladders
fZ = 0.5 * (zMin + zMax);
fNofSensors = nSensors; fNofSensors = nSensors;
fZmin -= fSensorD * 0.5;
fZmax += fSensorD * 0.5;
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -256,7 +259,7 @@ void CbmStsStation::Init() ...@@ -256,7 +259,7 @@ void CbmStsStation::Init()
string CbmStsStation::ToString() const string CbmStsStation::ToString() const
{ {
stringstream ss; 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 " << " cm, y = " << fYmin << " to " << fYmax << " cm "
<< "\n\t\t" << "\n\t\t"
<< " rotation " << fSensorRot * 180. / 3.1415927 << " degrees," << " rotation " << fSensorRot * 180. / 3.1415927 << " degrees,"
......
...@@ -126,7 +126,17 @@ public: ...@@ -126,7 +126,17 @@ public:
** **
** Calculated from the sensor positions (mean between min z and max z) ** 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 **/ /** @brief Initialise the station parameters **/
...@@ -138,11 +148,12 @@ public: ...@@ -138,11 +148,12 @@ public:
private: private:
Double_t fZ; ///< z position of station [cm]
Double_t fXmin; ///< minimal x coordinate [cm] Double_t fXmin; ///< minimal x coordinate [cm]
Double_t fXmax; ///< maximal x coordinate [cm] Double_t fXmax; ///< maximal x coordinate [cm]
Double_t fYmin; ///< minimal y coordinate [cm] Double_t fYmin; ///< minimal y coordinate [cm]
Double_t fYmax; ///< maximal 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 fSensorD; ///< thickness of sensors [cm]
Double_t fSensorRot; ///< Rotation of first sensor in global c.s. [rad] Double_t fSensorRot; ///< Rotation of first sensor in global c.s. [rad]
Int_t fNofSensors; ///< Number of sensors in station Int_t fNofSensors; ///< Number of sensors in station
......
...@@ -96,9 +96,9 @@ InitStatus CbmStsTrackingInterface::Init() ...@@ -96,9 +96,9 @@ InitStatus CbmStsTrackingInterface::Init()
for (int iSt = 0; iSt < nStations; ++iSt) { for (int iSt = 0; iSt < nStations; ++iSt) {
const auto* pStsStation{CbmStsSetup::Instance()->GetStation(iSt)}; const auto* pStsStation{CbmStsSetup::Instance()->GetStation(iSt)};
if constexpr (kDebugGeoDefined) { if constexpr (kDebugGeoDefined) {
fvStations.emplace_back(pStsStation->GetZ(), pStsStation->GetZ() - pStsStation->GetSensorD(), fvStations.emplace_back(pStsStation->GetZ(), pStsStation->GetZmin(), pStsStation->GetZmax(),
pStsStation->GetZ() + pStsStation->GetSensorD(), pStsStation->GetXmin(), pStsStation->GetXmin(), pStsStation->GetXmax(), pStsStation->GetYmin(),
pStsStation->GetXmax(), pStsStation->GetYmin(), pStsStation->GetYmax()); pStsStation->GetYmax());
} }
else { else {
fvStations.emplace_back(pStsStation->GetZ(), fvStations.emplace_back(pStsStation->GetZ(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment