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 @@ -18,6 +18,7 @@

#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"
#include "Framework/CCDBParamSpec.h"

namespace o2
{
Expand All @@ -39,6 +40,7 @@ o2::framework::DataProcessorSpec getClusterSharingMapSpec()
inputs.emplace_back("trackTPC", "TPC", "TRACKS", 0, o2::framework::Lifetime::Timeframe);
inputs.emplace_back("trackTPCClRefs", "TPC", "CLUSREFS", 0, o2::framework::Lifetime::Timeframe);
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);

return o2::framework::DataProcessorSpec{
Expand Down
8 changes: 7 additions & 1 deletion Detectors/TPC/workflow/src/ClusterSharingMapSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@
#include "DataFormatsTPC/TrackTPC.h"
#include "GPUO2InterfaceRefit.h"
#include "TPCWorkflow/ClusterSharingMapSpec.h"
#include "DataFormatsParameters/GRPECSObject.h"

using namespace o2::framework;
using namespace o2::tpc;

void ClusterSharingMapSpec::run(ProcessingContext& pc)
{
TStopwatch timer;

static int nHBPerTF = 0;
const auto tracksTPC = pc.inputs().get<gsl::span<o2::tpc::TrackTPC>>("trackTPC");
const auto tracksTPCClRefs = pc.inputs().get<gsl::span<o2::tpc::TPCClRefElem>>("trackTPCClRefs");
const auto& clustersTPC = getWorkflowTPCInput(pc);
if (pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // new run is starting
auto grp = pc.inputs().get<o2::parameters::GRPECSObject*>("grpecs");
nHBPerTF = grp->getNHBFPerTF();
LOGP(info, "Will use {} HB per TF from GRPECS", nHBPerTF);
}

auto& bufVec = pc.outputs().make<std::vector<unsigned char>>(Output{o2::header::gDataOriginTPC, "CLSHAREDMAP", 0}, clustersTPC->clusterIndex.nClustersTotal);
o2::gpu::GPUO2InterfaceRefit::fillSharedClustersMap(&clustersTPC->clusterIndex, tracksTPC, tracksTPCClRefs.data(), bufVec.data());
Expand Down