File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,16 @@ void SliceTrendingTask::configure(const boost::property_tree::ptree& config)
47
47
48
48
void SliceTrendingTask::initialize (Trigger, framework::ServiceRegistryRef services)
49
49
{
50
+ // removing leftovers from any previous runs
51
+ mTrend .reset ();
52
+ for (auto [name, object] : mPlots ) {
53
+ getObjectsManager ()->stopPublishing (object);
54
+ delete object;
55
+ }
56
+ mPlots .clear ();
57
+ mReductors .clear ();
58
+ mSources .clear ();
59
+
50
60
// Prepare the data structure of the trending TTree.
51
61
if (mConfig .resumeTrend ) {
52
62
ILOG (Info, Support) << " Trying to retrieve an existing TTree for this task to continue the trend." << ENDM;
@@ -169,7 +179,7 @@ void SliceTrendingTask::generatePlots()
169
179
for (const auto & plot : mConfig .plots ) {
170
180
// Delete the existing plots before regenerating them.
171
181
if (mPlots .count (plot.name )) {
172
- getObjectsManager ()->stopPublishing (plot.name );
182
+ getObjectsManager ()->stopPublishing (mPlots [ plot.name ] );
173
183
delete mPlots [plot.name ];
174
184
}
175
185
Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ bool TrendingTask::canContinueTrend(TTree* tree)
80
80
81
81
void TrendingTask::initialize (Trigger, framework::ServiceRegistryRef services)
82
82
{
83
+ // removing leftovers from any previous runs
84
+ mTrend .reset ();
85
+ for (auto [name, object] : mPlots ) {
86
+ getObjectsManager ()->stopPublishing (object);
87
+ delete object;
88
+ }
89
+ mPlots .clear ();
90
+ mReductors .clear ();
91
+
83
92
// Preparing data structure of TTree
84
93
if (mConfig .resumeTrend ) {
85
94
ILOG (Info, Support) << " Trying to retrieve an existing TTree for this task to continue the trend." << ENDM;
@@ -208,7 +217,7 @@ void TrendingTask::generatePlots()
208
217
// Before we generate any new plots, we have to delete existing under the same names.
209
218
// It seems that ROOT cannot handle an existence of two canvases with a common name in the same process.
210
219
if (mPlots .count (plot.name )) {
211
- getObjectsManager ()->stopPublishing (plot.name );
220
+ getObjectsManager ()->stopPublishing (mPlots [ plot.name ] );
212
221
delete mPlots [plot.name ];
213
222
}
214
223
You can’t perform that action at this time.
0 commit comments