Skip to content

Commit 6da61f5

Browse files
authored
Replaced TList with TFolder (#4360)
1 parent 421210f commit 6da61f5

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Framework/Core/include/Framework/HistogramRegistry.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "TH3.h"
2828
#include "THn.h"
2929
#include "THnSparse.h"
30-
#include "TList.h"
30+
#include "TFolder.h"
3131

3232
#include <string>
3333
#include <variant>
@@ -295,17 +295,17 @@ class HistogramRegistry
295295
taskHash = hash;
296296
}
297297

298-
TList* operator*()
298+
TFolder* operator*()
299299
{
300-
TList* list = new TList();
301-
list->SetName(this->name.c_str());
300+
TFolder* folder = new TFolder(this->name.c_str(), this->name.c_str());
302301
for (auto j = 0u; j < MAX_REGISTRY_SIZE; ++j) {
303302
if (mRegistryValue[j].get() != nullptr) {
304303
auto hist = mRegistryValue[j].get();
305-
list->Add(hist);
304+
folder->Add(hist);
306305
}
307306
}
308-
return list;
307+
folder->SetOwner();
308+
return folder;
309309
}
310310

311311
/// lookup distance counter for benchmarking

Framework/Core/src/AnalysisManagers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ struct OutputManager<HistogramRegistry> {
181181

182182
static bool postRun(EndOfStreamContext& context, HistogramRegistry& what)
183183
{
184-
TList* list = *what;
185-
context.outputs().snapshot(what.ref(), *list);
184+
context.outputs().snapshot(what.ref(), *(*what));
186185
return true;
187186
}
188187
};

0 commit comments

Comments
 (0)