Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ struct RecoContainer {
o2::ctp::LumiInfo mCTPLumi;

gsl::span<const unsigned char> clusterShMapTPC; ///< externally set TPC clusters sharing map
gsl::span<const unsigned int> occupancyMapTPC; ///< externally set TPC clusters occupancy map

std::unique_ptr<o2::tpc::internal::getWorkflowTPCInput_ret> inputsTPCclusters; // special struct for TPC clusters access
std::unique_ptr<o2::trd::RecoInputContainer> inputsTRD; // special struct for TRD tracklets, trigger records
Expand Down Expand Up @@ -371,7 +372,7 @@ struct RecoContainer {

void addITSClusters(o2::framework::ProcessingContext& pc, bool mc);
void addMFTClusters(o2::framework::ProcessingContext& pc, bool mc);
void addTPCClusters(o2::framework::ProcessingContext& pc, bool mc, bool shmap);
void addTPCClusters(o2::framework::ProcessingContext& pc, bool mc, bool shmap, bool occmap);
void addTPCTriggers(o2::framework::ProcessingContext& pc);
void addTOFClusters(o2::framework::ProcessingContext& pc, bool mc);
void addHMPClusters(o2::framework::ProcessingContext& pc, bool mc);
Expand Down
10 changes: 8 additions & 2 deletions DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void DataRequest::requestTPCTracks(bool mc)
addInput({"trackTPCClRefs", "TPC", "CLUSREFS", 0, Lifetime::Timeframe});
if (requestMap.find("clusTPC") != requestMap.end()) {
addInput({"clusTPCshmap", "TPC", "CLSHAREDMAP", 0, Lifetime::Timeframe});
addInput({"clusTPCoccmap", "TPC", "TPCOCCUPANCYMAP", 0, Lifetime::Timeframe});
}
if (mc) {
addInput({"trackTPCMCTR", "TPC", "TRACKSMCLBL", 0, Lifetime::Timeframe});
Expand Down Expand Up @@ -255,6 +256,7 @@ void DataRequest::requestTPCClusters(bool mc)
}
if (requestMap.find("trackTPC") != requestMap.end()) {
addInput({"clusTPCshmap", "TPC", "CLSHAREDMAP", 0, Lifetime::Timeframe});
addInput({"clusTPCoccmap", "TPC", "TPCOCCUPANCYMAP", 0, Lifetime::Timeframe});
}
if (mc) {
addInput({"clusTPCMC", ConcreteDataTypeMatcher{"TPC", "CLNATIVEMCLBL"}, Lifetime::Timeframe});
Expand Down Expand Up @@ -678,7 +680,8 @@ void RecoContainer::collectData(ProcessingContext& pc, const DataRequest& reques

req = reqMap.find("clusTPC");
if (req != reqMap.end()) {
addTPCClusters(pc, req->second, reqMap.find("trackTPC") != reqMap.end());
auto tracksON = reqMap.find("trackTPC") != reqMap.end();
addTPCClusters(pc, req->second, tracksON, tracksON);
}

req = reqMap.find("trigTPC");
Expand Down Expand Up @@ -1060,12 +1063,15 @@ void RecoContainer::addMFTClusters(ProcessingContext& pc, bool mc)
}

//__________________________________________________________
void RecoContainer::addTPCClusters(ProcessingContext& pc, bool mc, bool shmap)
void RecoContainer::addTPCClusters(ProcessingContext& pc, bool mc, bool shmap, bool occmap)
{
inputsTPCclusters = o2::tpc::getWorkflowTPCInput(pc, 0, mc);
if (shmap) {
clusterShMapTPC = pc.inputs().get<gsl::span<unsigned char>>("clusTPCshmap");
}
if (occmap) {
occupancyMapTPC = pc.inputs().get<gsl::span<unsigned int>>("clusTPCoccmap");
}
}

//__________________________________________________________
Expand Down
1 change: 1 addition & 0 deletions Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "TPCCalibration/VDriftHelper.h"
#include "TPCCalibration/CorrectionMapsLoader.h"
#include "GPUO2Interface.h"
#include "GPUO2InterfaceUtils.h"
#include "GPUParam.h"
#include "Headers/DataHeader.h"
#include "Framework/ConfigParamRegistry.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class MatchTOF
/// data needed for refit of time-constrained TPC tracks
gsl::span<const o2::tpc::TPCClRefElem> mTPCTrackClusIdx; ///< input TPC track cluster indices span
gsl::span<const unsigned char> mTPCRefitterShMap; ///< externally set TPC clusters sharing map
gsl::span<const unsigned int> mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map
const o2::tpc::ClusterNativeAccess* mTPCClusterIdxStruct = nullptr; ///< struct holding the TPC cluster indices

o2::gpu::CorrectionMapsHelper* mTPCCorrMapsHelper = nullptr; ///< TPC cluster transformation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ class MatchTPCITS
gsl::span<const o2::ft0::RecPoints> mFITInfo; ///< optional input FIT info span

gsl::span<const unsigned char> mTPCRefitterShMap; ///< externally set TPC clusters sharing map
gsl::span<const unsigned int> mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map

const o2::itsmft::TopologyDictionary* mITSDict{nullptr}; // cluster patterns dictionary

Expand Down
5 changes: 3 additions & 2 deletions Detectors/GlobalTracking/src/MatchCosmics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ void MatchCosmics::refitWinners(const o2::globaltracking::RecoContainer& data)
auto tpcTBinMUSInv = 1. / mTPCTBinMUS;
const auto& tpcClusRefs = data.getTPCTracksClusterRefs();
const auto& tpcClusShMap = data.clusterShMapTPC;
const auto& tpcClusOccMap = data.occupancyMapTPC;
std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> tpcRefitter;
if (data.inputsTPCclusters) {
tpcRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(&data.inputsTPCclusters->clusterIndex,
mTPCCorrMapsHelper, mBz,
tpcClusRefs.data(), tpcClusShMap.data(),
nullptr, o2::base::Propagator::Instance());
tpcClusRefs.data(), 0, tpcClusShMap.data(),
tpcClusOccMap.data(), tpcClusOccMap.size(), nullptr, o2::base::Propagator::Instance());
}

const auto& itsClusters = prepareITSClusters(data);
Expand Down
5 changes: 3 additions & 2 deletions Detectors/GlobalTracking/src/MatchTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ bool MatchTOF::prepareTPCData()
mTPCTracksArray = mRecoCont->getTPCTracks();
mTPCTrackClusIdx = mRecoCont->getTPCTracksClusterRefs();
mTPCRefitterShMap = mRecoCont->clusterShMapTPC;
mTPCRefitterOccMap = mRecoCont->occupancyMapTPC;
}

return true;
Expand Down Expand Up @@ -1797,7 +1798,7 @@ void MatchTOF::checkRefitter()
{
if (mTPCClusterIdxStruct) {
mTPCRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mTPCClusterIdxStruct, mTPCCorrMapsHelper, mBz,
mTPCTrackClusIdx.data(), mTPCRefitterShMap.data(),
nullptr, o2::base::Propagator::Instance());
mTPCTrackClusIdx.data(), 0, mTPCRefitterShMap.data(),
mTPCRefitterOccMap.data(), mTPCRefitterOccMap.size(), nullptr, o2::base::Propagator::Instance());
}
}
4 changes: 3 additions & 1 deletion Detectors/GlobalTracking/src/MatchTPCITS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ bool MatchTPCITS::prepareTPCData()
mTPCTrackClusIdx = inp.getTPCTracksClusterRefs();
mTPCClusterIdxStruct = &inp.inputsTPCclusters->clusterIndex;
mTPCRefitterShMap = inp.clusterShMapTPC;
mTPCRefitterOccMap = inp.occupancyMapTPC;

if (mMCTruthON) {
mTPCTrkLabels = inp.getTPCTracksMCLabels();
}
Expand Down Expand Up @@ -572,7 +574,7 @@ bool MatchTPCITS::prepareTPCData()
mITSROFofTPCBin[ib] = itsROF;
}
*/
mTPCRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mTPCClusterIdxStruct, mTPCCorrMapsHelper, mBz, mTPCTrackClusIdx.data(), mTPCRefitterShMap.data(), nullptr, o2::base::Propagator::Instance());
mTPCRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mTPCClusterIdxStruct, mTPCCorrMapsHelper, mBz, mTPCTrackClusIdx.data(), 0, mTPCRefitterShMap.data(), mTPCRefitterOccMap.data(), mTPCRefitterOccMap.size(), nullptr, o2::base::Propagator::Instance());
mInteractionMUSLUT.clear();
mInteractionMUSLUT.resize(maxTime + 3 * o2::constants::lhc::LHCOrbitMUS, -1);
mTimer[SWPrepTPC].Stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class TPCTrackStudySpec : public Task
gsl::span<const o2::tpc::TPCClRefElem> mTPCTrackClusIdx; ///< input TPC track cluster indices span
gsl::span<const o2::tpc::TrackTPC> mTPCTracksArray; ///< input TPC tracks span
gsl::span<const unsigned char> mTPCRefitterShMap; ///< externally set TPC clusters sharing map
gsl::span<const unsigned int> mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map
const o2::tpc::ClusterNativeAccess* mTPCClusterIdxStruct = nullptr; ///< struct holding the TPC cluster indices
gsl::span<const o2::MCCompLabel> mTPCTrkLabels; ///< input TPC Track MC labels
std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mTPCRefitter; ///< TPC refitter used for TPC tracks refit during the reconstruction
Expand Down Expand Up @@ -169,6 +170,7 @@ void TPCTrackStudySpec::process(o2::globaltracking::RecoContainer& recoData)
mTPCTrackClusIdx = recoData.getTPCTracksClusterRefs();
mTPCClusterIdxStruct = &recoData.inputsTPCclusters->clusterIndex;
mTPCRefitterShMap = recoData.clusterShMapTPC;
mTPCRefitterOccMap = recoData.occupancyMapTPC;

std::vector<o2::InteractionTimeRecord> intRecs;
if (mUseMC) { // extract MC tracks
Expand All @@ -181,7 +183,7 @@ void TPCTrackStudySpec::process(o2::globaltracking::RecoContainer& recoData)
mTPCTrkLabels = recoData.getTPCTracksMCLabels();
}

mTPCRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mTPCClusterIdxStruct, &mTPCCorrMapsLoader, prop->getNominalBz(), mTPCTrackClusIdx.data(), mTPCRefitterShMap.data(), nullptr, o2::base::Propagator::Instance());
mTPCRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mTPCClusterIdxStruct, &mTPCCorrMapsLoader, prop->getNominalBz(), mTPCTrackClusIdx.data(), 0, mTPCRefitterShMap.data(), mTPCRefitterOccMap.data(), mTPCRefitterOccMap.size(), nullptr, o2::base::Propagator::Instance());

float vdriftTB = mTPCVDriftHelper.getVDriftObject().getVDrift() * o2::tpc::ParameterElectronics::Instance().ZbinWidth; // VDrift expressed in cm/TimeBin
float tpcTBBias = mTPCVDriftHelper.getVDriftObject().getTimeOffset() / (8 * o2::constants::lhc::LHCBunchSpacingMUS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class CalibPadGainTracks : public CalibPadGainTracksBase
/// \param vTPCTracksArrayInp vector of tpc tracks
/// \param tpcTrackClIdxVecInput set the TPCClRefElem member variable
/// \param clIndex set the ClusterNativeAccess member variable
void setMembers(gsl::span<const o2::tpc::TrackTPC>* vTPCTracksArrayInp, gsl::span<const o2::tpc::TPCClRefElem>* tpcTrackClIdxVecInput, const o2::tpc::ClusterNativeAccess& clIndex);
void setMembers(gsl::span<const o2::tpc::TrackTPC>* vTPCTracksArrayInp, gsl::span<const o2::tpc::TPCClRefElem>* tpcTrackClIdxVecInput, const o2::tpc::ClusterNativeAccess& clIndex, gsl::span<const unsigned char> TPCRefitterShMap, gsl::span<const unsigned int> TPCRefitterOccMap);

/// this function sets the mode of the class.
/// e.g. mode=0 -> use the truncated mean from the track for normalizing the dedx
Expand Down Expand Up @@ -220,8 +220,9 @@ class CalibPadGainTracks : public CalibPadGainTracksBase
gsl::span<const TrackTPC>* mTracks{nullptr}; ///<! vector containing the tpc tracks which will be processed. Cant be const due to the propagate function
gsl::span<const TPCClRefElem>* mTPCTrackClIdxVecInput{nullptr}; ///<! input vector with TPC tracks cluster indicies
const o2::tpc::ClusterNativeAccess* mClusterIndex{nullptr}; ///<! needed to access clusternative with tpctracks
gsl::span<const unsigned char> mTPCRefitterShMap; ///<! externally set TPC clusters sharing map
gsl::span<const unsigned int> mTPCRefitterOccMap; ///<! externally set TPC clusters occupancy map
std::vector<unsigned char> mBufVec; ///<! buffer for filling shared cluster map
unsigned char* mClusterShMapTPC{nullptr}; ///<! externally set TPC clusters sharing map
DEdxType mMode = dedxTrack; ///< normalization type: type=DedxTrack use truncated mean, type=DedxBB use value from BB fit
DEdxRegion mDedxRegion = stack; ///< using the dE/dx per chamber, stack or per sector
float mFieldNominalGPUBz{-5}; ///< Magnetic field in kG, used for track propagation
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TPC/calibration/src/CalculatedEdx.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void CalculatedEdx::setMembers(std::vector<o2::tpc::TPCClRefElem>* tpcTrackClIdx

void CalculatedEdx::setRefit()
{
mRefit = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mClusterIndex, &mTPCCorrMapsHelper, mFieldNominalGPUBz, mTPCTrackClIdxVecInput->data(), nullptr, mTracks);
mRefit = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mClusterIndex, &mTPCCorrMapsHelper, mFieldNominalGPUBz, mTPCTrackClIdxVecInput->data(), 0, nullptr, nullptr, -1, mTracks);
}

void CalculatedEdx::fillMissingClusters(int missingClusters[4], float minChargeTot, float minChargeMax, int method)
Expand Down
9 changes: 4 additions & 5 deletions Detectors/TPC/calibration/src/CalibPadGainTracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ void CalibPadGainTracks::processTracks(const int nMaxTracks)
{
std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> refit;
if (!mPropagateTrack) {
mBufVec.resize(mClusterIndex->nClustersTotal);
o2::gpu::GPUO2InterfaceRefit::fillSharedClustersMap(mClusterIndex, *mTracks, mTPCTrackClIdxVecInput->data(), mBufVec.data());
mClusterShMapTPC = mBufVec.data();
refit = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mClusterIndex, mTPCCorrMapsHelper, mFieldNominalGPUBz, mTPCTrackClIdxVecInput->data(), mClusterShMapTPC);
refit = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mClusterIndex, mTPCCorrMapsHelper, mFieldNominalGPUBz, mTPCTrackClIdxVecInput->data(), 0, mTPCRefitterShMap.data(), mTPCRefitterOccMap.data(), mTPCRefitterOccMap.size());
}

const size_t loopEnd = (nMaxTracks < 0) ? mTracks->size() : ((nMaxTracks > mTracks->size()) ? mTracks->size() : size_t(nMaxTracks));
Expand Down Expand Up @@ -310,11 +307,13 @@ void CalibPadGainTracks::dumpToFile(const char* outFileName, const char* outName
fOut.Close();
}

void CalibPadGainTracks::setMembers(gsl::span<const o2::tpc::TrackTPC>* vTPCTracksArrayInp, gsl::span<const o2::tpc::TPCClRefElem>* tpcTrackClIdxVecInput, const o2::tpc::ClusterNativeAccess& clIndex)
void CalibPadGainTracks::setMembers(gsl::span<const o2::tpc::TrackTPC>* vTPCTracksArrayInp, gsl::span<const o2::tpc::TPCClRefElem>* tpcTrackClIdxVecInput, const o2::tpc::ClusterNativeAccess& clIndex, gsl::span<const unsigned char> TPCRefitterShMap, gsl::span<const unsigned int> TPCRefitterOccMap)
{
mTracks = vTPCTracksArrayInp;
mTPCTrackClIdxVecInput = tpcTrackClIdxVecInput;
mClusterIndex = &clIndex;
mTPCRefitterShMap = TPCRefitterShMap;
mTPCRefitterOccMap = TPCRefitterOccMap;
}

void CalibPadGainTracks::setMomentumRange(const float momMin, const float momMax)
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TPC/qc/src/TrackClusters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bool TrackClusters::processTrackAndClusters(const std::vector<o2::tpc::TrackTPC>
std::vector<unsigned char> mBufVec;
mBufVec.resize(clusterIndex->nClustersTotal);

o2::gpu::GPUO2InterfaceRefit::fillSharedClustersMap(clusterIndex, *tracks, clusRefs->data(), mBufVec.data());
o2::gpu::GPUO2InterfaceRefit::fillSharedClustersAndOccupancyMap(clusterIndex, *tracks, clusRefs->data(), mBufVec.data());

for (auto const& track : (*tracks)) {
const auto dEdxTot = track.getdEdx().dEdxTotTPC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ o2::framework::DataProcessorSpec getClusterSharingMapSpec()
inputs.emplace_back("clusTPC", o2::framework::ConcreteDataTypeMatcher{"TPC", "CLUSTERNATIVE"}, o2::framework::Lifetime::Timeframe);
inputs.emplace_back("grpecs", "GLO", "GRPECS", 0, o2::framework::Lifetime::Condition, o2::framework::ccdbParamSpec("GLO/Config/GRPECS", true));
outputs.emplace_back("TPC", "CLSHAREDMAP", 0, o2::framework::Lifetime::Timeframe);
outputs.emplace_back("TPC", "TPCOCCUPANCYMAP", 0, o2::framework::Lifetime::Timeframe);

return o2::framework::DataProcessorSpec{
"tpc-clusters-sharing-map-producer",
Expand Down
Loading