Skip to content

Commit e070a1f

Browse files
sawenzelclaude
andcommitted
Release the TPC distortion corrections after the recalculation
This frees memory in the TPC digitizer that is not needed after the recalculation of the scaled distortions. - The digitizer only uses the global distortions of the main map. - The global corrections of the main and the derivative map are now released after the recalculation. https://its.cern.ch/jira/browse/O2-7309 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5f95228 commit e070a1f

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎Detectors/TPC/simulation/src/Digitizer.cxx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ void Digitizer::recalculateDistortions()
274274
}
275275
// set new lumi of avg map
276276
mSpaceCharge->setMeanLumi(CorrMapParam::Instance().lumiInst);
277+
// the corrections were only needed to compute the scaled distortions
278+
mSpaceCharge->releaseGlobalCorrections();
279+
mSpaceChargeDer->releaseGlobalCorrections();
277280
} else {
278281
LOGP(info, "Inst. lumi {} is same as mean lumi {}. Skip recalculation of distortions", CorrMapParam::Instance().lumiInst, mSpaceCharge->getMeanLumi());
279282
}

‎Detectors/TPC/spacecharge/include/TPCSpaceCharge/SpaceCharge.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,9 @@ class SpaceCharge
638638
/// \param side side of the TPC
639639
void setDistortionLookupTables(const DataContainer& distdZ, const DataContainer& distdR, const DataContainer& distdRPhi, const Side side);
640640

641+
/// release the memory of the global corrections of both sides
642+
void releaseGlobalCorrections();
643+
641644
/// set the density, potential, electric fields, local distortions/corrections, global distortions/corrections from a file. Missing objects in the file are ignored.
642645
/// \param file output file where the electrical fields will be written to
643646
/// \param side of the TPC

‎Detectors/TPC/spacecharge/src/SpaceCharge.cxx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,16 @@ void SpaceCharge<DataT>::init()
21262126
}
21272127
}
21282128

2129+
template <typename DataT>
2130+
void SpaceCharge<DataT>::releaseGlobalCorrections()
2131+
{
2132+
for (int iside = 0; iside < FNSIDES; ++iside) {
2133+
mGlobalCorrdR[iside] = DataContainer();
2134+
mGlobalCorrdZ[iside] = DataContainer();
2135+
mGlobalCorrdRPhi[iside] = DataContainer();
2136+
}
2137+
}
2138+
21292139
template <typename DataT>
21302140
void SpaceCharge<DataT>::setDistortionLookupTables(const DataContainer& distdZ, const DataContainer& distdR, const DataContainer& distdRPhi, const Side side)
21312141
{

0 commit comments

Comments
 (0)