From cbbb66b0752e074fc86e3ed9ac1fc5b521159b8a Mon Sep 17 00:00:00 2001 From: saiola Date: Fri, 17 Oct 2014 22:31:20 -0400 Subject: [PATCH] Move the code that adds the jet container to the end, to avoid nasty errors when something goes wrong --- PWGJE/EMCALJetTasks/AliEmcalJetTask.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGJE/EMCALJetTasks/AliEmcalJetTask.cxx b/PWGJE/EMCALJetTasks/AliEmcalJetTask.cxx index 587dbbb1b87..31655a5c949 100644 --- a/PWGJE/EMCALJetTasks/AliEmcalJetTask.cxx +++ b/PWGJE/EMCALJetTasks/AliEmcalJetTask.cxx @@ -697,14 +697,6 @@ Bool_t AliEmcalJetTask::DoInit() return 0; } - // add jets to event if not yet there - if (!(fEvent->FindListObject(fJetsName))) - fEvent->AddObject(fJets); - else { - AliError(Form("%s: Object with name %s already in event! Returning", GetName(), fJetsName.Data())); - return 0; - } - if (!(fEvent->FindListObject(fJetsSubName)) && fJetsSub) fEvent->AddObject(fJetsSub); @@ -752,6 +744,14 @@ Bool_t AliEmcalJetTask::DoInit() return 0; } } + + // add jets to event if not yet there + if (!(fEvent->FindListObject(fJetsName))) + fEvent->AddObject(fJets); + else { + AliError(Form("%s: Object with name %s already in event! Returning", GetName(), fJetsName.Data())); + return 0; + } return 1; } -- 2.43.0