From f6287b39859cd9e081f997024c4f7d8b74b63545 Mon Sep 17 00:00:00 2001 From: "s.zharko@gsi.de" <s.zharko@gsi.de> Date: Wed, 15 Jun 2022 15:51:50 +0200 Subject: [PATCH] L1: renamed tracking interface classes + clang format bugfix --- macro/mcbm/mcbm_reco_event.C | 20 ++-- macro/run/run_reco.C | 14 +-- reco/KF/CbmKF.cxx | 23 ++-- ...kerIF.cxx => CbmMuchTrackingInterface.cxx} | 105 ++++++------------ ...TrackerIF.h => CbmMuchTrackingInterface.h} | 49 ++++---- ...ckerIF.cxx => CbmMvdTrackingInterface.cxx} | 91 ++++++--------- ...dTrackerIF.h => CbmMvdTrackingInterface.h} | 47 ++++---- ...ckerIF.cxx => CbmStsTrackingInterface.cxx} | 103 +++++++++-------- ...sTrackerIF.h => CbmStsTrackingInterface.h} | 51 +++++---- reco/KF/CbmTrackerDetInitializer.h | 58 ---------- ...e.h => CbmTrackingDetectorInterfaceBase.h} | 44 ++++---- ...x => CbmTrackingDetectorInterfaceInit.cxx} | 48 ++++---- reco/KF/CbmTrackingDetectorInterfaceInit.h | 59 ++++++++++ ...ckerIF.cxx => CbmTrdTrackingInterface.cxx} | 100 ++++++----------- ...dTrackerIF.h => CbmTrdTrackingInterface.h} | 51 +++++---- reco/KF/KF.cmake | 22 ++-- reco/KF/KFLinkDef.h | 10 +- reco/L1/CbmL1.cxx | 75 ++++++------- reco/L1/CbmL1Performance.cxx | 31 ++++-- reco/L1/CbmL1ReadEvent.cxx | 12 +- reco/L1/L1Algo/L1Algo.cxx | 6 +- reco/L1/L1Algo/L1Algo.h | 13 ++- reco/L1/L1Algo/L1BaseStationInfo.cxx | 2 +- reco/L1/L1Algo/L1CATrackFinder.cxx | 29 ++--- reco/L1/L1Algo/L1Constants.h | 40 ++++--- reco/L1/L1Algo/L1Def.h | 4 +- reco/L1/L1Algo/L1Field.cxx | 12 +- reco/L1/L1Algo/L1Field.h | 47 ++++---- reco/L1/L1Algo/L1InitManager.cxx | 20 ++-- reco/L1/L1Algo/L1InitManager.h | 6 +- reco/L1/L1Algo/L1MaterialInfo.cxx | 34 +++--- reco/L1/L1Algo/L1MaterialInfo.h | 13 ++- reco/L1/L1Algo/L1Parameters.cxx | 100 +++++++++-------- reco/L1/L1Algo/L1Parameters.h | 58 +++++----- reco/L1/L1Algo/L1Station.cxx | 18 ++- reco/L1/L1Algo/L1Station.h | 21 ++-- reco/L1/L1Algo/L1TrackFitter.cxx | 62 ++++++----- reco/L1/L1Algo/L1UMeasurementInfo.cxx | 2 +- reco/L1/L1Algo/L1UMeasurementInfo.h | 4 +- reco/L1/L1Algo/L1Utils.h | 9 +- reco/L1/L1Algo/L1XYMeasurementInfo.cxx | 4 +- reco/L1/L1Algo/L1XYMeasurementInfo.h | 2 +- reco/L1/ParticleFinder/CbmL1PFFitter.cxx | 9 +- reco/L1/vectors/P4_F32vec4.h | 17 +-- 44 files changed, 750 insertions(+), 795 deletions(-) rename reco/KF/{CbmMuchTrackerIF.cxx => CbmMuchTrackingInterface.cxx} (70%) rename reco/KF/{CbmMuchTrackerIF.h => CbmMuchTrackingInterface.h} (81%) rename reco/KF/{CbmMvdTrackerIF.cxx => CbmMvdTrackingInterface.cxx} (68%) rename reco/KF/{CbmMvdTrackerIF.h => CbmMvdTrackingInterface.h} (79%) rename reco/KF/{CbmStsTrackerIF.cxx => CbmStsTrackingInterface.cxx} (71%) rename reco/KF/{CbmStsTrackerIF.h => CbmStsTrackingInterface.h} (78%) delete mode 100644 reco/KF/CbmTrackerDetInitializer.h rename reco/KF/{L1TrackerInterfaceBase.h => CbmTrackingDetectorInterfaceBase.h} (63%) rename reco/KF/{CbmTrackerDetInitializer.cxx => CbmTrackingDetectorInterfaceInit.cxx} (58%) create mode 100644 reco/KF/CbmTrackingDetectorInterfaceInit.h rename reco/KF/{CbmTrdTrackerIF.cxx => CbmTrdTrackingInterface.cxx} (67%) rename reco/KF/{CbmTrdTrackerIF.h => CbmTrdTrackingInterface.h} (80%) diff --git a/macro/mcbm/mcbm_reco_event.C b/macro/mcbm/mcbm_reco_event.C index 6d09f3debb..7a22303142 100644 --- a/macro/mcbm/mcbm_reco_event.C +++ b/macro/mcbm/mcbm_reco_event.C @@ -18,8 +18,7 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", - const char* setupName = "mcbm_beam_2022_03_09_carbon", - Bool_t debugWithMC = false) + const char* setupName = "mcbm_beam_2022_03_09_carbon", Bool_t debugWithMC = false) { // ======================================================================== // Adjust this part according to your requirements @@ -44,9 +43,7 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", // ------------------------------------------------------------------------ Int_t iTofCluMode = 1; - if (debugWithMC) { - Int_t iTrackMode = 1; - } + if (debugWithMC) { Int_t iTrackMode = 1; } // ----- Load the geometry setup ------------------------------------- std::cout << std::endl; TString setupFile = srcDir + "/geometry/setup/setup_" + setupName + ".C"; @@ -115,7 +112,7 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", Bool_t hasFairMonitor = kFALSE; //Has_Fair_Monitor(); if (hasFairMonitor) FairMonitor::GetMonitor()->EnableMonitor(kTRUE); // ------------------------------------------------------------------------ - + // ----- MCDataManager ------------------------------------------------- if (debugWithMC) { CbmMCDataManager* mcManager = new CbmMCDataManager("MCDataManager", 1); @@ -179,9 +176,7 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", // --- Initialization of the digi scheme auto muchGeoScheme = CbmMuchGeoScheme::Instance(); - if (!muchGeoScheme->IsInitialized()) { - muchGeoScheme->Init(parFile, muchFlag); - } + if (!muchGeoScheme->IsInitialized()) { muchGeoScheme->Init(parFile, muchFlag); } // --- Hit finder for GEMs FairTask* muchHitGem = new CbmMuchFindHitsGem(parFile.Data(), muchFlag); @@ -373,11 +368,12 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", // -------- L1 CA Track Finder --------------------------------------- // Geometry interface initializer for tracker - auto trackerIF = new CbmTrackerDetInitializer(); + run->AddTask(new CbmTrackingDetectorInterfaceInit()); // Kalman filter auto kalman = new CbmKF(); - + run->AddTask(kalman); + // L1 tracking auto l1 = (debugWithMC) ? new CbmL1("L1", 1, 3) : new CbmL1(); l1->SetLegacyEventMode(1); @@ -438,8 +434,6 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", l1->SetTofMaterialBudgetFileName(parFile.Data()); } - run->AddTask(trackerIF); - run->AddTask(kalman); run->AddTask(l1); CbmL1GlobalTrackFinder* globalTrackFinder = new CbmL1GlobalTrackFinder(); diff --git a/macro/run/run_reco.C b/macro/run/run_reco.C index b7125d5336..5f7af4a3ad 100644 --- a/macro/run/run_reco.C +++ b/macro/run/run_reco.C @@ -37,9 +37,9 @@ #include "CbmStsTrackFinder.h" #include "CbmTaskBuildRawEvents.h" #include "CbmTofSimpClusterizer.h" +#include "CbmTrackerDetInitializer.h" #include "CbmTrdClusterFinder.h" #include "CbmTrdHitProducer.h" -#include "CbmTrackerDetInitializer.h" #include <FairFileSource.h> #include <FairMonitor.h> @@ -261,8 +261,6 @@ void run_reco(TString input = "", Int_t nTimeSlices = -1, Int_t firstTimeSlice = // ------------------------------------------------------------------------ - - // ----- Local reconstruction in MVD ---------------------------------- if (useMvd) { CbmMvdClusterfinder* mvdCluster = new CbmMvdClusterfinder("MVD Cluster Finder", 0, 0); @@ -309,9 +307,7 @@ void run_reco(TString input = "", Int_t nTimeSlices = -1, Int_t firstTimeSlice = // --- Initialization of the digi scheme auto muchGeoScheme = CbmMuchGeoScheme::Instance(); - if (!muchGeoScheme->IsInitialized()) { - muchGeoScheme->Init(parFile, muchFlag); - } + if (!muchGeoScheme->IsInitialized()) { muchGeoScheme->Init(parFile, muchFlag); } // --- Hit finder for GEMs FairTask* muchReco = new CbmMuchFindHitsGem(parFile.Data(), muchFlag); @@ -374,12 +370,12 @@ void run_reco(TString input = "", Int_t nTimeSlices = -1, Int_t firstTimeSlice = // ----- Track finding in STS (+ MVD) -------------------------------- if (useMvd || useSts) { // Geometry interface initializer for tracker - run->AddTask(new CbmTrackerDetInitializer()); - + run->AddTask(new CbmTrackingDetectorInterfaceInit()); + // Kalman filter auto kalman = new CbmKF(); run->AddTask(kalman); - + // L1 tracking auto l1 = (debugWithMC) ? new CbmL1("L1", 2, 3) : new CbmL1("L1", 0); diff --git a/reco/KF/CbmKF.cxx b/reco/KF/CbmKF.cxx index 2f7bd12116..d6f8c2fc57 100644 --- a/reco/KF/CbmKF.cxx +++ b/reco/KF/CbmKF.cxx @@ -9,9 +9,9 @@ #include "CbmKFFieldMath.h" #include "CbmKFHit.h" #include "CbmKFMath.h" -#include "CbmTrackerDetInitializer.h" -#include "CbmMvdTrackerIF.h" -#include "CbmStsTrackerIF.h" +#include "CbmMvdTrackingInterface.h" +#include "CbmStsTrackingInterface.h" +#include "CbmTrackingDetectorInterfaceInit.h" #include "FairBaseParSet.h" #include "FairField.h" @@ -81,9 +81,10 @@ CbmKF::CbmKF(const char* name, Int_t iVerbose) { if (!fInstance) fInstance = this; - if (!CbmTrackerDetInitializer::Instance()) { - LOG(fatal) << "CbmL1: CbmTrackerDetInitializer instance was not found. Please, add it as a task to your reco macro before the KF and L1 tasks:\n" - << "\033[1;30mrun->AddTask(new CbmTrackerDetInitializer());\033[0m"; + if (!CbmTrackingDetectorInterfaceInit::Instance()) { + LOG(fatal) << "CbmL1: CbmTrackingDetectorInterfaceInit instance was not found. Please, add it as a task to your " + "reco macro before the KF and L1 tasks:\n" + << "\033[1;30mrun->AddTask(new CbmTrackingDetectorInterfaceInit());\033[0m"; } } @@ -144,7 +145,7 @@ InitStatus CbmKF::Init() digiMan->Init(); Bool_t useMVD = CbmDigiManager::IsPresent(ECbmModuleId::kMvd); if (useMVD) { - auto mvdInterface = CbmMvdTrackerIF::Instance(); + auto mvdInterface = CbmMvdTrackingInterface::Instance(); if (fVerbose) cout << "KALMAN FILTER : === READ MVD MATERIAL ===" << endl; @@ -155,8 +156,8 @@ InitStatus CbmKF::Init() tube.ID = 1101 + ist; // tube.F = 1.; - tube.z = mvdInterface->GetZ(ist); - tube.dz = mvdInterface->GetThickness(ist); + tube.z = mvdInterface->GetZ(ist); + tube.dz = mvdInterface->GetThickness(ist); // TODO: verify the thickness of MVD stations tube.RadLength = mvdInterface->GetRadLength(ist); tube.r = mvdInterface->GetRmin(ist); @@ -181,8 +182,8 @@ InitStatus CbmKF::Init() if (fVerbose) cout << "KALMAN FILTER : === READ STS MATERIAL ===" << endl; - auto stsInterface = CbmStsTrackerIF::Instance(); - int NStations = stsInterface->GetNtrackingStations(); + auto stsInterface = CbmStsTrackingInterface::Instance(); + int NStations = stsInterface->GetNtrackingStations(); for (Int_t ist = 0; ist < NStations; ist++) { CbmKFTube tube; diff --git a/reco/KF/CbmMuchTrackerIF.cxx b/reco/KF/CbmMuchTrackingInterface.cxx similarity index 70% rename from reco/KF/CbmMuchTrackerIF.cxx rename to reco/KF/CbmMuchTrackingInterface.cxx index 0566beeb05..ad890d5afc 100644 --- a/reco/KF/CbmMuchTrackerIF.cxx +++ b/reco/KF/CbmMuchTrackingInterface.cxx @@ -3,82 +3,70 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmMuchTrackerIF.cxx + * @file CbmMuchTrackingInterface.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 "CbmMuchTrackerIF.h" +#include "CbmMuchTrackingInterface.h" + #include "CbmMuchModuleGem.h" #include "CbmMuchPad.h" #include "CbmMuchStation.h" + #include "FairDetector.h" #include "FairRunAna.h" #include <FairLogger.h> -#include "TMath.h" + #include "TFile.h" +#include "TMath.h" -ClassImp(CbmMuchTrackerIF) +ClassImp(CbmMuchTrackingInterface) -CbmMuchTrackerIF* CbmMuchTrackerIF::fpInstance = nullptr; + CbmMuchTrackingInterface* CbmMuchTrackingInterface::fpInstance = nullptr; //------------------------------------------------------------------------------------------------------------------------------------- // -CbmMuchTrackerIF::CbmMuchTrackerIF() : FairTask("CbmMuchTrackerIF") +CbmMuchTrackingInterface::CbmMuchTrackingInterface() : FairTask("CbmMuchTrackingInterface") { if (!fpInstance) { fpInstance = this; } } //------------------------------------------------------------------------------------------------------------------------------------- // -CbmMuchTrackerIF::~CbmMuchTrackerIF() +CbmMuchTrackingInterface::~CbmMuchTrackingInterface() { if (fpInstance == this) { fpInstance = nullptr; } } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetTimeResolution(int /*stationId*/) const { return 3.9; } +double CbmMuchTrackingInterface::GetTimeResolution(int /*stationId*/) const { return 3.9; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetZ(int stationId) const -{ - return GetMuchLayer(stationId)->GetZ(); -} +double CbmMuchTrackingInterface::GetZ(int stationId) const { return GetMuchLayer(stationId)->GetZ(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetXmax(int /*stationId*/) const -{ - return 100.; -} +double CbmMuchTrackingInterface::GetXmax(int /*stationId*/) const { return 100.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetYmax(int /*stationId*/) const -{ - return 100.; -} +double CbmMuchTrackingInterface::GetYmax(int /*stationId*/) const { return 100.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetRmin(int /*stationId*/) const -{ - return 10.; -} +double CbmMuchTrackingInterface::GetRmin(int /*stationId*/) const { return 10.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetRmax(int /*stationId*/) const -{ - return 100.; -} +double CbmMuchTrackingInterface::GetRmax(int /*stationId*/) const { return 100.; } //------------------------------------------------------------------------------------------------------------------------------------- // -int CbmMuchTrackerIF::GetNtrackingStations() const +int CbmMuchTrackingInterface::GetNtrackingStations() const { // NOTE: For MuCh detector subsystem, a MuCh layer is assigned as a tracking station! Thus, we here separate names for MuCh stations: // iMuchSt, muchStationId and for the tracking stations - iSt, stationId @@ -91,66 +79,49 @@ int CbmMuchTrackerIF::GetNtrackingStations() const //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetThickness(int stationId) const -{ - return GetMuchLayer(stationId)->GetDz(); -} +double CbmMuchTrackingInterface::GetThickness(int stationId) const { return GetMuchLayer(stationId)->GetDz(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetRadLength(int /*stationId*/) const -{ - return 0; // TODO: Replace with correct value +double CbmMuchTrackingInterface::GetRadLength(int /*stationId*/) const +{ + return 0; // TODO: Replace with correct value } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetStripsStereoAngleFront(int /*stationId*/) const -{ - return 0.; -} +double CbmMuchTrackingInterface::GetStripsStereoAngleFront(int /*stationId*/) const { return 0.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetStripsStereoAngleBack(int /*stationId*/) const -{ - return TMath::Pi() / 2.; -} +double CbmMuchTrackingInterface::GetStripsStereoAngleBack(int /*stationId*/) const { return TMath::Pi() / 2.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetStripsSpatialRmsFront(int /*stationId*/) const -{ - return 0.35; -} +double CbmMuchTrackingInterface::GetStripsSpatialRmsFront(int /*stationId*/) const { return 0.35; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMuchTrackerIF::GetStripsSpatialRmsBack(int /*stationId*/) const -{ - return 0.35; -} +double CbmMuchTrackingInterface::GetStripsSpatialRmsBack(int /*stationId*/) const { return 0.35; } //------------------------------------------------------------------------------------------------------------------------------------- // -bool CbmMuchTrackerIF::IsTimeInfoProvided(int /*stationId*/) const { return true; } +bool CbmMuchTrackingInterface::IsTimeInfoProvided(int /*stationId*/) const { return true; } //------------------------------------------------------------------------------------------------------------------------------------- // -InitStatus CbmMuchTrackerIF::Init() +InitStatus CbmMuchTrackingInterface::Init() { - LOG(info) << "\033[1;33mCALL CbmMuchTrackerIF::Init()\033[0m"; - + LOG(info) << "\033[1;33mCALL CbmMuchTrackingInterface::Init()\033[0m"; + fGeoScheme = CbmMuchGeoScheme::Instance(); - if (!fGeoScheme) { - LOG(fatal) << "CbmMuchTrackerIF::Init: CbmMuchGeoScheme instance is nullptr"; - } + if (!fGeoScheme) { LOG(fatal) << "CbmMuchTrackingInterface::Init: CbmMuchGeoScheme instance is nullptr"; } // Check initialization of the MuCh digi parameters file - if (!fGeoScheme->IsInitialized()) { - LOG(fatal) << "CbmMuchTrackerIF::Init: MuCh digi parameters were not intialized\n" + if (!fGeoScheme->IsInitialized()) { + LOG(fatal) << "CbmMuchTrackingInterface::Init: MuCh digi parameters were not intialized\n" << "\033[4;1;32mNOTE\033[0m: For the MuCh digi parameters initialization one can place the following " << "code to the reconstruction macro:\n" << "\n\tif (CbmSetup::Instance()->IsActive(ECbmModuleId::kMuch)) {" @@ -160,8 +131,8 @@ InitStatus CbmMuchTrackerIF::Init() << "\n\t Int_t muchFlag = (geoTag.Contains(\"mcbm\") ? 1 : 0);" << "\n\t TString parFile = gSystem->Getenv(\"VMCWORKDIR\");" << "\n\t parFile += \"/parameters/much/much_\" + geoTag(0, 4) + \"_digi_sector.root\";" - << "\n\t" - << "\n\t // Initialization of the geometry scheme" + << "\n\t" + << "\n\t // Initialization of the geometry scheme" << "\n\t auto muchGeoScheme = CbmMuchGeoScheme::Instance();" << "\n\t if (!muchGeoScheme->IsInitialized()) { muchGeoScheme->Init(parFile, muchFlag); }" << "\n\t}"; @@ -172,18 +143,16 @@ InitStatus CbmMuchTrackerIF::Init() //------------------------------------------------------------------------------------------------------------------------------------- // -InitStatus CbmMuchTrackerIF::ReInit() +InitStatus CbmMuchTrackingInterface::ReInit() { - LOG(info) << "\033[1;33mCALL CbmMuchTrackerIF::ReInit()\033[0m"; + LOG(info) << "\033[1;33mCALL CbmMuchTrackingInterface::ReInit()\033[0m"; this->SetParContainers(); return Init(); } //------------------------------------------------------------------------------------------------------------------------------------- // -void CbmMuchTrackerIF::SetParContainers() -{ -} +void CbmMuchTrackingInterface::SetParContainers() {} //------------------------------------------------------------------------------------------------------------------------------------- // diff --git a/reco/KF/CbmMuchTrackerIF.h b/reco/KF/CbmMuchTrackingInterface.h similarity index 81% rename from reco/KF/CbmMuchTrackerIF.h rename to reco/KF/CbmMuchTrackingInterface.h index 04b43a04a2..bf2095a51c 100644 --- a/reco/KF/CbmMuchTrackerIF.h +++ b/reco/KF/CbmMuchTrackingInterface.h @@ -3,37 +3,39 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmMuchTrackerIF.h + * @file CbmMuchTrackingInterface.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 CbmMuchTrackerIF_h -#define CbmMuchTrackerIF_h 1 +#ifndef CbmMuchTrackingInterface_h +#define CbmMuchTrackingInterface_h 1 -#include "L1TrackerInterfaceBase.h" #include "CbmMuchGeoScheme.h" +#include "CbmTrackingDetectorInterfaceBase.h" + #include "FairTask.h" +#include "TString.h" + #include <iostream> #include <vector> -#include "TString.h" class CbmMuchLayer; -/// Class CbmMuchTrackerIF is a CbmL1 subtask, which provides necessary methods for L1 tracker +/// Class CbmMuchTrackingInterface is a CbmL1 subtask, which provides necessary methods for L1 tracker /// to access the geometry and dataflow settings. /// /// NOTE: For MuCh one tracking station is a MuCh layer! /// -class CbmMuchTrackerIF: public FairTask, public L1TrackerInterfaceBase { +class CbmMuchTrackingInterface : public FairTask, public CbmTrackingDetectorInterfaceBase { public: /// Default constructor - CbmMuchTrackerIF(); + CbmMuchTrackingInterface(); /// Destructor - ~CbmMuchTrackerIF(); + ~CbmMuchTrackingInterface(); /// FairTask: Init method InitStatus Init(); @@ -41,8 +43,8 @@ public: /// FairTask: ReInit method InitStatus ReInit(); - /// Gets pointer to the instance of the CbmMuchTrackerIF - static CbmMuchTrackerIF* Instance() { return fpInstance; } + /// Gets pointer to the instance of the CbmMuchTrackingInterface + static CbmMuchTrackingInterface* Instance() { return fpInstance; } /// Gets actual number of tracking stations, provided by the current geometry setup int GetNtrackingStations() const; @@ -61,7 +63,7 @@ public: /// \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; - + /// Gets max size of a station 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] @@ -90,12 +92,12 @@ public: /// Gets front strips stereo angle /// \param stationId Tracking 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; + double GetStripsStereoAngleFront(int stationId) const; /// Gets back strips stereo angle /// \param stationId Tracking 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; + double GetStripsStereoAngleBack(int stationId) const; /// Gets spatial resolution (RMS) for front strips /// \param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) @@ -111,15 +113,15 @@ public: /// \param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) /// \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 - CbmMuchTrackerIF(const CbmMuchTrackerIF&) = delete; - CbmMuchTrackerIF(CbmMuchTrackerIF&&) = delete; - CbmMuchTrackerIF& operator=(const CbmMuchTrackerIF&) = delete; - CbmMuchTrackerIF& operator=(CbmMuchTrackerIF&&) = delete; + CbmMuchTrackingInterface(const CbmMuchTrackingInterface&) = delete; + CbmMuchTrackingInterface(CbmMuchTrackingInterface&&) = delete; + CbmMuchTrackingInterface& operator=(const CbmMuchTrackingInterface&) = delete; + CbmMuchTrackingInterface& operator=(CbmMuchTrackingInterface&&) = delete; private: /// Calculates MuCh station ID from tracker station ID @@ -131,15 +133,16 @@ private: /// Gets pointer to the TRD module /// \param stationId Tracking staton ID /// \return Pointer to the particular CbmTrdParModDigi object - __attribute__((always_inline)) CbmMuchLayer* GetMuchLayer(int stationId) const { + __attribute__((always_inline)) CbmMuchLayer* GetMuchLayer(int stationId) const + { return fGeoScheme->GetLayer(GetMuchStationId(stationId), GetMuchLayerId(stationId)); } - static CbmMuchTrackerIF* fpInstance; ///< Instance of the class + static CbmMuchTrackingInterface* fpInstance; ///< Instance of the class CbmMuchGeoScheme* fGeoScheme {nullptr}; ///< MuCh geometry scheme instance - ClassDef(CbmMuchTrackerIF, 0); + ClassDef(CbmMuchTrackingInterface, 0); }; -#endif // CbmMuchTrackerIF +#endif // CbmMuchTrackingInterface diff --git a/reco/KF/CbmMvdTrackerIF.cxx b/reco/KF/CbmMvdTrackingInterface.cxx similarity index 68% rename from reco/KF/CbmMvdTrackerIF.cxx rename to reco/KF/CbmMvdTrackingInterface.cxx index c5602e3bf5..0ceebb2360 100644 --- a/reco/KF/CbmMvdTrackerIF.cxx +++ b/reco/KF/CbmMvdTrackingInterface.cxx @@ -3,117 +3,100 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmMvdTrackerIF.cxx + * @file CbmMvdTrackingInterface.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 "CbmMvdTrackerIF.h" +#include "CbmMvdTrackingInterface.h" + #include "CbmMvdDetector.h" #include "CbmMvdStationPar.h" + #include "FairDetector.h" #include "FairRunAna.h" #include <FairLogger.h> + #include "TMath.h" + #include "L1Def.h" -ClassImp(CbmMvdTrackerIF) +ClassImp(CbmMvdTrackingInterface) -CbmMvdTrackerIF* CbmMvdTrackerIF::fpInstance = nullptr; + CbmMvdTrackingInterface* CbmMvdTrackingInterface::fpInstance = nullptr; //------------------------------------------------------------------------------------------------------------------------------------- // -CbmMvdTrackerIF::CbmMvdTrackerIF() : FairTask("CbmMvdTrackerIF") +CbmMvdTrackingInterface::CbmMvdTrackingInterface() : FairTask("CbmMvdTrackingInterface") { if (!fpInstance) { fpInstance = this; } } //------------------------------------------------------------------------------------------------------------------------------------- // -CbmMvdTrackerIF::~CbmMvdTrackerIF() +CbmMvdTrackingInterface::~CbmMvdTrackingInterface() { if (fpInstance == this) { fpInstance = nullptr; } } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetTimeResolution(int /*stationId*/) const { return 1000.; } +double CbmMvdTrackingInterface::GetTimeResolution(int /*stationId*/) const { return 1000.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetZ(int stationId) const -{ - return fMvdStationPar->GetZPosition(stationId); -} +double CbmMvdTrackingInterface::GetZ(int stationId) const { return fMvdStationPar->GetZPosition(stationId); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetXmax(int stationId) const -{ - return this->GetRmax(stationId); -} +double CbmMvdTrackingInterface::GetXmax(int stationId) const { return this->GetRmax(stationId); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetYmax(int stationId) const -{ - return this->GetRmax(stationId); -} +double CbmMvdTrackingInterface::GetYmax(int stationId) const { return this->GetRmax(stationId); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetRmin(int stationId) const -{ - return std::min(fMvdStationPar->GetBeamHeight(stationId), fMvdStationPar->GetBeamWidth(stationId)); +double CbmMvdTrackingInterface::GetRmin(int stationId) const +{ + return std::min(fMvdStationPar->GetBeamHeight(stationId), fMvdStationPar->GetBeamWidth(stationId)); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetRmax(int stationId) const -{ - return std::max(fMvdStationPar->GetHeight(stationId), fMvdStationPar->GetWidth(stationId)); +double CbmMvdTrackingInterface::GetRmax(int stationId) const +{ + return std::max(fMvdStationPar->GetHeight(stationId), fMvdStationPar->GetWidth(stationId)); } //------------------------------------------------------------------------------------------------------------------------------------- // -int CbmMvdTrackerIF::GetNtrackingStations() const -{ - return fMvdStationPar->GetStationCount(); -} +int CbmMvdTrackingInterface::GetNtrackingStations() const { return fMvdStationPar->GetStationCount(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetThickness(int stationId) const -{ - return fMvdStationPar->GetZThickness(stationId); -} +double CbmMvdTrackingInterface::GetThickness(int stationId) const { return fMvdStationPar->GetZThickness(stationId); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetRadLength(int stationId) const -{ +double CbmMvdTrackingInterface::GetRadLength(int stationId) const +{ // NOTE: Taken from CbmKF::Init() (S.Zharko) return fMvdStationPar->GetZThickness(stationId) / (10. * fMvdStationPar->GetZRadThickness(stationId)); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetStripsStereoAngleFront(int /*stationId*/) const -{ - return 0.; -} +double CbmMvdTrackingInterface::GetStripsStereoAngleFront(int /*stationId*/) const { return 0.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetStripsStereoAngleBack(int /*stationId*/) const -{ - return TMath::Pi() / 2.; -} +double CbmMvdTrackingInterface::GetStripsStereoAngleBack(int /*stationId*/) const { return TMath::Pi() / 2.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetStripsSpatialRmsFront(int stationId) const +double CbmMvdTrackingInterface::GetStripsSpatialRmsFront(int stationId) const { return fMvdStationPar->GetXRes(stationId) / 10000.; } @@ -121,24 +104,24 @@ double CbmMvdTrackerIF::GetStripsSpatialRmsFront(int stationId) const //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmMvdTrackerIF::GetStripsSpatialRmsBack(int stationId) const +double CbmMvdTrackingInterface::GetStripsSpatialRmsBack(int stationId) const { return fMvdStationPar->GetYRes(stationId) / 10000.; } //------------------------------------------------------------------------------------------------------------------------------------- // -bool CbmMvdTrackerIF::IsTimeInfoProvided(int /*stationId*/) const { return false; } +bool CbmMvdTrackingInterface::IsTimeInfoProvided(int /*stationId*/) const { return false; } //------------------------------------------------------------------------------------------------------------------------------------- // -InitStatus CbmMvdTrackerIF::Init() +InitStatus CbmMvdTrackingInterface::Init() { - LOG(info) << "\033[1;33mCALL CbmMvdTrackerIF::Init()\033[0m"; - + LOG(info) << "\033[1;33mCALL CbmMvdTrackingInterface::Init()\033[0m"; + fMvdStationPar = CbmMvdDetector::Instance()->GetParameterFile(); - + if (!fMvdStationPar) { return kFATAL; } return kSUCCESS; @@ -146,18 +129,16 @@ InitStatus CbmMvdTrackerIF::Init() //------------------------------------------------------------------------------------------------------------------------------------- // -InitStatus CbmMvdTrackerIF::ReInit() +InitStatus CbmMvdTrackingInterface::ReInit() { - LOG(info) << "\033[1;33mCALL CbmMvdTrackerIF::ReInit()\033[0m"; + LOG(info) << "\033[1;33mCALL CbmMvdTrackingInterface::ReInit()\033[0m"; this->SetParContainers(); return Init(); } //------------------------------------------------------------------------------------------------------------------------------------- // -void CbmMvdTrackerIF::SetParContainers() -{ -} +void CbmMvdTrackingInterface::SetParContainers() {} //------------------------------------------------------------------------------------------------------------------------------------- // diff --git a/reco/KF/CbmMvdTrackerIF.h b/reco/KF/CbmMvdTrackingInterface.h similarity index 79% rename from reco/KF/CbmMvdTrackerIF.h rename to reco/KF/CbmMvdTrackingInterface.h index 3b2e31f6c0..9467b25aa4 100644 --- a/reco/KF/CbmMvdTrackerIF.h +++ b/reco/KF/CbmMvdTrackingInterface.h @@ -3,16 +3,17 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmMvdTrackerIF.h + * @file CbmMvdTrackingInterface.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 CbmMvdTrackerIF_h -#define CbmMvdTrackerIF_h 1 +#ifndef CbmMvdTrackingInterface_h +#define CbmMvdTrackingInterface_h 1 + +#include "CbmTrackingDetectorInterfaceBase.h" -#include "L1TrackerInterfaceBase.h" #include "FairTask.h" #include <iostream> @@ -22,16 +23,16 @@ class CbmMvdDetector; class CbmMvdStationPar; -/// Class CbmMvdTrackerIF is a CbmL1 subtask, which provides necessary methods for L1 tracker +/// Class CbmMvdTrackingInterface is a CbmL1 subtask, which provides necessary methods for L1 tracker /// to access the geometry and dataflow settings. -/// -class CbmMvdTrackerIF: public FairTask, public L1TrackerInterfaceBase { +/// +class CbmMvdTrackingInterface : public FairTask, public CbmTrackingDetectorInterfaceBase { public: /// Default constructor - CbmMvdTrackerIF(); + CbmMvdTrackingInterface(); /// Destructor - ~CbmMvdTrackerIF(); + ~CbmMvdTrackingInterface(); /// FairTask: Init method InitStatus Init(); @@ -39,8 +40,8 @@ public: /// FairTask: ReInit method InitStatus ReInit(); - /// Gets pointer to the instance of the CbmMvdTrackerIF - static CbmMvdTrackerIF* Instance() { return fpInstance; } + /// Gets pointer to the instance of the CbmMvdTrackingInterface + static CbmMvdTrackingInterface* Instance() { return fpInstance; } /// Gets actual number of tracking stations, provided by the current geometry setup int GetNtrackingStations() const; @@ -59,7 +60,7 @@ public: /// \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; - + /// Gets max size of a tracking station 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] @@ -88,12 +89,12 @@ public: /// Gets front strips stereo angle /// \param stationId Tracking 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; + double GetStripsStereoAngleFront(int stationId) const; /// Gets back strips stereo angle /// \param stationId Tracking 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; + double GetStripsStereoAngleBack(int stationId) const; /// Gets spatial resolution (RMS) for front strips /// \param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) @@ -109,22 +110,22 @@ public: /// \param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) /// \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 - CbmMvdTrackerIF(const CbmMvdTrackerIF&) = delete; - CbmMvdTrackerIF(CbmMvdTrackerIF&&) = delete; - CbmMvdTrackerIF& operator=(const CbmMvdTrackerIF&) = delete; - CbmMvdTrackerIF& operator=(CbmMvdTrackerIF&&) = delete; + CbmMvdTrackingInterface(const CbmMvdTrackingInterface&) = delete; + CbmMvdTrackingInterface(CbmMvdTrackingInterface&&) = delete; + CbmMvdTrackingInterface& operator=(const CbmMvdTrackingInterface&) = delete; + CbmMvdTrackingInterface& operator=(CbmMvdTrackingInterface&&) = delete; private: - static CbmMvdTrackerIF* fpInstance; ///< Instance of the class + static CbmMvdTrackingInterface* fpInstance; ///< Instance of the class - const CbmMvdStationPar* fMvdStationPar {nullptr}; ///< Pointer to the Mvd station parameters + const CbmMvdStationPar* fMvdStationPar {nullptr}; ///< Pointer to the Mvd station parameters - ClassDef(CbmMvdTrackerIF, 0); + ClassDef(CbmMvdTrackingInterface, 0); }; -#endif // CbmMvdTrackerIF +#endif // CbmMvdTrackingInterface diff --git a/reco/KF/CbmStsTrackerIF.cxx b/reco/KF/CbmStsTrackingInterface.cxx similarity index 71% rename from reco/KF/CbmStsTrackerIF.cxx rename to reco/KF/CbmStsTrackingInterface.cxx index efb623a5a0..bdc160f4ce 100644 --- a/reco/KF/CbmStsTrackerIF.cxx +++ b/reco/KF/CbmStsTrackingInterface.cxx @@ -3,114 +3,115 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmStsTrackerIF.cxx + * @file CbmStsTrackingInterface.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 "CbmStsTrackerIF.h" +#include "CbmStsTrackingInterface.h" + #include "CbmStsStation.h" + #include "FairDetector.h" #include "FairRunAna.h" #include <FairLogger.h> + #include "TMath.h" + #include "L1Def.h" -ClassImp(CbmStsTrackerIF) +ClassImp(CbmStsTrackingInterface) -CbmStsTrackerIF* CbmStsTrackerIF::fpInstance = nullptr; + CbmStsTrackingInterface* CbmStsTrackingInterface::fpInstance = nullptr; //------------------------------------------------------------------------------------------------------------------------------------- // -CbmStsTrackerIF::CbmStsTrackerIF() : FairTask("CbmStsTrackerIF") +CbmStsTrackingInterface::CbmStsTrackingInterface() : FairTask("CbmStsTrackingInterface") { if (!fpInstance) { fpInstance = this; } } //------------------------------------------------------------------------------------------------------------------------------------- // -CbmStsTrackerIF::~CbmStsTrackerIF() +CbmStsTrackingInterface::~CbmStsTrackingInterface() { if (fpInstance == this) { fpInstance = nullptr; } } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetTimeResolution(int /*stationId*/) const { return 5.; } +double CbmStsTrackingInterface::GetTimeResolution(int /*stationId*/) const { return 5.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetZ(int stationId) const -{ - return CbmStsSetup::Instance()->GetStation(stationId)->GetZ(); +double CbmStsTrackingInterface::GetZ(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetZ(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetXmax(int stationId) const -{ - return CbmStsSetup::Instance()->GetStation(stationId)->GetXmax(); +double CbmStsTrackingInterface::GetXmax(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetXmax(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetYmax(int stationId) const -{ - return CbmStsSetup::Instance()->GetStation(stationId)->GetYmax(); +double CbmStsTrackingInterface::GetYmax(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetYmax(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetRmin(int /*stationId*/) const { return 0.; } +double CbmStsTrackingInterface::GetRmin(int /*stationId*/) const { return 0.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetRmax(int stationId) const -{ - return GetXmax(stationId) > GetYmax(stationId) ? GetXmax(stationId) : GetYmax(stationId); +double CbmStsTrackingInterface::GetRmax(int stationId) const +{ + return GetXmax(stationId) > GetYmax(stationId) ? GetXmax(stationId) : GetYmax(stationId); } //------------------------------------------------------------------------------------------------------------------------------------- // -int CbmStsTrackerIF::GetNtrackingStations() const -{ - return CbmStsSetup::Instance()->GetNofStations(); -} +int CbmStsTrackingInterface::GetNtrackingStations() const { return CbmStsSetup::Instance()->GetNofStations(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetThickness(int stationId) const -{ - return CbmStsSetup::Instance()->GetStation(stationId)->GetSensorD(); +double CbmStsTrackingInterface::GetThickness(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetSensorD(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetRadLength(int stationId) const -{ - return CbmStsSetup::Instance()->GetStation(stationId)->GetRadLength(); +double CbmStsTrackingInterface::GetRadLength(int stationId) const +{ + return CbmStsSetup::Instance()->GetStation(stationId)->GetRadLength(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetStripsStereoAngleFront(int stationId) const -{ +double CbmStsTrackingInterface::GetStripsStereoAngleFront(int stationId) const +{ auto station = CbmStsSetup::Instance()->GetStation(stationId); return station->GetSensorRotation() + station->GetSensorStereoAngle(0) * TMath::Pi() / 180.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetStripsStereoAngleBack(int stationId) const -{ +double CbmStsTrackingInterface::GetStripsStereoAngleBack(int stationId) const +{ auto station = CbmStsSetup::Instance()->GetStation(stationId); return station->GetSensorRotation() + station->GetSensorStereoAngle(1) * TMath::Pi() / 180.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetStripsSpatialRmsFront(int stationId) const +double CbmStsTrackingInterface::GetStripsSpatialRmsFront(int stationId) const { auto station = CbmStsSetup::Instance()->GetStation(stationId); return station->GetSensorPitch(0) / TMath::Sqrt(12.); @@ -119,7 +120,7 @@ double CbmStsTrackerIF::GetStripsSpatialRmsFront(int stationId) const //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmStsTrackerIF::GetStripsSpatialRmsBack(int stationId) const +double CbmStsTrackingInterface::GetStripsSpatialRmsBack(int stationId) const { auto station = CbmStsSetup::Instance()->GetStation(stationId); return station->GetSensorPitch(0) / TMath::Sqrt(12.); @@ -127,50 +128,56 @@ double CbmStsTrackerIF::GetStripsSpatialRmsBack(int stationId) const //------------------------------------------------------------------------------------------------------------------------------------- // -bool CbmStsTrackerIF::IsTimeInfoProvided(int /*stationId*/) const { return true; } +bool CbmStsTrackingInterface::IsTimeInfoProvided(int /*stationId*/) const { return true; } //------------------------------------------------------------------------------------------------------------------------------------- // -InitStatus CbmStsTrackerIF::Init() +InitStatus CbmStsTrackingInterface::Init() { - LOG(info) << "\033[1;33mCALL CbmStsTrackerIF::Init()\033[0m"; + LOG(info) << "\033[1;33mCALL CbmStsTrackingInterface::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 CbmStsTrackerIF::ReInit() +InitStatus CbmStsTrackingInterface::ReInit() { - LOG(info) << "\033[1;33mCALL CbmStsTrackerIF::ReInit()\033[0m"; + LOG(info) << "\033[1;33mCALL CbmStsTrackingInterface::ReInit()\033[0m"; this->SetParContainers(); return Init(); } //------------------------------------------------------------------------------------------------------------------------------------- // -void CbmStsTrackerIF::SetParContainers() +void CbmStsTrackingInterface::SetParContainers() { - auto runtimeDb = FairRunAna::Instance()->GetRuntimeDb(); + 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")); - if (!fStsParSetModule) { LOG(fatal) << "CbmStsTrackerIF::SetParContainers: error accessing to CbmStsParSetModule container"; } - if (!fStsParSetSensor) { LOG(fatal) << "CbmStsTrackerIF::SetParContainers: error accessing to CbmStsParSetSensor container"; } - if (!fStsParSetSensorCond) { LOG(fatal) << "CbmStsTrackerIF::SetParContainers: error accessing to CbmStsParSetSensorCond container"; } + if (!fStsParSetModule) { + LOG(fatal) << "CbmStsTrackingInterface::SetParContainers: error accessing to CbmStsParSetModule container"; + } + if (!fStsParSetSensor) { + LOG(fatal) << "CbmStsTrackingInterface::SetParContainers: error accessing to CbmStsParSetSensor container"; + } + if (!fStsParSetSensorCond) { + LOG(fatal) << "CbmStsTrackingInterface::SetParContainers: error accessing to CbmStsParSetSensorCond container"; + } } //------------------------------------------------------------------------------------------------------------------------------------- diff --git a/reco/KF/CbmStsTrackerIF.h b/reco/KF/CbmStsTrackingInterface.h similarity index 78% rename from reco/KF/CbmStsTrackerIF.h rename to reco/KF/CbmStsTrackingInterface.h index 183ac40a60..095990c093 100644 --- a/reco/KF/CbmStsTrackerIF.h +++ b/reco/KF/CbmStsTrackingInterface.h @@ -3,35 +3,36 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmStsTrackerIF.h + * @file CbmStsTrackingInterface.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 CbmStsTrackerIF_h -#define CbmStsTrackerIF_h 1 +#ifndef CbmStsTrackingInterface_h +#define CbmStsTrackingInterface_h 1 #include "CbmStsParSetModule.h" #include "CbmStsParSetSensor.h" #include "CbmStsParSetSensorCond.h" #include "CbmStsSetup.h" -#include "L1TrackerInterfaceBase.h" +#include "CbmTrackingDetectorInterfaceBase.h" + #include "FairTask.h" #include <iostream> -/// Class CbmStsTrackerIF is a CbmL1 subtask, which provides necessary methods for L1 tracker +/// Class CbmStsTrackingInterface is a CbmL1 subtask, which provides necessary methods for L1 tracker /// to access the geometry and dataflow settings. -/// -class CbmStsTrackerIF: public FairTask, public L1TrackerInterfaceBase { +/// +class CbmStsTrackingInterface : public FairTask, public CbmTrackingDetectorInterfaceBase { public: /// Default constructor - CbmStsTrackerIF(); + CbmStsTrackingInterface(); /// Destructor - ~CbmStsTrackerIF(); + ~CbmStsTrackingInterface(); /// FairTask: Init method InitStatus Init(); @@ -39,8 +40,8 @@ public: /// FairTask: ReInit method InitStatus ReInit(); - /// Gets pointer to the instance of the CbmStsTrackerIF class - static CbmStsTrackerIF* Instance() { return fpInstance; } + /// Gets pointer to the instance of the CbmStsTrackingInterface class + static CbmStsTrackingInterface* Instance() { return fpInstance; } /// Gets actual number of the tracking stations, provided by the current geometry setup int GetNtrackingStations() const; @@ -59,7 +60,7 @@ public: /// \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; - + /// Gets max size of a station 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] @@ -88,12 +89,12 @@ public: /// Gets front strips stereo angle /// \param stationId Tracking 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; + double GetStripsStereoAngleFront(int stationId) const; /// Gets back strips stereo angle /// \param stationId Tracking 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; + double GetStripsStereoAngleBack(int stationId) const; /// Gets spatial resolution (RMS) for front strips /// \param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) @@ -109,26 +110,24 @@ public: /// \param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) /// \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 - CbmStsTrackerIF(const CbmStsTrackerIF&) = delete; - CbmStsTrackerIF(CbmStsTrackerIF&&) = delete; - CbmStsTrackerIF& operator=(const CbmStsTrackerIF&) = delete; - CbmStsTrackerIF& operator=(CbmStsTrackerIF&&) = delete; + CbmStsTrackingInterface(const CbmStsTrackingInterface&) = delete; + CbmStsTrackingInterface(CbmStsTrackingInterface&&) = delete; + CbmStsTrackingInterface& operator=(const CbmStsTrackingInterface&) = delete; + CbmStsTrackingInterface& operator=(CbmStsTrackingInterface&&) = delete; private: - static CbmStsTrackerIF* fpInstance; + static CbmStsTrackingInterface* fpInstance; - CbmStsParSetSensor* fStsParSetSensor {nullptr}; ///< + CbmStsParSetSensor* fStsParSetSensor {nullptr}; ///< CbmStsParSetSensorCond* fStsParSetSensorCond {nullptr}; ///< - CbmStsParSetModule* fStsParSetModule {nullptr}; ///< - - ClassDef(CbmStsTrackerIF, 0); - + CbmStsParSetModule* fStsParSetModule {nullptr}; ///< + ClassDef(CbmStsTrackingInterface, 0); }; -#endif // CbmStsTrackerIF +#endif // CbmStsTrackingInterface diff --git a/reco/KF/CbmTrackerDetInitializer.h b/reco/KF/CbmTrackerDetInitializer.h deleted file mode 100644 index 2d4f76a066..0000000000 --- a/reco/KF/CbmTrackerDetInitializer.h +++ /dev/null @@ -1,58 +0,0 @@ -/* 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 CbmMvdTrackerIF; -class CbmStsTrackerIF; -class CbmMuchTrackerIF; -class CbmTrdTrackerIF; - -/// 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 and mvd will be initialized) - 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; - - // Accessors for the tracker interfaces - CbmMvdTrackerIF* GetMvdTrackerIF() { return fpMvdTrackerIF; } - CbmStsTrackerIF* GetStsTrackerIF() { return fpStsTrackerIF; } - CbmMuchTrackerIF* GetMuchTrackerIF() { return fpMuchTrackerIF; } - -private: - static CbmTrackerDetInitializer* fpInstance; ///< Instance of the class - - CbmMvdTrackerIF* fpMvdTrackerIF {nullptr}; ///< Instance of the MVD tracker interface - CbmStsTrackerIF* fpStsTrackerIF {nullptr}; ///< Instance of the STS tracker interface - CbmMuchTrackerIF* fpMuchTrackerIF {nullptr}; ///< Instance of the MuCh tracker interface - CbmTrdTrackerIF* fpTrdTrackerIF {nullptr}; ///< Instance of the TRD tracker interface - - ClassDef(CbmTrackerDetInitializer, 0); -}; - -#endif // bmTrackerDetInitializer_h diff --git a/reco/KF/L1TrackerInterfaceBase.h b/reco/KF/CbmTrackingDetectorInterfaceBase.h similarity index 63% rename from reco/KF/L1TrackerInterfaceBase.h rename to reco/KF/CbmTrackingDetectorInterfaceBase.h index 17a3938674..e78c7f2146 100644 --- a/reco/KF/L1TrackerInterfaceBase.h +++ b/reco/KF/CbmTrackingDetectorInterfaceBase.h @@ -3,89 +3,89 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file L1TrackerInterfaceBase.h + * @file CbmTrackingDetectorInterfaceBase.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 +#ifndef CbmTrackingDetectorInterfaceBase_h +#define CbmTrackingDetectorInterfaceBase_h 1 /// Abstract class, which should be inherited by every detecting subsystem interface class /// -class L1TrackerInterfaceBase { +class CbmTrackingDetectorInterfaceBase { public: /// Virtual destructor - virtual ~L1TrackerInterfaceBase() {} + virtual ~CbmTrackingDetectorInterfaceBase() {} /// Gets actual number of stations, provided by the current geometry setup virtual int GetNtrackingStations() const = 0; /// Gets time resolution for a station - /// \param stationId Station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) + /// \param stationId Tracking 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]) + /// \param stationId Tracking 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]) + /// \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] 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]) + /// \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] 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]) + /// \param stationId Tracking 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]) + /// \param stationId Tracking 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]) + /// \param stationId Tracking 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]) + /// \param stationId Tracking 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]) + /// \param stationId Tracking 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; + 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]) + /// \param stationId Tracking 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; + 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]) + /// \param stationId Tracking 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]) + /// \param stationId Tracking 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 + /// \param stationId Tracking 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 +#endif // CbmTrackingDetectorInterfaceBase_h diff --git a/reco/KF/CbmTrackerDetInitializer.cxx b/reco/KF/CbmTrackingDetectorInterfaceInit.cxx similarity index 58% rename from reco/KF/CbmTrackerDetInitializer.cxx rename to reco/KF/CbmTrackingDetectorInterfaceInit.cxx index d11a6fb039..318f218854 100644 --- a/reco/KF/CbmTrackerDetInitializer.cxx +++ b/reco/KF/CbmTrackingDetectorInterfaceInit.cxx @@ -3,33 +3,34 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmTrackerDetInitializer.cxx + * @file CbmTrackingDetectorInterfaceInit.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 "CbmMuchTrackerIF.h" -#include "CbmMvdTrackerIF.h" +#include "CbmTrackingDetectorInterfaceInit.h" + +#include "CbmMuchTrackingInterface.h" +#include "CbmMvdTrackingInterface.h" #include "CbmSetup.h" -#include "CbmStsTrackerIF.h" -#include "CbmTrackerDetInitializer.h" -#include "CbmTrdTrackerIF.h" +#include "CbmStsTrackingInterface.h" +#include "CbmTrdTrackingInterface.h" + +#include "FairTask.h" #include <FairLogger.h> -ClassImp(CbmTrackerDetInitializer) +ClassImp(CbmTrackingDetectorInterfaceInit) -CbmTrackerDetInitializer* CbmTrackerDetInitializer::fpInstance = nullptr; + CbmTrackingDetectorInterfaceInit* CbmTrackingDetectorInterfaceInit::fpInstance = nullptr; //------------------------------------------------------------------------------------------------------------------------------------- // -CbmTrackerDetInitializer::CbmTrackerDetInitializer() -: FairTask("CbmTrackerDetInitializer") +CbmTrackingDetectorInterfaceInit::CbmTrackingDetectorInterfaceInit() : FairTask("CbmTrackingDetectorInterfaceInit") { - if (!fpInstance) { - fpInstance = this; - + if (!fpInstance) { + fpInstance = this; + /** Check presence of the desired detectors **/ bool useMvd = CbmSetup::Instance()->IsActive(ECbmModuleId::kMvd); bool useSts = CbmSetup::Instance()->IsActive(ECbmModuleId::kSts); @@ -38,26 +39,25 @@ CbmTrackerDetInitializer::CbmTrackerDetInitializer() bool useTof = CbmSetup::Instance()->IsActive(ECbmModuleId::kTof); /** Invoke the detector interfaces **/ - if (useMvd) { fpMvdTrackerIF = new CbmMvdTrackerIF(); } - if (useSts) { fpStsTrackerIF = new CbmStsTrackerIF(); } - if (useMuch) { fpMuchTrackerIF = new CbmMuchTrackerIF(); } - if (useTrd) { fpTrdTrackerIF = new CbmTrdTrackerIF(); } + if (useMvd) { fpMvdTrackingInterface = new CbmMvdTrackingInterface(); } + if (useSts) { fpStsTrackingInterface = new CbmStsTrackingInterface(); } + if (useMuch) { fpMuchTrackingInterface = new CbmMuchTrackingInterface(); } + if (useTrd) { fpTrdTrackingInterface = new CbmTrdTrackingInterface(); } /** Add subtasks - tracker detector interfaces **/ - if (useMvd) { this->Add(fpMvdTrackerIF); } - if (useSts) { this->Add(fpStsTrackerIF); } - if (useMuch) { this->Add(fpMuchTrackerIF); } - if (useTrd) { this->Add(fpTrdTrackerIF); } + if (useMvd) { this->Add(fpMvdTrackingInterface); } + if (useSts) { this->Add(fpStsTrackingInterface); } + if (useMuch) { this->Add(fpMuchTrackingInterface); } + if (useTrd) { this->Add(fpTrdTrackingInterface); } } } //------------------------------------------------------------------------------------------------------------------------------------- // -CbmTrackerDetInitializer::~CbmTrackerDetInitializer() +CbmTrackingDetectorInterfaceInit::~CbmTrackingDetectorInterfaceInit() { if (fpInstance == this) { fpInstance = nullptr; } } //------------------------------------------------------------------------------------------------------------------------------------- // - diff --git a/reco/KF/CbmTrackingDetectorInterfaceInit.h b/reco/KF/CbmTrackingDetectorInterfaceInit.h new file mode 100644 index 0000000000..04e5cead71 --- /dev/null +++ b/reco/KF/CbmTrackingDetectorInterfaceInit.h @@ -0,0 +1,59 @@ +/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/*************************************************************************************************** + * @file CbmTrackingDetectorInterfaceInit.h + * @brief FairTask for the tracker detector interfaces initialization (declaration) + * @since 31.05.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***************************************************************************************************/ + +#ifndef CbmTrackingDetectorInterfaceInit_h +#define CbmTrackingDetectorInterfaceInit_h 1 + +class FairTask; +class CbmMvdTrackingInterface; +class CbmStsTrackingInterface; +class CbmMuchTrackingInterface; +class CbmTrdTrackingInterface; + +/// Class CbmTrackingDetectorInterfaceInit implements a task for the tracking detector interfaces initialization. +/// The tracking detector interfaces are added as subtasks. The CbmTrackingDetectorInterfaceInit class instance is to +/// be added as a task to the FairRunAna instance prior to the CbmL1 task. +/// +class CbmTrackingDetectorInterfaceInit : public FairTask { +public: + /// Default constructor (only sts and mvd will be initialized) + CbmTrackingDetectorInterfaceInit(); + + /// Destructor + ~CbmTrackingDetectorInterfaceInit(); + + /// Returns a pointer to the class instance + static CbmTrackingDetectorInterfaceInit* Instance() { return fpInstance; } + + // Copy and move of the instance is prohibited + CbmTrackingDetectorInterfaceInit(const CbmTrackingDetectorInterfaceInit&) = delete; + CbmTrackingDetectorInterfaceInit(CbmTrackingDetectorInterfaceInit&&) = delete; + CbmTrackingDetectorInterfaceInit& operator=(const CbmTrackingDetectorInterfaceInit&) = delete; + CbmTrackingDetectorInterfaceInit& operator=(CbmTrackingDetectorInterfaceInit&&) = delete; + + // Accessors for the tracker interfaces + CbmMvdTrackingInterface* GetMvdTrackingInterface() { return fpMvdTrackingInterface; } + CbmStsTrackingInterface* GetStsTrackingInterface() { return fpStsTrackingInterface; } + CbmMuchTrackingInterface* GetMuchTrackingInterface() { return fpMuchTrackingInterface; } + CbmTrdTrackingInterface* GetTrdTrackingInterface() { return fpTrdTrackingInterface; } + +private: + static CbmTrackingDetectorInterfaceInit* fpInstance; ///< Instance of the class + + CbmMvdTrackingInterface* fpMvdTrackingInterface {nullptr}; ///< Instance of the MVD tracker interface + CbmStsTrackingInterface* fpStsTrackingInterface {nullptr}; ///< Instance of the STS tracker interface + CbmMuchTrackingInterface* fpMuchTrackingInterface {nullptr}; ///< Instance of the MuCh tracker interface + CbmTrdTrackingInterface* fpTrdTrackingInterface {nullptr}; ///< Instance of the TRD tracker interface + + ClassDef(CbmTrackingDetectorInterfaceInit, 0); +}; + +#endif // bmTrackerDetInitializer_h diff --git a/reco/KF/CbmTrdTrackerIF.cxx b/reco/KF/CbmTrdTrackingInterface.cxx similarity index 67% rename from reco/KF/CbmTrdTrackerIF.cxx rename to reco/KF/CbmTrdTrackingInterface.cxx index 0478b18b43..db6481a374 100644 --- a/reco/KF/CbmTrdTrackerIF.cxx +++ b/reco/KF/CbmTrdTrackingInterface.cxx @@ -3,85 +3,72 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmTrdTrackerIF.cxx + * @file CbmTrdTrackingInterface.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 "CbmTrdTrackerIF.h" +#include "CbmTrdTrackingInterface.h" + #include "FairDetector.h" #include "FairRunAna.h" #include <FairLogger.h> -#include "TMath.h" + #include "TFile.h" #include "TGeoManager.h" +#include "TMath.h" #include "TString.h" -ClassImp(CbmTrdTrackerIF) +ClassImp(CbmTrdTrackingInterface) -CbmTrdTrackerIF* CbmTrdTrackerIF::fpInstance = nullptr; + CbmTrdTrackingInterface* CbmTrdTrackingInterface::fpInstance = nullptr; //------------------------------------------------------------------------------------------------------------------------------------- // -CbmTrdTrackerIF::CbmTrdTrackerIF() : FairTask("CbmTrdTrackerIF") +CbmTrdTrackingInterface::CbmTrdTrackingInterface() : FairTask("CbmTrdTrackingInterface") { if (!fpInstance) { fpInstance = this; } } //------------------------------------------------------------------------------------------------------------------------------------- // -CbmTrdTrackerIF::~CbmTrdTrackerIF() +CbmTrdTrackingInterface::~CbmTrdTrackingInterface() { if (fpInstance == this) { fpInstance = nullptr; } } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetTimeResolution(int /*stationId*/) const { return 10.; } +double CbmTrdTrackingInterface::GetTimeResolution(int /*stationId*/) const { return 10.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetZ(int stationId) const -{ - return GetTrdModulePar(stationId)->GetZ(); -} +double CbmTrdTrackingInterface::GetZ(int stationId) const { return GetTrdModulePar(stationId)->GetZ(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetXmax(int stationId) const -{ - return GetTrdModulePar(stationId)->GetSizeX(); -} +double CbmTrdTrackingInterface::GetXmax(int stationId) const { return GetTrdModulePar(stationId)->GetSizeX(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetYmax(int stationId) const -{ - return GetTrdModulePar(stationId)->GetSizeY(); -} +double CbmTrdTrackingInterface::GetYmax(int stationId) const { return GetTrdModulePar(stationId)->GetSizeY(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetRmin(int /*stationId*/) const -{ - return 0.; -} +double CbmTrdTrackingInterface::GetRmin(int /*stationId*/) const { return 0.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetRmax(int stationId) const -{ - return 2. * this->GetXmax(stationId); -} +double CbmTrdTrackingInterface::GetRmax(int stationId) const { return 2. * this->GetXmax(stationId); } //------------------------------------------------------------------------------------------------------------------------------------- // -int CbmTrdTrackerIF::GetNtrackingStations() const +int CbmTrdTrackingInterface::GetNtrackingStations() const { // NOTE: For TRD detector subsystem, a TRD layer is assigned as a tracking station: int nTrdLayers = 0; - auto topNodes = gGeoManager->GetTopNode()->GetNodes(); + auto topNodes = gGeoManager->GetTopNode()->GetNodes(); for (int iTopNode = 0; iTopNode < topNodes->GetEntriesFast(); ++iTopNode) { auto topNode = static_cast<TGeoNode*>(topNodes->At(iTopNode)); if (TString(topNode->GetName()).Contains("trd")) { @@ -97,62 +84,47 @@ int CbmTrdTrackerIF::GetNtrackingStations() const //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetThickness(int stationId) const -{ - return 2. * GetTrdModulePar(stationId)->GetSizeZ(); +double CbmTrdTrackingInterface::GetThickness(int stationId) const +{ + return 2. * GetTrdModulePar(stationId)->GetSizeZ(); } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetRadLength(int /*stationId*/) const -{ - return 1.6; -} +double CbmTrdTrackingInterface::GetRadLength(int /*stationId*/) const { return 1.6; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetStripsStereoAngleFront(int /*stationId*/) const -{ - return 0.; -} +double CbmTrdTrackingInterface::GetStripsStereoAngleFront(int /*stationId*/) const { return 0.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetStripsStereoAngleBack(int /*stationId*/) const -{ - return TMath::Pi() / 2.; -} +double CbmTrdTrackingInterface::GetStripsStereoAngleBack(int /*stationId*/) const { return TMath::Pi() / 2.; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetStripsSpatialRmsFront(int /*stationId*/) const -{ - return 0.15; -} +double CbmTrdTrackingInterface::GetStripsSpatialRmsFront(int /*stationId*/) const { return 0.15; } //------------------------------------------------------------------------------------------------------------------------------------- // -double CbmTrdTrackerIF::GetStripsSpatialRmsBack(int /*stationId*/) const -{ - return 0.15; -} +double CbmTrdTrackingInterface::GetStripsSpatialRmsBack(int /*stationId*/) const { return 0.15; } //------------------------------------------------------------------------------------------------------------------------------------- // -bool CbmTrdTrackerIF::IsTimeInfoProvided(int /*stationId*/) const { return true; } +bool CbmTrdTrackingInterface::IsTimeInfoProvided(int /*stationId*/) const { return true; } //------------------------------------------------------------------------------------------------------------------------------------- // -InitStatus CbmTrdTrackerIF::Init() +InitStatus CbmTrdTrackingInterface::Init() { - // Check access to TRD modules + // Check access to TRD modules for (int iSt = 0; iSt < this->GetNtrackingStations(); ++iSt) { if (!dynamic_cast<CbmTrdParModDigi*>(fTrdDigiPar->GetModulePar(fTrdDigiPar->GetModuleId(iSt)))) { - LOG(fatal) << "CbmTrdTrackerIF::Init: error accessing the TRD tracking station " << iSt - << " (failed dynamic cast to CbmTrdParModDigi)"; - } + LOG(fatal) << "CbmTrdTrackingInterface::Init: error accessing the TRD tracking station " << iSt + << " (failed dynamic cast to CbmTrdParModDigi)"; + } } return kSUCCESS; @@ -160,7 +132,7 @@ InitStatus CbmTrdTrackerIF::Init() //------------------------------------------------------------------------------------------------------------------------------------- // -InitStatus CbmTrdTrackerIF::ReInit() +InitStatus CbmTrdTrackingInterface::ReInit() { this->SetParContainers(); return Init(); @@ -168,11 +140,13 @@ InitStatus CbmTrdTrackerIF::ReInit() //------------------------------------------------------------------------------------------------------------------------------------- // -void CbmTrdTrackerIF::SetParContainers() +void CbmTrdTrackingInterface::SetParContainers() { auto runtimeDb = FairRunAna::Instance()->GetRuntimeDb(); - fTrdDigiPar = dynamic_cast<CbmTrdParSetDigi*>(runtimeDb->getContainer("CbmTrdParSetDigi")); - if (!fTrdDigiPar) { LOG(fatal) << "CbmTrdTrackerIF::SetParContainers: error accessing to CbmTrdParSetDigi container"; } + fTrdDigiPar = dynamic_cast<CbmTrdParSetDigi*>(runtimeDb->getContainer("CbmTrdParSetDigi")); + if (!fTrdDigiPar) { + LOG(fatal) << "CbmTrdTrackingInterface::SetParContainers: error accessing to CbmTrdParSetDigi container"; + } } //------------------------------------------------------------------------------------------------------------------------------------- diff --git a/reco/KF/CbmTrdTrackerIF.h b/reco/KF/CbmTrdTrackingInterface.h similarity index 80% rename from reco/KF/CbmTrdTrackerIF.h rename to reco/KF/CbmTrdTrackingInterface.h index a7bac2b465..d07a848d9a 100644 --- a/reco/KF/CbmTrdTrackerIF.h +++ b/reco/KF/CbmTrdTrackingInterface.h @@ -3,36 +3,38 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ /*************************************************************************************************** - * @file CbmTrdTrackerIF.h + * @file CbmTrdTrackingInterface.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 CbmTrdTrackerIF_h -#define CbmTrdTrackerIF_h 1 +#ifndef CbmTrdTrackingInterface_h +#define CbmTrdTrackingInterface_h 1 +#include "CbmTrackingDetectorInterfaceBase.h" #include "CbmTrdParModDigi.h" #include "CbmTrdParSetDigi.h" -#include "L1TrackerInterfaceBase.h" + #include "FairTask.h" +#include "TString.h" + #include <iostream> #include <vector> -#include "TString.h" -/// Class CbmTrdTrackerIF is a CbmL1 subtask, which provides necessary methods for L1 tracker +/// Class CbmTrdTrackingInterface is a CbmL1 subtask, which provides necessary methods for L1 tracker /// to access the geometry and dataflow settings. /// /// NOTE: For TRD one tracking station is a TRD module! /// -class CbmTrdTrackerIF: public FairTask, public L1TrackerInterfaceBase { +class CbmTrdTrackingInterface : public FairTask, public CbmTrackingDetectorInterfaceBase { public: /// Default constructor - CbmTrdTrackerIF(); + CbmTrdTrackingInterface(); /// Destructor - ~CbmTrdTrackerIF(); + ~CbmTrdTrackingInterface(); /// FairTask: Init method InitStatus Init(); @@ -40,8 +42,8 @@ public: /// FairTask: ReInit method InitStatus ReInit(); - /// Gets pointer to the instance of the CbmTrdTrackerIF - static CbmTrdTrackerIF* Instance() { return fpInstance; } + /// Gets pointer to the instance of the CbmTrdTrackingInterface + static CbmTrdTrackingInterface* Instance() { return fpInstance; } /// Gets actual number of tracking stations, provided by the current geometry setup int GetNtrackingStations() const; @@ -60,7 +62,7 @@ public: /// \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; - + /// Gets max size of a station 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] @@ -89,12 +91,12 @@ public: /// Gets front strips stereo angle /// \param stationId Tracking 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; + double GetStripsStereoAngleFront(int stationId) const; /// Gets back strips stereo angle /// \param stationId Tracking 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; + double GetStripsStereoAngleBack(int stationId) const; /// Gets spatial resolution (RMS) for front strips /// \param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) @@ -110,30 +112,31 @@ public: /// \param stationId Tracking station ID in the setup (NOTE: must be in range [0..GetNstations()-1]) /// \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 - CbmTrdTrackerIF(const CbmTrdTrackerIF&) = delete; - CbmTrdTrackerIF(CbmTrdTrackerIF&&) = delete; - CbmTrdTrackerIF& operator=(const CbmTrdTrackerIF&) = delete; - CbmTrdTrackerIF& operator=(CbmTrdTrackerIF&&) = delete; + CbmTrdTrackingInterface(const CbmTrdTrackingInterface&) = delete; + CbmTrdTrackingInterface(CbmTrdTrackingInterface&&) = delete; + CbmTrdTrackingInterface& operator=(const CbmTrdTrackingInterface&) = delete; + CbmTrdTrackingInterface& operator=(CbmTrdTrackingInterface&&) = delete; private: /// Gets pointer to the TRD module /// \param moduleId Id of the Trd module /// \return Pointer to the particular CbmTrdParModDigi object - __attribute__((always_inline)) CbmTrdParModDigi* GetTrdModulePar(int moduleId) const { - return static_cast<CbmTrdParModDigi*>(fTrdDigiPar->GetModulePar(fTrdDigiPar->GetModuleId(moduleId))); + __attribute__((always_inline)) CbmTrdParModDigi* GetTrdModulePar(int moduleId) const + { + return static_cast<CbmTrdParModDigi*>(fTrdDigiPar->GetModulePar(fTrdDigiPar->GetModuleId(moduleId))); } - static CbmTrdTrackerIF* fpInstance; ///< Instance of the class + static CbmTrdTrackingInterface* fpInstance; ///< Instance of the class CbmTrdParSetDigi* fTrdDigiPar {nullptr}; //CbmTrdParModDigi* fTrdModuleInfo {nullptr}; - ClassDef(CbmTrdTrackerIF, 0); + ClassDef(CbmTrdTrackingInterface, 0); }; -#endif // CbmTrdTrackerIF +#endif // CbmTrdTrackingInterface diff --git a/reco/KF/KF.cmake b/reco/KF/KF.cmake index 667ac72c63..a218226b8b 100644 --- a/reco/KF/KF.cmake +++ b/reco/KF/KF.cmake @@ -67,11 +67,11 @@ CbmKFUMeasurement.cxx CbmKFVertexInterface.cxx #### Tracker interfaces (will be moved to core/detector/*) ################ -CbmStsTrackerIF.cxx # TMP: Should be placed to the detector directory! -CbmMvdTrackerIF.cxx # TMP: Should be placed to the detector directory! -CbmMuchTrackerIF.cxx # TMP: Should be placed to the detector directory! -CbmTrdTrackerIF.cxx # TMP: Should be placed to the detector directory! -CbmTrackerDetInitializer.cxx +CbmStsTrackingInterface.cxx # TMP: Should be placed to the detector directory! +CbmMvdTrackingInterface.cxx # TMP: Should be placed to the detector directory! +CbmMuchTrackingInterface.cxx # TMP: Should be placed to the detector directory! +CbmTrdTrackingInterface.cxx # TMP: Should be placed to the detector directory! +CbmTrackingDetectorInterfaceInit.cxx ########################################################################### #Interface/CbmEcalTrackExtrapolationKF.cxx @@ -114,12 +114,12 @@ CbmKFUMeasurement.h CbmKFVertexInterface.h #### Tracker interfaces (will be moved to core/detector/*) ################ -CbmStsTrackerIF.h # TMP: Should be placed to the detector directory! -CbmMvdTrackerIF.h # TMP: Should be placed to the detector directory! -CbmMuchTrackerIF.h # TMP: Should be placed to the detector directory! -CbmTrdTrackerIF.h # TMP: Should be placed to the detector directory! -CbmTrackerDetInitializer.h -L1TrackerInterfaceBase.h # TMP: Should be placed to the detector directory! +CbmStsTrackingInterface.h # TMP: Should be placed to the detector directory! +CbmMvdTrackingInterface.h # TMP: Should be placed to the detector directory! +CbmMuchTrackingInterface.h # TMP: Should be placed to the detector directory! +CbmTrdTrackingInterface.h # TMP: Should be placed to the detector directory! +CbmTrackingDetectorInterfaceBase.h +CbmTrackingDetectorInterfaceInit.h ########################################################################### #Interface/CbmEcalTrackExtrapolationKF.h diff --git a/reco/KF/KFLinkDef.h b/reco/KF/KFLinkDef.h index a8f93ff184..7f3885f0cf 100644 --- a/reco/KF/KFLinkDef.h +++ b/reco/KF/KFLinkDef.h @@ -37,11 +37,11 @@ #pragma link C++ class CbmTofTrackFitterKF + ; #pragma link C++ class CbmGlobalTrackFitterKF + ; -#pragma link C++ class CbmTrackerDetInitializer + ; -#pragma link C++ class CbmMvdTrackerIF + ; -#pragma link C++ class CbmStsTrackerIF + ; -#pragma link C++ class CbmMuchTrackerIF + ; -#pragma link C++ class CbmTrdTrackerIF + ; +#pragma link C++ class CbmTrackingDetectorInterfaceInit + ; +#pragma link C++ class CbmMvdTrackingInterface + ; +#pragma link C++ class CbmStsTrackingInterface + ; +#pragma link C++ class CbmMuchTrackingInterface + ; +#pragma link C++ class CbmTrdTrackingInterface + ; //KFQA /* #pragma link C++ class CbmKFPartEfficiencies + ; diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 596035d88e..537d43dbee 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -24,11 +24,11 @@ #include "CbmKFVertex.h" #include "CbmL1PFFitter.h" #include "CbmMCDataManager.h" +#include "CbmMuchTrackingInterface.h" +#include "CbmMvdTrackingInterface.h" #include "CbmSetup.h" -#include "CbmMvdTrackerIF.h" -#include "CbmStsTrackerIF.h" -#include "CbmMuchTrackerIF.h" -#include "CbmTrdTrackerIF.h" +#include "CbmStsTrackingInterface.h" +#include "CbmTrdTrackingInterface.h" #include <boost/filesystem.hpp> // TODO: include of CbmSetup.h creates problems on Mac @@ -39,7 +39,7 @@ #include "CbmTofCell.h" #include "CbmTofDigiBdfPar.h" #include "CbmTofDigiPar.h" // in tof/TofParam -#include "CbmTrackerDetInitializer.h" +#include "CbmTrackingDetectorInterfaceInit.h" #include "FairEventHeader.h" #include "FairRunAna.h" @@ -85,16 +85,11 @@ ClassImp(CbmL1) CbmL1* CbmL1::fInstance = 0; -CbmL1::CbmL1(): CbmL1("L1") {} +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_) @@ -103,10 +98,11 @@ CbmL1::CbmL1( { 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 before the KF and L1 task:\n" - << "\033[1;30mrun->AddTask(new CbmTrackerDetInitializer());\033[0m"; + + if (!CbmTrackingDetectorInterfaceInit::Instance()) { + LOG(fatal) << "CbmL1: CbmTrackingDetectorInterfaceInit instance was not found. Please, add it as a task to your " + "reco macro before the KF and L1 task:\n" + << "\033[1;30mrun->AddTask(new CbmTrackingDetectorInterfaceInit());\033[0m"; } } @@ -146,7 +142,7 @@ InitStatus CbmL1::ReInit() InitStatus CbmL1::Init() { - + fData = new L1AlgoInputData(); if (fVerbose > 1) { @@ -378,7 +374,7 @@ InitStatus CbmL1::Init() ** Target field initialization ** *********************************/ - fpInitManager->InitTargetField(/*zStep = */ 2.5 /*cm*/); // Replace zStep -> sizeZfieldRegion = 2 * zStep (TODO) + fpInitManager->InitTargetField(/*zStep = */ 2.5 /*cm*/); // Replace zStep -> sizeZfieldRegion = 2 * zStep (TODO) /************************************** ** ** @@ -414,7 +410,7 @@ InitStatus CbmL1::Init() // const CbmMuchStation* station = fGeoScheme->GetStation(iStation); // int nLayers = station->GetNLayers(); // NMuchStationsGeom += nLayers; - // std::cout << "\033[1;31mMUCH: station " << iStation << " layer\033[0m\n"; + // std::cout << "\033[1;31mMUCH: station " << iStation << " layer\033[0m\n"; // } //} @@ -473,10 +469,10 @@ InitStatus CbmL1::Init() /*** MVD and STS ***/ - auto mvdInterface = CbmMvdTrackerIF::Instance(); - auto stsInterface = CbmStsTrackerIF::Instance(); - auto muchInterface = CbmMuchTrackerIF::Instance(); - auto trdInterface = CbmTrdTrackerIF::Instance(); + auto mvdInterface = CbmMvdTrackingInterface::Instance(); + auto stsInterface = CbmStsTrackingInterface::Instance(); + auto muchInterface = CbmMuchTrackingInterface::Instance(); + auto trdInterface = CbmTrdTrackingInterface::Instance(); NMvdStationsGeom = (fUseMVD) ? mvdInterface->GetNtrackingStations() : 0; NStsStationsGeom = (fUseSTS) ? stsInterface->GetNtrackingStations() : 0; @@ -565,11 +561,8 @@ InitStatus CbmL1::Init() stationInfo.SetMaterialMap(std::move(materialTableMvd[iSt]), correctionMvd); // 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) - ); + (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() << " cm"; @@ -583,7 +576,7 @@ InitStatus CbmL1::Init() stationInfo.SetStationType(0); // STS stationInfo.SetTimeInfo(stsInterface->IsTimeInfoProvided(iSt)); stationInfo.SetTimeResolution(stsInterface->GetTimeResolution(iSt)); - stationInfo.SetFieldStatus(L1Algo::TrackingMode::kMcbm == fTrackingMode? 0 : 1); + stationInfo.SetFieldStatus(L1Algo::TrackingMode::kMcbm == fTrackingMode ? 0 : 1); stationInfo.SetZ(stsInterface->GetZ(iSt)); stationInfo.SetXmax(stsInterface->GetXmax(iSt)); stationInfo.SetYmax(stsInterface->GetYmax(iSt)); @@ -593,11 +586,8 @@ InitStatus CbmL1::Init() stationInfo.SetMaterialMap(std::move(materialTableSts[iSt]), correctionSts); // 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) - ); + (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() << " cm"; @@ -621,11 +611,8 @@ InitStatus CbmL1::Init() stationInfo.SetMaterialMap(std::move(materialTableMuch[iSt]), correctionMuch); // TODO: The CA TF result is dependent from type of geometry settings. Should be understood (S.Zharko) stationInfo.SetFrontBackStripsGeometry( - (fscal) muchInterface->GetStripsStereoAngleFront(iSt), - (fscal) muchInterface->GetStripsSpatialRmsFront(iSt), - (fscal) muchInterface->GetStripsStereoAngleBack(iSt), - (fscal) muchInterface->GetStripsSpatialRmsBack(iSt) - ); + (fscal) muchInterface->GetStripsStereoAngleFront(iSt), (fscal) muchInterface->GetStripsSpatialRmsFront(iSt), + (fscal) muchInterface->GetStripsStereoAngleBack(iSt), (fscal) muchInterface->GetStripsSpatialRmsBack(iSt)); stationInfo.SetTrackingStatus(target.z < stationInfo.GetZdouble() ? true : false); fpInitManager->AddStation(stationInfo); LOG(info) << "- MuCh station " << iSt << " at z = " << stationInfo.GetZdouble() << " cm"; @@ -870,7 +857,7 @@ InitStatus CbmL1::Init() /**********************/ algo->Init(fUseHitErrors, fTrackingMode, fMissingHits); - + /*** Get numbers of active stations ***/ NMvdStations = fpInitManager->GetNstationsActive(L1DetectorID::kMvd); @@ -2093,7 +2080,7 @@ void CbmL1::WriteSIMDKFData() } FileGeo.close(); } -#endif +#endif ///Write Tracks and MC Tracks static int TrNumber = 0; @@ -2181,8 +2168,8 @@ std::vector<L1Material> CbmL1::ReadMaterialBudget(L1DetectorID detectorID) { std::vector<L1Material> result {}; if (fMatBudgetFileName.find(detectorID) != fMatBudgetFileName.end()) { - auto* oldFile = gFile; - auto* 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/CbmL1Performance.cxx b/reco/L1/CbmL1Performance.cxx index e3f8b74ecd..d650160dfb 100644 --- a/reco/L1/CbmL1Performance.cxx +++ b/reco/L1/CbmL1Performance.cxx @@ -1384,10 +1384,12 @@ void CbmL1::TrackFitPerformance() L1Extrapolate(trPar, mc.z, trPar.qp, fld); // add material const int fSta = vHitStore[it->StsHits[0]].iStation; - const int dir = int((mc.z - algo->GetParameters()->GetStation(fSta).z[0]) / fabs(mc.z - algo->GetParameters()->GetStation(fSta).z[0])); + const int dir = int((mc.z - algo->GetParameters()->GetStation(fSta).z[0]) + / fabs(mc.z - algo->GetParameters()->GetStation(fSta).z[0])); // if (abs(mc.z - algo->GetParameters()->GetStation(fSta).z[0]) > 10.) continue; // can't extrapolate on large distance for (int iSta = fSta /*+dir*/; - (iSta >= 0) && (iSta < NStation) && (dir * (mc.z - algo->GetParameters()->GetStation(iSta).z[0]) > 0); iSta += dir) { + (iSta >= 0) && (iSta < NStation) && (dir * (mc.z - algo->GetParameters()->GetStation(iSta).z[0]) > 0); + iSta += dir) { // cout << iSta << " " << dir << endl; fit.L1AddMaterial(trPar, algo->GetParameters()->GetStation(iSta).materialInfo, trPar.qp, 1); if (iSta + dir == NMvdStations - 1) fit.L1AddPipeMaterial(trPar, trPar.qp, 1); @@ -1449,21 +1451,24 @@ void CbmL1::TrackFitPerformance() // add material const int fSta = vHitStore[it->StsHits[0]].iStation; - const int dir = (mc.z - algo->GetParameters()->GetStation(fSta).z[0]) / abs(mc.z - algo->GetParameters()->GetStation(fSta).z[0]); + const int dir = (mc.z - algo->GetParameters()->GetStation(fSta).z[0]) + / abs(mc.z - algo->GetParameters()->GetStation(fSta).z[0]); // if (abs(mc.z - algo->GetParameters()->GetStation(fSta].z[0]) > 10.) continue; // can't extrapolate on large distance for (int iSta = fSta + dir; - (iSta >= 0) && (iSta < NStation) && (dir * (mc.z - algo->GetParameters()->GetStation(iSta).z[0]) > 0); iSta += dir) { + (iSta >= 0) && (iSta < NStation) && (dir * (mc.z - algo->GetParameters()->GetStation(iSta).z[0]) > 0); + iSta += dir) { z[0] = algo->GetParameters()->GetStation(iSta).z[0]; float dz = z[1] - z[0]; - algo->GetParameters()->GetStation(iSta).fieldSlice.GetFieldValue(trPar.x - trPar.tx * dz, trPar.y - trPar.ty * dz, B[0]); + algo->GetParameters()->GetStation(iSta).fieldSlice.GetFieldValue(trPar.x - trPar.tx * dz, + trPar.y - trPar.ty * dz, B[0]); fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]); L1Extrapolate(trPar, algo->GetParameters()->GetStation(iSta).z[0], trPar.qp, fld); fit.L1AddMaterial(trPar, algo->GetParameters()->GetMaterialThickness(iSta, trPar.x, trPar.y), trPar.qp, 1); - fit.EnergyLossCorrection(trPar, algo->GetParameters()->GetMaterialThickness(iSta, trPar.x, trPar.y), trPar.qp, fvec(1.f), - fvec(1.f)); + fit.EnergyLossCorrection(trPar, algo->GetParameters()->GetMaterialThickness(iSta, trPar.x, trPar.y), + trPar.qp, fvec(1.f), fvec(1.f)); if (iSta + dir == NMvdStations - 1) { fit.L1AddPipeMaterial(trPar, trPar.qp, 1); fit.EnergyLossCorrection(trPar, fit.PipeRadThick, trPar.qp, fvec(1.f), fvec(1.f)); @@ -1984,8 +1989,10 @@ void CbmL1::InputPerformance() pullTsts->Fill((sh->GetTime() - mcTime) / sh->GetTimeError()); } else { // errors used in TF - pullXsts->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C00[0])); - pullYsts->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C11[0])); + pullXsts->Fill((hitPos.X() - mcPos.X()) + / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C00[0])); + pullYsts->Fill((hitPos.Y() - mcPos.Y()) + / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C11[0])); } resXsts->Fill((hitPos.X() - mcPos.X()) * 10 * 1000); @@ -2030,8 +2037,10 @@ void CbmL1::InputPerformance() // if (hitErr.X() != 0) pullX->Fill( (hitPos.X() - mcPos.X()) / sh->GetDx() ); // qa errors // if (hitErr.Y() != 0) pullY->Fill( (hitPos.Y() - mcPos.Y()) / sh->GetDy() ); if (hitErr.X() != 0) - pullXmvd->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetParameters()->GetStation(0).XYInfo.C00[0])); // errors used in TF - if (hitErr.Y() != 0) pullYmvd->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetParameters()->GetStation(0).XYInfo.C11[0])); + pullXmvd->Fill((hitPos.X() - mcPos.X()) + / sqrt(algo->GetParameters()->GetStation(0).XYInfo.C00[0])); // errors used in TF + if (hitErr.Y() != 0) + pullYmvd->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetParameters()->GetStation(0).XYInfo.C11[0])); resXmvd->Fill((hitPos.X() - mcPos.X()) * 10 * 1000); resYmvd->Fill((hitPos.Y() - mcPos.Y()) * 10 * 1000); diff --git a/reco/L1/CbmL1ReadEvent.cxx b/reco/L1/CbmL1ReadEvent.cxx index de1b2bcbee..2588913575 100644 --- a/reco/L1/CbmL1ReadEvent.cxx +++ b/reco/L1/CbmL1ReadEvent.cxx @@ -582,7 +582,8 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, // << p.time << " mc " << p.ID << " p " << p.p << endl; TmpHit th; int DetId = 1; - th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetParameters()->GetStation(p.iStation)); + th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, + algo->GetParameters()->GetStation(p.iStation)); tmpHits.push_back(th); nStsHits++; } @@ -743,7 +744,8 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, TmpHit th; int DetId = 2; - th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetParameters()->GetStation(p.iStation)); + th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, + algo->GetParameters()->GetStation(p.iStation)); tmpHits.push_back(th); nMuchHits++; @@ -848,7 +850,8 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, TmpHit th; int DetId = 3; - th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetParameters()->GetStation(p.iStation)); + th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, + algo->GetParameters()->GetStation(p.iStation)); tmpHits.push_back(th); nTrdHits++; } @@ -990,7 +993,8 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength, TmpHit th; int DetId = 4; - th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetParameters()->GetStation(p.iStation)); + th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, + algo->GetParameters()->GetStation(p.iStation)); tmpHits.push_back(th); nTofHits++; diff --git a/reco/L1/L1Algo/L1Algo.cxx b/reco/L1/L1Algo/L1Algo.cxx index 6a65627387..c6e238a358 100644 --- a/reco/L1/L1Algo/L1Algo.cxx +++ b/reco/L1/L1Algo/L1Algo.cxx @@ -89,7 +89,7 @@ void L1Algo::Init(const bool UseHitErrors, const TrackingMode mode, const bool M fInitManager.TransferParametersContainer(fParameters); LOG(info) << fParameters.ToString(); - + // Get number of station fNstations = fInitManager.GetNstationsActive(); @@ -168,8 +168,8 @@ void L1Algo::GetHitCoor(const L1Hit& _h, fscal& _x, fscal& _y, char iS) const L1Station& sta = fParameters.GetStation(int(iS)); fscal u = _h.u; fscal v = _h.v; - _x = (sta.xInfo.sin_phi[0] * u + sta.xInfo.cos_phi[0] * v) / (_h.z - fParameters.GetTargetPositionZ()[0]); - _y = (sta.yInfo.cos_phi[0] * u + sta.yInfo.sin_phi[0] * v) / (_h.z - fParameters.GetTargetPositionZ()[0]); + _x = (sta.xInfo.sin_phi[0] * u + sta.xInfo.cos_phi[0] * v) / (_h.z - fParameters.GetTargetPositionZ()[0]); + _y = (sta.yInfo.cos_phi[0] * u + sta.yInfo.sin_phi[0] * v) / (_h.z - fParameters.GetTargetPositionZ()[0]); } void L1Algo::GetHitCoor(const L1Hit& _h, fscal& _x, fscal& _y, fscal& _z, const L1Station& sta) diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index ca2faa6fd2..c703786a6a 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -151,7 +151,7 @@ public: // The candidates may share any amount of hits. L1Vector<L1Branch> fTrackCandidates[L1Constants::size::kMaxNthreads] {"L1Algo::fTrackCandidates"}; - Tindex fDupletPortionStopIndex[L1Constants::size::kMaxNstations] {0}; // end of the duplet portions for the station + Tindex fDupletPortionStopIndex[L1Constants::size::kMaxNstations] {0}; // end of the duplet portions for the station L1Vector<Tindex> fDupletPortionSize {"L1Algo::fDupletPortionSize"}; // N duplets in a portion /********************************************************************************************/ /** @@ -305,8 +305,8 @@ public: MaxNPortion = 40 * coeff / multiCoeff, - MaxArrSize = MaxNPortion * MaxPortionDoublets / L1Constants::size::kMaxNstations - //200000, // standart size of big arrays // mas be 40000 for normal work in cbmroot! + MaxArrSize = MaxNPortion * MaxPortionDoublets / L1Constants::size::kMaxNstations + //200000, // standart size of big arrays // mas be 40000 for normal work in cbmroot! }; @@ -395,7 +395,7 @@ public: L1InitManager* GetInitManager() { return &fInitManager; } private: - L1Parameters fParameters {}; ///< Object of L1Algo parameters class + L1Parameters fParameters {}; ///< Object of L1Algo parameters class L1InitManager fInitManager {}; ///< Object of L1Algo initialization manager class @@ -497,7 +497,8 @@ private: /// Find the doublets. Reformat data in the portion of doublets. void f20( // input - Tindex n1, const L1Station& stal, const L1Station& stam, L1HitPoint* vStsHits_m, L1TrackPar* T_1, L1HitIndex_t* hitsl_1, + Tindex n1, const L1Station& stal, const L1Station& stam, L1HitPoint* vStsHits_m, L1TrackPar* T_1, + L1HitIndex_t* hitsl_1, // output Tindex& n2, L1Vector<L1HitIndex_t>& i1_2, @@ -687,7 +688,7 @@ private: fvec fMaxInvMom {L1Utils::kNaN}; ///< max considered q/p for tracks fvec fMaxSlopePV {L1Utils::kNaN}; ///< max slope (tx\ty) in prim vertex float fMaxSlope {L1Utils::kNaN}; ///< max slope (tx\ty) in 3d hit position of a triplet - + fvec fTargX {L1Utils::kNaN}; ///< target position x coordinate for the current iteration (modifiable) fvec fTargY {L1Utils::kNaN}; ///< target position y coordinate for the current iteration (modifiable) fvec fTargZ {L1Utils::kNaN}; ///< target position z coordinate for the current iteration (modifiable) diff --git a/reco/L1/L1Algo/L1BaseStationInfo.cxx b/reco/L1/L1Algo/L1BaseStationInfo.cxx index dac4c26e53..9c44b64eed 100644 --- a/reco/L1/L1Algo/L1BaseStationInfo.cxx +++ b/reco/L1/L1Algo/L1BaseStationInfo.cxx @@ -19,8 +19,8 @@ // L1Algo core #include "L1Assert.h" #include "L1BaseStationInfo.h" -#include "L1Def.h" #include "L1Constants.h" +#include "L1Def.h" // C++ STL #include <iomanip> #include <sstream> diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx index fb617e1822..3e08d6ae1c 100644 --- a/reco/L1/L1Algo/L1CATrackFinder.cxx +++ b/reco/L1/L1Algo/L1CATrackFinder.cxx @@ -362,7 +362,8 @@ inline void L1Algo::f11( /// input 1st stage of singlet search if constexpr (L1Constants::control::kIfUseRadLengthTable) { if (kGlobal == fTrackingMode || kMcbm == fTrackingMode) { - fit.L1AddThickMaterial(T, fParameters.GetMaterialThickness(istal, T.x, T.y), fMaxInvMom, 1, stal.materialInfo.thick, 1); + fit.L1AddThickMaterial(T, fParameters.GetMaterialThickness(istal, T.x, T.y), fMaxInvMom, 1, + stal.materialInfo.thick, 1); } else { fit.L1AddMaterial(T, fParameters.GetMaterialThickness(istal, T.x, T.y), fMaxInvMom, 1); @@ -395,7 +396,8 @@ inline void L1Algo::f11( /// input 1st stage of singlet search /// Find the doublets. Reformat data in the portion of doublets. inline void L1Algo::f20( /// input - Tindex n1, const L1Station& stal, const L1Station& stam, L1HitPoint* vStsHits_m, L1TrackPar* T_1, L1HitIndex_t* hitsl_1, + Tindex n1, const L1Station& stal, const L1Station& stam, L1HitPoint* vStsHits_m, L1TrackPar* T_1, + L1HitIndex_t* hitsl_1, /// output Tindex& n2, L1Vector<L1HitIndex_t>& i1_2, #ifdef DOUB_PERFORMANCE @@ -434,8 +436,8 @@ inline void L1Algo::f20( while (true) { if (kGlobal == fTrackingMode || kMcbm == fTrackingMode) { irm1++; - if ((L1HitIndex_t) irm1 - >= (StsHitsUnusedStopIndex[&stam - fParameters.GetStations().begin()] - StsHitsUnusedStartIndex[&stam - fParameters.GetStations().begin()])) + if ((L1HitIndex_t) irm1 >= (StsHitsUnusedStopIndex[&stam - fParameters.GetStations().begin()] + - StsHitsUnusedStartIndex[&stam - fParameters.GetStations().begin()])) break; imh = irm1; } @@ -689,8 +691,8 @@ inline void L1Algo::f30( // input FilterTime(T2, timeM, timeMEr, stam.timeInfo); if constexpr (L1Constants::control::kIfUseRadLengthTable) { if (kGlobal == fTrackingMode || kMcbm == fTrackingMode) { - fit.L1AddThickMaterial(T2, fParameters.GetMaterialThickness(istam, T2.x, T2.y), fMaxInvMom, 1, stam.materialInfo.thick, - 1); + fit.L1AddThickMaterial(T2, fParameters.GetMaterialThickness(istam, T2.x, T2.y), fMaxInvMom, 1, + stam.materialInfo.thick, 1); } else { fit.L1AddMaterial(T2, fParameters.GetMaterialThickness(istam, T2.x, T2.y), T2.qp, 1); @@ -934,8 +936,8 @@ inline void L1Algo::f31( // input if (fUseHitErrors) info.sigma2 = du_[i3_V] * du_[i3_V]; - bool noField = - (kGlobal == fTrackingMode || kMcbm == fTrackingMode) && (&star - fParameters.GetStations().begin() >= fNfieldStations); + bool noField = (kGlobal == fTrackingMode || kMcbm == fTrackingMode) + && (&star - fParameters.GetStations().begin() >= fNfieldStations); if (noField) { L1FilterNoField(T_3[i3_V], info, u_front_[i3_V]); } else { @@ -1661,8 +1663,8 @@ void L1Algo::CATrackFinder() static Tindex stat_nTriplets[fNFindIterations] = {0}; static Tindex stat_nLevels[L1Constants::size::kMaxNstations - 2][fNFindIterations] = {{0}}; - static Tindex stat_nCalls[fNFindIterations] = {0}; // n calls of CAFindTrack - static Tindex stat_nTrCandidates[fNFindIterations] = {0}; + static Tindex stat_nCalls[fNFindIterations] = {0}; // n calls of CAFindTrack + static Tindex stat_nTrCandidates[fNFindIterations] = {0}; #endif /********************************/ /** @@ -1780,7 +1782,7 @@ void L1Algo::CATrackFinder() // ---- Loop over Track Finder iterations ----------------------------------------------------------------// L1ASSERT(0, fNFindIterations == fParameters.GetCAIterations().size()); - isec = 0; // TODO: temporary! (S.Zharko) + isec = 0; // TODO: temporary! (S.Zharko) for (const auto& caIteration : fParameters.GetCAIterations()) // all finder { //if (fTrackingMode == kMcbm) { @@ -1934,7 +1936,8 @@ void L1Algo::CATrackFinder() // fMaxDZ = 0.1; // TODO: to be removed, because this condition is checked in L1InitManager (S.Zharko) - if (fNstations > (int) L1Constants::size::kMaxNstations) cout << " CATrackFinder: Error: Too many Stations" << endl; + if (fNstations > (int) L1Constants::size::kMaxNstations) + cout << " CATrackFinder: Error: Too many Stations" << endl; } #ifndef L1_NO_ASSERT @@ -2409,7 +2412,7 @@ void L1Algo::CATrackFinder() L1HitPoint tempPoint = CreateHitPoint(hit); //TODO take number of station from hit float xcoor, ycoor = 0; - L1Station stah = fParameters.GetStation(0); // TODO: Why is it a copy? + L1Station stah = fParameters.GetStation(0); // TODO: Why is it a copy? StripsToCoor(tempPoint.U(), tempPoint.V(), xcoor, ycoor, stah); float zcoor = tempPoint.Z() - fParameters.GetTargetPositionZ()[0]; diff --git a/reco/L1/L1Algo/L1Constants.h b/reco/L1/L1Algo/L1Constants.h index 06734ae6ec..e6744d88cc 100644 --- a/reco/L1/L1Algo/L1Constants.h +++ b/reco/L1/L1Algo/L1Constants.h @@ -13,29 +13,32 @@ #define L1Constants_h 1 /// Namespace contains compile-time constants definition for the L1 tracking algorithm -namespace L1Constants { - +namespace L1Constants +{ + /// Array sizes - namespace size { + namespace size + { /// Amount of coefficients in field approximations constexpr int kMaxNFieldApproxCoefficients {21}; // TODO: May be it is better to use the polynomial - // order instead of this? + // order instead of this? /// Order of polynomial to approximate field in the vicinity of station plane constexpr int kMaxFieldApproxPolynomialOrder {5}; - + /// Amount of bits to code a station, thread or triplet. This values determine the ma - constexpr unsigned int kStationBits {6u}; ///< Amount of bits to code one station - constexpr unsigned int kThreadBits {6u}; ///< Amount of bits to code one thread + constexpr unsigned int kStationBits {6u}; ///< Amount of bits to code one station + constexpr unsigned int kThreadBits {6u}; ///< Amount of bits to code one thread constexpr unsigned int kTripletBits {32u - kStationBits - kThreadBits}; ///< Amount of bits to code one triplet - + constexpr int kMaxNdetectors {5}; ///< Max number of tracking detectors constexpr int kMaxNstations {1u << kStationBits}; ///< Max number of stations, 2^6 = 64 constexpr int kMaxNthreads {1u << kThreadBits}; ///< Max number of threads, 2^6 = 64 constexpr int kMaxNtriplets {1u << kTripletBits}; ///< Max number of triplets, 2^20 = 1,048,576 - } // end namespace size + } // end namespace size /// Control flags - namespace control { + namespace control + { /// Flag for the radiation length tables usage /// true - Radiational tables will be used, /// false - basic station material info is used @@ -46,21 +49,22 @@ namespace L1Constants { /// Flag: debug mode for analyzing the doublets pergormance efficiencies //constexpr bool kIfDebugDoubletsPerformance {false}; - + /// Flag: debug mode for analyzing the tiplets pergormance efficiencies //constexpr bool kIfDebugTripletsPerformance {false}; - + /// Flag: debug mode for creating pools for triplets. /// NOTE: this feature will work only if the L1Parameters::kIfDebugTipletsPerformace is true! //constexpr bool kIfCreateTripletPulls {false}; - } // end namespace control - + } // end namespace control + /// Miscellaneous constants - namespace misc { + namespace misc + { constexpr int kAssertionLevel {0}; ///< Assertion level constexpr int kAlignment {16}; - } // end namespace misc -} // end namespace L1Constants + } // end namespace misc +} // end namespace L1Constants -#endif // L1Constants_h +#endif // L1Constants_h diff --git a/reco/L1/L1Algo/L1Def.h b/reco/L1/L1Algo/L1Def.h index 76c7525172..36ad064561 100644 --- a/reco/L1/L1Algo/L1Def.h +++ b/reco/L1/L1Algo/L1Def.h @@ -51,7 +51,7 @@ 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 +// Prints file and line information to the std::cout #define L1_SHOWF(msg) #else #define L1_ASSERT(v, msg) \ @@ -65,7 +65,7 @@ T finite(T x) #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" + std::cout << "(!) " << __FILE__ << ":" << __LINE__ << ": \033[01;38;5;208m" << (#msg) << "\033[0m\n" #endif diff --git a/reco/L1/L1Algo/L1Field.cxx b/reco/L1/L1Algo/L1Field.cxx index 4f71d06cff..ad8730296c 100644 --- a/reco/L1/L1Algo/L1Field.cxx +++ b/reco/L1/L1Algo/L1Field.cxx @@ -3,12 +3,13 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ #include "L1Field.h" -#include "L1Utils.h" #include <iomanip> #include <iostream> #include <sstream> +#include "L1Utils.h" + // // L1FieldValue methods // @@ -68,19 +69,22 @@ void L1FieldSlice::CheckConsistency() const for (int i = 0; i < L1Constants::size::kMaxNFieldApproxCoefficients; ++i) { if (!cx[i].IsHorizontallyEqual()) { std::stringstream msg; - msg << "L1FieldSlice: \"cx[" << i << "]\" SIMD vector is inconsistent not all of the words are equal each other: " << cx[i]; + msg << "L1FieldSlice: \"cx[" << i + << "]\" SIMD vector is inconsistent not all of the words are equal each other: " << cx[i]; throw std::logic_error(msg.str()); } if (!cy[i].IsHorizontallyEqual()) { std::stringstream msg; - msg << "L1FieldSlice: \"cy[" << i << "]\" SIMD vector is inconsistent not all of the words are equal each other: " << cy[i]; + msg << "L1FieldSlice: \"cy[" << i + << "]\" SIMD vector is inconsistent not all of the words are equal each other: " << cy[i]; throw std::logic_error(msg.str()); } if (!cz[i].IsHorizontallyEqual()) { std::stringstream msg; - msg << "L1FieldSlice: \"cz[" << i << "]\" SIMD vector is inconsistent not all of the words are equal each other: " << cz[i]; + msg << "L1FieldSlice: \"cz[" << i + << "]\" SIMD vector is inconsistent not all of the words are equal each other: " << cz[i]; throw std::logic_error(msg.str()); } } diff --git a/reco/L1/L1Algo/L1Field.h b/reco/L1/L1Algo/L1Field.h index b69ce7b8ff..28b6845489 100644 --- a/reco/L1/L1Algo/L1Field.h +++ b/reco/L1/L1Algo/L1Field.h @@ -7,8 +7,8 @@ #include <string> -#include "L1Def.h" #include "L1Constants.h" +#include "L1Def.h" class L1FieldValue { public: @@ -20,13 +20,13 @@ public: /// \param B other field value to combine with /// \param w weight from 0 to 1 // TODO: Do we need any checks here? (S.Zharko) void Combine(L1FieldValue& B, fvec w); // TODO: Shouldn't the B parameter be const? (S.Zharko) - + /// Consistency checker void CheckConsistency() const; - + /// Operator << overloading friend std::ostream& operator<<(std::ostream& out, const L1FieldValue& B); - + /// String representation of class contents /// \param indentLevel number of indent characters in the output std::string ToString(int indentLevel) const; @@ -46,7 +46,7 @@ class L1FieldSlice { public: /// Default constructor L1FieldSlice(); - + /// Consistency checker void CheckConsistency() const; @@ -55,7 +55,7 @@ public: /// \param y y-coordinate of input /// \param B the L1FieldValue output void GetFieldValue(const fvec& x, const fvec& y, L1FieldValue& B) const; - + /// String representation of class contents /// \param indentLevel number of indent characters in the output std::string ToString(int indentLevel = 0) const; @@ -64,9 +64,12 @@ public: // NOTE: We don't use an initialization of arrays here because we cannot be sure // if the underlying type (fvec) has a default constructor, but // we are sure, that it can be initialized with a float. (S.Zharko) - fvec cx[L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for x-component of the field value - fvec cy[L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for y-component of the field value - fvec cz[L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for z-component of the field value + fvec cx + [L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for x-component of the field value + fvec cy + [L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for y-component of the field value + fvec cz + [L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for z-component of the field value } _fvecalignment; @@ -74,21 +77,21 @@ class L1FieldRegion { public: // NOTE: When a custom constructor is defined, default constructor also should be provided (S.Zharko) L1FieldRegion() = default; - + L1FieldRegion(float reg[10]) noexcept; - + /// Consistency checker void CheckConsistency() const; - + /// Gets the field vector at z // TODO: Probably we need a const specifier here, because the method does not change the fields L1FieldValue Get(const fvec z); - + /// Gets the field vector and writes it into B pointer /// \param z_ z-coordinate of the point to calculate the field /// \param B pointer to the output fvec array of the magnetic field void Get(const fvec z_, fvec* B) const; - + /// Interpolates the magnetic field by three nodal points and sets the result to this L1FieldRegion object /// The result is a quadratic interpolation of the field as a function of z /// \param b0 field value in the first nodal point @@ -100,7 +103,7 @@ public: /// TODO: does the sequence of b0z, b1z and b2z matter? If yes, probalby we need an assertion (S.Zharko) void Set(const L1FieldValue& b0, const fvec b0z, const L1FieldValue& b1, const fvec b1z, const L1FieldValue& b2, const fvec b2z); - + /// Interpolates the magnetic field by thwo nodal points and sets the result to this L1FieldRegion object. /// The result is a linear interpolation of the field as a function of z /// \param b0 field value in the first nodal point @@ -109,24 +112,24 @@ public: /// \param b1z z-coordinate of the second nodal point /// TODO: does the sequence of b0z and b1z matter? If yes, probalby we need an assertion (S.Zharko) void Set(const L1FieldValue& b0, const fvec b0z, const L1FieldValue& b1, const fvec b1z); - + /// Shifts the coefficients to new central point /// \param z z-coordinate of the new central point void Shift(fvec z); - + /// Replaces the selected layer of the coefficients with one from another /// L1FieldRegion object /// \param i0 the index of the fvect layer in this L1FieldRegion object /// \param fl the other L1FieldRegion object, which layer is going to be replaced /// \param i1 the index of the source fvect layer to copy void SetOneEntry(const int i0, const L1FieldRegion& f1, const int i1); - + /// Replaces all the layers of the coefficients with one selected layer from another /// L1FieldRegion object /// \param fl the other L1FieldRegion object, which layer is going to be replaced /// \param i1 the index of the source fvect layer to copy void SetOneEntry(const L1FieldRegion& f1, const int i1); - + /// Saves the contents of the particular layer of the coefficients into an array of floats /// \param reg output array of 10 floats /// \param iVec index of the input @@ -134,7 +137,7 @@ public: // parameter of this function (S.Zharko) // TODO: Probably we need a const specifier here, because the method does not change the fields void GetOneEntry(float reg[10], const int iVec); - + /// String representation of class contents /// \param indentLevel number of indent characters in the output std::string ToString(int indentLevel = 0) const; @@ -145,12 +148,12 @@ public: fvec cx0 {0.f}; fvec cx1 {0.f}; fvec cx2 {0.f}; - + // By(z) = cy0 + cy1*(z-z0) + cy2*(z-z0)^2 fvec cy0 {0.f}; fvec cy1 {0.f}; fvec cy2 {0.f}; - + // Bz(z) = cz0 + cz1*(z-z0) + cz2*(z-z0)^2 fvec cz0 {0.f}; fvec cz1 {0.f}; diff --git a/reco/L1/L1Algo/L1InitManager.cxx b/reco/L1/L1Algo/L1InitManager.cxx index b621b83004..4685b84292 100644 --- a/reco/L1/L1Algo/L1InitManager.cxx +++ b/reco/L1/L1Algo/L1InitManager.cxx @@ -10,7 +10,6 @@ #include "L1InitManager.h" - #include <algorithm> #include <sstream> @@ -53,10 +52,8 @@ void L1InitManager::AddStation(const L1BaseStationInfo& inStation) } // Check station init - LOG(debug) << "L1InitManager::AddStation:(original) L1BaseStationInfo " - << inStation.GetInitController().ToString(); - LOG(debug) << "L1InitManager::AddStation:(copy) L1BaseStationInfo " - << inStation.GetInitController().ToString(); + LOG(debug) << "L1InitManager::AddStation:(original) L1BaseStationInfo " << inStation.GetInitController().ToString(); + LOG(debug) << "L1InitManager::AddStation:(copy) L1BaseStationInfo " << inStation.GetInitController().ToString(); if (!inStationCopy.GetInitController().IsFinalized()) { LOG(fatal) << "Attempt to add an incompletely initialized station info object (detectorID = " << static_cast<int>(inStationCopy.GetDetectorID()) << ", stationID = " << inStationCopy.GetStationID() @@ -100,7 +97,7 @@ void L1InitManager::FormParametersContainer() { // Check initialization this->CheckInit(); - + if (!fInitController.IsFinalized()) { LOG(fatal) << "Attempt to form parameters container before all necessary fields were initialized" << fInitController.ToString(); @@ -120,12 +117,12 @@ void L1InitManager::FormParametersContainer() // Form array of material map auto thickMapIt = fParameters.fThickMap.begin(); for (auto it = fStationsInfo.begin(); it != fStationsInfo.end(); ++it) { - auto node = fStationsInfo.extract(it); + auto node = fStationsInfo.extract(it); *thickMapIt = std::move(node.value().TakeMaterialMap()); fStationsInfo.insert(std::move(node)); ++thickMapIt; } - + // Check the consistency of the parameters object. If object inconsistent, it throws std::logic_error fParameters.CheckConsistency(); } @@ -310,12 +307,12 @@ void L1InitManager::SetTargetPosition(double x, double y, double z) return; } - /// Fill fvec target fields + /// Fill fvec target fields fParameters.fTargetPos[0] = x; fParameters.fTargetPos[1] = y; fParameters.fTargetPos[2] = z; /// Set additional field for z component in double precision - fTargetZ = z; + fTargetZ = z; fInitController.SetFlag(EInitKey::kTargetPos); } @@ -333,7 +330,8 @@ void L1InitManager::SetTrackingLevel(int trackingLevel) //----------------------------------------------------------------------------------------------------------------------- // -void L1InitManager::TransferParametersContainer(L1Parameters& destination) { +void L1InitManager::TransferParametersContainer(L1Parameters& destination) +{ this->FormParametersContainer(); destination = std::move(fParameters); LOG(info) << "Parameters object transfered to L1Algo core"; diff --git a/reco/L1/L1Algo/L1InitManager.h b/reco/L1/L1Algo/L1InitManager.h index 2925d7cceb..3b7924708f 100644 --- a/reco/L1/L1Algo/L1InitManager.h +++ b/reco/L1/L1Algo/L1InitManager.h @@ -126,7 +126,7 @@ public: void CheckInit(); // NOTE: This method calls checkers of large fields initializations like a station or an iteration. The method must be // called in the L1Algo class. (S.Zharko) - + /// Gets ghost suppression flag int GetGhostSuppression() const { return fGhostSuppression; } @@ -215,7 +215,7 @@ private: /// Checker for L1BaseStationInfo set initialization (sets EInitKey::kStationsInfo) /// \return true If all L1BaseStationInfo objects were initialized properly. Similar effect can be achieved by void CheckStationsInfoInit(); - + /// Forms parameters container void FormParametersContainer(); @@ -248,7 +248,7 @@ private: int fCAIterationsNumberCrosscheck {-1}; ///< Number of iterations to be passed (must be used for cross-checks) - L1Parameters fParameters {}; ///< L1Algo parameters object + L1Parameters fParameters {}; ///< L1Algo parameters object int fTrackingLevel {0}; ///< tracking level int fGhostSuppression {0}; ///< flag: if true, ghost tracks are suppressed diff --git a/reco/L1/L1Algo/L1MaterialInfo.cxx b/reco/L1/L1Algo/L1MaterialInfo.cxx index 6aeee7c8f1..e7c864f3b4 100644 --- a/reco/L1/L1Algo/L1MaterialInfo.cxx +++ b/reco/L1/L1Algo/L1MaterialInfo.cxx @@ -4,10 +4,11 @@ #include "L1MaterialInfo.h" +#include <FairLogger.h> + #include <iomanip> #include <sstream> #include <vector> -#include <FairLogger.h> /************************ * L1MaterialInfo class * @@ -27,7 +28,6 @@ std::string L1MaterialInfo::ToString(int indentLevel) const } - //------------------------------------------------------------------------------------------------------------------------------------ // void L1MaterialInfo::CheckConsistency() const @@ -37,23 +37,26 @@ void L1MaterialInfo::CheckConsistency() const L1Utils::CheckSimdVectorEquality(RL, "L1MaterialInfo::RL"); L1Utils::CheckSimdVectorEquality(RadThick, "L1MaterialInfo::RadThick"); L1Utils::CheckSimdVectorEquality(logRadThick, "L1MaterialInfo::logRadThick"); - + /* (ii) Checks for physical sence: thick and RL must be larger then 0. */ if (thick[0] < fscal(0.)) { std::stringstream aStream; - aStream <<"L1MaterialInfo: illegal value for station thickness: (" << thick[0] << ", positive value expected) [cm]"; + aStream << "L1MaterialInfo: illegal value for station thickness: (" << thick[0] + << ", positive value expected) [cm]"; throw std::logic_error(aStream.str()); } if (RL[0] < fscal(0.)) { std::stringstream aStream; - aStream <<"L1MaterialInfo: illegal value for station radiation length: (" << RL[0] << ", positive value expected) [cm]"; + aStream << "L1MaterialInfo: illegal value for station radiation length: (" << RL[0] + << ", positive value expected) [cm]"; throw std::logic_error(aStream.str()); } /* (iii) Checks for RadThick and logRadThick */ if (!L1Utils::CmpFloats(RadThick[0] * RL[0], thick[0])) { - throw std::logic_error("L1MaterialInfo: illegal relation between thickness, radiation length and their ratio (RadThick)"); + throw std::logic_error( + "L1MaterialInfo: illegal relation between thickness, radiation length and their ratio (RadThick)"); } if (!L1Utils::CmpFloats(std::exp(logRadThick[0]), RadThick[0])) { @@ -70,8 +73,7 @@ L1Material::L1Material() {} //------------------------------------------------------------------------------------------------------------------------------------ // -L1Material::~L1Material() -{} +L1Material::~L1Material() {} //------------------------------------------------------------------------------------------------------------------------------------ // @@ -145,20 +147,20 @@ fvec L1Material::GetRadThick(fvec x, fvec y) const void L1Material::CheckConsistency() const { /* (i) Check, if the object was initialized */ - if (fNbins < 1 || std::isnan(fRmax)) { - throw std::logic_error("L1Material: class was not initialized"); - } + if (fNbins < 1 || std::isnan(fRmax)) { throw std::logic_error("L1Material: class was not initialized"); } /* (ii) Check if the thickness values correct (non-negative) */ bool isThicknessOk = true; for (int i = 0; i < int(fTable.size()); ++i) { if (fTable[i] < 0) { isThicknessOk = false; - LOG(error) << "L1Material: found illegal negative station thickness value " << fTable[i] << " at iBinX = " << (i % fNbins) - << ", iBin = " << (i / fNbins); + LOG(error) << "L1Material: found illegal negative station thickness value " << fTable[i] + << " at iBinX = " << (i % fNbins) << ", iBin = " << (i / fNbins); } } - if (!isThicknessOk) { throw std::logic_error("L1Material: incorrect station thickness values found in the thickness map"); } + if (!isThicknessOk) { + throw std::logic_error("L1Material: incorrect station thickness values found in the thickness map"); + } } //------------------------------------------------------------------------------------------------------------------------------------ @@ -167,10 +169,10 @@ void L1Material::SetBins(int nBins, float stationSize) { fNbins = nBins; fRmax = stationSize; - + if (fNbins < 1) { std::stringstream aStream; - aStream <<"L1Material: object cannot be initialized with non-positive nBins = " << nBins; + aStream << "L1Material: object cannot be initialized with non-positive nBins = " << nBins; throw std::logic_error(aStream.str()); } diff --git a/reco/L1/L1Algo/L1MaterialInfo.h b/reco/L1/L1Algo/L1MaterialInfo.h index 85f17a6f70..22824be9c4 100644 --- a/reco/L1/L1Algo/L1MaterialInfo.h +++ b/reco/L1/L1Algo/L1MaterialInfo.h @@ -17,11 +17,12 @@ /// The fields of the structure should ONLY be initialized within L1BaseStationInfo::SetMaterial(double, double) method, when the /// stations sequence is initialized struct L1MaterialInfo { - fvec thick {L1Utils::kNaN}; ///< Average thickness of the station in arbitary length units - fvec RL {L1Utils::kNaN}; ///< Average radiation length (X0) of the station material in THE SAME UNITS as the thickness + fvec thick {L1Utils::kNaN}; ///< Average thickness of the station in arbitary length units + fvec RL { + L1Utils::kNaN}; ///< Average radiation length (X0) of the station material in THE SAME UNITS as the thickness fvec RadThick {L1Utils::kNaN}; ///< Average thickness in units of radiation length (X/X0) fvec logRadThick {L1Utils::kNaN}; - + /// Verifies class invariant consistency void CheckConsistency() const; @@ -70,7 +71,7 @@ public: /// \param x X coordinate of the point [cm] (SIMDized vector) /// \param y Y coordinate of the point [cm] (SIMDized veotor) fvec GetRadThick(fvec x, fvec y) const; - + /// Verifies class invariant consistency void CheckConsistency() const; @@ -93,8 +94,8 @@ public: private: int fNbins {-1}; ///< Number of rows (columns) in the material budget table - float fRmax {L1Utils::kNaN}; ///< Size of the station in x and y dimensions [cm] - float fFactor {L1Utils::kNaN}; ///< Factor used in the recalculation of point coordinates to row/column id + float fRmax {L1Utils::kNaN}; ///< Size of the station in x and y dimensions [cm] + float fFactor {L1Utils::kNaN}; ///< Factor used in the recalculation of point coordinates to row/column id std::vector<float> fTable {}; ///< Material budget table } _fvecalignment; diff --git a/reco/L1/L1Algo/L1Parameters.cxx b/reco/L1/L1Algo/L1Parameters.cxx index 1fd9d863d2..24e3348ced 100644 --- a/reco/L1/L1Algo/L1Parameters.cxx +++ b/reco/L1/L1Algo/L1Parameters.cxx @@ -14,9 +14,9 @@ //------------------------------------------------------------------------------------------------------------------------------------ // -L1Parameters::L1Parameters() +L1Parameters::L1Parameters() { - fActiveStationGlobalIDs.fill(-1); // by default, all stations are inactive, thus all the IDs must be -1 + fActiveStationGlobalIDs.fill(-1); // by default, all stations are inactive, thus all the IDs must be -1 } //------------------------------------------------------------------------------------------------------------------------------------ @@ -26,18 +26,19 @@ L1Parameters::~L1Parameters() noexcept {} //------------------------------------------------------------------------------------------------------------------------------------ // L1Parameters::L1Parameters(const L1Parameters& other) noexcept -: fMaxDoubletsPerSinglet(other.fMaxDoubletsPerSinglet), - fMaxTripletPerDoublets(other.fMaxTripletPerDoublets), - fCAIterations(other.fCAIterations), - fTargetPos(other.fTargetPos), - fVertexFieldValue(other.fVertexFieldValue), - fVertexFieldRegion(other.fVertexFieldRegion), - fStations(other.fStations), - fThickMap(other.fThickMap), - fNstationsActive(other.fNstationsActive), - fNstationsGeometry(other.fNstationsGeometry), - fActiveStationGlobalIDs(other.fActiveStationGlobalIDs) -{} + : fMaxDoubletsPerSinglet(other.fMaxDoubletsPerSinglet) + , fMaxTripletPerDoublets(other.fMaxTripletPerDoublets) + , fCAIterations(other.fCAIterations) + , fTargetPos(other.fTargetPos) + , fVertexFieldValue(other.fVertexFieldValue) + , fVertexFieldRegion(other.fVertexFieldRegion) + , fStations(other.fStations) + , fThickMap(other.fThickMap) + , fNstationsActive(other.fNstationsActive) + , fNstationsGeometry(other.fNstationsGeometry) + , fActiveStationGlobalIDs(other.fActiveStationGlobalIDs) +{ +} //------------------------------------------------------------------------------------------------------------------------------------ // @@ -49,10 +50,7 @@ L1Parameters& L1Parameters::operator=(const L1Parameters& other) noexcept //------------------------------------------------------------------------------------------------------------------------------------ // -L1Parameters::L1Parameters(L1Parameters&& other) noexcept -{ - this->Swap(other); -} +L1Parameters::L1Parameters(L1Parameters&& other) noexcept { this->Swap(other); } //------------------------------------------------------------------------------------------------------------------------------------ // @@ -84,7 +82,8 @@ void L1Parameters::Swap(L1Parameters& other) noexcept //------------------------------------------------------------------------------------------------------------------------------------ // -void L1Parameters::CheckConsistency() const { +void L1Parameters::CheckConsistency() const +{ LOG(info) << "Consistency test for L1 parameters object... "; /* * Arrays containing numbers of stations @@ -94,13 +93,14 @@ void L1Parameters::CheckConsistency() const { * active). This fact applies restriction on the arrays: the last element must be equal to the sum of all previous elements. * */ - - if (std::accumulate(fNstationsGeometry.cbegin(), fNstationsGeometry.cend() - 1, 0) != *(fNstationsGeometry.cend() - 1)) { + + if (std::accumulate(fNstationsGeometry.cbegin(), fNstationsGeometry.cend() - 1, 0) + != *(fNstationsGeometry.cend() - 1)) { throw std::logic_error("L1Parameters: invalid object condition: total number of stations provided by geometry " "differs from the sum of the station numbers for individual detector subsystems"); }; - - if (std::accumulate(fNstationsActive.cbegin(), fNstationsActive.cend() - 1, 0) != *(fNstationsActive.cend() - 1)) { + + if (std::accumulate(fNstationsActive.cbegin(), fNstationsActive.cend() - 1, 0) != *(fNstationsActive.cend() - 1)) { throw std::logic_error("L1Parameters: invalid object condition: total number of stations active in tracking " "differs from the sum of the station numbers for individual detector subsystems"); }; @@ -113,8 +113,9 @@ void L1Parameters::CheckConsistency() const { * (ii) subsequence of all the elements, which are not equal -1, must be a gapless subset of integer numbers starting with 0 */ - auto filterInactiveStationIDs = [](int x) {return x != -1;}; - int nStationsCheck = std::count_if(fActiveStationGlobalIDs.cbegin(), fActiveStationGlobalIDs.cend(), filterInactiveStationIDs); + auto filterInactiveStationIDs = [](int x) { return x != -1; }; + int nStationsCheck = + std::count_if(fActiveStationGlobalIDs.cbegin(), fActiveStationGlobalIDs.cend(), filterInactiveStationIDs); if (nStationsCheck != *(fNstationsActive.cend() - 1)) { std::stringstream msg; msg << "L1Parameters: invalid object condition: array of active station IDs is not consistent " @@ -123,21 +124,23 @@ void L1Parameters::CheckConsistency() const { throw std::logic_error(msg.str()); } - // Check, if the subsequence of all the elements, which are not equal -1, must be a gapless subset of integer numbers + // Check, if the subsequence of all the elements, which are not equal -1, must be a gapless subset of integer numbers // starting from 0. If it is, the testValue in the end must be equal the number of non -1 elements - std::vector<int> idsCheck(nStationsCheck); // temporary vector containing a sequence of active station IDs without -1 elements - std::copy_if(fActiveStationGlobalIDs.cbegin(), fActiveStationGlobalIDs.cend(), idsCheck.begin(), filterInactiveStationIDs); + std::vector<int> idsCheck( + nStationsCheck); // temporary vector containing a sequence of active station IDs without -1 elements + std::copy_if(fActiveStationGlobalIDs.cbegin(), fActiveStationGlobalIDs.cend(), idsCheck.begin(), + filterInactiveStationIDs); bool isStationIDsOk = true; - for (int id = 0; id < nStationsCheck; ++id) { - isStationIDsOk = isStationIDsOk && idsCheck[id] == id; + for (int id = 0; id < nStationsCheck; ++id) { + isStationIDsOk = isStationIDsOk && idsCheck[id] == id; } if (!isStationIDsOk) { std::stringstream msg; msg << "L1Parameters: invalid object condition: array of active station IDs is not a gapless subset " << "of integer numbers starting from 0:\n\t"; - for (auto id: fActiveStationGlobalIDs) { - msg << std::setw(3) << std::setfill(' ') << id << ' '; + for (auto id : fActiveStationGlobalIDs) { + msg << std::setw(3) << std::setfill(' ') << id << ' '; } throw std::logic_error(msg.str()); } @@ -149,7 +152,7 @@ void L1Parameters::CheckConsistency() const { L1Utils::CheckSimdVectorEquality(fTargetPos[0], "L1Parameters: target position x"); L1Utils::CheckSimdVectorEquality(fTargetPos[1], "L1Parameters: target position y"); L1Utils::CheckSimdVectorEquality(fTargetPos[2], "L1Parameters: target position z"); - + /* * Check vertex field region and value objects at primary vertex */ @@ -176,7 +179,7 @@ void L1Parameters::CheckConsistency() const { throw std::logic_error(msg.str()); } } - + /* * Check thickness maps * NOTE: If a L1Material map was not set up, it is accounted inconsistent (uninitialized). In the array of thickness maps for each @@ -212,12 +215,12 @@ std::string L1Parameters::ToString(int verbosity, int indentLevel) const aStream << indent << " L1 parameters list\n"; aStream << indent << "--------------------------------------------------------------------------------\n"; aStream << indent << "COMPILE TIME CONSTANTS:\n"; - aStream << indent << indentChar << "Bits to code one station: " <<L1Constants::size::kStationBits << '\n'; - aStream << indent << indentChar << "Bits to code one thread: " <<L1Constants::size::kThreadBits << '\n'; - aStream << indent << indentChar << "Bits to code one triplet: " <<L1Constants::size::kTripletBits << '\n'; - aStream << indent << indentChar << "Max number of stations: " <<L1Constants::size::kMaxNstations << '\n'; - aStream << indent << indentChar << "Max number of threads: " <<L1Constants::size::kMaxNthreads << '\n'; - aStream << indent << indentChar << "Max number of triplets: " <<L1Constants::size::kMaxNtriplets << '\n'; + aStream << indent << indentChar << "Bits to code one station: " << L1Constants::size::kStationBits << '\n'; + aStream << indent << indentChar << "Bits to code one thread: " << L1Constants::size::kThreadBits << '\n'; + aStream << indent << indentChar << "Bits to code one triplet: " << L1Constants::size::kTripletBits << '\n'; + aStream << indent << indentChar << "Max number of stations: " << L1Constants::size::kMaxNstations << '\n'; + aStream << indent << indentChar << "Max number of threads: " << L1Constants::size::kMaxNthreads << '\n'; + aStream << indent << indentChar << "Max number of triplets: " << L1Constants::size::kMaxNtriplets << '\n'; aStream << indent << "RUNTIME CONSTANTS:\n"; aStream << indent << indentChar << "Max number of doublets per singlet: " << fMaxDoubletsPerSinglet << '\n'; aStream << indent << indentChar << "Max number of triplets per doublet: " << fMaxTripletPerDoublets << '\n'; @@ -226,32 +229,33 @@ std::string L1Parameters::ToString(int verbosity, int indentLevel) const aStream << idx << ") " << fCAIterations[idx].ToString(indentLevel + 1) << '\n'; } aStream << indent << "GEOMETRY:\n"; - + aStream << indent << indentChar << "TARGET:\n"; aStream << indent << indentChar << indentChar << "Position:\n"; - for (int dim = 0; dim < 3 /*nDimensions*/; ++dim ) { - aStream << indent << indentChar << indentChar << indentChar << char(120 + dim) << " = " << fTargetPos[dim][0] << " cm\n"; + for (int dim = 0; dim < 3 /*nDimensions*/; ++dim) { + aStream << indent << indentChar << indentChar << indentChar << char(120 + dim) << " = " << fTargetPos[dim][0] + << " cm\n"; } - + aStream << indent << indentChar << "NUMBER OF STATIONS:\n"; aStream << indent << indentChar << indentChar << "Number of stations (Geometry): "; - for (int idx = 0; idx < int(fNstationsGeometry.size()); ++idx ) { + for (int idx = 0; idx < int(fNstationsGeometry.size()); ++idx) { if (int(fNstationsGeometry.size() - 1) == idx) { aStream << " | total = "; } aStream << std::setw(2) << std::setfill(' ') << fNstationsGeometry[idx] << ' '; } aStream << '\n'; aStream << indent << indentChar << indentChar << "Number of stations (Active): "; - for (int idx = 0; idx < int(fNstationsActive.size()); ++idx ) { + for (int idx = 0; idx < int(fNstationsActive.size()); ++idx) { if (int(fNstationsActive.size() - 1) == idx) { aStream << " | total = "; } aStream << std::setw(2) << std::setfill(' ') << fNstationsActive[idx] << ' '; } aStream << '\n'; aStream << indent << indentChar << indentChar << "Active station indeces: "; - for (int idx = 0; idx < *(fNstationsActive.end() - 1); ++idx ) { + for (int idx = 0; idx < *(fNstationsActive.end() - 1); ++idx) { aStream << std::setw(3) << std::setfill(' ') << fActiveStationGlobalIDs[idx] << ' '; } aStream << '\n'; - + aStream << indent << indentChar << "STATIONS:\n "; for (int idx = 0; idx < *(fNstationsActive.end() - 1); ++idx) { aStream << indent << indentChar << indentChar << fStations[idx].ToString(verbosity) << '\n'; diff --git a/reco/L1/L1Algo/L1Parameters.h b/reco/L1/L1Algo/L1Parameters.h index 59d869d81c..a659d4a67d 100644 --- a/reco/L1/L1Algo/L1Parameters.h +++ b/reco/L1/L1Algo/L1Parameters.h @@ -12,24 +12,25 @@ #ifndef L1Parameters_h #define L1Parameters_h 1 +#include <type_traits> + +#include <numeric> + #include "L1CAIteration.h" #include "L1Constants.h" -#include "L1Station.h" #include "L1MaterialInfo.h" +#include "L1Station.h" #include "L1Utils.h" #include "L1Vector.h" -#include <type_traits> -#include <numeric> - -class L1InitManager; +class L1InitManager; enum class L1DetectorID; /// Type definitions for used containers using L1IterationsContainer_t = L1Vector<L1CAIteration>; -using L1StationsContainer_t = std::array<L1Station, L1Constants::size::kMaxNstations>; -using L1MaterialContainer_t = std::array<L1Material, L1Constants::size::kMaxNstations>; - +using L1StationsContainer_t = std::array<L1Station, L1Constants::size::kMaxNstations>; +using L1MaterialContainer_t = std::array<L1Material, L1Constants::size::kMaxNstations>; + /// Class L1Parameters represents a container for all external parameters of the L1 tracking algorithm, /// including geometry parameters and physics cuts. The instance of the L1Parameters is constructed inside @@ -37,22 +38,23 @@ using L1MaterialContainer_t = std::array<L1Material, L1Constants::size::kMaxNsta /// class alignas(L1Constants::misc::kAlignment) L1Parameters { using L1DetectorID_t = std::underlying_type_t<L1DetectorID>; + public: /// Default constructor L1Parameters(); - + /// Destructor ~L1Parameters() noexcept; - + /// Copy constructor L1Parameters(const L1Parameters& other) noexcept; - + /// Copy assignment operator L1Parameters& operator=(const L1Parameters& other) noexcept; - + /// Move constructor L1Parameters(L1Parameters&& other) noexcept; - + /// Move assignment operator L1Parameters& operator=(L1Parameters&& other) noexcept; @@ -67,16 +69,16 @@ public: /// Sets upper-bound cut on max number of doublets per one singlet void SetMaxDoubletsPerSinglet(unsigned int value) { fMaxDoubletsPerSinglet = value; } - + /// Sets upper-bound cut on max number of triplets per one doublet void SetMaxTripletPerDoublets(unsigned int value) { fMaxTripletPerDoublets = value; } /// Gets upper-bound cut on max number of doublets per one singlet unsigned int GetMaxDoubletsPerSinglet() const { return fMaxDoubletsPerSinglet; } - + /// Gets upper-bound cut on max number of triplets per one doublet unsigned int GetMaxTripletPerDoublets() const { return fMaxTripletPerDoublets; } - + /// Gets total number of active stations int GetNstationsActive() const { return fNstationsActive[fNstationsActive.size() - 1]; } @@ -101,7 +103,8 @@ public: __attribute__((always_inline)) int GetStationIndexGeometry(int localIndex, L1DetectorID detectorID) const { return localIndex - + std::accumulate(fNstationsGeometry.cbegin(), fNstationsGeometry.cbegin() + static_cast<int>(detectorID), 0); + + std::accumulate(fNstationsGeometry.cbegin(), fNstationsGeometry.cbegin() + static_cast<int>(detectorID), + 0); } /// Calculates global index of station used by track finder @@ -111,20 +114,20 @@ public: { return fActiveStationGlobalIDs[GetStationIndexGeometry(localIndex, detectorID)]; } - + /// Provides access to L1CAIteration vector (const) const L1IterationsContainer_t& GetCAIterations() const { return fCAIterations; } /// Provides access to L1Stations container (const) const L1StationsContainer_t& GetStations() const { return fStations; } - + /// Gets reference to the particular station /// \param iStation Index of station in the active stations container const L1Station& GetStation(int iStation) const { return fStations[iStation]; } /// Gets reference to the array of station thickness map const L1MaterialContainer_t& GetThicknessMaps() const { return fThickMap; } - + /// Gets material thickness in units of radiation length in a point on the XY plane for a selected station /// \param iStActive Global index of an active station /// \param xPos Position of the point in X dimension [cm] @@ -148,7 +151,7 @@ public: fvec GetTargetPositionX() const { return fTargetPos[0]; } fvec GetTargetPositionY() const { return fTargetPos[1]; } fvec GetTargetPositionZ() const { return fTargetPos[2]; } - + /// Gets L1FieldRegion object at primary vertex const L1FieldRegion& GetVertexFieldRegion() const { return fVertexFieldRegion; } @@ -159,25 +162,26 @@ public: void CheckConsistency() const; private: - unsigned int fMaxDoubletsPerSinglet {150}; ///< Upper-bound cut on max number of doublets per one singlet unsigned int fMaxTripletPerDoublets {15}; ///< Upper-bound cut on max number of triplets per one doublet - alignas(L1Constants::misc::kAlignment) L1IterationsContainer_t fCAIterations {}; ///< L1 Track finder iterations vector + alignas(L1Constants::misc::kAlignment) + L1IterationsContainer_t fCAIterations {}; ///< L1 Track finder iterations vector /************************* ** Geometry parameters ** *************************/ /// Target position - alignas(L1Constants::misc::kAlignment) std::array<fvec, /*nDimensions*/3> fTargetPos {L1Utils::kNaN, L1Utils::kNaN, L1Utils::kNaN}; + alignas(L1Constants::misc::kAlignment) std::array<fvec, /*nDimensions*/ 3> fTargetPos {L1Utils::kNaN, L1Utils::kNaN, + L1Utils::kNaN}; /// Field value object at primary vertex (between target and the first station) alignas(L1Constants::misc::kAlignment) L1FieldValue fVertexFieldValue {}; - + /// Field region object at primary vertex (between target and the first station) alignas(L1Constants::misc::kAlignment) L1FieldRegion fVertexFieldRegion {}; - /// Array of stations + /// Array of stations alignas(L1Constants::misc::kAlignment) L1StationsContainer_t fStations {}; /// Array of station thickness map @@ -197,7 +201,7 @@ private: /// actual index: 0 1 2 3 4 5 6 7 8 9 0 0 0 0 /// active index: 0 -1 1 2 -1 3 4 5 6 7 0 0 0 0 alignas(L1Constants::misc::kAlignment) std::array<int, L1Constants::size::kMaxNstations> fActiveStationGlobalIDs {}; - + /******************************** ** Friend classes declaration ** ********************************/ diff --git a/reco/L1/L1Algo/L1Station.cxx b/reco/L1/L1Algo/L1Station.cxx index 354ada7e2b..6d316cea36 100644 --- a/reco/L1/L1Algo/L1Station.cxx +++ b/reco/L1/L1Algo/L1Station.cxx @@ -25,7 +25,7 @@ void L1Station::CheckConsistency() const if (timeInfo != 0 && timeInfo != 1) { std::stringstream msg; - msg << "L1Station: illegal time information flag (timeInfo = " << timeInfo << ", " + msg << "L1Station: illegal time information flag (timeInfo = " << timeInfo << ", " << "0 [time information is not used] or 1 [time information is used] expected)"; throw std::logic_error(msg.str()); } @@ -36,7 +36,7 @@ void L1Station::CheckConsistency() const << "0 [station is outside the field] or 1 [station is inside the field] expected"; throw std::logic_error(msg.str()); } - + /* * SIMD vector checks: all the words in a SIMD vector must be equal */ @@ -45,7 +45,7 @@ void L1Station::CheckConsistency() const L1Utils::CheckSimdVectorEquality(Rmin, "L1Station::Rmin"); L1Utils::CheckSimdVectorEquality(Rmax, "L1Station::Rmax"); L1Utils::CheckSimdVectorEquality(dt, "L1Station::dt"); - + /* * Inner and outer radia checks: * (i) both Rmin and Rmax must be >= 0 @@ -62,7 +62,7 @@ void L1Station::CheckConsistency() const /* * Time resolution cannot be smaller then 0 */ - + if (dt[0] < 0) { std::stringstream msg; msg << "L1Station: " << this->ToString() << " has incorrect time resolution value: " @@ -73,9 +73,9 @@ void L1Station::CheckConsistency() const /* * Check consistency of other members */ - - //materialInfo.CheckConsistency(); - // TODO: Temporarily switched off, because Much has RL = 0, which is actually incorrect, but really is not used. + + //materialInfo.CheckConsistency(); + // TODO: Temporarily switched off, because Much has RL = 0, which is actually incorrect, but really is not used. // One should provide average radiation length values for each Much layer (S.Zharko) fieldSlice.CheckConsistency(); frontInfo.CheckConsistency(); @@ -100,9 +100,7 @@ std::string L1Station::ToString(int verbosityLevel, int indentLevel) const if (verbosityLevel > 1) { // TODO: probably we can have verbosity level and address for each underlying object (S.Zharko) } - if (verbosityLevel == 0) { - aStream << "L1Station at z = " << z[0] << " cm" ; - } + if (verbosityLevel == 0) { aStream << "L1Station at z = " << z[0] << " cm"; } else { aStream << '\n' << indent << "Address: " << this << '\n'; aStream << indent << "Station type ID: " << std::setw(12) << std::setfill(' ') << type << '\n'; diff --git a/reco/L1/L1Algo/L1Station.h b/reco/L1/L1Algo/L1Station.h index 8a8a51f706..ac7762f727 100644 --- a/reco/L1/L1Algo/L1Station.h +++ b/reco/L1/L1Algo/L1Station.h @@ -10,22 +10,23 @@ #include "L1Field.h" #include "L1MaterialInfo.h" #include "L1UMeasurementInfo.h" -#include "L1XYMeasurementInfo.h" #include "L1Utils.h" +#include "L1XYMeasurementInfo.h" /// Structure L1Station /// Contains a set of geometry parameters for a particular station /// struct L1Station { int type {-1}; - int timeInfo {-1}; ///< flag: if time information can be used - int fieldStatus {-1}; ///< flag: 1 - station is INSIDE the field, 0 - station is OUTSIDE the field - fvec z {L1Utils::kNaN}; ///< z position of station [cm] - fvec Rmin {L1Utils::kNaN}; ///< min radius of the station [cm] - fvec Rmax {L1Utils::kNaN}; ///< max radius of the station [cm] - fvec dt {L1Utils::kNaN}; ///< time resolution [ns] - L1MaterialInfo materialInfo {}; ///< structure containing station thickness(X), rad. length (X0), X/X0 and log(X/X0) values - L1FieldSlice fieldSlice {}; + int timeInfo {-1}; ///< flag: if time information can be used + int fieldStatus {-1}; ///< flag: 1 - station is INSIDE the field, 0 - station is OUTSIDE the field + fvec z {L1Utils::kNaN}; ///< z position of station [cm] + fvec Rmin {L1Utils::kNaN}; ///< min radius of the station [cm] + fvec Rmax {L1Utils::kNaN}; ///< max radius of the station [cm] + fvec dt {L1Utils::kNaN}; ///< time resolution [ns] + L1MaterialInfo + materialInfo {}; ///< structure containing station thickness(X), rad. length (X0), X/X0 and log(X/X0) values + L1FieldSlice fieldSlice {}; L1UMeasurementInfo frontInfo {}; L1UMeasurementInfo backInfo {}; L1UMeasurementInfo xInfo {}; @@ -35,7 +36,7 @@ struct L1Station { /// Prints object fields /// \param verbosity Verbosity level of the output void Print(int verbosity = 0) const; - + /// String representation of class contents /// \param verbosityLevel Verbosity level of the output /// \param indentLevel Number of indent characters in the output diff --git a/reco/L1/L1Algo/L1TrackFitter.cxx b/reco/L1/L1Algo/L1TrackFitter.cxx index da954dee68..bb655d3432 100644 --- a/reco/L1/L1Algo/L1TrackFitter.cxx +++ b/reco/L1/L1Algo/L1TrackFitter.cxx @@ -264,7 +264,7 @@ void L1Algo::KFTrackFitter_simple() // TODO: Add pipe. for (int i = 1; i < nHits; i++) { const L1Hit& hit = (*vStsHits)[hits[i]]; ista = (*fStripFlag)[hit.f] / 4; - const L1Station& sta = fParameters.GetStation(ista); + const L1Station& sta = fParameters.GetStation(ista); fvec u = hit.u; fvec v = hit.v; fvec x, y; @@ -355,13 +355,15 @@ void L1Algo::L1KFTrackFitter() const L1Station* sta = fParameters.GetStations().begin(); L1Station staFirst, staLast; fvec x[L1Constants::size::kMaxNstations], u[L1Constants::size::kMaxNstations], v[L1Constants::size::kMaxNstations], - y[L1Constants::size::kMaxNstations], time[L1Constants::size::kMaxNstations], timeEr[L1Constants::size::kMaxNstations], - z[L1Constants::size::kMaxNstations]; - fvec d_x[L1Constants::size::kMaxNstations], d_y[L1Constants::size::kMaxNstations], d_xy[L1Constants::size::kMaxNstations], - d_u[L1Constants::size::kMaxNstations], d_v[L1Constants::size::kMaxNstations]; + y[L1Constants::size::kMaxNstations], time[L1Constants::size::kMaxNstations], + timeEr[L1Constants::size::kMaxNstations], z[L1Constants::size::kMaxNstations]; + fvec d_x[L1Constants::size::kMaxNstations], d_y[L1Constants::size::kMaxNstations], + d_xy[L1Constants::size::kMaxNstations], d_u[L1Constants::size::kMaxNstations], + d_v[L1Constants::size::kMaxNstations]; fvec x_first, y_first, time_first, x_last, y_last, time_last, time_er_first, time_er_last, d_x_fst, d_y_fst, d_xy_fst, time_er_lst, d_x_lst, d_y_lst, d_xy_lst; - fvec Sy[L1Constants::size::kMaxNstations], w[L1Constants::size::kMaxNstations], w_time[L1Constants::size::kMaxNstations]; + fvec Sy[L1Constants::size::kMaxNstations], w[L1Constants::size::kMaxNstations], + w_time[L1Constants::size::kMaxNstations]; fvec y_temp, x_temp; fvec fldZ0, fldZ1, fldZ2, z_start, z_end; L1FieldValue fB[L1Constants::size::kMaxNstations], fB_temp _fvecalignment; @@ -445,7 +447,7 @@ void L1Algo::L1KFTrackFitter() fscal cursy = 0., curSy = 0.; for (i = nHitsTrack - 1; i >= 0; i--) { const int ista = iSta[i]; - const L1Station& st = fParameters.GetStation(ista); + const L1Station& st = fParameters.GetStation(ista); const fscal curZ = z[ista][iVec]; fscal dZ = curZ - prevZ; fscal By = st.fieldSlice.cy[0][0]; @@ -781,10 +783,11 @@ void L1Algo::L1KFTrackFitterMuch() const L1Station* sta = fParameters.GetStations().begin(); L1Station staFirst, staLast; fvec x[L1Constants::size::kMaxNstations], u[L1Constants::size::kMaxNstations], v[L1Constants::size::kMaxNstations], - y[L1Constants::size::kMaxNstations], time[L1Constants::size::kMaxNstations], timeEr[L1Constants::size::kMaxNstations], - z[L1Constants::size::kMaxNstations]; - fvec d_x[L1Constants::size::kMaxNstations], d_y[L1Constants::size::kMaxNstations], d_xy[L1Constants::size::kMaxNstations], - d_u[L1Constants::size::kMaxNstations], d_v[L1Constants::size::kMaxNstations]; + y[L1Constants::size::kMaxNstations], time[L1Constants::size::kMaxNstations], + timeEr[L1Constants::size::kMaxNstations], z[L1Constants::size::kMaxNstations]; + fvec d_x[L1Constants::size::kMaxNstations], d_y[L1Constants::size::kMaxNstations], + d_xy[L1Constants::size::kMaxNstations], d_u[L1Constants::size::kMaxNstations], + d_v[L1Constants::size::kMaxNstations]; fvec x_first, y_first, time_first, x_last, y_last, time_last, time_er_fst, d_x_fst, d_y_fst, d_xy_fst, time_er_lst, d_x_lst, d_y_lst, d_xy_lst, dz; int iSta[L1Constants::size::kMaxNstations]; @@ -884,7 +887,7 @@ void L1Algo::L1KFTrackFitterMuch() // for(i = nHitsTrack - 1; i >= 0; i-- ){ for (i = 0; i < nHitsTrackSts; i++) { const int ista = iSta[i]; - const L1Station& st = fParameters.GetStation(ista); + const L1Station& st = fParameters.GetStation(ista); const fscal curZ = z[ista][iVec]; fscal dZ = curZ - prevZ; fscal By = st.fieldSlice.cy[0][0]; @@ -968,7 +971,8 @@ void L1Algo::L1KFTrackFitterMuch() if constexpr (L1Constants::control::kIfUseRadLengthTable) { T1.EnergyLossCorrection(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, fvec(-1.f), wIn); - T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, wIn, sta[i].materialInfo.thick, 1); + T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, wIn, + sta[i].materialInfo.thick, 1); } else { // L1AddMaterial( T, sta[i].materialInfo, qp0, wIn ); @@ -1037,19 +1041,19 @@ void L1Algo::L1KFTrackFitterMuch() w2 = w2 & (one - mask1); -// T1.ExtrapolateLine( z_last, &w1); -// L1ExtrapolateLine( T, z_last); -// TODO: Unify energy loss corrections (S.Zharko) + // T1.ExtrapolateLine( z_last, &w1); + // L1ExtrapolateLine( T, z_last); + // TODO: Unify energy loss corrections (S.Zharko) if constexpr (L1Constants::control::kIfUseRadLengthTable) { if (i == 11 || i == 14 || i == 17) - T1.EnergyLossCorrectionIron(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f), - wIn); + T1.EnergyLossCorrectionIron(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, + fvec(-1.f), wIn); if (i == 8) - T1.EnergyLossCorrectionCarbon(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f), - wIn); + T1.EnergyLossCorrectionCarbon(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, + fvec(-1.f), wIn); if (i == 9 || i == 10 || i == 12 || i == 13 || i == 15 || i == 16 || i == 18 || i == 19) - T1.EnergyLossCorrectionAl(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f), - wIn); + T1.EnergyLossCorrectionAl(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, + fvec(-1.f), wIn); T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + fvec(1)), qp01, wIn, sta[i].materialInfo.thick / (nofSteps + fvec(1)), 1); @@ -1183,13 +1187,14 @@ void L1Algo::L1KFTrackFitterMuch() // TODO: Unify the selection of energy loss correction! (S.Zharko) if constexpr (L1Constants::control::kIfUseRadLengthTable) { if (i == 11 || i == 14 || i == 17) - T1.EnergyLossCorrectionIron(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f), - w2); + T1.EnergyLossCorrectionIron(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, + fvec(1.f), w2); if (i == 8) - T1.EnergyLossCorrectionCarbon(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f), - w2); + T1.EnergyLossCorrectionCarbon(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, + fvec(1.f), w2); if (i == 9 || i == 10 || i == 12 || i == 13 || i == 15 || i == 16 || i == 18) - T1.EnergyLossCorrectionAl(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f), w2); + T1.EnergyLossCorrectionAl(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, + fvec(1.f), w2); T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + fvec(1)), qp01, w2, sta[i].materialInfo.thick / (nofSteps + fvec(1)), 0); @@ -1257,7 +1262,8 @@ void L1Algo::L1KFTrackFitterMuch() if constexpr (L1Constants::control::kIfUseRadLengthTable) { T1.EnergyLossCorrection(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, fvec(1.f), wIn); - T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, wIn, sta[i].materialInfo.thick, 0); + T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, wIn, + sta[i].materialInfo.thick, 0); } else { fit.L1AddMaterial(T, sta[i].materialInfo, qp0, wIn); diff --git a/reco/L1/L1Algo/L1UMeasurementInfo.cxx b/reco/L1/L1Algo/L1UMeasurementInfo.cxx index 2f8992f2be..f0c94375e0 100644 --- a/reco/L1/L1Algo/L1UMeasurementInfo.cxx +++ b/reco/L1/L1Algo/L1UMeasurementInfo.cxx @@ -29,7 +29,7 @@ void L1UMeasurementInfo::CheckConsistency() const L1Utils::CheckSimdVectorEquality(cos_phi, "L1UMeasurementsInfo::cos_phi"); L1Utils::CheckSimdVectorEquality(sin_phi, "L1UMeasurementsInfo::sin_phi"); L1Utils::CheckSimdVectorEquality(sigma2, "L1UMeasurementsInfo::sigma2"); - + /*(ii) Sigma2 possible values*/ if (sigma2[0] < 0) { std::stringstream msg; diff --git a/reco/L1/L1Algo/L1UMeasurementInfo.h b/reco/L1/L1Algo/L1UMeasurementInfo.h index 3a33617d2a..7452c60de0 100644 --- a/reco/L1/L1Algo/L1UMeasurementInfo.h +++ b/reco/L1/L1Algo/L1UMeasurementInfo.h @@ -7,8 +7,8 @@ #include <string> -#include "L1Utils.h" #include "L1Def.h" +#include "L1Utils.h" class L1UMeasurementInfo { @@ -16,7 +16,7 @@ public: fvec cos_phi {0.f}; fvec sin_phi {0.f}; fvec sigma2 {0.f}; - + /// String representation of class contents /// \param indentLevel number of indent characters in the output std::string ToString(int indentLevel = 0) const; diff --git a/reco/L1/L1Algo/L1Utils.h b/reco/L1/L1Algo/L1Utils.h index fee4f61e52..10f0b6f892 100644 --- a/reco/L1/L1Algo/L1Utils.h +++ b/reco/L1/L1Algo/L1Utils.h @@ -13,11 +13,12 @@ #include <iomanip> #include <limits> #include <map> -#include <cmath> #include <sstream> #include <string> #include <unordered_map> +#include <cmath> + #include "vectors/P4_F32vec4.h" /// Class contains some utility functions for L1Algo @@ -29,12 +30,12 @@ struct L1Utils { /// Comparison method for floats /// \param lhs Left floating point to compare /// \param rhs Right floating point to compare - /// \return Comparison result: true - equals within epsilon - template <typename T> + /// \return Comparison result: true - equals within epsilon + template<typename T> static bool CmpFloats(T lhs, T rhs) { static_assert(!std::numeric_limits<T>::is_integer, "L1Utils::CmpFloatingPoint does not work with integers"); - return fabs(lhs - rhs) < 2. * std::numeric_limits<T>::epsilon() * fabs(lhs + rhs) + return fabs(lhs - rhs) < 2. * std::numeric_limits<T>::epsilon() * fabs(lhs + rhs) || fabs(lhs - rhs) < std::numeric_limits<T>::min(); } diff --git a/reco/L1/L1Algo/L1XYMeasurementInfo.cxx b/reco/L1/L1Algo/L1XYMeasurementInfo.cxx index b8eba31513..7549f80c69 100644 --- a/reco/L1/L1Algo/L1XYMeasurementInfo.cxx +++ b/reco/L1/L1Algo/L1XYMeasurementInfo.cxx @@ -3,10 +3,12 @@ Authors: Sergey Gorbunov, Sergei Zharko [committer] */ #include "L1XYMeasurementInfo.h" -#include "L1Utils.h" + #include <iomanip> #include <sstream> // for stringstream +#include "L1Utils.h" + void L1XYMeasurementInfo::CheckConsistency() const { /* (i) Checks for the horizontal equality of SIMD vector elements */ diff --git a/reco/L1/L1Algo/L1XYMeasurementInfo.h b/reco/L1/L1Algo/L1XYMeasurementInfo.h index d8b7ac0c6b..e0b933e106 100644 --- a/reco/L1/L1Algo/L1XYMeasurementInfo.h +++ b/reco/L1/L1Algo/L1XYMeasurementInfo.h @@ -15,7 +15,7 @@ public: fvec C00 {0}; fvec C10 {0}; fvec C11 {0}; - + /// Consistency checker void CheckConsistency() const; diff --git a/reco/L1/ParticleFinder/CbmL1PFFitter.cxx b/reco/L1/ParticleFinder/CbmL1PFFitter.cxx index 1dc9c06b1b..0c0d71e7cd 100644 --- a/reco/L1/ParticleFinder/CbmL1PFFitter.cxx +++ b/reco/L1/ParticleFinder/CbmL1PFFitter.cxx @@ -263,7 +263,8 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo) } if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, wIn); - fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, -1, wIn); + fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, + -1, wIn); } else { fit.L1AddMaterial(T, sta[i].materialInfo, qp0, wIn); @@ -339,7 +340,8 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo) } if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, wIn); - fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, 1, wIn); + fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, 1, + wIn); } else { fit.L1AddMaterial(T, sta[i].materialInfo, qp0, wIn); @@ -504,7 +506,8 @@ void CbmL1PFFitter::GetChiToVertex(vector<CbmStsTrack>& Tracks, vector<L1FieldRe fit.EnergyLossCorrection(T, fit.PipeRadThick, T.qp, fvec(1.f), w); } fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(iSt, T.x, T.y), T.qp, w); - fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(iSt, T.x, T.y), T.qp, fvec(1.f), w); + fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(iSt, T.x, T.y), T.qp, + fvec(1.f), w); } if (NMvdStations <= 0) { fit.L1AddPipeMaterial(T, T.qp, ONE); diff --git a/reco/L1/vectors/P4_F32vec4.h b/reco/L1/vectors/P4_F32vec4.h index 1d22e5e241..aaaca2fe7b 100644 --- a/reco/L1/vectors/P4_F32vec4.h +++ b/reco/L1/vectors/P4_F32vec4.h @@ -229,24 +229,15 @@ public: } /// Checks, if all bands are equal - /// NOTE: two values defined as signaling_NaN() are not equal, thus if there are all or one + /// NOTE: two values defined as signaling_NaN() are not equal, thus if there are all or one /// of the words are kNaN, the function returns false - bool IsHorizontallyEqual() const - { - return v[0] == v[1] && v[1] == v[2] && v[2] == v[3]; - } + bool IsHorizontallyEqual() const { return v[0] == v[1] && v[1] == v[2] && v[2] == v[3]; } /// Checks, if any of the bands is NaN - bool IsNanAny() const - { - return std::isnan(v[0]) || std::isnan(v[1]) || std::isnan(v[2]) || std::isnan(v[3]); - } + bool IsNanAny() const { return std::isnan(v[0]) || std::isnan(v[1]) || std::isnan(v[2]) || std::isnan(v[3]); } /// Checks, if all of the bands is NaN - bool IsNanAll() const - { - return std::isnan(v[0]) && std::isnan(v[1]) && std::isnan(v[2]) && std::isnan(v[3]); - } + bool IsNanAll() const { return std::isnan(v[0]) && std::isnan(v[1]) && std::isnan(v[2]) && std::isnan(v[3]); } } __attribute__((aligned(16))); -- GitLab