Skip to content

Commit 3d42f03

Browse files
ktfBarthelemy
authored andcommitted
Do not specify Lifetime when creating the output (#2066)
Lifetime cannot actually be changed on a per timeframe basis, it's a property of the topology. Output will soon be refactored to remove it.
1 parent 19f1e1d commit 3d42f03

9 files changed

Lines changed: 31 additions & 35 deletions

Framework/src/CheckRunner.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ void CheckRunner::send(QualityObjectsType& qualityObjects, framework::DataAlloca
420420
auto outputSpec = correspondingCheck.getOutputSpec();
421421
auto concreteOutput = framework::DataSpecUtils::asConcreteDataMatcher(outputSpec);
422422
allocator.snapshot(
423-
framework::Output{ concreteOutput.origin, concreteOutput.description, concreteOutput.subSpec, outputSpec.lifetime }, *qo);
423+
framework::Output{ concreteOutput.origin, concreteOutput.description, concreteOutput.subSpec }, *qo);
424424
mTotalQOSent++;
425425
}
426426
}

Framework/src/TaskRunner.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,7 @@ int TaskRunner::publish(DataAllocator& outputs)
575575
outputs.snapshot(
576576
Output{ concreteOutput.origin,
577577
concreteOutput.description,
578-
concreteOutput.subSpec,
579-
mTaskConfig.moSpec.lifetime },
578+
concreteOutput.subSpec },
580579
*array);
581580

582581
mLastPublicationDuration = publicationDurationTimer.getTime();

Modules/ITS/src/runITSClustersRootFileReader.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ class ITSClustersRootFileReader : public o2::framework::Task
9999
std::copy(patterns.begin(), patterns.end(), std::back_inserter(*clusPatternArr));
100100

101101
// Output vectors
102-
pc.outputs().snapshot(Output{ "ITS", "CLUSTERSROF", 0, Lifetime::Timeframe }, *clusRofArr);
103-
pc.outputs().snapshot(Output{ "ITS", "COMPCLUSTERS", 0, Lifetime::Timeframe }, *clusArr);
104-
pc.outputs().snapshot(Output{ "ITS", "PATTERNS", 0, Lifetime::Timeframe }, *clusPatternArr);
102+
pc.outputs().snapshot(Output{ "ITS", "CLUSTERSROF", 0 }, *clusRofArr);
103+
pc.outputs().snapshot(Output{ "ITS", "COMPCLUSTERS", 0 }, *clusArr);
104+
pc.outputs().snapshot(Output{ "ITS", "PATTERNS", 0 }, *clusPatternArr);
105105

106106
// move to a new entry in TTree
107107
++mCurrentEntry;

Modules/ITS/src/runITSTracksRootFileReader.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ class ITSTracksRootFileReader : public o2::framework::Task
146146
std::copy(patterns.begin(), patterns.end(), std::back_inserter(*clusPatternArr));
147147

148148
// Output vectors
149-
pc.outputs().snapshot(Output{ "ITS", "ITSTrackROF", 0, Lifetime::Timeframe }, *trackRofArr);
150-
pc.outputs().snapshot(Output{ "ITS", "TRACKS", 0, Lifetime::Timeframe }, *trackArr);
151-
pc.outputs().snapshot(Output{ "ITS", "VERTICES", 0, Lifetime::Timeframe }, *vertexArr);
152-
pc.outputs().snapshot(Output{ "ITS", "VERTICESROF", 0, Lifetime::Timeframe }, *vertexRofArr);
153-
pc.outputs().snapshot(Output{ "ITS", "TRACKCLSID", 0, Lifetime::Timeframe }, *clusIdx);
154-
155-
pc.outputs().snapshot(Output{ "ITS", "CLUSTERSROF", 0, Lifetime::Timeframe }, *clusRofArr);
156-
pc.outputs().snapshot(Output{ "ITS", "COMPCLUSTERS", 0, Lifetime::Timeframe }, *clusArr);
157-
pc.outputs().snapshot(Output{ "ITS", "PATTERNS", 0, Lifetime::Timeframe }, *clusPatternArr);
149+
pc.outputs().snapshot(Output{ "ITS", "ITSTrackROF", 0 }, *trackRofArr);
150+
pc.outputs().snapshot(Output{ "ITS", "TRACKS", 0 }, *trackArr);
151+
pc.outputs().snapshot(Output{ "ITS", "VERTICES", 0 }, *vertexArr);
152+
pc.outputs().snapshot(Output{ "ITS", "VERTICESROF", 0 }, *vertexRofArr);
153+
pc.outputs().snapshot(Output{ "ITS", "TRACKCLSID", 0 }, *clusIdx);
154+
155+
pc.outputs().snapshot(Output{ "ITS", "CLUSTERSROF", 0 }, *clusRofArr);
156+
pc.outputs().snapshot(Output{ "ITS", "COMPCLUSTERS", 0 }, *clusArr);
157+
pc.outputs().snapshot(Output{ "ITS", "PATTERNS", 0 }, *clusPatternArr);
158158

159159
// move to a new entry in TTree
160160
++mCurrentEntry;

Modules/MFT/src/runMFTClustersRootFileReader.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ class MFTClustersRootFileReader : public o2::framework::Task
115115
std::copy(patterns.begin(), patterns.end(), std::back_inserter(*clusPatternArr));
116116

117117
// fill in the message
118-
pc.outputs().snapshot(Output{ "MFT", "COMPCLUSTERS", 0, Lifetime::Timeframe }, *clustersInROF);
119-
pc.outputs().snapshot(Output{ "MFT", "CLUSTERSROF", 0, Lifetime::Timeframe }, *oneROFvec);
120-
pc.outputs().snapshot(Output{ "MFT", "PATTERNS", 0, Lifetime::Timeframe }, *clusPatternArr);
118+
pc.outputs().snapshot(Output{ "MFT", "COMPCLUSTERS", 0 }, *clustersInROF);
119+
pc.outputs().snapshot(Output{ "MFT", "CLUSTERSROF", 0 }, *oneROFvec);
120+
pc.outputs().snapshot(Output{ "MFT", "PATTERNS", 0 }, *clusPatternArr);
121121

122122
// update the ROF counter
123123
mCurrentROF++;

Modules/MFT/src/runMFTDigitsHotPixelRootFileReader.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ class MFTDigitsHotPixelRootFileReader : public o2::framework::Task
113113
AddHotPixel(digitsInROF, 35, 200, 200, 165);
114114

115115
// fill in the message
116-
pc.outputs().snapshot(Output{ "MFT", "DIGITS", 0, Lifetime::Timeframe }, *digitsInROF);
117-
pc.outputs().snapshot(Output{ "MFT", "DIGITSROF", 0, Lifetime::Timeframe }, *oneROFvec);
116+
pc.outputs().snapshot(Output{ "MFT", "DIGITS", 0 }, *digitsInROF);
117+
pc.outputs().snapshot(Output{ "MFT", "DIGITSROF", 0 }, *oneROFvec);
118118

119119
// update the ROF counter
120120
mCurrentROF++;

Modules/MFT/src/runMFTDigitsRootFileReader.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ class MFTDigitsRootFileReader : public o2::framework::Task
109109
std::copy(digits.begin() + index, digits.begin() + lastIndex, std::back_inserter(*digitsInROF));
110110

111111
// fill in the message
112-
pc.outputs().snapshot(Output{ "MFT", "DIGITS", 0, Lifetime::Timeframe }, *digitsInROF);
113-
pc.outputs().snapshot(Output{ "MFT", "DIGITSROF", 0, Lifetime::Timeframe }, *oneROFvec);
112+
pc.outputs().snapshot(Output{ "MFT", "DIGITS", 0 }, *digitsInROF);
113+
pc.outputs().snapshot(Output{ "MFT", "DIGITSROF", 0 }, *oneROFvec);
114114

115115
// update the ROF counter
116116
mCurrentROF++;

Modules/MFT/src/runMFTTracksRootFileReader.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ class MFTTracksRootFileReader : public o2::framework::Task
111111
std::copy(tracks.begin() + index, tracks.begin() + lastIndex, std::back_inserter(*tracksInROF));
112112

113113
// fill in the message
114-
pc.outputs().snapshot(Output{ "MFT", "TRACKS", 0, Lifetime::Timeframe }, *tracksInROF);
115-
pc.outputs().snapshot(Output{ "MFT", "MFTTrackROF", 0, Lifetime::Timeframe }, *oneROFvec);
114+
pc.outputs().snapshot(Output{ "MFT", "TRACKS", 0 }, *tracksInROF);
115+
pc.outputs().snapshot(Output{ "MFT", "MFTTrackROF", 0 }, *oneROFvec);
116116

117117
// update the ROF counter
118118
mCurrentROF++;

Modules/TPC/run/runTPCQCTrackReader.cxx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,21 @@ WorkflowSpec defineDataProcessing(const ConfigContext& config)
8383
(AlgorithmSpec::InitCallback)[inputFile, treeName, branchName](InitContext&){
8484

8585
// root tree reader
86-
//constexpr auto persistency = Lifetime::Transient;
87-
constexpr auto persistency = Lifetime::Timeframe;
88-
89-
auto reader = std::make_shared<RootTreeReader>(treeName.data(), // tree name
90-
inputFile.data(), // input file name
91-
RootTreeReader::PublishingMode::Loop, // loop over
92-
Output{ "TPC", "TRACKS", 0, persistency },
93-
branchName.data() // name of the branch
94-
);
86+
auto reader = std::make_shared<RootTreeReader>(treeName.data(), // tree name
87+
inputFile.data(), // input file name
88+
RootTreeReader::PublishingMode::Loop, // loop over
89+
Output{ "TPC", "TRACKS", 0 },
90+
branchName.data() // name of the branch
91+
);
9592

9693
return (AlgorithmSpec::ProcessCallback)[reader](ProcessingContext & processingContext) mutable
9794
{
9895
//(++(*reader))(processingContext);
9996
if (reader->next()) {
10097
(*reader)(processingContext);
101-
//LOG(info) << "Call producer AlgorithmSpec::ProcessCallback: has data " << reader->getCount();
98+
// LOG(info) << "Call producer AlgorithmSpec::ProcessCallback: has data " << reader->getCount();
10299
} else {
103-
//LOG(info) << "Call producer AlgorithmSpec::ProcessCallback: no next data" << reader->getCount();
100+
// LOG(info) << "Call producer AlgorithmSpec::ProcessCallback: no next data" << reader->getCount();
104101
}
105102
};
106103
}

0 commit comments

Comments
 (0)