Skip to content

Commit 337a19b

Browse files
committed
TPC splines: add possibility to merge specific sector
1 parent cd9df99 commit 337a19b

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

Detectors/TPC/calibration/include/TPCCalibration/TPCFastSpaceChargeCorrectionHelper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ class TPCFastSpaceChargeCorrectionHelper
119119
/// \param mainCorrection main correction
120120
/// \param scale scaling factor for the main correction
121121
/// \param additionalCorrections vector of pairs of additional corrections and their scaling factors
122-
/// \param prn printout flag
122+
/// \param sector when >=0 perform the merge only for the sector
123123
/// \return main correction merged with additional corrections
124124
void mergeCorrections(
125125
o2::gpu::TPCFastSpaceChargeCorrection& mainCorrection, float scale,
126-
const std::vector<std::pair<const o2::gpu::TPCFastSpaceChargeCorrection*, float>>& additionalCorrections, bool prn);
126+
const std::vector<std::pair<const o2::gpu::TPCFastSpaceChargeCorrection*, float>>& additionalCorrections, int sector = -1);
127127

128128
/// how far the voxel mean is allowed to be outside of the voxel (1.1 means 10%)
129129
void setVoxelMeanValidityRange(double range)

Detectors/TPC/calibration/src/TPCFastSpaceChargeCorrectionHelper.cxx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ void TPCFastSpaceChargeCorrectionHelper::initInverse(std::vector<o2::gpu::TPCFas
10321032

10331033
void TPCFastSpaceChargeCorrectionHelper::mergeCorrections(
10341034
o2::gpu::TPCFastSpaceChargeCorrection& mainCorrection, float mainScale,
1035-
const std::vector<std::pair<const o2::gpu::TPCFastSpaceChargeCorrection*, float>>& additionalCorrections, bool /*prn*/)
1035+
const std::vector<std::pair<const o2::gpu::TPCFastSpaceChargeCorrection*, float>>& additionalCorrections, int SelectedSector)
10361036
{
10371037
/// merge several corrections
10381038

@@ -1041,7 +1041,15 @@ void TPCFastSpaceChargeCorrectionHelper::mergeCorrections(
10411041

10421042
const auto& geo = mainCorrection.getGeometry();
10431043

1044-
for (int sector = 0; sector < geo.getNumberOfSectors(); sector++) {
1044+
int firstSector = 0;
1045+
int lastSector = geo.getNumberOfSectors() - 1;
1046+
if (SelectedSector >= 0) {
1047+
assert(SelectedSector < geo.getNumberOfSectors());
1048+
firstSector = SelectedSector;
1049+
lastSector = SelectedSector;
1050+
}
1051+
1052+
for (int sector = firstSector; sector <= lastSector; sector++) {
10451053

10461054
auto myThread = [&](int iThread) {
10471055
for (int row = iThread; row < geo.getNumberOfRows(); row += mNthreads) {

0 commit comments

Comments
 (0)