Skip to content

Commit e50629e

Browse files
committed
Support per-layer ITS clusters in tpc-interpolation-workflow
1 parent 95b10aa commit e50629e

5 files changed

Lines changed: 20 additions & 11 deletions

File tree

‎Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCInterpolationSpec.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class TPCInterpolationDPL : public Task
6868

6969
/// create a processor spec
7070
framework::DataProcessorSpec getTPCInterpolationSpec(o2::dataformats::GlobalTrackID::mask_t srcCls, o2::dataformats::GlobalTrackID::mask_t srcVtx, o2::dataformats::GlobalTrackID::mask_t srcTrk,
71-
o2::dataformats::GlobalTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput, bool extDetResid);
71+
o2::dataformats::GlobalTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput, bool extDetResid, bool itsStag);
7272

7373
} // namespace tpc
7474
} // namespace o2

‎Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCInterpolationSpec.cxx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,10 @@ void TPCInterpolationDPL::endOfStream(EndOfStreamContext& ec)
159159
mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
160160
}
161161

162-
DataProcessorSpec getTPCInterpolationSpec(GTrackID::mask_t srcCls, GTrackID::mask_t srcVtx, GTrackID::mask_t srcTrk, GTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput, bool extDetResid)
162+
DataProcessorSpec getTPCInterpolationSpec(GTrackID::mask_t srcCls, GTrackID::mask_t srcVtx, GTrackID::mask_t srcTrk, GTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput, bool extDetResid, bool itsStag)
163163
{
164164
auto dataRequest = std::make_shared<DataRequest>();
165+
dataRequest->setITSPerLayer(itsStag);
165166
std::vector<OutputSpec> outputs;
166167

167168
if (useMC) {

‎Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/tpc-interpolation-workflow.cxx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,12 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
105105
o2::conf::ConfigurableParam::writeINI("o2tpcinterpolation-workflow_configuration.ini");
106106
auto useMC = !configcontext.options().get<bool>("disable-mc");
107107
useMC = false; // force disabling MC as long as it is not implemented
108+
auto doStag = o2::itsmft::DPLAlpideParamInitializer::isITSStaggeringEnabled(configcontext);
108109
auto sendTrackData = configcontext.options().get<bool>("send-track-data");
109110
auto debugOutput = configcontext.options().get<bool>("debug-output");
110111
auto extDetResid = !configcontext.options().get<bool>("skip-ext-det-residuals");
111112

112-
specs.emplace_back(o2::tpc::getTPCInterpolationSpec(srcClusters, srcVtx, srcTracks, srcTracksMap, useMC, processITSTPConly, sendTrackData, debugOutput, extDetResid));
113+
specs.emplace_back(o2::tpc::getTPCInterpolationSpec(srcClusters, srcVtx, srcTracks, srcTracksMap, useMC, processITSTPConly, sendTrackData, debugOutput, extDetResid, doStag));
113114
if (!configcontext.options().get<bool>("disable-root-output")) {
114115
specs.emplace_back(o2::tpc::getTPCResidualWriterSpec(sendTrackData, debugOutput));
115116
}

‎Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackInterpolation.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "TPCReconstruction/TPCFastTransformHelperO2.h"
4040
#include "DetectorsBase/Propagator.h"
4141
#include "DataFormatsGlobalTracking/RecoContainer.h"
42+
#include "DataFormatsITSMFT/ClustersPerLayer.h"
4243
#include "GPUTRDRecoParam.h"
4344
#include "TRDBase/Geometry.h"
4445
#include "CommonUtils/TreeStreamRedirector.h"
@@ -245,6 +246,7 @@ class TrackInterpolation
245246
{
246247
public:
247248
using MatCorrType = o2::base::Propagator::MatCorrType;
249+
using ITSClusters = o2::itsmft::ClustersPerLayer<o2::BaseCluster<float>>;
248250

249251
/// Default constructor
250252
TrackInterpolation() = default;
@@ -468,7 +470,7 @@ class TrackInterpolation
468470

469471
// ITS specific input only needed for debugging
470472
gsl::span<const int> mITSTrackClusIdx; ///< input ITS track cluster indices span
471-
std::vector<o2::BaseCluster<float>> mITSClustersArray; ///< ITS clusters created in run() method from compact clusters
473+
ITSClusters mITSClustersArray; ///< ITS clusters created in run() from compact clusters, by composed ID
472474
std::vector<int> mITSRefitSeedID; ///< seed ID first using refitted ITS track
473475
const o2::itsmft::TopologyDictionary* mITSDict = nullptr; ///< cluster patterns dictionary
474476

‎Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,18 @@ void TrackInterpolation::process()
351351
return;
352352
}
353353
mITSTrackClusIdx = mRecoCont->getITSTracksClusterRefs();
354-
const auto clusITS = mRecoCont->getITSClusters();
355-
const auto patterns = mRecoCont->getITSClustersPatterns();
356-
auto pattIt = patterns.begin();
357-
mITSClustersArray.clear();
358-
mITSClustersArray.reserve(clusITS.size());
359-
LOGP(info, "We have {} ITS clusters and the number of patterns is {}", clusITS.size(), patterns.size());
360-
o2::its::ioutils::convertCompactClusters(clusITS, pattIt, mITSClustersArray, mITSDict);
354+
int nLr = mRecoCont->getITSPerLayer() ? o2::globaltracking::MaxITSLayers : 1;
355+
mITSClustersArray.init(nLr);
356+
for (int lr = 0; lr < nLr; lr++) { // with a single (monolithic) input all clusters are in the layer slot 0
357+
mITSClustersArray.beginLayer(lr);
358+
const auto clusITS = mRecoCont->getITSClusters(lr);
359+
const auto patterns = mRecoCont->getITSClustersPatterns(lr);
360+
auto pattIt = patterns.begin();
361+
mITSClustersArray.getClusters().reserve(mITSClustersArray.size() + clusITS.size());
362+
LOGP(info, "We have {} ITS clusters and the number of patterns is {} on the layer slot {}", clusITS.size(), patterns.size(), lr);
363+
o2::its::ioutils::convertCompactClusters(clusITS, pattIt, mITSClustersArray.getClusters(), mITSDict);
364+
}
365+
mITSClustersArray.finalize();
361366
}
362367

363368
// In case we have more input tracks available than are required per TF

0 commit comments

Comments
 (0)