Skip to content

Commit 1af7254

Browse files
matthias-kleinerdavidrohr
authored andcommitted
TPC: remove CorrectionMaps helper/loader classes
Replace CorrectionMapsLoader/Helper with their Full variants, renaming CorrectionMapsLoaderFull -> CorrectionMapsLoader and CorrectionMapsHelperFull -> CorrectionMapsHelper. Use TPCFastTransformPOD directly without the intermediate helper class.
1 parent b3a71fa commit 1af7254

File tree

102 files changed

+907
-1207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+907
-1207
lines changed

Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "TRDBase/TrackletTransformer.h"
3737
#include "CommonUtils/TreeStreamRedirector.h"
3838
#include "TPCCalibration/VDriftHelper.h"
39-
#include "TPCCalibration/CorrectionMapsLoader.h"
39+
#include "TPCFastTransformPOD.h"
4040
#include "GPUO2ExternalUser.h"
4141
#include "GPUO2InterfaceUtils.h"
4242
#include "GPUParam.h"
@@ -117,7 +117,9 @@ class BarrelAlignmentSpec : public Task
117117
std::unique_ptr<o2::gpu::GPUParam> mTPCParam;
118118

119119
o2::tpc::VDriftHelper mTPCVDriftHelper{};
120-
o2::tpc::CorrectionMapsLoader mTPCCorrMapsLoader{};
120+
121+
std::vector<char> mCorrMapBuffer; // buffer to hold the raw map data from CCDB, needed to keep the pointer valid in the CorrectionMapsHelper
122+
const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps{};
121123

122124
//
123125
TStopwatch mTimer;
@@ -264,21 +266,17 @@ void BarrelAlignmentSpec::updateTimeDependentParams(ProcessingContext& pc)
264266
}
265267

266268
mTPCVDriftHelper.extractCCDBInputs(pc);
267-
mTPCCorrMapsLoader.extractCCDBInputs(pc);
268-
bool updateMaps = false;
269-
if (mTPCCorrMapsLoader.isUpdated()) {
270-
mTPCCorrMapsLoader.acknowledgeUpdate();
271-
updateMaps = true;
272-
}
273-
// mController->setTPCCorrMaps(&mTPCCorrMapsLoader);
269+
270+
auto const& raw = pc.inputs().get<const char*>("corrMap");
271+
mTPCCorrMaps = &o2::gpu::TPCFastTransformPOD::get(raw);
272+
mController->setTPCCorrMaps(mTPCCorrMaps);
274273
if (mTPCVDriftHelper.isUpdated()) {
275274
LOGP(info, "Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
276275
mTPCVDriftHelper.getVDriftObject().corrFact, mTPCVDriftHelper.getVDriftObject().refVDrift,
277276
mTPCVDriftHelper.getVDriftObject().timeOffsetCorr, mTPCVDriftHelper.getVDriftObject().refTimeOffset,
278277
mTPCVDriftHelper.getSourceName());
279278
mController->setTPCVDrift(mTPCVDriftHelper.getVDriftObject());
280279
mTPCVDriftHelper.acknowledgeUpdate();
281-
updateMaps = true;
282280
}
283281
}
284282
}
@@ -385,7 +383,7 @@ DataProcessorSpec getBarrelAlignmentSpec(GTrackID::mask_t srcMP, GTrackID::mask_
385383
}
386384
if (src[DetID::TPC] && !skipDetClusters[DetID::TPC]) {
387385
o2::tpc::VDriftHelper::requestCCDBInputs(dataRequest->inputs);
388-
o2::tpc::CorrectionMapsLoader::requestInputs(dataRequest->inputs, opts);
386+
dataRequest->inputs.emplace_back("corrMap", o2::header::gDataOriginTPC, "TPCCORRMAP", 0, Lifetime::Timeframe);
389387
loadTPCCalib = true;
390388
}
391389
}

Detectors/Align/Workflow/src/barrel-alignment-workflow.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "ReconstructionDataFormats/GlobalTrackID.h"
2727
#include "DetectorsCommonDataFormats/DetID.h"
2828
#include "GlobalTrackingWorkflowReaders/TrackTPCITSReaderSpec.h"
29+
#include "TPCCalibration/CorrectionMapsOptions.h"
2930

3031
#include "Algorithm/RangeTokenizer.h"
3132
#include "DetectorsRaw/HBFUtilsInitializer.h"
@@ -58,7 +59,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
5859
{"enable-cosmic", VariantType::Bool, false, {"enable cosmic tracks)"}},
5960
{"postprocessing", VariantType::Int, 0, {"postprocessing bits: 1 - extract alignment objects, 2 - check constraints, 4 - print mpParams/Constraints, 8 - relabel pede results"}},
6061
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
61-
o2::tpc::CorrectionMapsLoader::addGlobalOptions(options);
62+
o2::tpc::CorrectionMapsOptions::addGlobalOptions(options);
6263
o2::raw::HBFUtilsInitializer::addConfigOption(options);
6364
std::swap(workflowOptions, options);
6465
}
@@ -101,7 +102,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
101102
if (dets[DetID::TPC]) {
102103
loadTPCClusters = loadTPCTracks = true;
103104
}
104-
auto sclOpt = o2::tpc::CorrectionMapsLoader::parseGlobalOptions(configcontext.options());
105+
auto sclOpt = o2::tpc::CorrectionMapsOptions::parseGlobalOptions(configcontext.options());
105106
if (!postprocess) { // this part is needed only if the data should be read
106107
if (GID::includesDet(DetID::ITS, src)) {
107108
src |= GID::getSourceMask(GID::ITS);

Detectors/Align/include/Align/Controller.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "ReconstructionDataFormats/PrimaryVertex.h"
3131
#include "ReconstructionDataFormats/TrackCosmics.h"
3232
#include "DataFormatsTPC/VDriftCorrFact.h"
33-
#include "CorrectionMapsHelper.h"
33+
#include "TPCFastTransformPOD.h"
3434

3535
#include "Align/Millepede2Record.h"
3636
#include "Align/ResidualsController.h"
@@ -272,8 +272,8 @@ class Controller final : public TObject
272272
bool getAllowAfterburnerTracks() const { return mAllowAfterburnerTracks; }
273273

274274
void setTPCVDrift(const o2::tpc::VDriftCorrFact& v);
275-
void setTPCCorrMaps(o2::gpu::CorrectionMapsHelper* maph);
276-
o2::gpu::CorrectionMapsHelper* getTPCCorrMaps() { return mTPCCorrMapsHelper; }
275+
void setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD* maph);
276+
const o2::gpu::TPCFastTransformPOD* getTPCCorrMaps() { return mTPCCorrMaps; }
277277
const o2::tpc::VDriftCorrFact& getTPCVDrift() const { return mTPCDrift; }
278278

279279
int getInstanceID() const { return mInstanceID; }
@@ -359,7 +359,7 @@ class Controller final : public TObject
359359
bool mUseRecoOCDB = true; // flag to preload reco-time calib objects
360360

361361
o2::tpc::VDriftCorrFact mTPCDrift{};
362-
o2::gpu::CorrectionMapsHelper* mTPCCorrMapsHelper = nullptr;
362+
const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps = nullptr;
363363

364364
//
365365
static const int sSkipLayers[kNLrSkip]; // detector layers for which we don't need module matrices

Detectors/Align/src/Controller.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,9 +1882,9 @@ void Controller::setTPCVDrift(const o2::tpc::VDriftCorrFact& v)
18821882
}
18831883

18841884
//______________________________________________
1885-
void Controller::setTPCCorrMaps(o2::gpu::CorrectionMapsHelper* maph)
1885+
void Controller::setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD* maph)
18861886
{
1887-
mTPCCorrMapsHelper = maph;
1887+
mTPCCorrMaps = maph;
18881888
}
18891889

18901890
} // namespace align

Detectors/GlobalTracking/include/GlobalTracking/MatchCosmics.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "SimulationDataFormat/MCCompLabel.h"
2727
#include "GlobalTracking/MatchCosmicsParams.h"
2828
#include "CommonUtils/TreeStreamRedirector.h"
29-
#include "TPCFastTransform.h"
3029

3130
#define _ALLOW_DEBUG_TREES_COSM // to allow debug and control tree output
3231

@@ -38,7 +37,7 @@ class VDriftCorrFact;
3837
}
3938
namespace gpu
4039
{
41-
class CorrectionMapsHelper;
40+
class TPCFastTransformPOD;
4241
}
4342
namespace globaltracking
4443
{
@@ -85,7 +84,7 @@ class MatchCosmics
8584
GTrackID origID; ///< track origin id
8685
int matchID = MinusOne; ///< entry (none if MinusOne) of its match in the vector of matches
8786
};
88-
void setTPCCorrMaps(o2::gpu::CorrectionMapsHelper* maph);
87+
void setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD* maph);
8988
void setTPCVDrift(const o2::tpc::VDriftCorrFact& v);
9089
void setITSROFrameLengthMUS(float fums) { mITSROFrameLengthMUS = fums; }
9190
void setITSDict(const o2::itsmft::TopologyDictionary* dict) { mITSDict = dict; }
@@ -138,14 +137,14 @@ class MatchCosmics
138137
std::vector<MatchRecord> mRecords;
139138
std::vector<int> mWinners;
140139
const o2::itsmft::TopologyDictionary* mITSDict = nullptr; // cluster patterns dictionary
141-
o2::gpu::CorrectionMapsHelper* mTPCCorrMapsHelper = nullptr;
140+
const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps = nullptr;
142141
int mTFCount = 0;
143-
float mTPCVDriftRef = -1.; ///< TPC nominal drift speed in cm/microseconds
144-
float mTPCVDriftCorrFact = 1.; ///< TPC nominal correction factort (wrt ref)
145-
float mTPCVDrift = -1.; ///< TPC drift speed in cm/microseconds
142+
float mTPCVDriftRef = -1.; ///< TPC nominal drift speed in cm/microseconds
143+
float mTPCVDriftCorrFact = 1.; ///< TPC nominal correction factort (wrt ref)
144+
float mTPCVDrift = -1.; ///< TPC drift speed in cm/microseconds
146145
float mTPCDriftTimeOffset = 0.; ///< drift time offset in mus
147-
float mTPCTBinMUS = 0.; ///< TPC time bin duration in microseconds
148-
float mBz = 0; ///< nominal Bz
146+
float mTPCTBinMUS = 0.; ///< TPC time bin duration in microseconds
147+
float mBz = 0; ///< nominal Bz
149148
bool mFieldON = true;
150149
bool mUseMC = true;
151150
float mITSROFrameLengthMUS = 0.;

Detectors/GlobalTracking/include/GlobalTracking/MatchHMP.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "DataFormatsTPC/TrackTPC.h"
4242
#include "DataFormatsTRD/TrackTRD.h"
4343
#include "ReconstructionDataFormats/PID.h"
44-
#include "TPCFastTransform.h"
4544
#include "CommonDataFormat/InteractionRecord.h"
4645
#include "ReconstructionDataFormats/MatchInfoHMP.h"
4746
#include "ReconstructionDataFormats/TrackHMP.h"

Detectors/GlobalTracking/include/GlobalTracking/MatchTOF.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
#include "DataFormatsTPC/TrackTPC.h"
3838
#include "DataFormatsTRD/TrackTRD.h"
3939
#include "ReconstructionDataFormats/PID.h"
40-
#include "TPCFastTransform.h"
4140
#include "CommonDataFormat/InteractionRecord.h"
42-
#include "CorrectionMapsHelper.h"
4341
#include "GlobalTracking/MatchTOFParams.h"
4442

4543
// from FIT
@@ -152,7 +150,7 @@ class MatchTOF
152150
std::vector<o2::MCCompLabel>& getMatchedTOFLabelsVector(trkType index) { return mOutTOFLabels[index]; } ///< get vector of TOF labels of matched tracks
153151

154152
void setTPCVDrift(const o2::tpc::VDriftCorrFact& v);
155-
void setTPCCorrMaps(o2::gpu::CorrectionMapsHelper* maph);
153+
void setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD* maph, float lumi);
156154

157155
void setFIT(bool value = true) { mIsFIT = value; }
158156
static int findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FITRecPoints, unsigned long firstOrbit);
@@ -292,7 +290,8 @@ class MatchTOF
292290
gsl::span<const unsigned int> mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map
293291
const o2::tpc::ClusterNativeAccess* mTPCClusterIdxStruct = nullptr; ///< struct holding the TPC cluster indices
294292

295-
o2::gpu::CorrectionMapsHelper* mTPCCorrMapsHelper = nullptr; ///< TPC cluster transformation
293+
const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps = nullptr; ///< TPC cluster transformation
294+
float mCTPLumi = {-1};
296295
std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mTPCRefitter; ///< TPC refitter used for TPC tracks refit during the reconstruction
297296

298297
const o2::dataformats::MCTruthContainer<o2::MCCompLabel>* mTOFClusLabels; ///< input TOF clusters MC labels (pointer to read from tree)

Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@
4848
#include "DataFormatsTPC/ClusterNativeHelper.h"
4949
#include "DataFormatsTPC/VDriftCorrFact.h"
5050
#include "ITSReconstruction/RecoGeomHelper.h"
51-
#include "TPCFastTransform.h"
5251
#include "GPUO2InterfaceRefit.h"
5352
#include "GPUTPCGeometry.h"
5453
#include "GlobalTracking/MatchTPCITSParams.h"
5554
#include "DataFormatsITSMFT/TopologyDictionary.h"
5655
#include "DataFormatsITSMFT/TrkClusRef.h"
5756
#include "ITSMFTReconstruction/ChipMappingITS.h"
58-
#include "CorrectionMapsHelper.h"
57+
#include "TPCFastTransformPOD.h"
5958
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
6059
#include "MemoryResources/MemoryResources.h"
6160
#endif
@@ -434,7 +433,7 @@ class MatchTPCITS
434433
mVDriftCalibOn = v;
435434
}
436435
void setTPCVDrift(const o2::tpc::VDriftCorrFact& v);
437-
void setTPCCorrMaps(o2::gpu::CorrectionMapsHelper* maph);
436+
void setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD* maph, float lumi);
438437

439438
///< print settings
440439
void print() const;
@@ -641,7 +640,8 @@ class MatchTPCITS
641640
float mMinITSTrackPtInv = 999.; ///< cutoff on ITS track inverse pT
642641
bool mVDriftCalibOn = false; ///< flag to produce VDrift calibration data
643642
o2::tpc::VDriftCorrFact mTPCDrift{};
644-
o2::gpu::CorrectionMapsHelper* mTPCCorrMapsHelper = nullptr;
643+
const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps = nullptr;
644+
float mLumiCTP{-1};
645645

646646
std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mTPCRefitter; ///< TPC refitter used for TPC tracks refit during the reconstruction
647647

Detectors/GlobalTracking/src/MatchCosmics.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "CommonConstants/GeomConstants.h"
3333
#include "DataFormatsTPC/WorkflowHelper.h"
3434
#include "DataFormatsTPC/VDriftCorrFact.h"
35-
#include "CorrectionMapsHelper.h"
35+
#include "TPCFastTransformPOD.h"
3636
#include <algorithm>
3737
#include <numeric>
3838

@@ -93,7 +93,7 @@ void MatchCosmics::refitWinners(const o2::globaltracking::RecoContainer& data)
9393
std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> tpcRefitter;
9494
if (data.inputsTPCclusters) {
9595
tpcRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(&data.inputsTPCclusters->clusterIndex,
96-
mTPCCorrMapsHelper, mBz,
96+
mTPCCorrMaps, mBz,
9797
tpcClusRefs.data(), 0, tpcClusShMap.data(),
9898
tpcClusOccMap.data(), tpcClusOccMap.size(), nullptr, o2::base::Propagator::Instance());
9999
}
@@ -597,9 +597,9 @@ void MatchCosmics::setTPCVDrift(const o2::tpc::VDriftCorrFact& v)
597597
}
598598

599599
//______________________________________________
600-
void MatchCosmics::setTPCCorrMaps(o2::gpu::CorrectionMapsHelper* maph)
600+
void MatchCosmics::setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD* maph)
601601
{
602-
mTPCCorrMapsHelper = maph;
602+
mTPCCorrMaps = maph;
603603
}
604604

605605
#endif

Detectors/GlobalTracking/src/MatchTOF.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,10 @@ void MatchTOF::setTPCVDrift(const o2::tpc::VDriftCorrFact& v)
255255
}
256256

257257
//______________________________________________
258-
void MatchTOF::setTPCCorrMaps(o2::gpu::CorrectionMapsHelper* maph)
258+
void MatchTOF::setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD* maph, float lumi)
259259
{
260-
mTPCCorrMapsHelper = maph;
260+
mTPCCorrMaps = maph;
261+
mCTPLumi = lumi;
261262
}
262263

263264
//______________________________________________
@@ -2085,7 +2086,7 @@ void MatchTOF::updateTimeDependentParams()
20852086
mMaxInvPt = std::abs(mBz) > 0.1 ? 1. / (std::abs(mBz) * 0.05) : 999.;
20862087

20872088
const auto& trackTune = TrackTuneParams::Instance();
2088-
float scale = mTPCCorrMapsHelper->getInstLumiCTP();
2089+
float scale = mCTPLumi;
20892090
if (scale < 0.f) {
20902091
LOGP(warning, "Negative scale factor for TPC covariance correction, setting it to zero");
20912092
scale = 0.f;
@@ -2167,7 +2168,7 @@ bool MatchTOF::makeConstrainedTPCTrack(int matchedID, o2::dataformats::TrackTPCT
21672168
void MatchTOF::checkRefitter()
21682169
{
21692170
if (mTPCClusterIdxStruct) {
2170-
mTPCRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mTPCClusterIdxStruct, mTPCCorrMapsHelper, mBz,
2171+
mTPCRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mTPCClusterIdxStruct, mTPCCorrMaps, mBz,
21712172
mTPCTrackClusIdx.data(), 0, mTPCRefitterShMap.data(),
21722173
mTPCRefitterOccMap.data(), mTPCRefitterOccMap.size(), nullptr, o2::base::Propagator::Instance());
21732174
}

0 commit comments

Comments
 (0)