From e46961b039168422f871e5ab2a08c66130c3fe36 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Tue, 16 Apr 2024 19:16:18 +0200 Subject: [PATCH] asldjlkjlk Signed-off-by: Felix Schlepper --- Detectors/GlobalTracking/CMakeLists.txt | 60 ++++++++++--------- .../include/GlobalTracking/MatchTPCITS.h | 34 ++++++++--- Detectors/GlobalTracking/src/MatchTPCITS.cxx | 6 +- .../GlobalTrackingWorkflow/CMakeLists.txt | 6 +- .../TPCITSMatchingSpec.h | 2 +- .../src/TPCITSMatchingSpec.cxx | 28 +++++++-- .../src/tpcits-match-workflow.cxx | 6 +- .../ITS3/reconstruction/CMakeLists.txt | 3 + .../include/ITS3Reconstruction/IOUtils.h | 60 ++++++++++++------- .../ITS3Reconstruction/TopologyDictionary.h | 7 ++- .../ITS3/reconstruction/src/IOUtils.cxx | 50 ++++++++++++---- .../reconstruction/src/TopologyDictionary.cxx | 14 +++-- cmake/O2AddLibrary.cmake | 13 +++- 13 files changed, 202 insertions(+), 87 deletions(-) diff --git a/Detectors/GlobalTracking/CMakeLists.txt b/Detectors/GlobalTracking/CMakeLists.txt index bd5fb4f9976d1..fdf933defe09e 100644 --- a/Detectors/GlobalTracking/CMakeLists.txt +++ b/Detectors/GlobalTracking/CMakeLists.txt @@ -8,7 +8,8 @@ # In applying this license CERN does not waive the privileges and immunities # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -# add_compile_options(-O0 -g -fPIC) + +add_compile_options(-O0 -g -fPIC -fno-omit-frame-pointer) o2_add_library(GlobalTracking TARGETVARNAME targetName @@ -24,34 +25,35 @@ o2_add_library(GlobalTracking src/ITSTPCMatchingQCParams.cxx src/MatchGlobalFwdParam.cxx src/MatchTOFParams.cxx - PUBLIC_LINK_LIBRARIES O2::Framework - O2::DataFormatsTPC - O2::DataFormatsITSMFT - O2::DataFormatsITS - O2::DataFormatsFT0 - O2::DataFormatsTOF - O2::DataFormatsHMP - O2::DataFormatsTRD - O2::ITSReconstruction - O2::FT0Reconstruction - O2::TPCFastTransformation - O2::GPUO2Interface - O2::TPCBase - O2::TPCReconstruction - O2::TPCCalibration - O2::TOFBase - O2::HMPIDReconstruction - O2::TOFCalibration - O2::TOFWorkflowUtils - O2::SimConfig - O2::DataFormatsFT0 - O2::DataFormatsGlobalTracking - O2::ITStracking - O2::MFTTracking - O2::MCHTracking - O2::MathUtils - O2::ReconstructionDataFormats - O2::Steer) + PUBLIC_LINK_LIBRARIES O2::Framework + O2::DataFormatsTPC + O2::DataFormatsITSMFT + O2::DataFormatsITS + O2::DataFormatsFT0 + O2::DataFormatsTOF + O2::DataFormatsHMP + O2::DataFormatsTRD + O2::ITSReconstruction + O2::FT0Reconstruction + O2::TPCFastTransformation + O2::GPUO2Interface + O2::TPCBase + O2::TPCReconstruction + O2::TPCCalibration + O2::TOFBase + O2::HMPIDReconstruction + O2::TOFCalibration + O2::TOFWorkflowUtils + O2::SimConfig + O2::DataFormatsFT0 + O2::DataFormatsGlobalTracking + O2::ITStracking + O2::MFTTracking + O2::MCHTracking + O2::MathUtils + O2::ReconstructionDataFormats + O2::Steer + PUBLIC_UPGRADE_LINK_LIBRARIES O2::ITS3Reconstruction) o2_target_root_dictionary(GlobalTracking HEADERS include/GlobalTracking/MatchTPCITSParams.h diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h index a2cb21bdaf04f..f20d6a49b15e0 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h @@ -58,6 +58,9 @@ #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__) #include "MemoryResources/MemoryResources.h" #endif +#ifdef ENABLE_UPGRADES +#include "ITS3Reconstruction/TopologyDictionary.h" +#endif class TTree; @@ -356,7 +359,10 @@ class MatchTPCITS pmr::vector& ABTrackletRefs, pmr::vector>& calib); bool refitABTrack(int iITSAB, const TPCABSeed& seed, pmr::vector& matchedTracks, pmr::vector& ABTrackletClusterIDs, pmr::vector& ABTrackletRefs); #endif // CLING - void setSkipTPCOnly(bool v) { mSkipTPCOnly = v; } + void setSkipTPCOnly(bool v) + { + mSkipTPCOnly = v; + } void setCosmics(bool v) { mCosmics = v; } bool isCosmics() const { return mCosmics; } void setNThreads(int n); @@ -393,6 +399,12 @@ class MatchTPCITS // ==================== >> DPL-driven input >> ======================= void setITSDictionary(const o2::itsmft::TopologyDictionary* d) { mITSDict = d; } +#ifdef ENABLE_UPGRADES + void setIT3Dictionary(const o2::its3::TopologyDictionary* d) + { + mIT3Dict = d; + } +#endif ///< set flag to use MC truth void setMCTruthOn(bool v) @@ -400,6 +412,8 @@ class MatchTPCITS mMCTruthON = v; } + void setWithIT3(bool v) { mWithIT3 = v; } + ///< request VDrift calibration void setVDriftCalib(bool v) { @@ -560,6 +574,7 @@ class MatchTPCITS bool mFieldON = true; ///< flag for field ON/OFF bool mCosmics = false; ///< flag cosmics mode bool mMCTruthON = false; ///< flag availability of MC truth + bool mWithIT3 = false; ///< flag availability of using IT3 float mBz = 0; ///< nominal Bz int mTFCount = 0; ///< internal TF counter for debugger int mNThreads = 1; ///< number of OMP threads @@ -639,6 +654,9 @@ class MatchTPCITS gsl::span mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map const o2::itsmft::TopologyDictionary* mITSDict{nullptr}; // cluster patterns dictionary +#ifdef ENABLE_UPGRADES + const o2::its3::TopologyDictionary* mIT3Dict{nullptr}; // cluster patterns dictionary +#endif const o2::tpc::ClusterNativeAccess* mTPCClusterIdxStruct = nullptr; ///< struct holding the TPC cluster indices @@ -652,9 +670,9 @@ class MatchTPCITS size_t mNMatchesControl = 0; size_t mNABRefsClus = 0; - float mAB2MatchGuess = 0.2; // heuristic guess about fraction of AB matches in total matches - std::vector mInteractions; ///< possible interaction times - std::vector mInteractionMUSLUT; ///< LUT for interactions in 1MUS bins + float mAB2MatchGuess = 0.2; // heuristic guess about fraction of AB matches in total matches + std::vector mInteractions; ///< possible interaction times + std::vector mInteractionMUSLUT; ///< LUT for interactions in 1MUS bins ///< container for record the match of TPC track to single ITS track std::vector mMatchRecordsTPC; // RSS DEQ @@ -662,12 +680,12 @@ class MatchTPCITS std::vector mMatchRecordsITS; // RSS DEQ //// std::vector mITSROFofTPCBin; ///< aux structure for mapping of TPC time-bins on ITS ROFs - std::vector mITSROFTimes; ///< min/max times of ITS ROFs in \mus - std::vector mTPCWork; ///< TPC track params prepared for matching - std::vector mITSWork; ///< ITS track params prepared for matching + std::vector mITSROFTimes; ///< min/max times of ITS ROFs in \mus + std::vector mTPCWork; ///< TPC track params prepared for matching + std::vector mITSWork; ///< ITS track params prepared for matching std::vector mTPCLblWork; ///< TPC track labels std::vector mITSLblWork; ///< ITS track labels - std::vector mWinnerChi2Refit; ///< vector of refitChi2 for winners + std::vector mWinnerChi2Refit; ///< vector of refitChi2 for winners // ------------------------------ std::vector mTPCABSeeds; ///< pool of primary TPC seeds for AB diff --git a/Detectors/GlobalTracking/src/MatchTPCITS.cxx b/Detectors/GlobalTracking/src/MatchTPCITS.cxx index 2a6e8efd9ed03..71bc577ecb9eb 100644 --- a/Detectors/GlobalTracking/src/MatchTPCITS.cxx +++ b/Detectors/GlobalTracking/src/MatchTPCITS.cxx @@ -235,7 +235,9 @@ void MatchTPCITS::init() } #endif - mRGHelper.init(); // prepare helper for TPC track / ITS clusters matching + if (mParams->runAfterBurner) { + mRGHelper.init(); // prepare helper for TPC track / ITS clusters matching + } clear(); @@ -1506,7 +1508,7 @@ bool MatchTPCITS::refitTrackTPCITS(int slot, int iTPC, int& iITS, pmr::vector; using MCLabelsTr = gsl::span; @@ -64,8 +68,8 @@ class TPCITSMatchingDPL : public Task { public: TPCITSMatchingDPL(std::shared_ptr dr, std::shared_ptr gr, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts, - bool useFT0, bool calib, bool skipTPCOnly, bool useMC) - : mDataRequest(dr), mGGCCDBRequest(gr), mUseFT0(useFT0), mCalibMode(calib), mSkipTPCOnly(skipTPCOnly), mUseMC(useMC) + bool useFT0, bool calib, bool skipTPCOnly, bool useMC, bool withIT3) + : mDataRequest(dr), mGGCCDBRequest(gr), mUseFT0(useFT0), mCalibMode(calib), mSkipTPCOnly(skipTPCOnly), mUseMC(useMC), mWithIT3(withIT3) { mTPCCorrMapsLoader.setLumiScaleType(sclOpts.lumiType); mTPCCorrMapsLoader.setLumiScaleMode(sclOpts.lumiMode); @@ -87,6 +91,7 @@ class TPCITSMatchingDPL : public Task bool mCalibMode = false; bool mSkipTPCOnly = false; // to use only externally constrained tracks (for test only) bool mUseMC = true; + bool mWithIT3 = false; TStopwatch mTimer; }; @@ -147,10 +152,17 @@ void TPCITSMatchingDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) return; } if (matcher == ConcreteDataMatcher("ITS", "CLUSDICT", 0)) { - LOG(info) << "cluster dictionary updated"; + LOG(info) << "its cluster dictionary updated"; mMatching.setITSDictionary((const o2::itsmft::TopologyDictionary*)obj); return; } +#ifdef ENABLE_UPGRADES + if (matcher == ConcreteDataMatcher("IT3", "CLUSDICT", 0)) { + LOG(info) << "it3 cluster dictionary updated"; + mMatching.setIT3Dictionary((const o2::its3::TopologyDictionary*)obj); + return; + } +#endif if (matcher == ConcreteDataMatcher("ITS", "ALPIDEPARAM", 0)) { LOG(info) << "ITS Alpide param updated"; const auto& par = o2::itsmft::DPLAlpideParam::Instance(); @@ -185,6 +197,7 @@ void TPCITSMatchingDPL::updateTimeDependentParams(ProcessingContext& pc) mMatching.setSkipTPCOnly(mSkipTPCOnly); mMatching.setITSTriggered(!o2::base::GRPGeomHelper::instance().getGRPECS()->isDetContinuousReadOut(o2::detectors::DetID::ITS)); mMatching.setMCTruthOn(mUseMC); + mMatching.setWithIT3(mWithIT3); mMatching.setUseFT0(mUseFT0); mMatching.setVDriftCalib(mCalibMode); if (o2::base::GRPGeomHelper::instance().getGRPECS()->getRunType() != o2::parameters::GRPECSObject::RunType::COSMICS) { @@ -223,7 +236,7 @@ void TPCITSMatchingDPL::updateTimeDependentParams(ProcessingContext& pc) } } -DataProcessorSpec getTPCITSMatchingSpec(GTrackID::mask_t src, bool useFT0, bool calib, bool skipTPCOnly, bool useGeom, bool useMC, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts) +DataProcessorSpec getTPCITSMatchingSpec(GTrackID::mask_t src, bool useFT0, bool calib, bool skipTPCOnly, bool useGeom, bool useMC, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts, bool withIT3) { std::vector outputs; auto dataRequest = std::make_shared(); @@ -251,6 +264,11 @@ DataProcessorSpec getTPCITSMatchingSpec(GTrackID::mask_t src, bool useFT0, bool outputs.emplace_back("GLO", "TPCITSAB_MC", 0, Lifetime::Timeframe); // AfterBurner ITS tracklet MC } // Note: ITS/CLUSDICT and ITS/ALPIDEPARAM are requested/loaded by the recocontainer +#ifdef ENABLE_UPGRADES + if (withIT3) { + dataRequest->inputs.emplace_back("cldict", "IT3", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("IT3/Calib/ClusterDictionary")); + } +#endif auto ggRequest = std::make_shared(true, // orbitResetTime true, // GRPECS=true @@ -276,7 +294,7 @@ DataProcessorSpec getTPCITSMatchingSpec(GTrackID::mask_t src, bool useFT0, bool "itstpc-track-matcher", dataRequest->inputs, outputs, - AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, sclOpts, useFT0, calib, skipTPCOnly, useMC)}, + AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, sclOpts, useFT0, calib, skipTPCOnly, useMC, withIT3)}, opts}; } diff --git a/Detectors/GlobalTrackingWorkflow/src/tpcits-match-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/tpcits-match-workflow.cxx index c34f1fc79946a..61e3e7247ad17 100644 --- a/Detectors/GlobalTrackingWorkflow/src/tpcits-match-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/tpcits-match-workflow.cxx @@ -43,6 +43,7 @@ void customize(std::vector& workflowOptions) {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}}, {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}}, {"track-sources", VariantType::String, "TPC", {"comma-separated list of sources to use: TPC,TPC-TOF,TPC-TRD,TPC-TRD-TOF"}}, + {"with-it3", VariantType::Bool, false, {"run with IT3 detector instead of ITS"}}, {"produce-calibration-data", o2::framework::VariantType::Bool, false, {"produce output for TPC vdrift calibration"}}, {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight ITS part"}}, {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}}; @@ -84,7 +85,8 @@ WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& configcont } auto useMC = !configcontext.options().get("disable-mc"); auto calib = configcontext.options().get("produce-calibration-data"); - auto srcL = src | GID::getSourcesMask("ITS,TPC"); // ITS is neadded always, TPC must be loaded even if bare TPC tracks are not used in matching + auto withIT3 = configcontext.options().get("with-it3"); + auto srcL = src | GID::getSourcesMask("ITS,TPC"); // ITS is needed always, TPC must be loaded even if bare TPC tracks are not used in matching if (sclOpt.requestCTPLumi) { srcL = srcL | GID::getSourcesMask("CTP"); } @@ -93,7 +95,7 @@ WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& configcont if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get("disable-root-input")) { specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableMShapeCorrection)); } - specs.emplace_back(o2::globaltracking::getTPCITSMatchingSpec(srcL, useFT0, calib, !GID::includesSource(GID::TPC, src), useGeom, useMC, sclOpt)); + specs.emplace_back(o2::globaltracking::getTPCITSMatchingSpec(srcL, useFT0, calib, !GID::includesSource(GID::TPC, src), useGeom, useMC, sclOpt, withIT3)); if (!configcontext.options().get("disable-root-output")) { specs.emplace_back(o2::globaltracking::getTrackWriterTPCITSSpec(useMC)); diff --git a/Detectors/Upgrades/ITS3/reconstruction/CMakeLists.txt b/Detectors/Upgrades/ITS3/reconstruction/CMakeLists.txt index b69a810bd7846..97bc47bc1a2a5 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/CMakeLists.txt +++ b/Detectors/Upgrades/ITS3/reconstruction/CMakeLists.txt @@ -8,6 +8,9 @@ # In applying this license CERN does not waive the privileges and immunities # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. +# + +add_compile_options(-O0 -g -fPIC -fno-omit-frame-pointer) o2_add_library(ITS3Reconstruction TARGETVARNAME targetName diff --git a/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h b/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h index 69c445c296366..d984d77cc9179 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h +++ b/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h @@ -10,35 +10,55 @@ // or submit itself to any jurisdiction. #include #include "SimulationDataFormat/MCTruthContainer.h" +#include "ReconstructionDataFormats/BaseCluster.h" +#include "DataFormatsITSMFT/CompCluster.h" +#include "DataFormatsITSMFT/ROFRecord.h" +#include "ITS3Reconstruction/TopologyDictionary.h" +#include "ITStracking/TimeFrame.h" +#include "ITStracking/IOUtils.h" +#include "ITS3Base/SegmentationSuperAlpide.h" +#include "ITS3Base/SpecsV2.h" -namespace o2 +namespace o2::its3::ioutils { -namespace its +using SSAlpide = o2::its3::SegmentationSuperAlpide; +constexpr float DefClusErrorRow = o2::its3::SegmentationSuperAlpide::mPitchRow * 0.5; +constexpr float DefClusErrorCol = o2::its3::SegmentationSuperAlpide::mPitchCol * 0.5; +constexpr float DefClusError2Row = DefClusErrorRow * DefClusErrorRow; +constexpr float DefClusError2Col = DefClusErrorCol * DefClusErrorCol; + +template +o2::math_utils::Point3D extractClusterData(const itsmft::CompClusterExt& c, iterator& iter, const its3::TopologyDictionary* dict, T& sig2y, T& sig2z) { -class TimeFrame; + auto pattID = c.getPatternID(); + // Dummy COG errors (about half pixel size) + sig2y = (constants::detID::isDetITS3(c.getSensorID())) ? DefClusErrorRow : o2::its::ioutils::DefClusErrorRow; + sig2z = (constants::detID::isDetITS3(c.getSensorID())) ? DefClusErrorCol : o2::its::ioutils::DefClusErrorCol; + if (pattID != itsmft::CompCluster::InvalidPatternID) { + sig2y = dict->getErr2X(pattID); + sig2z = dict->getErr2Z(pattID); + if (!dict->isGroup(pattID)) { + return dict->getClusterCoordinates(c); + } else { + o2::itsmft::ClusterPattern patt(iter); + return dict->getClusterCoordinates(c, patt); + } + } else { + o2::itsmft::ClusterPattern patt(iter); + return dict->getClusterCoordinates(c, patt, false); + } } -namespace itsmft -{ -class ROFRecord; -class CompClusterExt; -} // namespace itsmft -namespace dataformats -{ -class MCCompLabel; -} // namespace dataformats -namespace its3 -{ -class TopologyDictionary; +void convertCompactClusters(gsl::span clusters, + gsl::span::iterator& pattIt, + std::vector>& output, + const its3::TopologyDictionary* dict); -namespace ioutils -{ int loadROFrameDataITS3(its::TimeFrame* tf, gsl::span rofs, gsl::span clusters, gsl::span::iterator& pattIt, const its3::TopologyDictionary* dict, const dataformats::MCTruthContainer* mcLabels = nullptr); -} -} // namespace its3 -} // namespace o2 \ No newline at end of file + +} // namespace o2::its3::ioutils diff --git a/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/TopologyDictionary.h b/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/TopologyDictionary.h index 06e8ddfe5b287..a11131ed9f61f 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/TopologyDictionary.h +++ b/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/TopologyDictionary.h @@ -120,9 +120,12 @@ class TopologyDictionary /// Returns the local position of a compact cluster /// Returns the local position of a compact cluster - math_utils::Point3D getClusterCoordinates(const itsmft::CompClusterExt& cl) const; + template + math_utils::Point3D getClusterCoordinates(const itsmft::CompClusterExt& cl) const; + /// Returns the local position of a compact cluster - static math_utils::Point3D getClusterCoordinates(const itsmft::CompClusterExt& cl, const itsmft::ClusterPattern& patt, bool isGroup = true); + template + static math_utils::Point3D getClusterCoordinates(const itsmft::CompClusterExt& cl, const itsmft::ClusterPattern& patt, bool isGroup = true); static TopologyDictionary* loadFrom(const std::string& fileName = "", const std::string& objName = "ccdb_object"); diff --git a/Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx b/Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx index fd8a7d333037e..918ca26c3ac5b 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx +++ b/Detectors/Upgrades/ITS3/reconstruction/src/IOUtils.cxx @@ -9,21 +9,49 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ITS3Reconstruction/IOUtils.h" +#include "ITStracking/IOUtils.h" +#include "ITStracking/TimeFrame.h" +#include "DataFormatsITSMFT/CompCluster.h" +#include "DataFormatsITSMFT/ROFRecord.h" +#include "ITS3Reconstruction/TopologyDictionary.h" +#include "ITSBase/GeometryTGeo.h" +#include "ITSMFTBase/SegmentationAlpide.h" +#include "ITS3Base/SegmentationSuperAlpide.h" #include "ITS3Base/SpecsV2.h" +#include "ITStracking/TrackingConfigParam.h" namespace o2::its3::ioutils { -using SSAlpide = o2::its3::SegmentationSuperAlpide; + +/// convert compact clusters to 3D spacepoints +void convertCompactClusters(gsl::span clusters, + gsl::span::iterator& pattIt, + std::vector>& output, + const its3::TopologyDictionary* dict) +{ + auto geom = o2::its::GeometryTGeo::Instance(); + bool applyMisalignment = false; + const auto& conf = o2::its::TrackerParamConfig::Instance(); + for (int il = 0; il < geom->getNumberOfLayers(); ++il) { + if (conf.sysErrY2[il] > 0.f || conf.sysErrZ2[il] > 0.f) { + applyMisalignment = true; + break; + } + } + + for (auto& c : clusters) { + float sigmaY2, sigmaZ2, sigmaYZ = 0; + auto locXYZ = extractClusterData(c, pattIt, dict, sigmaY2, sigmaZ2); + auto& cl3d = output.emplace_back(c.getSensorID(), geom->getMatrixT2L(c.getSensorID()) ^ locXYZ); // local --> tracking + if (applyMisalignment) { + auto lrID = geom->getLayer(c.getSensorID()); + sigmaY2 += conf.sysErrY2[lrID]; + sigmaZ2 += conf.sysErrZ2[lrID]; + } + cl3d.setErrors(sigmaY2, sigmaZ2, sigmaYZ); + } +} int loadROFrameDataITS3(its::TimeFrame* tf, gsl::span rofs, diff --git a/Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx b/Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx index ee36f26d61c51..66a4b0a6878cd 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx +++ b/Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx @@ -133,9 +133,10 @@ TH1F* TopologyDictionary::getTopologyDistribution(const std::string_view hname) return histo; } -math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmft::CompClusterExt& cl) const +template +math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmft::CompClusterExt& cl) const { - math_utils::Point3D locCl; + math_utils::Point3D locCl; if (!its3::constants::detID::isDetITS3(cl.getSensorID())) { o2::itsmft::SegmentationAlpide::detectorToLocalUnchecked(cl.getRow(), cl.getCol(), locCl); locCl.SetX(locCl.X() + this->getXCOG(cl.getPatternID()) * itsmft::SegmentationAlpide::PitchRow); @@ -152,7 +153,8 @@ math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmf return locCl; } -math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmft::CompClusterExt& cl, const itsmft::ClusterPattern& patt, bool isGroup) +template +math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmft::CompClusterExt& cl, const itsmft::ClusterPattern& patt, bool isGroup) { auto refRow = cl.getRow(); auto refCol = cl.getCol(); @@ -162,7 +164,7 @@ math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmf refRow -= round(xCOG); refCol -= round(zCOG); } - math_utils::Point3D locCl; + math_utils::Point3D locCl; if (!its3::constants::detID::isDetITS3(cl.getSensorID())) { o2::itsmft::SegmentationAlpide::detectorToLocalUnchecked(refRow + xCOG, refCol + zCOG, locCl); } else { @@ -190,4 +192,8 @@ TopologyDictionary* TopologyDictionary::loadFrom(const std::string& fname, const return dict; } +// Explicitly instaniate templates +template math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmft::CompClusterExt& cl) const; +template math_utils::Point3D TopologyDictionary::getClusterCoordinates(const itsmft::CompClusterExt& cl, const itsmft::ClusterPattern& patt, bool isGroup); + } // namespace o2::its3 diff --git a/cmake/O2AddLibrary.cmake b/cmake/O2AddLibrary.cmake index 2a0fcf8418ab4..39dfcab355fb6 100644 --- a/cmake/O2AddLibrary.cmake +++ b/cmake/O2AddLibrary.cmake @@ -61,7 +61,7 @@ function(o2_add_library baseTargetName) A "" "TARGETVARNAME" - "SOURCES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_LINK_LIBRARIES;PRIVATE_INCLUDE_DIRECTORIES;PRIVATE_LINK_LIBRARIES" + "SOURCES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_LINK_LIBRARIES;PRIVATE_INCLUDE_DIRECTORIES;PRIVATE_LINK_LIBRARIES;PUBLIC_UPGRADE_LINK_LIBRARIES" ) if(A_UNPARSED_ARGUMENTS) @@ -99,6 +99,17 @@ function(o2_add_library baseTargetName) endforeach() endif() + # Adding the public upgrade dependencies to other targets if ENABLE_UPGRADES is set + if(A_PUBLIC_UPGRADE_LINK_LIBRARIES AND ENABLE_UPGRADES) + foreach(L IN LISTS A_PUBLIC_UPGRADE_LINK_LIBRARIES) + string(FIND ${L} "::" NS) + if(${NS} EQUAL -1) + message(FATAL_ERROR "Trying to use a non-namespaced target ${L}") + endif() + target_link_libraries(${target} PUBLIC ${L}) + endforeach() + endif() + # Then add the private dependencies to other targets if(A_PRIVATE_LINK_LIBRARIES) foreach(L IN LISTS A_PRIVATE_LINK_LIBRARIES)