1616#include " DataFormatsParameters/GRPObject.h"
1717#include " ITSMFTBase/DPLAlpideParam.h"
1818#include " DetectorsCommonDataFormats/NameConf.h"
19+ #include " GlobalTracking/RecoContainer.h"
1920
2021using namespace o2 ::framework;
22+ using DetID = o2::detectors::DetID;
2123
2224namespace o2
2325{
2426namespace vertexing
2527{
28+ o2::globaltracking::DataRequest dataRequestV2T;
2629
2730void VertexTrackMatcherSpec::init (InitContext& ic)
2831{
@@ -38,33 +41,21 @@ void VertexTrackMatcherSpec::run(ProcessingContext& pc)
3841 double timeCPU0 = mTimer .CpuTime (), timeReal0 = mTimer .RealTime ();
3942 mTimer .Start (false );
4043
41- // eventually, this should be set per TF from CCDB?
42- if (mMatcher .getITSROFrameLengthInBC () == 0 ) {
43- std::unique_ptr<o2::parameters::GRPObject> grp{o2::parameters::GRPObject::loadFrom (o2::base::NameConf::getGRPFileName ())};
44- const auto & alpParams = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance ();
45- if (grp->isDetContinuousReadOut (o2::detectors::DetID::ITS)) {
46- mMatcher .setITSROFrameLengthInBC (alpParams.roFrameLengthInBC );
47- } else {
48- mMatcher .setITSROFrameLengthInBC (alpParams.roFrameLengthTrig / o2::constants::lhc::LHCOrbitNS);
49- }
50- }
44+ o2::globaltracking::RecoContainer recoData;
5145
5246 // RS FIXME this will not have effect until the 1st orbit is propagated, until that will work only for TF starting at orbit 0
53- const auto * dh = o2::header::get<o2::header::DataHeader*>(pc.inputs ().get ( " vertices " ).header );
47+ const auto * dh = o2::header::get<o2::header::DataHeader*>(pc.inputs ().getByPos ( 0 ).header );
5448 mMatcher .setStartIR ({0 , dh->firstTForbit });
49+ recoData.collectData (pc, dataRequestV2T);
5550
56- const auto tracksITSTPC = pc.inputs ().get <gsl::span<o2::dataformats::TrackTPCITS>>(" tpcits" );
57- const auto tracksTPC = pc.inputs ().get <gsl::span<o2::tpc::TrackTPC>>(" tpc" );
58- const auto tracksITS = pc.inputs ().get <gsl::span<o2::its::TrackITS>>(" its" );
59- const auto tracksITSROF = pc.inputs ().get <gsl::span<o2::itsmft::ROFRecord>>(" itsROF" );
6051 const auto vertices = pc.inputs ().get <gsl::span<o2::dataformats::PrimaryVertex>>(" vertices" );
6152 const auto vtxTracks = pc.inputs ().get <gsl::span<o2::dataformats::VtxTrackIndex>>(" vtxTracks" );
6253 const auto vtxTrackRefs = pc.inputs ().get <gsl::span<o2::dataformats::VtxTrackRef>>(" vtxTrackRefs" );
6354
6455 std::vector<o2::dataformats::VtxTrackIndex> trackIndex;
6556 std::vector<o2::dataformats::VtxTrackRef> vtxRefs;
6657
67- mMatcher .process (vertices, vtxTracks, vtxTrackRefs, tracksITSTPC, tracksITS, tracksITSROF, tracksTPC , trackIndex, vtxRefs);
58+ mMatcher .process (vertices, vtxTracks, vtxTrackRefs, recoData , trackIndex, vtxRefs);
6859
6960 pc.outputs ().snapshot (Output{" GLO" , " PVTX_TRMTC" , 0 , Lifetime::Timeframe}, trackIndex);
7061 pc.outputs ().snapshot (Output{" GLO" , " PVTX_TRMTCREFS" , 0 , Lifetime::Timeframe}, vtxRefs);
@@ -80,16 +71,28 @@ void VertexTrackMatcherSpec::endOfStream(EndOfStreamContext& ec)
8071 mTimer .CpuTime (), mTimer .RealTime (), mTimer .Counter () - 1 );
8172}
8273
83- DataProcessorSpec getVertexTrackMatcherSpec ()
74+ DataProcessorSpec getVertexTrackMatcherSpec (DetID:: mask_t dets )
8475{
85- std::vector<InputSpec> inputs;
8676 std::vector<OutputSpec> outputs;
8777
88- inputs.emplace_back (" tpcits" , " GLO" , " TPCITS" , 0 , Lifetime::Timeframe);
89- inputs.emplace_back (" its" , " ITS" , " TRACKS" , 0 , Lifetime::Timeframe);
90- inputs.emplace_back (" itsROF" , " ITS" , " ITSTrackROF" , 0 , Lifetime::Timeframe);
91- inputs.emplace_back (" tpc" , " TPC" , " TRACKS" , 0 , Lifetime::Timeframe);
92-
78+ if (dets[DetID::ITS]) {
79+ dataRequestV2T.requestITSTracks (false );
80+ }
81+ if (dets[DetID::TPC]) {
82+ dataRequestV2T.requestITSTPCTracks (false );
83+ dataRequestV2T.requestTPCTracks (false );
84+ if (dets[DetID::TRD]) {
85+ // RSTODO will add once TRD tracking available
86+ }
87+ if (dets[DetID::TOF]) {
88+ dataRequestV2T.requestTPCTOFTracks (false );
89+ dataRequestV2T.requestTOFClusters (false );
90+ if (dets[DetID::ITS]) {
91+ dataRequestV2T.requestTOFMatches (false );
92+ }
93+ }
94+ }
95+ auto & inputs = dataRequestV2T.inputs ;
9396 inputs.emplace_back (" vertices" , " GLO" , " PVTX" , 0 , Lifetime::Timeframe);
9497 inputs.emplace_back (" vtxTracks" , " GLO" , " PVTX_CONTID" , 0 , Lifetime::Timeframe);
9598 inputs.emplace_back (" vtxTrackRefs" , " GLO" , " PVTX_CONTIDREFS" , 0 , Lifetime::Timeframe);
0 commit comments