From 6f0452c0b1f5d0ce6ce87035ec23301a656d8eff Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Thu, 29 Jun 2023 16:04:27 +0200 Subject: [PATCH 01/12] Adding option for using derivative map --- .../calibration/src/CorrectionMapsLoader.cxx | 7 ++++- .../CorrectionMapsHelper.cxx | 2 +- .../CorrectionMapsHelper.h | 22 ++++++++++++-- GPU/TPCFastTransformation/TPCFastTransform.h | 29 +++++++++++++++++-- GPU/Workflow/src/GPUWorkflowSpec.cxx | 1 + 5 files changed, 54 insertions(+), 7 deletions(-) diff --git a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx index 2e557aac67dbf..ad99c408c23b8 100644 --- a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx +++ b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx @@ -64,6 +64,7 @@ void CorrectionMapsLoader::addOptions(std::vector& options) { addOption(options, ConfigParamSpec{"corrmap-lumi-mean", VariantType::Float, 0.f, {"override TPC corr.map mean lumi (if > 0), disable corrections if < 0"}}); addOption(options, ConfigParamSpec{"corrmap-lumi-inst", VariantType::Float, 0.f, {"override instantaneous CTP lumi (if > 0) for TPC corr.map scaling, disable corrections if < 0"}}); + addOption(options, ConfigParamSpec{"corrmap-lumi-scalemode", VariantType::Int, 0, {"override setting for scaling behaviour when using derivative maps"}}); } //________________________________________________________ @@ -116,12 +117,16 @@ void CorrectionMapsLoader::init(o2::framework::InitContext& ic) } mMeanLumiOverride = ic.options().get("corrmap-lumi-mean"); mInstLumiOverride = ic.options().get("corrmap-lumi-inst"); + mLumiScaleModeOverride = ic.options().get("corrmap-lumi-scalemode"); if (mMeanLumiOverride != 0.) { setMeanLumi(mMeanLumiOverride); } if (mInstLumiOverride != 0.) { setInstLumi(mInstLumiOverride); } - LOGP(info, "CTP Lumi request for TPC corr.map scaling={}, override values: lumiMean={} lumiInst={}", getUseCTPLumi() ? "ON" : "OFF", mMeanLumiOverride, mInstLumiOverride); + if (mLumiScaleModeOverride != 1) { + setLumiScaleMode(mLumiScaleModeOverride); + } + LOGP(info, "CTP Lumi request for TPC corr.map scaling={}, override values: lumiMean={} lumiInst={} lumiScaleMode={}", getUseCTPLumi() ? "ON" : "OFF", mMeanLumiOverride, mInstLumiOverride, mLumiScaleModeOverride); } #endif // #ifndef GPUCA_GPUCODE_DEVICE diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx index 9b837ccb80e7e..49b11d82bb38b 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx @@ -77,5 +77,5 @@ void CorrectionMapsHelper::setCorrMapRef(std::unique_ptr&& m) //________________________________________________________ void CorrectionMapsHelper::reportScaling() { - LOGP(info, "InstLumiOverride={}, UseCTPLumi={} -> instLumi={}, meanLumi={} -> LumiScale={}", getInstLumiOverride(), getUseCTPLumi(), getInstLumi(), getMeanLumi(), getLumiScale()); + LOGP(info, "InstLumiOverride={}, UseCTPLumi={} -> instLumi={}, meanLumi={} -> LumiScale={}, LumiScaleMode={}", getInstLumiOverride(), getUseCTPLumi(), getInstLumi(), getMeanLumi(), getLumiScale(), getLumiScaleMode()); } diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index a4bf4377cee44..648365c739555 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -80,11 +80,23 @@ class CorrectionMapsHelper } } + void setLumiScaleMode(int v) + { + if (v != mLumiScaleMode) { + mLumiScaleMode = v; + updateLumiScale(); + } + } + void updateLumiScale() { if (mMeanLumi < 0.f || mInstLumi < 0.f) { mLumiScale = -1.f; - } else { + } + else if(mLumiScaleMode == 1){ + mLumiScale = mInstLumi - mMeanLumi; + } + else { mLumiScale = mMeanLumi ? mInstLumi / mMeanLumi : 0.f; } setUpdatedLumi(); @@ -94,6 +106,7 @@ class CorrectionMapsHelper GPUd() float getInstLumi() const { return mInstLumi; } GPUd() float getMeanLumi() const { return mMeanLumi; } GPUd() float getLumiScale() const { return mLumiScale; } + GPUd() int getLumiScaleMode() const { return mLumiScaleMode; } bool isUpdated() const { return mUpdatedFlags != 0; } bool isUpdatedMap() const { return (mUpdatedFlags & UpdateFlags::MapBit) == 0; } @@ -119,6 +132,9 @@ class CorrectionMapsHelper void setInstLumiOverride(float f) { mInstLumiOverride = f; } float getInstLumiOverride() const { return mInstLumiOverride; } + void setLumiScaleModeOverride(int i) { mLumiScaleModeOverride = i; } + int getLumiScaleModeOverride() const { return mLumiScaleModeOverride; } + protected: enum UpdateFlags { MapBit = 0x1, MapRefBit = 0x2, @@ -128,9 +144,11 @@ class CorrectionMapsHelper int mUpdatedFlags = 0; float mInstLumi = 0.; // instanteneous luminosity (a.u) float mMeanLumi = 0.; // mean luminosity of the map (a.u) - float mLumiScale = 0.; // precalculated mInstLumi/mMeanLumi + int mLumiScaleMode = 0; // scaling-mode of the correciton maps + float mLumiScale = 0.; // precalculated lumi scaling float mMeanLumiOverride = -1.f; // optional value to override mean lumi float mInstLumiOverride = -1.f; // optional value to override inst lumi + int mLumiScaleModeOverride = 0; // optional value to choose scaling for correction map GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMap{nullptr}; // current transform GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMapRef{nullptr}; // reference transform #ifndef GPUCA_ALIROOT_LIB diff --git a/GPU/TPCFastTransformation/TPCFastTransform.h b/GPU/TPCFastTransformation/TPCFastTransform.h index ed017246d40ba..fc19fd2a9d185 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.h +++ b/GPU/TPCFastTransformation/TPCFastTransform.h @@ -158,6 +158,7 @@ class TPCFastTransform : public FlatObject void setLumi(float l) { mLumi = l; } void setLumiError(float e) { mLumiError = e; } void setLumiScaleFactor(float s) { mLumiScaleFactor = s; } + void setLumiScaleMode(int m) { mLumiScaleMode = m; } /// Sets the time stamp of the current calibaration void setTimeStamp(long int v) { mTimeStamp = v; } @@ -253,6 +254,9 @@ class TPCFastTransform : public FlatObject /// Return map user defined lumi scale factor GPUd() float getLumiScaleFactor() const { return mLumiScaleFactor; } + /// Return map user defined lumi scale mode + GPUd() int getLumiScaleMode() const { return mLumiScaleMode; } + /// maximal possible drift time of the active area GPUd() float getMaxDriftTime(int slice, int row, float pad) const; @@ -329,6 +333,7 @@ class TPCFastTransform : public FlatObject float mLumi; ///< luminosity estimator float mLumiError; ///< error on luminosity float mLumiScaleFactor; ///< user correction factor for lumi (e.g. normalization, efficiency correction etc.) + int mLumiScaleMode; ///< scale mode for the derivative or reference luminosity map /// Correction of (x,u,v) with tricubic interpolator on a regular grid TPCSlowSpaceChargeCorrection* mCorrectionSlow{nullptr}; ///< reference space charge corrections @@ -463,13 +468,20 @@ GPUdi() void TPCFastTransform::TransformInternal(int slice, int row, float& u, f #endif // GPUCA_GPUCODE { mCorrection.getCorrection(slice, row, u, v, dx, du, dv); - if (ref && scale > 0.f) { // scaling was requested + if (ref && scale > 0.f && mLumiScaleMode==0) { // scaling was requested float dxRef, duRef, dvRef; ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); dx = (dx - dxRef) * scale + dxRef; du = (du - duRef) * scale + duRef; dv = (dv - dvRef) * scale + dvRef; } + if(ref && scale > 0.f && mLumiScaleMode==1){ + float dxRef, duRef, dvRef; + ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); + dx = dxRef * scale + dx; + du = duRef * scale + du; + dv = dvRef * scale + dv; + } } } GPUCA_DEBUG_STREAMER_CHECK(if (o2::utils::DebugStreamer::checkStream(o2::utils::StreamFlags::streamFastTransform)) { @@ -725,11 +737,16 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y getGeometry().convLocalToUV(slice, y, z, u, v); if (scale >= 0.f) { mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, x); - if (ref && scale > 0.f) { // scaling was requested + if (ref && scale > 0.f && mLumiScaleMode==0) { // scaling was requested float xr; ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); x = (x - xr) * scale + xr; } + if(ref && scale > 0.f && mLumiScaleMode==1){ + float xr; + ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); + x = xr * scale + x; + } } GPUCA_DEBUG_STREAMER_CHECK(if (o2::utils::DebugStreamer::checkStream(o2::utils::StreamFlags::streamFastTransform)) { o2::utils::DebugStreamer::instance()->getStreamer("debug_fasttransform", "UPDATE") << o2::utils::DebugStreamer::instance()->getUniqueTreeName("tree_InverseTransformYZtoX").data() @@ -752,12 +769,18 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoNominalYZ(int slice, int row, getGeometry().convLocalToUV(slice, y, z, u, v); if (scale >= 0.f) { mCorrection.getCorrectionInvUV(slice, row, u, v, un, vn); - if (ref && scale > 0.f) { // scaling was requested + if (ref && scale > 0.f && mLumiScaleMode==0) { // scaling was requested float unr = 0, vnr = 0; ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); un = (un - unr) * scale + unr; vn = (vn - vnr) * scale + vnr; } + if(ref && scale > 0.f && mLumiScaleMode==1){ + float unr = 0, vnr = 0; + ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); + un = unr * scale + un; + vn = vnr * scale + vn; + } } getGeometry().convUVtoLocal(slice, un, vn, ny, nz); diff --git a/GPU/Workflow/src/GPUWorkflowSpec.cxx b/GPU/Workflow/src/GPUWorkflowSpec.cxx index e9beda3fe9fc9..8a32e56233ee0 100644 --- a/GPU/Workflow/src/GPUWorkflowSpec.cxx +++ b/GPU/Workflow/src/GPUWorkflowSpec.cxx @@ -1611,6 +1611,7 @@ bool GPURecoWorkflowSpec::fetchCalibsCCDBTPC(ProcessingContext& pc, T& newCalibO mFastTransformHelperNew->setUseCTPLumi(mFastTransformHelper->getUseCTPLumi()); mFastTransformHelperNew->setMeanLumiOverride(mFastTransformHelper->getMeanLumiOverride()); mFastTransformHelperNew->setInstLumiOverride(mFastTransformHelper->getInstLumiOverride()); + mFastTransformHelperNew->setLumiScaleModeOverride(mFastTransformHelper->getLumiScaleModeOverride()); mFastTransformHelperNew->setCorrMap(mFastTransformNew ? mFastTransformNew.get() : mFastTransform.get()); mFastTransformHelperNew->setCorrMapRef(mFastTransformRefNew ? mFastTransformRefNew.get() : mFastTransformRef.get()); newCalibObjects.fastTransformHelper = mFastTransformHelperNew.get(); From 03cf4922c7521a34c025f454061bb762cdda984c Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Thu, 29 Jun 2023 16:33:52 +0200 Subject: [PATCH 02/12] Fixing formatting --- .../TPC/base/include/TPCBase/CDBInterface.h | 4 ++-- .../CorrectionMapsHelper.h | 24 +++++++++---------- GPU/TPCFastTransformation/TPCFastTransform.h | 14 +++++------ GPU/Workflow/src/GPUWorkflowSpec.cxx | 4 ++-- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/Detectors/TPC/base/include/TPCBase/CDBInterface.h b/Detectors/TPC/base/include/TPCBase/CDBInterface.h index 256a32e7f4277..ba0d25f242b27 100644 --- a/Detectors/TPC/base/include/TPCBase/CDBInterface.h +++ b/Detectors/TPC/base/include/TPCBase/CDBInterface.h @@ -343,8 +343,8 @@ class CDBInterface std::unique_ptr mCMkValues; ///< Ion Tail exp(-lambda) // ===| switches and parameters |============================================= - bool mUseDefaults = false; ///< use defaults instead of CCDB - float mDefaultZSsigma = 3.f; ///< sigma to use in case the default zero suppression is created + bool mUseDefaults = false; ///< use defaults instead of CCDB + float mDefaultZSsigma = 3.f; ///< sigma to use in case the default zero suppression is created std::string mPedestalNoiseFileName; ///< optional file name for pedestal and noise data std::string mGainMapFileName; ///< optional file name for the gain map diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index 648365c739555..ced34b7d4cd54 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -92,11 +92,9 @@ class CorrectionMapsHelper { if (mMeanLumi < 0.f || mInstLumi < 0.f) { mLumiScale = -1.f; - } - else if(mLumiScaleMode == 1){ + } else if (mLumiScaleMode == 1) { mLumiScale = mInstLumi - mMeanLumi; - } - else { + } else { mLumiScale = mMeanLumi ? mInstLumi / mMeanLumi : 0.f; } setUpdatedLumi(); @@ -139,16 +137,16 @@ class CorrectionMapsHelper enum UpdateFlags { MapBit = 0x1, MapRefBit = 0x2, LumiBit = 0x4 }; - bool mOwner = false; // is content of pointers owned by the helper - bool mUseCTPLumi = false; // require CTP Lumi for mInstLumi + bool mOwner = false; // is content of pointers owned by the helper + bool mUseCTPLumi = false; // require CTP Lumi for mInstLumi int mUpdatedFlags = 0; - float mInstLumi = 0.; // instanteneous luminosity (a.u) - float mMeanLumi = 0.; // mean luminosity of the map (a.u) - int mLumiScaleMode = 0; // scaling-mode of the correciton maps - float mLumiScale = 0.; // precalculated lumi scaling - float mMeanLumiOverride = -1.f; // optional value to override mean lumi - float mInstLumiOverride = -1.f; // optional value to override inst lumi - int mLumiScaleModeOverride = 0; // optional value to choose scaling for correction map + float mInstLumi = 0.; // instanteneous luminosity (a.u) + float mMeanLumi = 0.; // mean luminosity of the map (a.u) + int mLumiScaleMode = 0; // scaling-mode of the correciton maps + float mLumiScale = 0.; // precalculated lumi scaling + float mMeanLumiOverride = -1.f; // optional value to override mean lumi + float mInstLumiOverride = -1.f; // optional value to override inst lumi + int mLumiScaleModeOverride = 0; // optional value to choose scaling for correction map GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMap{nullptr}; // current transform GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMapRef{nullptr}; // reference transform #ifndef GPUCA_ALIROOT_LIB diff --git a/GPU/TPCFastTransformation/TPCFastTransform.h b/GPU/TPCFastTransformation/TPCFastTransform.h index fc19fd2a9d185..c0d8c64caa809 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.h +++ b/GPU/TPCFastTransformation/TPCFastTransform.h @@ -328,7 +328,7 @@ class TPCFastTransform : public FlatObject /// float mTOFcorr; - float mPrimVtxZ; ///< Z of the primary vertex, needed for the Time-Of-Flight correction + float mPrimVtxZ; ///< Z of the primary vertex, needed for the Time-Of-Flight correction float mLumi; ///< luminosity estimator float mLumiError; ///< error on luminosity @@ -468,14 +468,14 @@ GPUdi() void TPCFastTransform::TransformInternal(int slice, int row, float& u, f #endif // GPUCA_GPUCODE { mCorrection.getCorrection(slice, row, u, v, dx, du, dv); - if (ref && scale > 0.f && mLumiScaleMode==0) { // scaling was requested + if (ref && scale > 0.f && mLumiScaleMode == 0) { // scaling was requested float dxRef, duRef, dvRef; ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); dx = (dx - dxRef) * scale + dxRef; du = (du - duRef) * scale + duRef; dv = (dv - dvRef) * scale + dvRef; } - if(ref && scale > 0.f && mLumiScaleMode==1){ + if (ref && scale > 0.f && mLumiScaleMode == 1) { float dxRef, duRef, dvRef; ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); dx = dxRef * scale + dx; @@ -737,12 +737,12 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y getGeometry().convLocalToUV(slice, y, z, u, v); if (scale >= 0.f) { mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, x); - if (ref && scale > 0.f && mLumiScaleMode==0) { // scaling was requested + if (ref && scale > 0.f && mLumiScaleMode == 0) { // scaling was requested float xr; ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); x = (x - xr) * scale + xr; } - if(ref && scale > 0.f && mLumiScaleMode==1){ + if (ref && scale > 0.f && mLumiScaleMode == 1) { float xr; ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); x = xr * scale + x; @@ -769,13 +769,13 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoNominalYZ(int slice, int row, getGeometry().convLocalToUV(slice, y, z, u, v); if (scale >= 0.f) { mCorrection.getCorrectionInvUV(slice, row, u, v, un, vn); - if (ref && scale > 0.f && mLumiScaleMode==0) { // scaling was requested + if (ref && scale > 0.f && mLumiScaleMode == 0) { // scaling was requested float unr = 0, vnr = 0; ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); un = (un - unr) * scale + unr; vn = (vn - vnr) * scale + vnr; } - if(ref && scale > 0.f && mLumiScaleMode==1){ + if (ref && scale > 0.f && mLumiScaleMode == 1) { float unr = 0, vnr = 0; ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); un = unr * scale + un; diff --git a/GPU/Workflow/src/GPUWorkflowSpec.cxx b/GPU/Workflow/src/GPUWorkflowSpec.cxx index 8a32e56233ee0..35b2e068bc90f 100644 --- a/GPU/Workflow/src/GPUWorkflowSpec.cxx +++ b/GPU/Workflow/src/GPUWorkflowSpec.cxx @@ -1035,7 +1035,7 @@ int GPURecoWorkflowSpec::runITSTracking(o2::framework::ProcessingContext& pc) // Some conversions that needs to be moved in the tracker internals for (unsigned int iTrk{0}; iTrk < tracks.size(); ++iTrk) { auto& trc{tracks[iTrk]}; - trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices + trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices int ncl = trc.getNumberOfClusters(), nclf = 0; for (int ic = o2::its::TrackITSExt::MaxClusters; ic--;) { // track internally keeps in->out cluster indices, but we want to store the references as out->in!!! auto clid = trc.getClusterIndex(ic); @@ -1537,7 +1537,7 @@ void GPURecoWorkflowSpec::finaliseCCDBTPC(ConcreteDataMatcher& matcher, void* ob bool GPURecoWorkflowSpec::fetchCalibsCCDBITS(ProcessingContext& pc) { static bool initOnceDone = false; - if (!initOnceDone) { // this params need to be queried only once + if (!initOnceDone) { // this params need to be queried only once initOnceDone = true; pc.inputs().get("itscldict"); // just to trigger the finaliseCCDB pc.inputs().get*>("itsalppar"); From 08a7da7cbbe48622e6952a58ec1f38da7390d023 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 29 Jun 2023 14:34:54 +0000 Subject: [PATCH 03/12] Please consider the following formatting changes --- Detectors/TPC/base/include/TPCBase/CDBInterface.h | 4 ++-- GPU/TPCFastTransformation/CorrectionMapsHelper.h | 4 ++-- GPU/TPCFastTransformation/TPCFastTransform.h | 2 +- GPU/Workflow/src/GPUWorkflowSpec.cxx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Detectors/TPC/base/include/TPCBase/CDBInterface.h b/Detectors/TPC/base/include/TPCBase/CDBInterface.h index ba0d25f242b27..256a32e7f4277 100644 --- a/Detectors/TPC/base/include/TPCBase/CDBInterface.h +++ b/Detectors/TPC/base/include/TPCBase/CDBInterface.h @@ -343,8 +343,8 @@ class CDBInterface std::unique_ptr mCMkValues; ///< Ion Tail exp(-lambda) // ===| switches and parameters |============================================= - bool mUseDefaults = false; ///< use defaults instead of CCDB - float mDefaultZSsigma = 3.f; ///< sigma to use in case the default zero suppression is created + bool mUseDefaults = false; ///< use defaults instead of CCDB + float mDefaultZSsigma = 3.f; ///< sigma to use in case the default zero suppression is created std::string mPedestalNoiseFileName; ///< optional file name for pedestal and noise data std::string mGainMapFileName; ///< optional file name for the gain map diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index ced34b7d4cd54..f7fce8be34689 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -137,8 +137,8 @@ class CorrectionMapsHelper enum UpdateFlags { MapBit = 0x1, MapRefBit = 0x2, LumiBit = 0x4 }; - bool mOwner = false; // is content of pointers owned by the helper - bool mUseCTPLumi = false; // require CTP Lumi for mInstLumi + bool mOwner = false; // is content of pointers owned by the helper + bool mUseCTPLumi = false; // require CTP Lumi for mInstLumi int mUpdatedFlags = 0; float mInstLumi = 0.; // instanteneous luminosity (a.u) float mMeanLumi = 0.; // mean luminosity of the map (a.u) diff --git a/GPU/TPCFastTransformation/TPCFastTransform.h b/GPU/TPCFastTransformation/TPCFastTransform.h index c0d8c64caa809..75e7f750abddb 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.h +++ b/GPU/TPCFastTransformation/TPCFastTransform.h @@ -328,7 +328,7 @@ class TPCFastTransform : public FlatObject /// float mTOFcorr; - float mPrimVtxZ; ///< Z of the primary vertex, needed for the Time-Of-Flight correction + float mPrimVtxZ; ///< Z of the primary vertex, needed for the Time-Of-Flight correction float mLumi; ///< luminosity estimator float mLumiError; ///< error on luminosity diff --git a/GPU/Workflow/src/GPUWorkflowSpec.cxx b/GPU/Workflow/src/GPUWorkflowSpec.cxx index 35b2e068bc90f..8a32e56233ee0 100644 --- a/GPU/Workflow/src/GPUWorkflowSpec.cxx +++ b/GPU/Workflow/src/GPUWorkflowSpec.cxx @@ -1035,7 +1035,7 @@ int GPURecoWorkflowSpec::runITSTracking(o2::framework::ProcessingContext& pc) // Some conversions that needs to be moved in the tracker internals for (unsigned int iTrk{0}; iTrk < tracks.size(); ++iTrk) { auto& trc{tracks[iTrk]}; - trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices + trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices int ncl = trc.getNumberOfClusters(), nclf = 0; for (int ic = o2::its::TrackITSExt::MaxClusters; ic--;) { // track internally keeps in->out cluster indices, but we want to store the references as out->in!!! auto clid = trc.getClusterIndex(ic); @@ -1537,7 +1537,7 @@ void GPURecoWorkflowSpec::finaliseCCDBTPC(ConcreteDataMatcher& matcher, void* ob bool GPURecoWorkflowSpec::fetchCalibsCCDBITS(ProcessingContext& pc) { static bool initOnceDone = false; - if (!initOnceDone) { // this params need to be queried only once + if (!initOnceDone) { // this params need to be queried only once initOnceDone = true; pc.inputs().get("itscldict"); // just to trigger the finaliseCCDB pc.inputs().get*>("itsalppar"); From 4ad7708792a04d3dc77645e5d58f6ecaacf74794 Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Fri, 30 Jun 2023 19:10:31 +0200 Subject: [PATCH 04/12] Flag passing from the tpc-reco-workflow to gpu configs --- .../CTP/include/DataFormatsCTP/LumiInfo.h | 3 +- .../TPC/base/include/TPCBase/CDBInterface.h | 16 +++- .../TPCCalibration/CorrectionMapsLoader.h | 2 +- .../calibration/src/CorrectionMapsLoader.cxx | 21 ++--- .../include/TPCWorkflow/RecoWorkflow.h | 5 +- Detectors/TPC/workflow/src/RecoWorkflow.cxx | 20 ++--- .../TPC/workflow/src/tpc-reco-workflow.cxx | 5 +- .../CorrectionMapsHelper.cxx | 1 + .../CorrectionMapsHelper.h | 12 +-- .../TPCFastTransform.cxx | 5 +- GPU/TPCFastTransformation/TPCFastTransform.h | 76 ++++++++++--------- .../include/GPUWorkflow/GPUWorkflowSpec.h | 1 + GPU/Workflow/src/GPUWorkflowSpec.cxx | 7 +- GPU/Workflow/src/gpu-reco-workflow.cxx | 4 +- 14 files changed, 105 insertions(+), 73 deletions(-) diff --git a/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h b/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h index 27f67ba6e92a8..1fb36010345ad 100644 --- a/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h +++ b/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h @@ -27,11 +27,12 @@ struct LumiInfo { uint32_t nHBFCountedFV0 = 0; uint64_t counts = 0; // counts in the interval for the nominal lumi detector (FT0) uint64_t countsFV0 = 0; // connts for FV0 (less reliable) + int lumiScaleMode = 0; // lumi scale mode: 0 = default, static reference map, 1 = derivative map float getLumi() const { return nHBFCounted > 0 ? float(counts / (nHBFCounted * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } float getLumiFV0() const { return nHBFCountedFV0 > 0 ? float(countsFV0 / (nHBFCountedFV0 * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } float getLumiError() const { return nHBFCounted > 0 ? float(std::sqrt(counts) / (nHBFCounted * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } float getLumiFV0Error() const { return nHBFCountedFV0 > 0 ? float(std::sqrt(countsFV0) / (nHBFCountedFV0 * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } - ClassDefNV(LumiInfo, 2); + ClassDefNV(LumiInfo, 3); }; } // namespace ctp diff --git a/Detectors/TPC/base/include/TPCBase/CDBInterface.h b/Detectors/TPC/base/include/TPCBase/CDBInterface.h index 256a32e7f4277..1d5a6fd385777 100644 --- a/Detectors/TPC/base/include/TPCBase/CDBInterface.h +++ b/Detectors/TPC/base/include/TPCBase/CDBInterface.h @@ -82,8 +82,11 @@ enum class CDBType { CalITPC0, ///< 2D average TPC clusters for longer time interval CalITPC1, ///< 1D integrated TPC clusters /// - CalCorrMap, ///< Cluster correction map + CalCorrMap, ///< Cluster correction map (high IR rate distortions) CalCorrMapRef, ///< Cluster correction reference map (static distortions) + /// + CalCorrDerivMap, ///< Cluster correction map (derivative map) + CalCorrDerivMapRef, ///< Cluster correction reference map (high IR rate distortions) }; /// Upload intervention type @@ -138,9 +141,14 @@ const std::unordered_map CDBTypeMap{ // ITPCCs {CDBType::CalITPC0, "TPC/Calib/ITPCC_0"}, {CDBType::CalITPC1, "TPC/Calib/ITPCC_1"}, - // correction maps + // correction maps for static distortions {CDBType::CalCorrMap, "TPC/Calib/CorrectionMap"}, {CDBType::CalCorrMapRef, "TPC/Calib/CorrectionMapRef"}, + // correction maps with derivative corrections + // {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionDerivativeMap"}, + // {CDBType::CalCorrDerivMapRef, "TPC/Calib/CorrectionDerivativeMapRef"}, + {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionMap"}, + {CDBType::CalCorrDerivMapRef, "TPC/Calib/CorrectionMapRef"}, }; /// Poor enum reflection ... @@ -343,8 +351,8 @@ class CDBInterface std::unique_ptr mCMkValues; ///< Ion Tail exp(-lambda) // ===| switches and parameters |============================================= - bool mUseDefaults = false; ///< use defaults instead of CCDB - float mDefaultZSsigma = 3.f; ///< sigma to use in case the default zero suppression is created + bool mUseDefaults = false; ///< use defaults instead of CCDB + float mDefaultZSsigma = 3.f; ///< sigma to use in case the default zero suppression is created std::string mPedestalNoiseFileName; ///< optional file name for pedestal and noise data std::string mGainMapFileName; ///< optional file name for the gain map diff --git a/Detectors/TPC/calibration/include/TPCCalibration/CorrectionMapsLoader.h b/Detectors/TPC/calibration/include/TPCCalibration/CorrectionMapsLoader.h index a6fb29bb2e8c7..0771b922a19d4 100644 --- a/Detectors/TPC/calibration/include/TPCCalibration/CorrectionMapsLoader.h +++ b/Detectors/TPC/calibration/include/TPCCalibration/CorrectionMapsLoader.h @@ -48,7 +48,7 @@ class CorrectionMapsLoader : public o2::gpu::CorrectionMapsHelper void extractCCDBInputs(o2::framework::ProcessingContext& pc); void updateVDrift(float vdriftCorr, float vdrifRef, float driftTimeOffset = 0); void init(o2::framework::InitContext& ic); - static void requestCCDBInputs(std::vector& inputs, std::vector& options, bool requestCTPLumi = false); + static void requestCCDBInputs(std::vector& inputs, std::vector& options, bool requestCTPLumi = false, int lumiScaleMode = 0); static void addOptions(std::vector& options); protected: diff --git a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx index ad99c408c23b8..d2806c7e3a2d4 100644 --- a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx +++ b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx @@ -49,10 +49,18 @@ void CorrectionMapsLoader::extractCCDBInputs(ProcessingContext& pc) } //________________________________________________________ -void CorrectionMapsLoader::requestCCDBInputs(std::vector& inputs, std::vector& options, bool requestCTPLumi) +void CorrectionMapsLoader::requestCCDBInputs(std::vector& inputs, std::vector& options, bool requestCTPLumi, int lumiScaleMode) { - addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMap), {}, 1)}); // time-dependent - addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMapRef), {}, 0)}); // load once + if (lumiScaleMode == 0) { + addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMap), {}, 1)}); // time-dependent + addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMapRef), {}, 0)}); // load once + } else if (lumiScaleMode == 1) { + addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrDerivMap), {}, 1)}); // time-dependent + addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrDerivMapRef), {}, 1)}); // time-dependent + } else { + LOG(fatal) << "Correction mode unknown! Choose either 0 (default) or 1 (derivative map) for flag corrmap-lumi-mode."; + } + if (requestCTPLumi) { addInput(inputs, {"CTPLumi", "CTP", "LUMI", 0, Lifetime::Timeframe}); } @@ -64,7 +72,6 @@ void CorrectionMapsLoader::addOptions(std::vector& options) { addOption(options, ConfigParamSpec{"corrmap-lumi-mean", VariantType::Float, 0.f, {"override TPC corr.map mean lumi (if > 0), disable corrections if < 0"}}); addOption(options, ConfigParamSpec{"corrmap-lumi-inst", VariantType::Float, 0.f, {"override instantaneous CTP lumi (if > 0) for TPC corr.map scaling, disable corrections if < 0"}}); - addOption(options, ConfigParamSpec{"corrmap-lumi-scalemode", VariantType::Int, 0, {"override setting for scaling behaviour when using derivative maps"}}); } //________________________________________________________ @@ -117,16 +124,12 @@ void CorrectionMapsLoader::init(o2::framework::InitContext& ic) } mMeanLumiOverride = ic.options().get("corrmap-lumi-mean"); mInstLumiOverride = ic.options().get("corrmap-lumi-inst"); - mLumiScaleModeOverride = ic.options().get("corrmap-lumi-scalemode"); if (mMeanLumiOverride != 0.) { setMeanLumi(mMeanLumiOverride); } if (mInstLumiOverride != 0.) { setInstLumi(mInstLumiOverride); } - if (mLumiScaleModeOverride != 1) { - setLumiScaleMode(mLumiScaleModeOverride); - } - LOGP(info, "CTP Lumi request for TPC corr.map scaling={}, override values: lumiMean={} lumiInst={} lumiScaleMode={}", getUseCTPLumi() ? "ON" : "OFF", mMeanLumiOverride, mInstLumiOverride, mLumiScaleModeOverride); + LOGP(info, "CTP Lumi request for TPC corr.map scaling={}, override values: lumiMean={} lumiInst={} lumiScaleMode={}", getUseCTPLumi() ? "ON" : "OFF", mMeanLumiOverride, mInstLumiOverride); } #endif // #ifndef GPUCA_GPUCODE_DEVICE diff --git a/Detectors/TPC/workflow/include/TPCWorkflow/RecoWorkflow.h b/Detectors/TPC/workflow/include/TPCWorkflow/RecoWorkflow.h index f9f1e3bf70807..b92f50b9ea23d 100644 --- a/Detectors/TPC/workflow/include/TPCWorkflow/RecoWorkflow.h +++ b/Detectors/TPC/workflow/include/TPCWorkflow/RecoWorkflow.h @@ -83,11 +83,12 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, bool askDISTSTF = true, bool selIR = false, bool filteredInp = false, - bool requireCTPLumi = false); + bool requireCTPLumi = false, + int lumiScaleMode = 0); void cleanupCallback(); } // end namespace reco_workflow } // end namespace tpc } // end namespace o2 -#endif //O2_TPC_RECOWORKFLOW_H +#endif // O2_TPC_RECOWORKFLOW_H diff --git a/Detectors/TPC/workflow/src/RecoWorkflow.cxx b/Detectors/TPC/workflow/src/RecoWorkflow.cxx index 2586af16262d4..5ec25635f5da0 100644 --- a/Detectors/TPC/workflow/src/RecoWorkflow.cxx +++ b/Detectors/TPC/workflow/src/RecoWorkflow.cxx @@ -95,7 +95,7 @@ const std::unordered_map OutputMap{ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vector const& tpcSectors, unsigned long tpcSectorMask, std::vector const& laneConfiguration, bool propagateMC, unsigned nLanes, std::string const& cfgInput, std::string const& cfgOutput, bool disableRootInput, - int caClusterer, int zsOnTheFly, bool askDISTSTF, bool selIR, bool filteredInp, bool requireCTPLumi) + int caClusterer, int zsOnTheFly, bool askDISTSTF, bool selIR, bool filteredInp, bool requireCTPLumi, int lumiScaleMode) { InputType inputType; try { @@ -162,7 +162,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto auto storedlabels = reinterpret_cast(data); o2::dataformats::ConstMCTruthContainer flatlabels; storedlabels->copyandflatten(flatlabels); - //LOG(info) << "PUBLISHING CONST LABELS " << flatlabels.getNElements(); + // LOG(info) << "PUBLISHING CONST LABELS " << flatlabels.getNElements(); context.outputs().snapshot(output, flatlabels); return true; } @@ -214,7 +214,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto "tpc-compclusters.root", "tpcrec", {"clusterbranch", "TPCCompClusters", "Branch with TPC compressed clusters"}, - {"", "", ""}, // No MC labels + {"", "", ""}, // No MC labels OutputSpec{"TPC", "COMPCLUSTERS"}, OutputSpec{"", ""}, // No MC labels std::vector(1, 0), @@ -241,7 +241,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto runGPUReco &= caClusterer || runHWDecoder || inputType == InputType::Clusters || decompressTPC; bool outRaw = inputType == InputType::Digits && isEnabled(OutputType::ZSRaw) && !isEnabled(OutputType::DisableWriter); - //bool runZSDecode = inputType == InputType::ZSRaw; + // bool runZSDecode = inputType == InputType::ZSRaw; bool zsToDigit = inputType == InputType::ZSRaw && isEnabled(OutputType::Digits); if (inputType == InputType::PassThrough) { @@ -366,7 +366,8 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto if (isEnabled(OutputType::Digits) && !isEnabled(OutputType::DisableWriter)) { using DigitOutputType = std::vector; specs.push_back(makeWriterSpec("tpc-digits-writer", - inputType == InputType::ZSRaw ? "tpc-zs-digits.root" : inputType == InputType::Digits ? "tpc-filtered-digits.root" : "tpcdigits.root", + inputType == InputType::ZSRaw ? "tpc-zs-digits.root" : inputType == InputType::Digits ? "tpc-filtered-digits.root" + : "tpcdigits.root", "o2sim", BranchDefinition{InputSpec{"data", "TPC", "DIGITS", 0}, "TPCDigit", @@ -430,6 +431,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto o2::gpu::GPURecoWorkflowSpec::Config cfg; cfg.runTPCTracking = true; cfg.requireCTPLumi = requireCTPLumi; + cfg.lumiScaleMode = lumiScaleMode; cfg.decompressTPC = decompressTPC; cfg.decompressTPCFromROOT = decompressTPC && inputType == InputType::CompClusters; cfg.caClusterer = caClusterer; @@ -484,7 +486,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto const char* defaultFileName = filteredInp ? "tpctracks_filtered.root" : "tpctracks.root"; const char* defaultTreeName = "tpcrec"; - //branch definitions for RootTreeWriter spec + // branch definitions for RootTreeWriter spec using TrackOutputType = std::vector; using ClusRefsOutputType = std::vector; @@ -523,13 +525,13 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto const char* defaultFileName = "tpc-compclusters.root"; const char* defaultTreeName = "tpcrec"; - //branch definitions for RootTreeWriter spec + // branch definitions for RootTreeWriter spec using CCluSerializedType = ROOTSerialized; auto ccldef = BranchDefinition{InputSpec{"inputCompCl", "TPC", "COMPCLUSTERS"}, // "TPCCompClusters_0", "compcluster-branch-name"}; // - specs.push_back(MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName, // - std::move(ccldef))()); // + specs.push_back(MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName, // + std::move(ccldef))()); // } return std::move(specs); diff --git a/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx b/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx index 89bd5151faa64..8d03680460e27 100644 --- a/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx +++ b/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx @@ -69,6 +69,7 @@ void customize(std::vector& workflowOptions) {"configFile", VariantType::String, "", {"configuration file for configurable parameters"}}, {"filtered-input", VariantType::Bool, false, {"Filtered tracks, clusters input, prefix dataDescriptors with F"}}, {"require-ctp-lumi", o2::framework::VariantType::Bool, false, {"require CTP lumi for TPC correction scaling"}}, + {"corrmap-lumi-mode", VariantType::Int, 0, {"scaling mode: (default) 0 = static + scale * full; 1 = full + scale * derivative"}}, {"select-ir-frames", VariantType::Bool, false, {"Subscribe and filter according to external IR Frames"}}}; o2::raw::HBFUtilsInitializer::addConfigOption(options); std::swap(workflowOptions, options); @@ -139,6 +140,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) auto nLanes = cfgc.options().get("tpc-lanes"); auto inputType = cfgc.options().get("input-type"); auto requireCTPLumi = cfgc.options().get("require-ctp-lumi"); + auto lumiScaleMode = cfgc.options().get("corrmap-lumi-mode"); // depending on whether to dispatch early (prompt) and on the input type, we // set the matcher. Note that this has to be in accordance with the OutputSpecs // configured for the PublisherSpec @@ -179,7 +181,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) !cfgc.options().get("ignore-dist-stf"), // cfgc.options().get("select-ir-frames"), cfgc.options().get("filtered-input"), - requireCTPLumi); + requireCTPLumi, + lumiScaleMode); // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf); diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx index 49b11d82bb38b..4b9c45cee5fa6 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx @@ -26,6 +26,7 @@ void CorrectionMapsHelper::clear() mUpdatedFlags = 0; mInstLumi = 0.f; mMeanLumi = 0.f; + mLumiScaleMode = 0; } void CorrectionMapsHelper::setOwner(bool v) diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index f7fce8be34689..c03638ac91b8b 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -93,7 +93,7 @@ class CorrectionMapsHelper if (mMeanLumi < 0.f || mInstLumi < 0.f) { mLumiScale = -1.f; } else if (mLumiScaleMode == 1) { - mLumiScale = mInstLumi - mMeanLumi; + mLumiScale = mInstLumi / mMeanLumi - 1.; } else { mLumiScale = mMeanLumi ? mInstLumi / mMeanLumi : 0.f; } @@ -137,20 +137,20 @@ class CorrectionMapsHelper enum UpdateFlags { MapBit = 0x1, MapRefBit = 0x2, LumiBit = 0x4 }; - bool mOwner = false; // is content of pointers owned by the helper - bool mUseCTPLumi = false; // require CTP Lumi for mInstLumi + bool mOwner = false; // is content of pointers owned by the helper + bool mUseCTPLumi = false; // require CTP Lumi for mInstLumi int mUpdatedFlags = 0; float mInstLumi = 0.; // instanteneous luminosity (a.u) float mMeanLumi = 0.; // mean luminosity of the map (a.u) - int mLumiScaleMode = 0; // scaling-mode of the correciton maps float mLumiScale = 0.; // precalculated lumi scaling + int mLumiScaleMode = 0; // scaling-mode of the correciton maps float mMeanLumiOverride = -1.f; // optional value to override mean lumi float mInstLumiOverride = -1.f; // optional value to override inst lumi - int mLumiScaleModeOverride = 0; // optional value to choose scaling for correction map + float mLumiScaleModeOverride = 0; // optional value to override inst lumi GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMap{nullptr}; // current transform GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMapRef{nullptr}; // reference transform #ifndef GPUCA_ALIROOT_LIB - ClassDefNV(CorrectionMapsHelper, 1); + ClassDefNV(CorrectionMapsHelper, 2); #endif }; diff --git a/GPU/TPCFastTransformation/TPCFastTransform.cxx b/GPU/TPCFastTransformation/TPCFastTransform.cxx index 6424292a6035a..bbff90b1a6656 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.cxx +++ b/GPU/TPCFastTransformation/TPCFastTransform.cxx @@ -37,7 +37,7 @@ using namespace GPUCA_NAMESPACE::gpu; TPCFastTransform::TPCFastTransform() - : FlatObject(), mTimeStamp(0), mCorrection(), mApplyCorrection(1), mT0(0.f), mVdrift(0.f), mVdriftCorrY(0.f), mLdriftCorr(0.f), mTOFcorr(0.f), mPrimVtxZ(0.f), mLumi(0.f), mLumiError(0.f), mLumiScaleFactor(1.0f) + : FlatObject(), mTimeStamp(0), mCorrection(), mApplyCorrection(1), mT0(0.f), mVdrift(0.f), mVdriftCorrY(0.f), mLdriftCorr(0.f), mTOFcorr(0.f), mPrimVtxZ(0.f), mLumi(0.f), mLumiError(0.f), mLumiScaleFactor(1.0f), mLumiScaleMode(0) { // Default Constructor: creates an empty uninitialized object } @@ -61,6 +61,7 @@ void TPCFastTransform::cloneFromObject(const TPCFastTransform& obj, char* newFla mLumi = obj.mLumi; mLumiError = obj.mLumiError; mLumiScaleFactor = obj.mLumiScaleFactor; + mLumiScaleMode = obj.mLumiScaleMode; // variable-size data char* distBuffer = FlatObject::relocatePointer(oldFlatBufferPtr, mFlatBufferPtr, obj.mCorrection.getFlatBufferPtr()); @@ -111,6 +112,7 @@ void TPCFastTransform::startConstruction(const TPCFastSpaceChargeCorrection& cor mLumi = 0.f; mLumiError = 0.f; mLumiScaleFactor = 1.f; + mLumiScaleMode = 0; // variable-size data @@ -161,6 +163,7 @@ void TPCFastTransform::print() const LOG(info) << "mLumi = " << mLumi; LOG(info) << "mLumiError = " << mLumiError; LOG(info) << "mLumiScaleFactor = " << mLumiScaleFactor; + LOG(info) << "mLumiScaleMode = " << mLumiScaleMode; mCorrection.print(); #endif } diff --git a/GPU/TPCFastTransformation/TPCFastTransform.h b/GPU/TPCFastTransformation/TPCFastTransform.h index 75e7f750abddb..1825e3c308bb3 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.h +++ b/GPU/TPCFastTransformation/TPCFastTransform.h @@ -328,7 +328,7 @@ class TPCFastTransform : public FlatObject /// float mTOFcorr; - float mPrimVtxZ; ///< Z of the primary vertex, needed for the Time-Of-Flight correction + float mPrimVtxZ; ///< Z of the primary vertex, needed for the Time-Of-Flight correction float mLumi; ///< luminosity estimator float mLumiError; ///< error on luminosity @@ -341,7 +341,7 @@ class TPCFastTransform : public FlatObject GPUd() void TransformInternal(int slice, int row, float& u, float& v, float& x, const TPCFastTransform* ref, float scale) const; #ifndef GPUCA_ALIROOT_LIB - ClassDefNV(TPCFastTransform, 3); + ClassDefNV(TPCFastTransform, 4); #endif }; @@ -468,19 +468,21 @@ GPUdi() void TPCFastTransform::TransformInternal(int slice, int row, float& u, f #endif // GPUCA_GPUCODE { mCorrection.getCorrection(slice, row, u, v, dx, du, dv); - if (ref && scale > 0.f && mLumiScaleMode == 0) { // scaling was requested - float dxRef, duRef, dvRef; - ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); - dx = (dx - dxRef) * scale + dxRef; - du = (du - duRef) * scale + duRef; - dv = (dv - dvRef) * scale + dvRef; - } - if (ref && scale > 0.f && mLumiScaleMode == 1) { - float dxRef, duRef, dvRef; - ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); - dx = dxRef * scale + dx; - du = duRef * scale + du; - dv = dvRef * scale + dv; + if (ref && scale > 0.f) { // scaling was requested + if (mLumiScaleMode == 0) { + float dxRef, duRef, dvRef; + ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); + dx = (dx - dxRef) * scale + dxRef; + du = (du - duRef) * scale + duRef; + dv = (dv - dvRef) * scale + dvRef; + } + if (mLumiScaleMode == 1) { + float dxRef, duRef, dvRef; + ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); + dx = dxRef * scale + dx; + du = duRef * scale + du; + dv = dvRef * scale + dv; + } } } } @@ -737,15 +739,17 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y getGeometry().convLocalToUV(slice, y, z, u, v); if (scale >= 0.f) { mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, x); - if (ref && scale > 0.f && mLumiScaleMode == 0) { // scaling was requested - float xr; - ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); - x = (x - xr) * scale + xr; - } - if (ref && scale > 0.f && mLumiScaleMode == 1) { - float xr; - ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); - x = xr * scale + x; + if (ref && scale > 0.f) { // scaling was requested + if (mLumiScaleMode == 0) { + float xr; + ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); + x = (x - xr) * scale + xr; + } + if (mLumiScaleMode == 1) { + float xr; + ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); + x = xr * scale + x; + } } } GPUCA_DEBUG_STREAMER_CHECK(if (o2::utils::DebugStreamer::checkStream(o2::utils::StreamFlags::streamFastTransform)) { @@ -769,17 +773,19 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoNominalYZ(int slice, int row, getGeometry().convLocalToUV(slice, y, z, u, v); if (scale >= 0.f) { mCorrection.getCorrectionInvUV(slice, row, u, v, un, vn); - if (ref && scale > 0.f && mLumiScaleMode == 0) { // scaling was requested - float unr = 0, vnr = 0; - ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); - un = (un - unr) * scale + unr; - vn = (vn - vnr) * scale + vnr; - } - if (ref && scale > 0.f && mLumiScaleMode == 1) { - float unr = 0, vnr = 0; - ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); - un = unr * scale + un; - vn = vnr * scale + vn; + if (ref && scale > 0.f) { // scaling was requested + if (mLumiScaleMode == 0) { + float unr = 0, vnr = 0; + ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); + un = (un - unr) * scale + unr; + vn = (vn - vnr) * scale + vnr; + } + if (mLumiScaleMode == 1) { + float unr = 0, vnr = 0; + ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); + un = unr * scale + un; + vn = vnr * scale + vn; + } } } getGeometry().convUVtoLocal(slice, un, vn, ny, nz); diff --git a/GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h b/GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h index ba40fbdee363a..89b9e03c33ce4 100644 --- a/GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h +++ b/GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h @@ -106,6 +106,7 @@ class GPURecoWorkflowSpec : public o2::framework::Task bool runITSTracking = false; int itsTriggerType = 0; bool itsOverrBeamEst = false; + int lumiScaleMode = 0; }; GPURecoWorkflowSpec(CompletionPolicyData* policyData, Config const& specconfig, std::vector const& tpcsectors, unsigned long tpcSectorMask, std::shared_ptr& ggr); diff --git a/GPU/Workflow/src/GPUWorkflowSpec.cxx b/GPU/Workflow/src/GPUWorkflowSpec.cxx index 8a32e56233ee0..159fc556b52d0 100644 --- a/GPU/Workflow/src/GPUWorkflowSpec.cxx +++ b/GPU/Workflow/src/GPUWorkflowSpec.cxx @@ -1035,7 +1035,7 @@ int GPURecoWorkflowSpec::runITSTracking(o2::framework::ProcessingContext& pc) // Some conversions that needs to be moved in the tracker internals for (unsigned int iTrk{0}; iTrk < tracks.size(); ++iTrk) { auto& trc{tracks[iTrk]}; - trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices + trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices int ncl = trc.getNumberOfClusters(), nclf = 0; for (int ic = o2::its::TrackITSExt::MaxClusters; ic--;) { // track internally keeps in->out cluster indices, but we want to store the references as out->in!!! auto clid = trc.getClusterIndex(ic); @@ -1144,7 +1144,7 @@ Inputs GPURecoWorkflowSpec::inputs() inputs.emplace_back("tpcthreshold", gDataOriginTPC, "PADTHRESHOLD", 0, Lifetime::Condition, ccdbParamSpec("TPC/Config/FEEPad")); o2::tpc::VDriftHelper::requestCCDBInputs(inputs); Options optsDummy; - mFastTransformHelper->requestCCDBInputs(inputs, optsDummy, mSpecConfig.requireCTPLumi); // option filled here is lost + mFastTransformHelper->requestCCDBInputs(inputs, optsDummy, mSpecConfig.requireCTPLumi, mSpecConfig.lumiScaleMode); // option filled here is lost } if (mSpecConfig.decompressTPC) { inputs.emplace_back(InputSpec{"input", ConcreteDataTypeMatcher{gDataOriginTPC, mSpecConfig.decompressTPCFromROOT ? o2::header::DataDescription("COMPCLUSTERS") : o2::header::DataDescription("COMPCLUSTERSFLAT")}, Lifetime::Timeframe}); @@ -1350,6 +1350,7 @@ void GPURecoWorkflowSpec::initFunctionTPCCalib(InitContext& ic) mFastTransformRef = std::move(o2::tpc::TPCFastTransformHelperO2::instance()->create(0)); mFastTransformHelper->setCorrMap(mFastTransform.get()); // just to reserve the space mFastTransformHelper->setCorrMapRef(mFastTransformRef.get()); + mFastTransformHelper->setLumiScaleMode(mSpecConfig.lumiScaleMode); if (mSpecConfig.outputTracks) { mFastTransformHelper->init(ic); } @@ -1537,7 +1538,7 @@ void GPURecoWorkflowSpec::finaliseCCDBTPC(ConcreteDataMatcher& matcher, void* ob bool GPURecoWorkflowSpec::fetchCalibsCCDBITS(ProcessingContext& pc) { static bool initOnceDone = false; - if (!initOnceDone) { // this params need to be queried only once + if (!initOnceDone) { // this params need to be queried only once initOnceDone = true; pc.inputs().get("itscldict"); // just to trigger the finaliseCCDB pc.inputs().get*>("itsalppar"); diff --git a/GPU/Workflow/src/gpu-reco-workflow.cxx b/GPU/Workflow/src/gpu-reco-workflow.cxx index 4edbdcfb6c09a..60d21c6ac6d49 100644 --- a/GPU/Workflow/src/gpu-reco-workflow.cxx +++ b/GPU/Workflow/src/gpu-reco-workflow.cxx @@ -51,7 +51,8 @@ void customize(std::vector& workflowOptions) std::vector options{ {"input-type", VariantType::String, "digits", {"digitizer, digits, zsraw, zsonthefly, clustersnative, compressed-clusters-root, compressed-clusters-ctf, trd-tracklets"}}, {"output-type", VariantType::String, "tracks", {"clustersnative, tracks, compressed-clusters-ctf, qa, no-shared-cluster-map, send-clusters-per-sector, trd-tracks, error-qa"}}, - {"require-ctp-lumi", o2::framework::VariantType::Bool, false, {"require CTP lumi for TPC correction scaling"}}, + {"require-ctp-lumi", VariantType::Bool, false, {"require CTP lumi for TPC correction scaling"}}, + {"corrmap-lumi-mode", VariantType::Int, 0, {"scaling mode: (default) 0 = static + scale * full; 1 = full + scale * derivative"}}, {"disable-root-input", VariantType::Bool, true, {"disable root-files input reader"}}, {"disable-mc", VariantType::Bool, false, {"disable sending of MC information"}}, {"ignore-dist-stf", VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}}, @@ -169,6 +170,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) cfg.askDISTSTF = !cfgc.options().get("ignore-dist-stf"); cfg.readTRDtracklets = isEnabled(inputTypes, ioType::TRDTracklets); cfg.runTRDTracking = isEnabled(outputTypes, ioType::TRDTracks); + cfg.lumiScaleMode = cfgc.options().get("corrmap-lumi-mode"); Inputs ggInputs; auto ggRequest = std::make_shared(false, true, false, true, true, o2::base::GRPGeomRequest::Aligned, ggInputs, true); From 72a0a79926311020d5e45f2729a8c11bb9615bab Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 30 Jun 2023 17:11:34 +0000 Subject: [PATCH 05/12] Please consider the following formatting changes --- Detectors/TPC/base/include/TPCBase/CDBInterface.h | 4 ++-- Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx | 4 ++-- Detectors/TPC/workflow/src/RecoWorkflow.cxx | 6 +++--- GPU/TPCFastTransformation/CorrectionMapsHelper.h | 4 ++-- GPU/TPCFastTransformation/TPCFastTransform.h | 2 +- GPU/Workflow/src/GPUWorkflowSpec.cxx | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Detectors/TPC/base/include/TPCBase/CDBInterface.h b/Detectors/TPC/base/include/TPCBase/CDBInterface.h index 1d5a6fd385777..468cab99741fb 100644 --- a/Detectors/TPC/base/include/TPCBase/CDBInterface.h +++ b/Detectors/TPC/base/include/TPCBase/CDBInterface.h @@ -351,8 +351,8 @@ class CDBInterface std::unique_ptr mCMkValues; ///< Ion Tail exp(-lambda) // ===| switches and parameters |============================================= - bool mUseDefaults = false; ///< use defaults instead of CCDB - float mDefaultZSsigma = 3.f; ///< sigma to use in case the default zero suppression is created + bool mUseDefaults = false; ///< use defaults instead of CCDB + float mDefaultZSsigma = 3.f; ///< sigma to use in case the default zero suppression is created std::string mPedestalNoiseFileName; ///< optional file name for pedestal and noise data std::string mGainMapFileName; ///< optional file name for the gain map diff --git a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx index d2806c7e3a2d4..0ae6719ccceec 100644 --- a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx +++ b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx @@ -52,8 +52,8 @@ void CorrectionMapsLoader::extractCCDBInputs(ProcessingContext& pc) void CorrectionMapsLoader::requestCCDBInputs(std::vector& inputs, std::vector& options, bool requestCTPLumi, int lumiScaleMode) { if (lumiScaleMode == 0) { - addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMap), {}, 1)}); // time-dependent - addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMapRef), {}, 0)}); // load once + addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMap), {}, 1)}); // time-dependent + addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMapRef), {}, 0)}); // load once } else if (lumiScaleMode == 1) { addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrDerivMap), {}, 1)}); // time-dependent addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrDerivMapRef), {}, 1)}); // time-dependent diff --git a/Detectors/TPC/workflow/src/RecoWorkflow.cxx b/Detectors/TPC/workflow/src/RecoWorkflow.cxx index 5ec25635f5da0..9f0475e53da1e 100644 --- a/Detectors/TPC/workflow/src/RecoWorkflow.cxx +++ b/Detectors/TPC/workflow/src/RecoWorkflow.cxx @@ -214,7 +214,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto "tpc-compclusters.root", "tpcrec", {"clusterbranch", "TPCCompClusters", "Branch with TPC compressed clusters"}, - {"", "", ""}, // No MC labels + {"", "", ""}, // No MC labels OutputSpec{"TPC", "COMPCLUSTERS"}, OutputSpec{"", ""}, // No MC labels std::vector(1, 0), @@ -530,8 +530,8 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto auto ccldef = BranchDefinition{InputSpec{"inputCompCl", "TPC", "COMPCLUSTERS"}, // "TPCCompClusters_0", "compcluster-branch-name"}; // - specs.push_back(MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName, // - std::move(ccldef))()); // + specs.push_back(MakeRootTreeWriterSpec(processName, defaultFileName, defaultTreeName, // + std::move(ccldef))()); // } return std::move(specs); diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index c03638ac91b8b..bcac408a1199a 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -137,8 +137,8 @@ class CorrectionMapsHelper enum UpdateFlags { MapBit = 0x1, MapRefBit = 0x2, LumiBit = 0x4 }; - bool mOwner = false; // is content of pointers owned by the helper - bool mUseCTPLumi = false; // require CTP Lumi for mInstLumi + bool mOwner = false; // is content of pointers owned by the helper + bool mUseCTPLumi = false; // require CTP Lumi for mInstLumi int mUpdatedFlags = 0; float mInstLumi = 0.; // instanteneous luminosity (a.u) float mMeanLumi = 0.; // mean luminosity of the map (a.u) diff --git a/GPU/TPCFastTransformation/TPCFastTransform.h b/GPU/TPCFastTransformation/TPCFastTransform.h index 1825e3c308bb3..265037594ed4d 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.h +++ b/GPU/TPCFastTransformation/TPCFastTransform.h @@ -328,7 +328,7 @@ class TPCFastTransform : public FlatObject /// float mTOFcorr; - float mPrimVtxZ; ///< Z of the primary vertex, needed for the Time-Of-Flight correction + float mPrimVtxZ; ///< Z of the primary vertex, needed for the Time-Of-Flight correction float mLumi; ///< luminosity estimator float mLumiError; ///< error on luminosity diff --git a/GPU/Workflow/src/GPUWorkflowSpec.cxx b/GPU/Workflow/src/GPUWorkflowSpec.cxx index 159fc556b52d0..3e54538efd970 100644 --- a/GPU/Workflow/src/GPUWorkflowSpec.cxx +++ b/GPU/Workflow/src/GPUWorkflowSpec.cxx @@ -1035,7 +1035,7 @@ int GPURecoWorkflowSpec::runITSTracking(o2::framework::ProcessingContext& pc) // Some conversions that needs to be moved in the tracker internals for (unsigned int iTrk{0}; iTrk < tracks.size(); ++iTrk) { auto& trc{tracks[iTrk]}; - trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices + trc.setFirstClusterEntry(allClusIdx.size()); // before adding tracks, create final cluster indices int ncl = trc.getNumberOfClusters(), nclf = 0; for (int ic = o2::its::TrackITSExt::MaxClusters; ic--;) { // track internally keeps in->out cluster indices, but we want to store the references as out->in!!! auto clid = trc.getClusterIndex(ic); @@ -1538,7 +1538,7 @@ void GPURecoWorkflowSpec::finaliseCCDBTPC(ConcreteDataMatcher& matcher, void* ob bool GPURecoWorkflowSpec::fetchCalibsCCDBITS(ProcessingContext& pc) { static bool initOnceDone = false; - if (!initOnceDone) { // this params need to be queried only once + if (!initOnceDone) { // this params need to be queried only once initOnceDone = true; pc.inputs().get("itscldict"); // just to trigger the finaliseCCDB pc.inputs().get*>("itsalppar"); From 919c20d51a23d4d26bd42acc4b39deace8fafb7a Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Sat, 1 Jul 2023 20:03:49 +0200 Subject: [PATCH 06/12] Setting path to derivative map CCDB objects --- Detectors/TPC/base/include/TPCBase/CDBInterface.h | 6 ++---- GPU/TPCFastTransformation/TPCFastTransform.h | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Detectors/TPC/base/include/TPCBase/CDBInterface.h b/Detectors/TPC/base/include/TPCBase/CDBInterface.h index 468cab99741fb..d2683c88879e2 100644 --- a/Detectors/TPC/base/include/TPCBase/CDBInterface.h +++ b/Detectors/TPC/base/include/TPCBase/CDBInterface.h @@ -145,10 +145,8 @@ const std::unordered_map CDBTypeMap{ {CDBType::CalCorrMap, "TPC/Calib/CorrectionMap"}, {CDBType::CalCorrMapRef, "TPC/Calib/CorrectionMapRef"}, // correction maps with derivative corrections - // {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionDerivativeMap"}, - // {CDBType::CalCorrDerivMapRef, "TPC/Calib/CorrectionDerivativeMapRef"}, - {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionMap"}, - {CDBType::CalCorrDerivMapRef, "TPC/Calib/CorrectionMapRef"}, + {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionDerivativeMap"}, + {CDBType::CalCorrDerivMapRef, "TPC/Calib/CorrectionDerivativeMapRef"}, }; /// Poor enum reflection ... diff --git a/GPU/TPCFastTransformation/TPCFastTransform.h b/GPU/TPCFastTransformation/TPCFastTransform.h index 265037594ed4d..0e7b83750a944 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.h +++ b/GPU/TPCFastTransformation/TPCFastTransform.h @@ -476,7 +476,7 @@ GPUdi() void TPCFastTransform::TransformInternal(int slice, int row, float& u, f du = (du - duRef) * scale + duRef; dv = (dv - dvRef) * scale + dvRef; } - if (mLumiScaleMode == 1) { + else if (mLumiScaleMode == 1) { float dxRef, duRef, dvRef; ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); dx = dxRef * scale + dx; @@ -745,7 +745,7 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); x = (x - xr) * scale + xr; } - if (mLumiScaleMode == 1) { + else if (mLumiScaleMode == 1) { float xr; ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); x = xr * scale + x; @@ -780,7 +780,7 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoNominalYZ(int slice, int row, un = (un - unr) * scale + unr; vn = (vn - vnr) * scale + vnr; } - if (mLumiScaleMode == 1) { + else if (mLumiScaleMode == 1) { float unr = 0, vnr = 0; ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); un = unr * scale + un; From ab20d67a56177a52619144fd911abc79e00c0499 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sat, 1 Jul 2023 18:04:43 +0000 Subject: [PATCH 07/12] Please consider the following formatting changes --- GPU/TPCFastTransformation/TPCFastTransform.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/GPU/TPCFastTransformation/TPCFastTransform.h b/GPU/TPCFastTransformation/TPCFastTransform.h index 0e7b83750a944..554cf7b81944c 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.h +++ b/GPU/TPCFastTransformation/TPCFastTransform.h @@ -475,8 +475,7 @@ GPUdi() void TPCFastTransform::TransformInternal(int slice, int row, float& u, f dx = (dx - dxRef) * scale + dxRef; du = (du - duRef) * scale + duRef; dv = (dv - dvRef) * scale + dvRef; - } - else if (mLumiScaleMode == 1) { + } else if (mLumiScaleMode == 1) { float dxRef, duRef, dvRef; ref->mCorrection.getCorrection(slice, row, u, v, dxRef, duRef, dvRef); dx = dxRef * scale + dx; @@ -744,8 +743,7 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoX(int slice, int row, float y float xr; ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); x = (x - xr) * scale + xr; - } - else if (mLumiScaleMode == 1) { + } else if (mLumiScaleMode == 1) { float xr; ref->mCorrection.getCorrectionInvCorrectedX(slice, row, u, v, xr); x = xr * scale + x; @@ -779,8 +777,7 @@ GPUdi() void TPCFastTransform::InverseTransformYZtoNominalYZ(int slice, int row, ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); un = (un - unr) * scale + unr; vn = (vn - vnr) * scale + vnr; - } - else if (mLumiScaleMode == 1) { + } else if (mLumiScaleMode == 1) { float unr = 0, vnr = 0; ref->mCorrection.getCorrectionInvUV(slice, row, u, v, unr, vnr); un = unr * scale + un; From b59a4e99c57e05dad884fc26d9b07edd10f1c09a Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Mon, 3 Jul 2023 15:48:43 +0200 Subject: [PATCH 08/12] Removing unnecessary CDB element for derivative map --- .../Detectors/CTP/include/DataFormatsCTP/LumiInfo.h | 1 - Detectors/TPC/base/include/TPCBase/CDBInterface.h | 1 - Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx | 7 +++---- GPU/TPCFastTransformation/CorrectionMapsHelper.cxx | 2 +- GPU/TPCFastTransformation/CorrectionMapsHelper.h | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h b/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h index 1fb36010345ad..03253f530a8eb 100644 --- a/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h +++ b/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h @@ -27,7 +27,6 @@ struct LumiInfo { uint32_t nHBFCountedFV0 = 0; uint64_t counts = 0; // counts in the interval for the nominal lumi detector (FT0) uint64_t countsFV0 = 0; // connts for FV0 (less reliable) - int lumiScaleMode = 0; // lumi scale mode: 0 = default, static reference map, 1 = derivative map float getLumi() const { return nHBFCounted > 0 ? float(counts / (nHBFCounted * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } float getLumiFV0() const { return nHBFCountedFV0 > 0 ? float(countsFV0 / (nHBFCountedFV0 * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } float getLumiError() const { return nHBFCounted > 0 ? float(std::sqrt(counts) / (nHBFCounted * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } diff --git a/Detectors/TPC/base/include/TPCBase/CDBInterface.h b/Detectors/TPC/base/include/TPCBase/CDBInterface.h index d2683c88879e2..c228ba0800211 100644 --- a/Detectors/TPC/base/include/TPCBase/CDBInterface.h +++ b/Detectors/TPC/base/include/TPCBase/CDBInterface.h @@ -146,7 +146,6 @@ const std::unordered_map CDBTypeMap{ {CDBType::CalCorrMapRef, "TPC/Calib/CorrectionMapRef"}, // correction maps with derivative corrections {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionDerivativeMap"}, - {CDBType::CalCorrDerivMapRef, "TPC/Calib/CorrectionDerivativeMapRef"}, }; /// Poor enum reflection ... diff --git a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx index 0ae6719ccceec..cfab361d0ce8d 100644 --- a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx +++ b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx @@ -51,12 +51,11 @@ void CorrectionMapsLoader::extractCCDBInputs(ProcessingContext& pc) //________________________________________________________ void CorrectionMapsLoader::requestCCDBInputs(std::vector& inputs, std::vector& options, bool requestCTPLumi, int lumiScaleMode) { + addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMap), {}, 1)}); // time-dependent if (lumiScaleMode == 0) { - addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMap), {}, 1)}); // time-dependent addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrMapRef), {}, 0)}); // load once } else if (lumiScaleMode == 1) { - addInput(inputs, {"tpcCorrMap", "TPC", "CorrMap", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrDerivMap), {}, 1)}); // time-dependent - addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrDerivMapRef), {}, 1)}); // time-dependent + addInput(inputs, {"tpcCorrMapRef", "TPC", "CorrMapRef", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalCorrDerivMap), {}, 1)}); // time-dependent } else { LOG(fatal) << "Correction mode unknown! Choose either 0 (default) or 1 (derivative map) for flag corrmap-lumi-mode."; } @@ -130,6 +129,6 @@ void CorrectionMapsLoader::init(o2::framework::InitContext& ic) if (mInstLumiOverride != 0.) { setInstLumi(mInstLumiOverride); } - LOGP(info, "CTP Lumi request for TPC corr.map scaling={}, override values: lumiMean={} lumiInst={} lumiScaleMode={}", getUseCTPLumi() ? "ON" : "OFF", mMeanLumiOverride, mInstLumiOverride); + LOGP(info, "CTP Lumi request for TPC corr.map scaling={}, override values: lumiMean={} lumiInst={} lumiScaleMode={}", getUseCTPLumi() ? "ON" : "OFF", mMeanLumiOverride, mInstLumiOverride, mLumiScaleMode); } #endif // #ifndef GPUCA_GPUCODE_DEVICE diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx index 4b9c45cee5fa6..9242d7163eb14 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx @@ -78,5 +78,5 @@ void CorrectionMapsHelper::setCorrMapRef(std::unique_ptr&& m) //________________________________________________________ void CorrectionMapsHelper::reportScaling() { - LOGP(info, "InstLumiOverride={}, UseCTPLumi={} -> instLumi={}, meanLumi={} -> LumiScale={}, LumiScaleMode={}", getInstLumiOverride(), getUseCTPLumi(), getInstLumi(), getMeanLumi(), getLumiScale(), getLumiScaleMode()); + LOGP(info, "InstLumiOverride={}, UseCTPLumi={} -> instLumi={}, meanLumi={} -> LumiScale={}, lumiScaleMode={}", getInstLumiOverride(), getUseCTPLumi(), getInstLumi(), getMeanLumi(), getLumiScale(), getLumiScaleMode()); } diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index bcac408a1199a..5b3985f0f11f3 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -146,7 +146,7 @@ class CorrectionMapsHelper int mLumiScaleMode = 0; // scaling-mode of the correciton maps float mMeanLumiOverride = -1.f; // optional value to override mean lumi float mInstLumiOverride = -1.f; // optional value to override inst lumi - float mLumiScaleModeOverride = 0; // optional value to override inst lumi + int mLumiScaleModeOverride = 0; // optional value to override inst lumi GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMap{nullptr}; // current transform GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMapRef{nullptr}; // reference transform #ifndef GPUCA_ALIROOT_LIB From 348cda1babd909d747b956624ef32c88e412e003 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 3 Jul 2023 13:49:36 +0000 Subject: [PATCH 09/12] Please consider the following formatting changes --- GPU/TPCFastTransformation/CorrectionMapsHelper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index 5b3985f0f11f3..f1b35b7536878 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -146,7 +146,7 @@ class CorrectionMapsHelper int mLumiScaleMode = 0; // scaling-mode of the correciton maps float mMeanLumiOverride = -1.f; // optional value to override mean lumi float mInstLumiOverride = -1.f; // optional value to override inst lumi - int mLumiScaleModeOverride = 0; // optional value to override inst lumi + int mLumiScaleModeOverride = 0; // optional value to override inst lumi GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMap{nullptr}; // current transform GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMapRef{nullptr}; // reference transform #ifndef GPUCA_ALIROOT_LIB From c77aa2615e2cb21fc0f9036f4fd085086f447688 Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Tue, 4 Jul 2023 13:34:03 +0200 Subject: [PATCH 10/12] Updating workflow and removing obsolete functions --- .../Detectors/CTP/include/DataFormatsCTP/LumiInfo.h | 2 +- Detectors/TPC/base/include/TPCBase/CDBInterface.h | 5 ++--- Detectors/TPC/workflow/src/tpc-reco-workflow.cxx | 2 +- GPU/TPCFastTransformation/CorrectionMapsHelper.h | 8 ++------ GPU/Workflow/src/GPUWorkflowSpec.cxx | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h b/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h index 03253f530a8eb..27f67ba6e92a8 100644 --- a/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h +++ b/DataFormats/Detectors/CTP/include/DataFormatsCTP/LumiInfo.h @@ -31,7 +31,7 @@ struct LumiInfo { float getLumiFV0() const { return nHBFCountedFV0 > 0 ? float(countsFV0 / (nHBFCountedFV0 * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } float getLumiError() const { return nHBFCounted > 0 ? float(std::sqrt(counts) / (nHBFCounted * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } float getLumiFV0Error() const { return nHBFCountedFV0 > 0 ? float(std::sqrt(countsFV0) / (nHBFCountedFV0 * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; } - ClassDefNV(LumiInfo, 3); + ClassDefNV(LumiInfo, 2); }; } // namespace ctp diff --git a/Detectors/TPC/base/include/TPCBase/CDBInterface.h b/Detectors/TPC/base/include/TPCBase/CDBInterface.h index c228ba0800211..bcb842dfa7904 100644 --- a/Detectors/TPC/base/include/TPCBase/CDBInterface.h +++ b/Detectors/TPC/base/include/TPCBase/CDBInterface.h @@ -86,7 +86,6 @@ enum class CDBType { CalCorrMapRef, ///< Cluster correction reference map (static distortions) /// CalCorrDerivMap, ///< Cluster correction map (derivative map) - CalCorrDerivMapRef, ///< Cluster correction reference map (high IR rate distortions) }; /// Upload intervention type @@ -141,10 +140,10 @@ const std::unordered_map CDBTypeMap{ // ITPCCs {CDBType::CalITPC0, "TPC/Calib/ITPCC_0"}, {CDBType::CalITPC1, "TPC/Calib/ITPCC_1"}, - // correction maps for static distortions + // correction maps {CDBType::CalCorrMap, "TPC/Calib/CorrectionMap"}, {CDBType::CalCorrMapRef, "TPC/Calib/CorrectionMapRef"}, - // correction maps with derivative corrections + // derivative map correction {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionDerivativeMap"}, }; diff --git a/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx b/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx index 8d03680460e27..8e873fbfc7851 100644 --- a/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx +++ b/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx @@ -140,7 +140,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) auto nLanes = cfgc.options().get("tpc-lanes"); auto inputType = cfgc.options().get("input-type"); auto requireCTPLumi = cfgc.options().get("require-ctp-lumi"); - auto lumiScaleMode = cfgc.options().get("corrmap-lumi-mode"); + auto lumiScaleMode = cfgc.options().get("corrmap-lumi-mode"); // depending on whether to dispatch early (prompt) and on the input type, we // set the matcher. Note that this has to be in accordance with the OutputSpecs // configured for the PublisherSpec diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index f1b35b7536878..4baeca1d4d3ea 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -90,10 +90,10 @@ class CorrectionMapsHelper void updateLumiScale() { - if (mMeanLumi < 0.f || mInstLumi < 0.f) { + if (mMeanLumi <= 0.f || mInstLumi < 0.f) { mLumiScale = -1.f; } else if (mLumiScaleMode == 1) { - mLumiScale = mInstLumi / mMeanLumi - 1.; + mLumiScale = mMeanLumi ? mInstLumi / mMeanLumi - 1. : 0.f; } else { mLumiScale = mMeanLumi ? mInstLumi / mMeanLumi : 0.f; } @@ -130,9 +130,6 @@ class CorrectionMapsHelper void setInstLumiOverride(float f) { mInstLumiOverride = f; } float getInstLumiOverride() const { return mInstLumiOverride; } - void setLumiScaleModeOverride(int i) { mLumiScaleModeOverride = i; } - int getLumiScaleModeOverride() const { return mLumiScaleModeOverride; } - protected: enum UpdateFlags { MapBit = 0x1, MapRefBit = 0x2, @@ -146,7 +143,6 @@ class CorrectionMapsHelper int mLumiScaleMode = 0; // scaling-mode of the correciton maps float mMeanLumiOverride = -1.f; // optional value to override mean lumi float mInstLumiOverride = -1.f; // optional value to override inst lumi - int mLumiScaleModeOverride = 0; // optional value to override inst lumi GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMap{nullptr}; // current transform GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMapRef{nullptr}; // reference transform #ifndef GPUCA_ALIROOT_LIB diff --git a/GPU/Workflow/src/GPUWorkflowSpec.cxx b/GPU/Workflow/src/GPUWorkflowSpec.cxx index 3e54538efd970..3b731228256ce 100644 --- a/GPU/Workflow/src/GPUWorkflowSpec.cxx +++ b/GPU/Workflow/src/GPUWorkflowSpec.cxx @@ -1612,7 +1612,7 @@ bool GPURecoWorkflowSpec::fetchCalibsCCDBTPC(ProcessingContext& pc, T& newCalibO mFastTransformHelperNew->setUseCTPLumi(mFastTransformHelper->getUseCTPLumi()); mFastTransformHelperNew->setMeanLumiOverride(mFastTransformHelper->getMeanLumiOverride()); mFastTransformHelperNew->setInstLumiOverride(mFastTransformHelper->getInstLumiOverride()); - mFastTransformHelperNew->setLumiScaleModeOverride(mFastTransformHelper->getLumiScaleModeOverride()); + mFastTransformHelperNew->setLumiScaleMode(mFastTransformHelper->getLumiScaleMode()); mFastTransformHelperNew->setCorrMap(mFastTransformNew ? mFastTransformNew.get() : mFastTransform.get()); mFastTransformHelperNew->setCorrMapRef(mFastTransformRefNew ? mFastTransformRefNew.get() : mFastTransformRef.get()); newCalibObjects.fastTransformHelper = mFastTransformHelperNew.get(); From b9497f3896cd3f13fc92be9c360c04836f537937 Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Wed, 5 Jul 2023 13:32:42 +0200 Subject: [PATCH 11/12] Setting mLumiScaleMode at loading of CCDB object --- Detectors/TPC/base/include/TPCBase/CDBInterface.h | 2 +- Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx | 1 + GPU/TPCFastTransformation/CorrectionMapsHelper.cxx | 1 - GPU/TPCFastTransformation/CorrectionMapsHelper.h | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Detectors/TPC/base/include/TPCBase/CDBInterface.h b/Detectors/TPC/base/include/TPCBase/CDBInterface.h index bcb842dfa7904..e3ac85f8c1090 100644 --- a/Detectors/TPC/base/include/TPCBase/CDBInterface.h +++ b/Detectors/TPC/base/include/TPCBase/CDBInterface.h @@ -144,7 +144,7 @@ const std::unordered_map CDBTypeMap{ {CDBType::CalCorrMap, "TPC/Calib/CorrectionMap"}, {CDBType::CalCorrMapRef, "TPC/Calib/CorrectionMapRef"}, // derivative map correction - {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionDerivativeMap"}, + {CDBType::CalCorrDerivMap, "TPC/Calib/CorrectionMapDerivative"}, }; /// Poor enum reflection ... diff --git a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx index cfab361d0ce8d..36d0abbd11229 100644 --- a/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx +++ b/Detectors/TPC/calibration/src/CorrectionMapsLoader.cxx @@ -98,6 +98,7 @@ bool CorrectionMapsLoader::accountCCDBInputs(const ConcreteDataMatcher& matcher, if (getMeanLumiOverride() <= 0 && mCorrMap->getLumi() > 0.) { setMeanLumi(mCorrMap->getLumi()); } + mCorrMap->setLumiScaleMode(getLumiScaleMode()); LOGP(debug, "MeanLumiOverride={} MeanLumiMap={} -> meanLumi = {}", getMeanLumiOverride(), mCorrMap->getLumi(), getMeanLumi()); setUpdatedMap(); return true; diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx index 9242d7163eb14..0d8dd922dad81 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx @@ -26,7 +26,6 @@ void CorrectionMapsHelper::clear() mUpdatedFlags = 0; mInstLumi = 0.f; mMeanLumi = 0.f; - mLumiScaleMode = 0; } void CorrectionMapsHelper::setOwner(bool v) diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index 4baeca1d4d3ea..67519cda08c3d 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -90,7 +90,7 @@ class CorrectionMapsHelper void updateLumiScale() { - if (mMeanLumi <= 0.f || mInstLumi < 0.f) { + if (mMeanLumi < 0.f || mInstLumi < 0.f) { mLumiScale = -1.f; } else if (mLumiScaleMode == 1) { mLumiScale = mMeanLumi ? mInstLumi / mMeanLumi - 1. : 0.f; From 58bb88ed3689fbd5ab90311347824490ce8a5dc6 Mon Sep 17 00:00:00 2001 From: Christian Sonnabend Date: Wed, 12 Jul 2023 16:16:51 +0200 Subject: [PATCH 12/12] [BugFix] Fixing accidental deletion of function --- GPU/TPCFastTransformation/CorrectionMapsHelper.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index dac9ac7ca3f21..332c284f53a27 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -80,6 +80,14 @@ class CorrectionMapsHelper } } + void setLumiScaleMode(int v) + { + if (v != mLumiScaleMode) { + mLumiScaleMode = v; + updateLumiScale(); + } + } + void updateLumiScale(bool report = true) { if (mMeanLumi < 0.f || mInstLumi < 0.f) {