diff --git a/macro/run/run_reco.C b/macro/run/run_reco.C index 7259d550b9cea785f6091e5e07b3c534d9a8d3c4..fb53fe2101e1756e041b9983139fe3c619e3bdda 100644 --- a/macro/run/run_reco.C +++ b/macro/run/run_reco.C @@ -39,6 +39,7 @@ #include "CbmTofSimpClusterizer.h" #include "CbmTrdClusterFinder.h" #include "CbmTrdHitProducer.h" +#include "CbmTrackerDetInitializer.h" #include <FairFileSource.h> #include <FairMonitor.h> @@ -367,6 +368,10 @@ void run_reco(TString input = "", Int_t nTimeSlices = -1, Int_t firstTimeSlice = if (useMvd || useSts) { CbmKF* kalman = new CbmKF(); run->AddTask(kalman); + + // Initialize tracker detector interfaces used in CbmL1 + run->AddTask(new CbmTrackerDetInitializer()); + CbmL1* l1 = 0; if (debugWithMC) { l1 = new CbmL1("L1", 2, 3); } else { diff --git a/reco/L1/CMakeLists.txt b/reco/L1/CMakeLists.txt index d2602fd95d16c88fc65052c08ce81b6be3116add..0548e07af4665066ac15180d7270235a7220df7b 100644 --- a/reco/L1/CMakeLists.txt +++ b/reco/L1/CMakeLists.txt @@ -110,6 +110,9 @@ CbmL1.cxx #CbmL1TrdTrackFinderSts.cxx CbmL1TrackMerger.cxx CbmL1TofMerger.cxx +CbmTrackerInterfaceSts.cxx # TMP: Should be placed to the detector directory! +CbmTrackerInterfaceMvd.cxx # TMP: Should be placed to the detector directory! +CbmTrackerDetInitializer.cxx L1AlgoInputData.cxx OffLineInterface/CbmL1RichENNRingFinder.cxx OffLineInterface/CbmL1RichENNRingFinderParallel.cxx @@ -171,6 +174,10 @@ CbmL1TrackMerger.h CbmL1TrackPar.h CbmL1TrdHit.h #CbmL1TrdTrackFinderSts.h +L1TrackerInterfaceBase.h # TMP: Should be placed to the detector directory! +CbmTrackerInterfaceSts.h # TMP: Should be placed to the detector directory! +CbmTrackerInterfaceMvd.h # TMP: Should be placed to the detector directory! +CbmTrackerDetInitializer.h CbmL1TrdTracklet4.h CbmL1TrdTracklet.h CbmL1Vtx.h diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index cf52bd3074ac0f31a1e8cba3ff81265e38a8e182..31eb7594547276f80b8c613d88c969a31e496a9a 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -30,7 +30,9 @@ #include "CbmMuchStation.h" #include "CbmMvdDetector.h" #include "CbmMvdStationPar.h" -#include "CbmSetup.h" +#include "CbmSetup.h" // TODO: To be replaced to the CbmTrackerInterfaceSts !! (S.Zharko) +#include "CbmTrackerInterfaceMvd.h" +#include "CbmTrackerInterfaceSts.h" #include <boost/filesystem.hpp> // TODO: include of CbmSetup.h creates problems on Mac @@ -38,16 +40,12 @@ #include "CbmMCDataObject.h" #include "CbmStsFindTracks.h" #include "CbmStsHit.h" -#include "CbmStsParSetModule.h" -#include "CbmStsParSetSensor.h" -#include "CbmStsParSetSensorCond.h" -#include "CbmStsSetup.h" -#include "CbmStsStation.h" #include "CbmTofCell.h" #include "CbmTofDigiBdfPar.h" #include "CbmTofDigiPar.h" // in tof/TofParam #include "CbmTrdParModDigi.h" // for CbmTrdModule #include "CbmTrdParSetDigi.h" // for CbmTrdParSetDigi +#include "CbmTrackerDetInitializer.h" #include "FairEventHeader.h" #include "FairRunAna.h" @@ -93,14 +91,16 @@ ClassImp(CbmL1) CbmL1* CbmL1::fInstance = 0; -CbmL1::CbmL1() : FairTask("L1") -{ - if (!fInstance) fInstance = this; - if (!fpInitManager) { fpInitManager = algo_static.GetInitManager(); } -} +CbmL1::CbmL1(): CbmL1("L1") {} + -CbmL1::CbmL1(const char* name, Int_t iVerbose, Int_t _fPerformance, int fSTAPDataMode_, TString fSTAPDataDir_, - int findParticleMode_) +CbmL1::CbmL1( + const char* name, + Int_t iVerbose, + Int_t _fPerformance, + int fSTAPDataMode_, + TString fSTAPDataDir_, + int findParticleMode_) : FairTask(name, iVerbose) , fPerformance(_fPerformance) , fSTAPDataMode(fSTAPDataMode_) @@ -109,6 +109,10 @@ CbmL1::CbmL1(const char* name, Int_t iVerbose, Int_t _fPerformance, int fSTAPDat { if (!fInstance) fInstance = this; if (!fpInitManager) { fpInitManager = algo_static.GetInitManager(); } + + if (!CbmTrackerDetInitializer::Instance()) { + LOG(fatal) << "CbmL1: CbmTrackerDetInitializer instance was not found. Please, add it as a task to your reco macro"; + } } CbmL1::~CbmL1() @@ -128,18 +132,13 @@ void CbmL1::CheckDetectorPresence() void CbmL1::SetParContainers() { + LOG(warn) << "(!) \033[1;32mCALL CbmL1::SetParContainers\033[0m"; FairRunAna* ana = FairRunAna::Instance(); FairRuntimeDb* rtdb = ana->GetRuntimeDb(); fDigiPar = (CbmTofDigiPar*) (rtdb->getContainer("CbmTofDigiPar")); // fTrdDigiPar = (CbmTrdDigiPar*)(FairRunAna::Instance()->GetRuntimeDb()->getContainer("CbmTrdDigiPar")); fTrdDigiPar = (CbmTrdParSetDigi*) (rtdb->getContainer("CbmTrdParSetDigi")); - // Trigger loading of STS parameters - // If L1 runs standalone the parameters are not required by any STS task - // but they are needed by CbmStsSetup - fStsParSetModule = dynamic_cast<CbmStsParSetModule*>(rtdb->getContainer("CbmStsParSetModule")); - fStsParSetSensor = dynamic_cast<CbmStsParSetSensor*>(rtdb->getContainer("CbmStsParSetSensor")); - fStsParSetSensorCond = dynamic_cast<CbmStsParSetSensorCond*>(rtdb->getContainer("CbmStsParSetSensorCond")); fTofDigiBdfPar = (CbmTofDigiBdfPar*) (rtdb->getContainer("CbmTofDigiBdfPar")); rtdb->initContainers(ana->GetRunId()); // needed to get tracking stations for ToF hits @@ -154,6 +153,7 @@ InitStatus CbmL1::ReInit() InitStatus CbmL1::Init() { + fData = new L1AlgoInputData(); if (fVerbose > 1) { @@ -386,7 +386,7 @@ InitStatus CbmL1::Init() ** Target field initialization ** *********************************/ - fpInitManager->InitTargetField(2.5); + fpInitManager->InitTargetField(/*zStep = */ 2.5 /*cm*/); // Replace zStep -> sizeZfieldRegion = 2 * zStep (TODO) /************************************** ** ** @@ -489,6 +489,7 @@ InitStatus CbmL1::Init() TofStationZ[i] = TofStationZ[i] / TofStationN[i]; } + /*** MVD and STS ***/ CbmStsSetup* stsSetup = CbmStsSetup::Instance(); if (!stsSetup->IsInit()) { stsSetup->Init(nullptr); } @@ -505,7 +506,13 @@ InitStatus CbmL1::Init() NMvdStationsGeom = mvdStationPar->GetStationCount(); } } - NStsStationsGeom = (fUseSTS) ? CbmStsSetup::Instance()->GetNofStations() : 0; + //NStsStationsGeom = (fUseSTS) ? CbmStsSetup::Instance()->GetNofStations() : 0; + + auto mvdInterface = CbmTrackerInterfaceMvd::Instance(); + auto stsInterface = CbmTrackerInterfaceSts::Instance(); + + //NMvdStationsGeom = mvdInterface->GetNstations(); + NStsStationsGeom = stsInterface->GetNstations(); NStationGeom = NMvdStationsGeom + NStsStationsGeom + NMuchStationsGeom + NTrdStationsGeom + NTOFStationGeom; // Provide crosscheck number of stations for the fpInitManagera @@ -517,7 +524,7 @@ InitStatus CbmL1::Init() { if (fSTAPDataMode % 2 == 1) { // 1,3 - LOG(warn) << "CbmL1::Init: geo vector was removed, currently data cannot be written to a text-file"; + LOG(fatal) << "CbmL1::Init: geo vector was removed, currently data cannot be written to a text-file"; // TODO: Rewrite parameters i/o into L1InitManager (S.Zharko, 12.05.2022) //WriteSTAPGeoData(geo); }; @@ -574,61 +581,52 @@ InitStatus CbmL1::Init() /*** MVD stations info ***/ for (int iSt = 0; iSt < NMvdStationsGeom; ++iSt) { // NOTE: example using in-stack defined objects - CbmMvdDetector* mvdDetector = CbmMvdDetector::Instance(); - CbmMvdStationPar* mvdStationPar = mvdDetector->GetParameterFile(); - - CbmKFTube& t = CbmKF::Instance()->vMvdMaterial[iSt]; auto stationInfo = L1BaseStationInfo(L1DetectorID::kMvd, iSt); - stationInfo.SetStationType(1); - // MVD // TODO: to be exchanged with specific flags (timeInfo, fieldInfo etc.) (S.Zh.) - stationInfo.SetTimeInfo(0); - stationInfo.SetTimeResolution(1000.); - stationInfo.SetFieldStatus(L1Algo::TrackingMode::kMcbm == fTrackingMode ? 0 : 1); - stationInfo.SetZ(t.z); - auto thickness = t.dz; - auto radLength = t.RadLength; - stationInfo.SetMaterialSimple(thickness, radLength); + stationInfo.SetStationType(1); // MVD + stationInfo.SetTimeInfo(mvdInterface->IsTimeInfoProvided(iSt)); + stationInfo.SetTimeResolution(mvdInterface->GetTimeResolution(iSt)); + stationInfo.SetFieldStatus(fTrackingMode == L1Algo::TrackingMode::kMcbm ? 0 : 1); + stationInfo.SetZ(mvdInterface->GetZ(iSt)); + stationInfo.SetXmax(mvdInterface->GetXmax(iSt)); + stationInfo.SetYmax(mvdInterface->GetYmax(iSt)); + stationInfo.SetRmin(mvdInterface->GetRmin(iSt)); + stationInfo.SetRmax(mvdInterface->GetRmax(iSt)); + stationInfo.SetMaterialSimple(mvdInterface->GetThickness(iSt), mvdInterface->GetRadLength(iSt)); stationInfo.SetMaterialMap(std::move(materialTableMvd[iSt]), correctionMvd); - stationInfo.SetXmax(t.R); - stationInfo.SetYmax(t.R); - stationInfo.SetRmin(t.r); - stationInfo.SetRmax(t.R); - fscal mvdFrontPhi = 0; - fscal mvdBackPhi = TMath::Pi() / 2.; - fscal mvdFrontSigma = mvdStationPar->GetXRes(iSt) / 10000; - fscal mvdBackSigma = mvdStationPar->GetYRes(iSt) / 10000; - stationInfo.SetFrontBackStripsGeometry(mvdFrontPhi, mvdFrontSigma, mvdBackPhi, mvdBackSigma); + // TODO: The CA TF result is dependent from type of geometry settings. Should be understood (S.Zharko) + stationInfo.SetFrontBackStripsGeometry( + (fscal) mvdInterface->GetStripsStereoAngleFront(iSt), + (fscal) mvdInterface->GetStripsSpatialRmsFront(iSt), + (fscal) mvdInterface->GetStripsStereoAngleBack(iSt), + (fscal) mvdInterface->GetStripsSpatialRmsBack(iSt) + ); stationInfo.SetTrackingStatus(target.z < stationInfo.GetZdouble() ? true : false); fpInitManager->AddStation(stationInfo); LOG(info) << "- MVD station " << iSt << " at z = " << stationInfo.GetZdouble(); } + /*** STS stations info ***/ for (int iSt = 0; iSt < NStsStationsGeom; ++iSt) { // NOTE: example using smart pointers - auto cbmSts = CbmStsSetup::Instance()->GetStation(iSt); auto stationInfo = L1BaseStationInfo(L1DetectorID::kSts, iSt); stationInfo.SetStationType(0); // STS - stationInfo.SetTimeInfo(1); - stationInfo.SetTimeResolution(5.); - stationInfo.SetFieldStatus(L1Algo::TrackingMode::kMcbm == fTrackingMode ? 0 : 1); - // Setup station geometry and material - stationInfo.SetZ(cbmSts->GetZ()); - double stsXmax = cbmSts->GetXmax(); - double stsYmax = cbmSts->GetYmax(); - stationInfo.SetXmax(stsXmax); - stationInfo.SetYmax(stsYmax); - stationInfo.SetRmin(0); - stationInfo.SetRmax(stsXmax > stsYmax ? stsXmax : stsYmax); - auto thickness = cbmSts->GetSensorD(); - auto radLength = cbmSts->GetRadLength(); - stationInfo.SetMaterialSimple(thickness, radLength); + stationInfo.SetTimeInfo(stsInterface->IsTimeInfoProvided(iSt)); + stationInfo.SetTimeResolution(stsInterface->GetTimeResolution(iSt)); + stationInfo.SetFieldStatus(L1Algo::TrackingMode::kMcbm == fTrackingMode? 0 : 1); + stationInfo.SetZ(stsInterface->GetZ(iSt)); + stationInfo.SetXmax(stsInterface->GetXmax(iSt)); + stationInfo.SetYmax(stsInterface->GetYmax(iSt)); + stationInfo.SetRmin(stsInterface->GetRmin(iSt)); + stationInfo.SetRmax(stsInterface->GetRmax(iSt)); + stationInfo.SetMaterialSimple(stsInterface->GetThickness(iSt), stsInterface->GetRadLength(iSt)); stationInfo.SetMaterialMap(std::move(materialTableSts[iSt]), correctionSts); - // Setup strips geometry - fscal stsFrontPhi = cbmSts->GetSensorRotation() + cbmSts->GetSensorStereoAngle(0) * TMath::Pi() / 180.; - fscal stsBackPhi = cbmSts->GetSensorRotation() + cbmSts->GetSensorStereoAngle(1) * TMath::Pi() / 180.; - fscal stsFrontSigma = cbmSts->GetSensorPitch(0) / sqrt(12); - fscal stsBackSigma = stsFrontSigma; - stationInfo.SetFrontBackStripsGeometry(stsFrontPhi, stsFrontSigma, stsBackPhi, stsBackSigma); + // TODO: The CA TF result is dependent from type of geometry settings. Should be understood (S.Zharko) + stationInfo.SetFrontBackStripsGeometry( + (fscal) stsInterface->GetStripsStereoAngleFront(iSt), + (fscal) stsInterface->GetStripsSpatialRmsFront(iSt), + (fscal) stsInterface->GetStripsStereoAngleBack(iSt), + (fscal) stsInterface->GetStripsSpatialRmsBack(iSt) + ); stationInfo.SetTrackingStatus(target.z < stationInfo.GetZdouble() ? true : false); fpInitManager->AddStation(stationInfo); LOG(info) << "- STS station " << iSt << " at z = " << stationInfo.GetZdouble(); @@ -1959,8 +1957,9 @@ void CbmL1::ReadSTAPPerfData() void CbmL1::WriteSIMDKFData() { + // TODO: Must be totally reimplemented (S.Zharko) static bool first = 1; - +#if 0 /// Write geometry info if (first) { FairField* dMF = CbmKF::Instance()->GetMagneticField(); @@ -2125,7 +2124,7 @@ void CbmL1::WriteSIMDKFData() } FileGeo.close(); } - +#endif ///Write Tracks and MC Tracks static int TrNumber = 0; @@ -2213,8 +2212,8 @@ std::vector<L1Material> CbmL1::ReadMaterialBudget(L1DetectorID detectorID) { std::vector<L1Material> result {}; if (fMatBudgetFileName.find(detectorID) != fMatBudgetFileName.end()) { - TFile* oldFile = gFile; - TDirectory* oldDir = gDirectory; + auto* oldFile = gFile; + auto* oldDir = gDirectory; auto rlFile = TFile(fMatBudgetFileName.at(detectorID)); if (rlFile.IsZombie()) { LOG(fatal) << "File " << fMatBudgetFileName.at(detectorID) << " is zombie!"; } diff --git a/reco/L1/CbmL1.h b/reco/L1/CbmL1.h index 552fabc48ea75fb20c6c5123d4a498a801197729..194bdf5da0a44bfdcae9032f7b7f641be02e2b21 100644 --- a/reco/L1/CbmL1.h +++ b/reco/L1/CbmL1.h @@ -63,9 +63,6 @@ class KFTopoPerformance; class CbmMCDataObject; class CbmEvent; -class CbmStsParSetSensor; -class CbmStsParSetSensorCond; -class CbmStsParSetModule; class CbmTofDigiBdfPar; class CbmTrdParSetDigi; @@ -522,10 +519,6 @@ private: KFTopoPerformance* fTopoPerformance {nullptr}; L1EventEfficiencies fEventEfficiency {}; // average efficiencies - CbmStsParSetSensor* fStsParSetSensor {nullptr}; - CbmStsParSetSensorCond* fStsParSetSensorCond {nullptr}; - CbmStsParSetModule* fStsParSetModule {nullptr}; - ClassDef(CbmL1, 0); }; diff --git a/reco/L1/CbmTrackerDetInitializer.cxx b/reco/L1/CbmTrackerDetInitializer.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a5da98cd8228486f68c4dfdfbddae98a7e90f07c --- /dev/null +++ b/reco/L1/CbmTrackerDetInitializer.cxx @@ -0,0 +1,44 @@ +/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/*************************************************************************************************** + * @file CbmTrackerDetInitializer.cxx + * @brief FairTask for the tracker detector interfaces initialization (implementation) + * @since 31.05.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***************************************************************************************************/ + +#include "FairTask.h" +#include "CbmTrackerDetInitializer.h" +#include "CbmTrackerInterfaceSts.h" +#include "CbmTrackerInterfaceMvd.h" +#include <FairLogger.h> + +ClassImp(CbmTrackerDetInitializer) + +CbmTrackerDetInitializer* CbmTrackerDetInitializer::fpInstance = nullptr; + +//------------------------------------------------------------------------------------------------------------------------------------- +// +CbmTrackerDetInitializer::CbmTrackerDetInitializer(): FairTask("CbmTrackerDetInitializer") +{ + if (!fpInstance) { + fpInstance = this; + + /** Add subtasks - tracker detector interfaces **/ + this->Add(new CbmTrackerInterfaceMvd()); + this->Add(new CbmTrackerInterfaceSts()); + } +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +CbmTrackerDetInitializer::~CbmTrackerDetInitializer() +{ + if (fpInstance == this) { fpInstance = nullptr; } +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// + diff --git a/reco/L1/CbmTrackerDetInitializer.h b/reco/L1/CbmTrackerDetInitializer.h new file mode 100644 index 0000000000000000000000000000000000000000..5af2af47154e95941d3b359d8227d7a9dacf59ab --- /dev/null +++ b/reco/L1/CbmTrackerDetInitializer.h @@ -0,0 +1,44 @@ +/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/*************************************************************************************************** + * @file CbmTrackerDetInitializer.h + * @brief FairTask for the tracker detector interfaces initialization (declaration) + * @since 31.05.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***************************************************************************************************/ + +#ifndef CbmTrackerDetInitializer_h +#define CbmTrackerDetInitializer_h 1 + +class FairTask; + +/// Class CbmTrackerDetInitializer implements a task for the tracking detector interfaces initialization. +/// The tracking detector interfaces are added as subtasks. The CbmTrackerDetInitializer class instance is to +/// be added as a task to the FairRunAna instance prior to the CbmL1 task. +/// +class CbmTrackerDetInitializer: public FairTask { +public: + /// Default constructor: only STS is initialized (TODO: try delete) + CbmTrackerDetInitializer(); + + /// Destructor + ~CbmTrackerDetInitializer(); + + /// Returns a pointer to the class instance + static CbmTrackerDetInitializer* Instance() { return fpInstance; } + + // Copy and move of the instance is prohibited + CbmTrackerDetInitializer(const CbmTrackerDetInitializer& ) = delete; + CbmTrackerDetInitializer(CbmTrackerDetInitializer&&) = delete; + CbmTrackerDetInitializer& operator=(const CbmTrackerDetInitializer&) = delete; + CbmTrackerDetInitializer& operator=(CbmTrackerDetInitializer&&) = delete; + +private: + static CbmTrackerDetInitializer* fpInstance; ///< Instance of the class + + ClassDef(CbmTrackerDetInitializer, 0); +}; + +#endif // bmTrackerDetInitializer_h diff --git a/reco/L1/CbmTrackerInterfaceMvd.cxx b/reco/L1/CbmTrackerInterfaceMvd.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bfcee604cf37218e6ff16d0897a88205a42a730a --- /dev/null +++ b/reco/L1/CbmTrackerInterfaceMvd.cxx @@ -0,0 +1,166 @@ +/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/*************************************************************************************************** + * @file CbmTrackerInterfaceMvd.cxx + * @brief Input data and parameters interface from STS subsystem used in L1 tracker (definition) + * @since 31.05.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***************************************************************************************************/ + +#include "CbmTrackerInterfaceMvd.h" +#include "CbmKF.h" +#include "CbmKFMaterial.h" // for CbmKFTube +#include "CbmMvdDetector.h" +#include "CbmMvdStationPar.h" +#include "FairDetector.h" +#include "FairRunAna.h" +#include <FairLogger.h> +#include "TMath.h" +#include "L1Def.h" + +ClassImp(CbmTrackerInterfaceMvd) + +CbmTrackerInterfaceMvd* CbmTrackerInterfaceMvd::fpInstance = nullptr; + +//------------------------------------------------------------------------------------------------------------------------------------- +// +CbmTrackerInterfaceMvd::CbmTrackerInterfaceMvd() : FairTask("CbmTrackerInterfaceMvd") +{ + if (!fpInstance) { fpInstance = this; } +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +CbmTrackerInterfaceMvd::~CbmTrackerInterfaceMvd() +{ + if (fpInstance == this) { fpInstance = nullptr; } +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetTimeResolution(int /*stationId*/) const { return 1000.; } + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetZ(int stationId) const +{ + return (fMvdMaterial->at(stationId)).z; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetXmax(int stationId) const +{ + return (fMvdMaterial->at(stationId)).R; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetYmax(int stationId) const +{ + return (fMvdMaterial->at(stationId)).R; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetRmin(int stationId) const +{ + return (fMvdMaterial->at(stationId)).r; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetRmax(int stationId) const +{ + return (fMvdMaterial->at(stationId)).R; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +int CbmTrackerInterfaceMvd::GetNstations() const +{ + return fMvdMaterial->size(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetThickness(int stationId) const +{ + return (fMvdMaterial->at(stationId)).dz; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetRadLength(int stationId) const +{ + return (fMvdMaterial->at(stationId)).RadLength; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetStripsStereoAngleFront(int /*stationId*/) const +{ + return 0.; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetStripsStereoAngleBack(int /*stationId*/) const +{ + return TMath::Pi() / 2.; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetStripsSpatialRmsFront(int stationId) const +{ + return fMvdStationPar->GetXRes(stationId) / 10000.; +} + + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceMvd::GetStripsSpatialRmsBack(int stationId) const +{ + return fMvdStationPar->GetYRes(stationId) / 10000.; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +bool CbmTrackerInterfaceMvd::IsTimeInfoProvided(int /*stationId*/) const { return false; } + + +//------------------------------------------------------------------------------------------------------------------------------------- +// +InitStatus CbmTrackerInterfaceMvd::Init() +{ + LOG(info) << "\033[1;33mCALL CbmTrackerInterfaceMvd::Init()\033[0m"; + + fMvdMaterial = &(CbmKF::Instance()->vMvdMaterial); + fMvdStationPar = CbmMvdDetector::Instance()->GetParameterFile(); + + if (!fMvdMaterial) { return kFATAL; } + if (!fMvdStationPar) { return kFATAL; } + + return kSUCCESS; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +InitStatus CbmTrackerInterfaceMvd::ReInit() +{ + LOG(info) << "\033[1;33mCALL CbmTrackerInterfaceMvd::ReInit()\033[0m"; + this->SetParContainers(); + return Init(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +void CbmTrackerInterfaceMvd::SetParContainers() +{ +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// diff --git a/reco/L1/CbmTrackerInterfaceMvd.h b/reco/L1/CbmTrackerInterfaceMvd.h new file mode 100644 index 0000000000000000000000000000000000000000..1f3416df14a5f124c78f4c190acb591de1191e5c --- /dev/null +++ b/reco/L1/CbmTrackerInterfaceMvd.h @@ -0,0 +1,132 @@ +/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/*************************************************************************************************** + * @file CbmTrackerInterfaceMvd.h + * @brief Input data and parameters interface from MVD subsystem used in L1 tracker (declaration) + * @since 31.05.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***************************************************************************************************/ + +#ifndef CbmTrackerInterfaceMvd_h +#define CbmTrackerInterfaceMvd_h 1 + +#include "L1TrackerInterfaceBase.h" +#include "FairTask.h" + +#include <iostream> +#include <vector> + + +class CbmMvdDetector; +class CbmMvdStationPar; +class CbmKFTube; + +/// Class CbmTrackerInterfaceMvd is a CbmL1 subtask, which provides necessary methods for L1 tracker +/// to access the geometry and dataflow settings. +/// +class CbmTrackerInterfaceMvd: public FairTask, public L1TrackerInterfaceBase { +public: + /// Default constructor + CbmTrackerInterfaceMvd(); + + /// Destructor + ~CbmTrackerInterfaceMvd(); + + /// FairTask: Init method + InitStatus Init(); + + /// FairTask: ReInit method + InitStatus ReInit(); + + /// Gets pointer to the instance of the CbmTrackerInterfaceMvd + static CbmTrackerInterfaceMvd* Instance() { return fpInstance; } + + /// Gets actual number of stations, provided by the current geometry setup + int GetNstations() const; + + /// Gets time resolution for a station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Time resolution [ns] + double GetTimeResolution(int stationId) const; + + /// Gets z component of the station position + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Z position of station [cm] + double GetZ(int stationId) const; + + /// Gets max size of a station along the X-axis + /// \param stationId 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; + + /// Gets max size of a station along the Y-axis + /// \param stationId 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; + + /// Gets size of inner radius of station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Size of station inner radius [cm] + double GetRmin(int stationId) const; + + /// Gets size of outer radius of station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Size of station outer radius [cm] + double GetRmax(int stationId) const; + + /// Gets station thickness along the Z-axis + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Station thickness [cm] + double GetThickness(int stationId) const; + + /// Gets station radiation length + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Radiation length [cm] + double GetRadLength(int stationId) const; + + /// Gets front strips stereo angle + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Absolute stereo angle for front strips [rad] + double GetStripsStereoAngleFront(int stationId) const; + + /// Gets back strips stereo angle + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Absolute stereo angle for back strips [rad] + double GetStripsStereoAngleBack(int stationId) const; + + /// Gets spatial resolution (RMS) for front strips + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Spatial resolution (RMS) for front strips [cm] + double GetStripsSpatialRmsFront(int stationId) const; + + /// Gets spatial resolution (RMS) for back strips + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Spatial resolution (RMS) for front strips [cm] + double GetStripsSpatialRmsBack(int stationId) const; + + /// Check if station provides time measurements + /// \param stationId Station ID in the setup + /// \return Flag: true - station provides time measurements, false - station does not provide time measurements + bool IsTimeInfoProvided(int stationId) const; + + /// FairTask: sets parameter containers up + void SetParContainers(); + + /// Copy and move constructers and assign operators are prohibited + CbmTrackerInterfaceMvd(const CbmTrackerInterfaceMvd&) = delete; + CbmTrackerInterfaceMvd(CbmTrackerInterfaceMvd&&) = delete; + CbmTrackerInterfaceMvd& operator=(const CbmTrackerInterfaceMvd&) = delete; + CbmTrackerInterfaceMvd& operator=(CbmTrackerInterfaceMvd&&) = delete; + +private: + static CbmTrackerInterfaceMvd* fpInstance; ///< Instance of the class + + const std::vector<CbmKFTube> * fMvdMaterial {nullptr}; ///< Pointer to the MVD vector of CbmKFTube objects (owner: CbmKF) + const CbmMvdStationPar * fMvdStationPar {nullptr}; ///< Pointer to the Mvd station parameters file + + ClassDef(CbmTrackerInterfaceMvd, 0); +}; + +#endif // CbmTrackerInterfaceMvd diff --git a/reco/L1/CbmTrackerInterfaceSts.cxx b/reco/L1/CbmTrackerInterfaceSts.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c66a31ca9b0381f685c084734023ec765261575c --- /dev/null +++ b/reco/L1/CbmTrackerInterfaceSts.cxx @@ -0,0 +1,175 @@ +/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/*************************************************************************************************** + * @file CbmTrackerInterfaceSts.cxx + * @brief Input data and parameters interface from STS subsystem used in L1 tracker (definition) + * @since 27.05.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***************************************************************************************************/ + +#include "CbmTrackerInterfaceSts.h" +#include "CbmStsStation.h" +#include "FairDetector.h" +#include "FairRunAna.h" +#include <FairLogger.h> +#include "TMath.h" +#include "L1Def.h" + +ClassImp(CbmTrackerInterfaceSts) + +CbmTrackerInterfaceSts* CbmTrackerInterfaceSts::fpInstance = nullptr; + +//------------------------------------------------------------------------------------------------------------------------------------- +// +CbmTrackerInterfaceSts::CbmTrackerInterfaceSts() : FairTask("CbmTrackerInterfaceSts") +{ + if (!fpInstance) { fpInstance = this; } +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +CbmTrackerInterfaceSts::~CbmTrackerInterfaceSts() +{ + if (fpInstance == this) { fpInstance = nullptr; } +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetTimeResolution(int /*stationId*/) const { return 5.; } + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetZ(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetZ(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetXmax(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetXmax(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetYmax(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetYmax(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetRmin(int /*stationId*/) const { return 0.; } + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetRmax(int stationId) const +{ + return GetXmax(stationId) > GetYmax(stationId) ? GetXmax(stationId) : GetYmax(stationId); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +int CbmTrackerInterfaceSts::GetNstations() const +{ + return CbmStsSetup::Instance()->GetNofStations(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetThickness(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetSensorD(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetRadLength(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetRadLength(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetStripsStereoAngleFront(int stationId) const +{ + auto station = CbmStsSetup::Instance()->GetStation(stationId); + return station->GetSensorRotation() + station->GetSensorStereoAngle(0) * TMath::Pi() / 180.; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetStripsStereoAngleBack(int stationId) const +{ + auto station = CbmStsSetup::Instance()->GetStation(stationId); + return station->GetSensorRotation() + station->GetSensorStereoAngle(1) * TMath::Pi() / 180.; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetStripsSpatialRmsFront(int stationId) const +{ + auto station = CbmStsSetup::Instance()->GetStation(stationId); + return station->GetSensorPitch(0) / TMath::Sqrt(12.); +} + + +//------------------------------------------------------------------------------------------------------------------------------------- +// +double CbmTrackerInterfaceSts::GetStripsSpatialRmsBack(int stationId) const +{ + auto station = CbmStsSetup::Instance()->GetStation(stationId); + return station->GetSensorPitch(0) / TMath::Sqrt(12.); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +bool CbmTrackerInterfaceSts::IsTimeInfoProvided(int /*stationId*/) const { return true; } + + +//------------------------------------------------------------------------------------------------------------------------------------- +// +InitStatus CbmTrackerInterfaceSts::Init() +{ + LOG(info) << "\033[1;33mCALL CbmTrackerInterfaceSts::Init()\033[0m"; + + // Check, if all the necessary parameter containers were found + if (!fStsParSetModule) { return kFATAL; } + if (!fStsParSetSensor) { return kFATAL; } + if (!fStsParSetSensorCond) { return kFATAL; } + + // Initialize CbmStsSetup instance + auto stsSetup = CbmStsSetup::Instance(); + if (!stsSetup->IsInit()) { stsSetup->Init(nullptr); } + if (!stsSetup->IsModuleParsInit()) { stsSetup->SetModuleParameters(fStsParSetModule); } + if (!stsSetup->IsSensorParsInit()) { stsSetup->SetSensorParameters(fStsParSetSensor); } + if (!stsSetup->IsSensorCondInit()) { stsSetup->SetSensorConditions(fStsParSetSensorCond); } + + return kSUCCESS; +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +InitStatus CbmTrackerInterfaceSts::ReInit() +{ + LOG(info) << "\033[1;33mCALL CbmTrackerInterfaceSts::ReInit()\033[0m"; + this->SetParContainers(); + return Init(); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// +void CbmTrackerInterfaceSts::SetParContainers() +{ + LOG(info) << "\033[1;33mCALL CbmTrackerInterfaceSts::SetParContainer()\033[0m"; + auto runtimeDb = FairRunAna::Instance()->GetRuntimeDb(); + fStsParSetModule = dynamic_cast<CbmStsParSetModule*>(runtimeDb->getContainer("CbmStsParSetModule")); + fStsParSetSensor = dynamic_cast<CbmStsParSetSensor*>(runtimeDb->getContainer("CbmStsParSetSensor")); + fStsParSetSensorCond = dynamic_cast<CbmStsParSetSensorCond*>(runtimeDb->getContainer("CbmStsParSetSensorCond")); +} + +//------------------------------------------------------------------------------------------------------------------------------------- +// diff --git a/reco/L1/CbmTrackerInterfaceSts.h b/reco/L1/CbmTrackerInterfaceSts.h new file mode 100644 index 0000000000000000000000000000000000000000..cbf59deaadfadf8a9af4d64de6338ffbd52ee691 --- /dev/null +++ b/reco/L1/CbmTrackerInterfaceSts.h @@ -0,0 +1,134 @@ +/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/*************************************************************************************************** + * @file CbmTrackerInterfaceSts.h + * @brief Input data and parameters interface from STS subsystem used in L1 tracker (declaration) + * @since 27.05.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***************************************************************************************************/ + +#ifndef CbmTrackerInterfaceSts_h +#define CbmTrackerInterfaceSts_h 1 + +#include "CbmStsParSetModule.h" +#include "CbmStsParSetSensor.h" +#include "CbmStsParSetSensorCond.h" +#include "CbmStsSetup.h" +#include "L1TrackerInterfaceBase.h" +#include "FairTask.h" + +#include <iostream> + + +/// Class CbmTrackerInterfaceSts is a CbmL1 subtask, which provides necessary methods for L1 tracker +/// to access the geometry and dataflow settings. +/// +class CbmTrackerInterfaceSts: public FairTask, public L1TrackerInterfaceBase { +public: + /// Default constructor + CbmTrackerInterfaceSts(); + + /// Destructor + ~CbmTrackerInterfaceSts(); + + /// FairTask: Init method + InitStatus Init(); + + /// FairTask: ReInit method + InitStatus ReInit(); + + /// Gets pointer to the instance of the CbmTrackerInterfaceSts class + static CbmTrackerInterfaceSts* Instance() { return fpInstance; } + + /// Gets actual number of stations, provided by the current geometry setup + int GetNstations() const; + + /// Gets time resolution for a station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Time resolution [ns] + double GetTimeResolution(int stationId) const; + + /// Gets z component of the station position + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Z position of station [cm] + double GetZ(int stationId) const; + + /// Gets max size of a station along the X-axis + /// \param stationId 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; + + /// Gets max size of a station along the Y-axis + /// \param stationId 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; + + /// Gets size of inner radius of station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Size of station inner radius [cm] + double GetRmin(int stationId) const; + + /// Gets size of outer radius of station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Size of station outer radius [cm] + double GetRmax(int stationId) const; + + /// Gets station thickness along the Z-axis + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Station thickness [cm] + double GetThickness(int stationId) const; + + /// Gets station radiation length + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Radiation length [cm] + double GetRadLength(int stationId) const; + + /// Gets front strips stereo angle + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Absolute stereo angle for front strips [rad] + double GetStripsStereoAngleFront(int stationId) const; + + /// Gets back strips stereo angle + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Absolute stereo angle for back strips [rad] + double GetStripsStereoAngleBack(int stationId) const; + + /// Gets spatial resolution (RMS) for front strips + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Spatial resolution (RMS) for front strips [cm] + double GetStripsSpatialRmsFront(int stationId) const; + + /// Gets spatial resolution (RMS) for back strips + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Spatial resolution (RMS) for front strips [cm] + double GetStripsSpatialRmsBack(int stationId) const; + + /// Check if station provides time measurements + /// \param stationId Station ID in the setup + /// \return Flag: true - station provides time measurements, false - station does not provide time measurements + bool IsTimeInfoProvided(int stationId) const; + + /// FairTask: sets parameter containers up + void SetParContainers(); + + /// Copy and move constructers and assign operators are forbidden + CbmTrackerInterfaceSts(const CbmTrackerInterfaceSts&) = delete; + CbmTrackerInterfaceSts(CbmTrackerInterfaceSts&&) = delete; + CbmTrackerInterfaceSts& operator=(const CbmTrackerInterfaceSts&) = delete; + CbmTrackerInterfaceSts& operator=(CbmTrackerInterfaceSts&&) = delete; + +private: + static CbmTrackerInterfaceSts* fpInstance; + + CbmStsParSetSensor* fStsParSetSensor {nullptr}; ///< + CbmStsParSetSensorCond* fStsParSetSensorCond {nullptr}; ///< + CbmStsParSetModule* fStsParSetModule {nullptr}; ///< + + ClassDef(CbmTrackerInterfaceSts, 0); + + +}; + +#endif // CbmTrackerInterfaceSts diff --git a/reco/L1/L1Algo/L1Def.h b/reco/L1/L1Algo/L1Def.h index ac1fe5832a1faa731e59dd926b5be177353b4784..76c7525172046546c303e2c2a1a2bb122c93614a 100644 --- a/reco/L1/L1Algo/L1Def.h +++ b/reco/L1/L1Algo/L1Def.h @@ -51,6 +51,8 @@ T finite(T x) #define L1_assert(v) // Prints expression value to the std::cout #define L1_SHOW(expr) +// Prints file and line information to the std::cout +#define L1_SHOWF(msg) #else #define L1_ASSERT(v, msg) \ if (v) {} \ @@ -62,6 +64,8 @@ T finite(T x) #define L1_assert(v) assert(v) #define L1_SHOW(expr) \ std::cout << __FILE__ << ":" << __LINE__ << ": \033[01;38;5;208m" << (#expr) << "\033[0m = " << (expr) << "\n" +#define L1_SHOWF(msg) \ + std::cout << "(!) " << __FILE__ << ":" << __LINE__ << ": \033[01;38;5;208m" << (#msg) << "\033[0m\n" #endif diff --git a/reco/L1/L1Algo/L1InitManager.h b/reco/L1/L1Algo/L1InitManager.h index 7fa5ff021b20c07f9b51abb0208bd22f37a5c9ec..011306165b5825f927ce57294f4a00f9926e2942 100644 --- a/reco/L1/L1Algo/L1InitManager.h +++ b/reco/L1/L1Algo/L1InitManager.h @@ -189,7 +189,7 @@ public: /// Gets tracking level int GetTrackingLevel() const { return fTrackingLevel; } - /// Calculates L1FieldValue and L1FieldReference values for a selected step in z coordinate from the target position + /// Calculates L1FieldValue and L1FieldReference values for a selected step in z-axis from the target position /// \param zStep step between nodal points // TODO: Consider posibility for linear approximation (S.Zh.) void InitTargetField(double zStep); diff --git a/reco/L1/L1LinkDef.h b/reco/L1/L1LinkDef.h index d7b233e93c745d2394112ddc05f0450903394d4f..3e554a2d09d9a4415d1cb4b31c8135ef4e24ccc3 100644 --- a/reco/L1/L1LinkDef.h +++ b/reco/L1/L1LinkDef.h @@ -30,6 +30,8 @@ //#pragma link C++ class CbmL1SttTrackFinder+; //#pragma link C++ class CbmL1SttTrack+; #pragma link C++ class CbmTrackerInputQaTrd + ; - +#pragma link C++ class CbmTrackerDetInitializer + ; +#pragma link C++ class CbmTrackerInterfaceMvd + ; +#pragma link C++ class CbmTrackerInterfaceSts + ; #endif diff --git a/reco/L1/L1TrackerInterfaceBase.h b/reco/L1/L1TrackerInterfaceBase.h new file mode 100644 index 0000000000000000000000000000000000000000..f8b64f3ffd961a26dcbe721892975c88db5cfeef --- /dev/null +++ b/reco/L1/L1TrackerInterfaceBase.h @@ -0,0 +1,91 @@ +/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/*************************************************************************************************** + * @file L1TrackerInterfaceBase.h + * @brief Base abstract class for tracking detector interface to L1 + * @since 31.05.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***************************************************************************************************/ + +#ifndef L1TrackerInterfaceBase_h +#define L1TrackerInterfaceBase_h 1 + +/// Abstract class, which should be inherited by every detecting subsystem interface class +/// +class L1TrackerInterfaceBase { +public: + /// Virtual destructor + virtual ~L1TrackerInterfaceBase() {} + + /// Gets actual number of stations, provided by the current geometry setup + virtual int GetNstations() const = 0; + + /// Gets time resolution for a station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Time resolution [ns] + virtual double GetTimeResolution(int stationId) const = 0; + + /// Gets z component of the station position + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Z position of station [cm] + virtual double GetZ(int stationId) const = 0; + + /// Gets max size of a station along the X-axis + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Size of station along the X-axis [cm] + virtual double GetXmax(int stationId) const = 0; + + /// Gets max size of a station along the Y-axis + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Size of station along the Y-axis [cm] + virtual double GetYmax(int stationId) const = 0; + + /// Gets size of inner radius of station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Size of station inner radius [cm] + virtual double GetRmin(int stationId) const = 0; + + /// Gets size of outer radius of station + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Size of station outer radius [cm] + virtual double GetRmax(int stationId) const = 0; + + /// Gets station thickness along the Z-axis + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Station thickness [cm] + virtual double GetThickness(int stationId) const = 0; + + /// Gets station radiation length + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Radiation length [cm] + virtual double GetRadLength(int stationId) const = 0; + + /// Gets front strips stereo angle + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Absolute stereo angle for front strips [rad] + virtual double GetStripsStereoAngleFront(int stationId) const = 0; + + /// Gets back strips stereo angle + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Absolute stereo angle for back strips [rad] + virtual double GetStripsStereoAngleBack(int stationId) const = 0; + + /// Gets spatial resolution (RMS) for front strips + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Spatial resolution (RMS) for front strips [cm] + virtual double GetStripsSpatialRmsFront(int stationId) const = 0; + + /// Gets spatial resolution (RMS) for back strips + /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \return Spatial resolution (RMS) for front strips [cm] + virtual double GetStripsSpatialRmsBack(int stationId) const = 0; + + /// Check if station provides time measurements + /// \param stationId Station ID in the setup + /// \return Flag: true - station provides time measurements, false - station does not provide time measurements + virtual bool IsTimeInfoProvided(int stationId) const = 0; +}; + +#endif // L1TrackerInterfaceBase_h