Skip to content

Commit

Permalink
ClusterSharingMapSpec loads GRPECS for NHBFPerTF
Browse files Browse the repository at this point in the history
  • Loading branch information
shahor02 committed Apr 3, 2024
1 parent dd4a55f commit 046c793
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 046c793

Please sign in to comment.