42 LOG(
debug) <<
"Enter Initializer of ClustererTask";
44 FairRootManager* mgr = FairRootManager::Instance();
46 LOG(error) <<
"Could not instantiate FairRootManager. Exiting ...";
51 LOG(error) <<
"Sector ID " << mClusterSector <<
" is not supported. Exiting ...";
56 std::stringstream sectornamestr;
57 sectornamestr <<
"TPCDigit" << mClusterSector;
58 LOG(info) <<
"FETCHING DIGITS FOR SECTOR " << mClusterSector <<
"\n";
59 mDigitsArray = std::unique_ptr<const std::vector<Digit>>(
60 mgr->InitObjectAs<
const std::vector<Digit>*>(sectornamestr.str().c_str()));
62 LOG(error) <<
"TPC points not registered in the FairRootManager. Exiting ...";
65 std::stringstream mcsectornamestr;
66 mcsectornamestr <<
"TPCDigitMCTruth" << mClusterSector;
67 mDigitMCTruthArray = std::unique_ptr<const ConstMCLabelContainerView>(
69 if (!mDigitMCTruthArray) {
70 LOG(error) <<
"TPC MC Truth not registered in the FairRootManager. Exiting ...";
75 mHwClustersArray = std::make_unique<std::vector<OutputType>>();
77 static auto clusterArrayTmpPtr = mHwClustersArray.get();
78 mgr->RegisterAny(Form(
"TPCClusterHW%i", mClusterSector), clusterArrayTmpPtr, kTRUE);
81 mHwClustersMCTruthArray = std::make_unique<MCLabelContainer>();
83 static auto clusterMcTruthTmpPtr = mHwClustersMCTruthArray.get();
84 mgr->RegisterAny(Form(
"TPCClusterHWMCTruth%i", mClusterSector), clusterMcTruthTmpPtr, kTRUE);
87 mHwClusterer = std::make_unique<HwClusterer>(mHwClustersArray.get(), mClusterSector, mHwClustersMCTruthArray.get());
88 mHwClusterer->setContinuousReadout(mIsContinuousReadout);
100 LOG(
debug) <<
"Running clusterization on event " << mEventCount <<
" with " << mDigitsArray->size() <<
" digits.";
102 if (mHwClustersArray) {
103 mHwClustersArray->clear();
105 if (mHwClustersMCTruthArray) {
106 mHwClustersMCTruthArray->clear();
109 mHwClusterer->process(gsl::span<o2::tpc::Digit const>(mDigitsArray->data(), mDigitsArray->size()), *mDigitMCTruthArray.get());
110 LOG(
debug) <<
"Hw clusterer delivered " << mHwClustersArray->size() <<
" cluster container";
118 LOG(
debug) <<
"Finish clusterization";
120 if (mHwClustersArray) {
121 mHwClustersArray->clear();
123 if (mHwClustersMCTruthArray) {
124 mHwClustersMCTruthArray->clear();
127 mHwClusterer->finishProcess(*mDigitsArray.get(), *mDigitMCTruthArray.get());
128 LOG(
debug) <<
"Hw clusterer delivered " << mHwClustersArray->size() <<
" cluster container";