Skip to content
Snippets Groups Projects
Commit 429452b9 authored by Sergey Gorbunov's avatar Sergey Gorbunov
Browse files

Ca: tracking interfaces: cosmetics

parent 1036dc23
Branches
Tags dev_2024_37
1 merge request!1921Ca: tracking interfaces: cosmetics
Pipeline #31129 passed
......@@ -14,18 +14,16 @@
#include "CbmHit.h"
#include "CbmPixelHit.h"
#include "FairMCPoint.h"
#include <array>
#include <cmath>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
#include <cmath>
class TGeoNode;
class TString;
......@@ -89,7 +87,7 @@ public:
virtual std::string GetDetectorName() const = 0;
/// @brief Gets actual number of stations, provided by the current geometry setup
int GetNtrackingStations() const { return fvStationsFull.size(); }
int GetNtrackingStations() const { return fvStationFullVolume.size(); }
/// @brief Gets stereo angles of the two independent measured coordinates
/// @note The tracking does not use this method. It is only used by the QA task.
......@@ -115,22 +113,22 @@ public:
/// @brief Gets upper bound of a station passive volume along the X-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return Size of station along the X-axis [cm]
double GetXmax(int stationId) const { return fvStationsFull[stationId].fXmax; }
double GetXmax(int stationId) const { return fvStationFullVolume[stationId].fXmax; }
/// @brief Gets lower bound of a station passive volume along the X-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return Size of station along the X-axis [cm]
double GetXmin(int stationId) const { return fvStationsFull[stationId].fXmin; }
double GetXmin(int stationId) const { return fvStationFullVolume[stationId].fXmin; }
/// @brief Gets upper bound of a station passive volume along the Y-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return Size of station along the Y-axis [cm]
double GetYmax(int stationId) const { return fvStationsFull[stationId].fYmax; }
double GetYmax(int stationId) const { return fvStationFullVolume[stationId].fYmax; }
/// @brief Gets lower bound of a station passive volume along the Y-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return Size of station along the Y-axis [cm]
double GetYmin(int stationId) const { return fvStationsFull[stationId].fYmin; }
double GetYmin(int stationId) const { return fvStationFullVolume[stationId].fYmin; }
/// @brief Gets reference z of the station passive volume
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
......@@ -145,42 +143,42 @@ public:
/// @brief Gets min z of the station passive volume
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return min Z of the station [cm]
double GetZmin(int stationId) const { return fvStationsFull[stationId].fZmin; }
double GetZmin(int stationId) const { return fvStationFullVolume[stationId].fZmin; }
/// @brief Gets max z of the station passive volume
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return max Z of the station [cm]
double GetZmax(int stationId) const { return fvStationsFull[stationId].fZmax; }
double GetZmax(int stationId) const { return fvStationFullVolume[stationId].fZmax; }
/// @brief Gets lower bound of the station active volume along x-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return min X of the station active volume [cm]
double GetActiveXmin(int stationId) const { return fvStationsActive[stationId].fXmin; }
double GetActiveXmin(int stationId) const { return fvStationActiveVolume[stationId].fXmin; }
/// @brief Gets upper bound of the station active volume along x-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return max X of the station active volume [cm]
double GetActiveXmax(int stationId) const { return fvStationsActive[stationId].fXmax; }
double GetActiveXmax(int stationId) const { return fvStationActiveVolume[stationId].fXmax; }
/// @brief Gets lower bound of the station active volume along y-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return min Y of the station active volume [cm]
double GetActiveYmin(int stationId) const { return fvStationsActive[stationId].fYmin; }
double GetActiveYmin(int stationId) const { return fvStationActiveVolume[stationId].fYmin; }
/// @brief Gets upper bound of the station active volume along y-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return max Y of the station active volume [cm]
double GetActiveYmax(int stationId) const { return fvStationsActive[stationId].fYmax; }
double GetActiveYmax(int stationId) const { return fvStationActiveVolume[stationId].fYmax; }
/// @brief Gets lower bound of the station active volume along z-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return min Z of the station active volume [cm]
double GetActiveZmin(int stationId) const { return fvStationsActive[stationId].fZmin; }
double GetActiveZmin(int stationId) const { return fvStationActiveVolume[stationId].fZmin; }
/// @brief Gets upper bound of the station active volume along z-axis
/// @param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1])
/// @return max Z of the station active volume [cm]
double GetActiveZmax(int stationId) const { return fvStationsActive[stationId].fZmax; }
double GetActiveZmax(int stationId) const { return fvStationActiveVolume[stationId].fZmax; }
/// @brief Check if station provides time measurements
/// @param stationId Tracking station ID in the setup
......@@ -226,8 +224,8 @@ public:
// NOTE: SZh 10.09.2024: For now the passive and active volumes destinguish in TRD and TOF only. For STS
// the z-components are active, and the x- and y-components are passive. For
// MVD and MuCh the components are legacy (active? taken from digitizers).
std::vector<VolumeInfo> fvStationsFull{}; ///< Geometric properties of passive station volumes
std::vector<VolumeInfo> fvStationsActive{}; ///< Geometric properties of active station volumes
std::vector<VolumeInfo> fvStationFullVolume{}; ///< Geometric properties of each station passive volume
std::vector<VolumeInfo> fvStationActiveVolume{}; ///< Geometric properties of each station active volume
};
#endif // CbmTrackingDetectorInterfaceBase_h
......@@ -73,16 +73,16 @@ InitStatus CbmMuchTrackingInterface::Init()
for (int iMuchSt = 0; iMuchSt < fGeoScheme->GetNStations(); ++iMuchSt) {
nStations += fGeoScheme->GetStation(iMuchSt)->GetNLayers();
}
fvStationsFull.clear();
fvStationFullVolume.clear();
// FIXME: Provide
fvStationsFull.reserve(nStations);
fvStationFullVolume.reserve(nStations);
for (int iSt = 0; iSt < nStations; ++iSt) {
auto* pLayer{GetMuchLayer(iSt)};
fvStationsFull.emplace_back(-100., +100, -100., +100, pLayer->GetZ() - 0.5 * pLayer->GetDz(),
fvStationFullVolume.emplace_back(-100., +100, -100., +100, pLayer->GetZ() - 0.5 * pLayer->GetDz(),
pLayer->GetZ() + 0.5 * pLayer->GetDz());
}
fvStationsActive = fvStationsFull;
fvStationActiveVolume = fvStationFullVolume;
// Check the validity of the parameters
if (!this->Check()) {
......
......@@ -42,17 +42,17 @@ InitStatus CbmMvdTrackingInterface::Init()
if (!fMvdStationPar) { return kFATAL; }
fvStationsFull.clear();
fvStationFullVolume.clear();
// FIXME: Provide station parameters from geometry definition (seems to be unavailable)
int nStations{fMvdStationPar->GetStationCount()};
fvStationsFull.reserve(nStations);
fvStationFullVolume.reserve(nStations);
for (int iSt = 0; iSt < nStations; ++iSt) {
fvStationsFull.emplace_back(-fMvdStationPar->GetWidth(iSt), +fMvdStationPar->GetWidth(iSt),
fvStationFullVolume.emplace_back(-fMvdStationPar->GetWidth(iSt), +fMvdStationPar->GetWidth(iSt),
-fMvdStationPar->GetHeight(iSt), +fMvdStationPar->GetHeight(iSt),
fMvdStationPar->GetZPosition(iSt) - 0.5 * fMvdStationPar->GetZThickness(iSt),
fMvdStationPar->GetZPosition(iSt) + 0.5 * fMvdStationPar->GetZThickness(iSt));
}
fvStationsActive = fvStationsFull;
fvStationActiveVolume = fvStationFullVolume;
// Check the validity of the parameters
if (!this->Check()) {
......
......@@ -91,20 +91,20 @@ InitStatus CbmStsTrackingInterface::Init()
if (!stsSetup->IsSensorCondInit()) { stsSetup->SetSensorConditions(fStsParSetSensorCond); }
int nStations = CbmStsSetup::Instance()->GetNofStations();
fvStationsFull.clear();
fvStationsFull.reserve(nStations);
fvStationFullVolume.clear();
fvStationFullVolume.reserve(nStations);
for (int iSt = 0; iSt < nStations; ++iSt) {
const auto* pStsStation{CbmStsSetup::Instance()->GetStation(iSt)};
if constexpr (!kLegacy) {
fvStationsFull.emplace_back(pStsStation->GetXmin(), pStsStation->GetXmax(), pStsStation->GetYmin(),
fvStationFullVolume.emplace_back(pStsStation->GetXmin(), pStsStation->GetXmax(), pStsStation->GetYmin(),
pStsStation->GetYmax(), pStsStation->GetZmin(), pStsStation->GetZmax());
}
else {
fvStationsFull.emplace_back(pStsStation->GetXmin(), pStsStation->GetXmax(), pStsStation->GetYmin(),
fvStationFullVolume.emplace_back(pStsStation->GetXmin(), pStsStation->GetXmax(), pStsStation->GetYmin(),
pStsStation->GetYmax(), pStsStation->GetZ() - 2., pStsStation->GetZ() + 2.);
}
}
fvStationsActive = fvStationsFull;
fvStationActiveVolume = fvStationFullVolume;
// Check the validity of the parameters
......
......@@ -60,10 +60,10 @@ InitStatus CbmTofTrackingInterface::Init()
// Number of ToF RPCs for a given tracking station:
std::vector<int> nTofStationModules(nStations, 0);
fvStationsFull.clear();
fvStationsFull.resize(nStations);
fvStationsActive.clear();
fvStationsActive.resize(nStations);
fvStationFullVolume.clear();
fvStationFullVolume.resize(nStations);
fvStationActiveVolume.clear();
fvStationActiveVolume.resize(nStations);
if constexpr (!kLegacy) {
// loop over all RPCs; assign a tracking station ID using DigiBdfPar; combine the RPCs for each station ID
auto vRpcPaths{CollectNodes("tof", "counter", "", gGeoManager->GetTopNode())};
......@@ -81,11 +81,11 @@ InitStatus CbmTofTrackingInterface::Init()
continue;
}
fvStationsFull[iStation] += ReadVolume(rpcPath); // Adding RPC as a passive volume
fvStationFullVolume[iStation] += ReadVolume(rpcPath); // Adding RPC as a passive volume
gGeoManager->cd(rpcPath);
auto vCellPaths{CollectNodes("tof", "cell", rpcPath(0, rpcPath.Last('/')), gGeoManager->GetCurrentNode())};
for (const auto& cellPath : vCellPaths) {
fvStationsActive[iStation] += ReadVolume(cellPath);
fvStationActiveVolume[iStation] += ReadVolume(cellPath);
}
}
}
......@@ -137,7 +137,7 @@ InitStatus CbmTofTrackingInterface::Init()
/// Get the average values and define final arrays
for (int iSt{0}; iSt < nStations; ++iSt) {
fTofStationZ[iSt] = fTofStationZ[iSt] / nTofStationModules[iSt];
auto& station{fvStationsActive[iSt]};
auto& station{fvStationActiveVolume[iSt]};
station.fXmin = -100.;
station.fXmax = +100.;
station.fYmin = -100.;
......@@ -145,7 +145,7 @@ InitStatus CbmTofTrackingInterface::Init()
station.fZmin = fTofStationZMin[iSt] - .5;
station.fZmax = fTofStationZMax[iSt] + .5;
}
fvStationsFull = fvStationsActive;
fvStationFullVolume = fvStationActiveVolume;
}
// Check the validity of the parameters
......
......@@ -91,21 +91,21 @@ InitStatus CbmTrdTrackingInterface::Init()
// Collect nodes
if constexpr (!kLegacy) {
auto vLayerPaths{CollectNodes("trd", "layer", "", gGeoManager->GetTopNode())};
fvStationsFull.clear();
fvStationsFull.resize(vLayerPaths.size());
fvStationsActive.clear();
fvStationsActive.resize(vLayerPaths.size());
fvStationFullVolume.clear();
fvStationFullVolume.resize(vLayerPaths.size());
fvStationActiveVolume.clear();
fvStationActiveVolume.resize(vLayerPaths.size());
std::regex stationPattern{"layer(\\d+)_(\\d+)"};
for (const auto& layerPath : vLayerPaths) {
std::smatch match;
std::string line{layerPath.Data()};
if (std::regex_search(line, match, stationPattern)) {
int iStation{std::stoi(match[1]) - 1}; // the tracking station is a TRD layer
fvStationsFull[iStation] = ReadVolume(layerPath);
fvStationFullVolume[iStation] = ReadVolume(layerPath);
gGeoManager->cd(layerPath);
auto vGasPaths{CollectNodes("trd", "gas", layerPath(0, layerPath.Last('/')), gGeoManager->GetCurrentNode())};
for (const auto& gasPath : vGasPaths) {
fvStationsActive[iStation] += ReadVolume(gasPath);
fvStationActiveVolume[iStation] += ReadVolume(gasPath);
}
}
}
......@@ -127,16 +127,16 @@ InitStatus CbmTrdTrackingInterface::Init()
}
}
}
fvStationsFull.clear();
fvStationsFull.reserve(nStations);
fvStationFullVolume.clear();
fvStationFullVolume.reserve(nStations);
for (int iSt = 0; iSt < nStations; ++iSt) {
const auto* pModulePar = GetTrdModulePar(iSt);
fvStationsFull.emplace_back(
fvStationFullVolume.emplace_back(
pModulePar->GetX() - pModulePar->GetSizeX(), pModulePar->GetX() + pModulePar->GetSizeX(),
pModulePar->GetY() - pModulePar->GetSizeY(), pModulePar->GetY() + pModulePar->GetSizeY(),
pModulePar->GetZ() - pModulePar->GetSizeZ(), pModulePar->GetZ() + pModulePar->GetSizeZ());
}
fvStationsActive = fvStationsFull;
fvStationActiveVolume = fvStationFullVolume;
}
// Check access to TRD modules
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment