Remove the task from the task folder in the dtor
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTrackSegmentMaker.cxx
index 415bc78756bab0949d6b2e078e50c23965683b09..c497799ecbfe3791a5b6be258257ca8d92d861e5 100644 (file)
@@ -28,6 +28,7 @@
 
 // --- AliRoot header files ---
 #include "AliEMCALTrackSegmentMaker.h"
+#include "AliEMCALGetter.h"
 
 ClassImp( AliEMCALTrackSegmentMaker) 
 
@@ -41,8 +42,10 @@ ClassImp( AliEMCALTrackSegmentMaker)
 }
 
 //____________________________________________________________________________
-AliEMCALTrackSegmentMaker::AliEMCALTrackSegmentMaker(const TString alirunFileName, const TString eventFolderName):
-  TTask("EMCAL"+AliConfig::fgkTrackerTaskName, alirunFileName), fEventFolderName(eventFolderName)
+AliEMCALTrackSegmentMaker::AliEMCALTrackSegmentMaker(const TString alirunFileName,
+                                                    const TString eventFolderName):
+  TTask("EMCAL"+AliConfig::Instance()->GetTrackerTaskName(), alirunFileName),
+  fEventFolderName(eventFolderName)
 {
   // ctor
 
@@ -51,5 +54,7 @@ AliEMCALTrackSegmentMaker::AliEMCALTrackSegmentMaker(const TString alirunFileNam
 //____________________________________________________________________________
 AliEMCALTrackSegmentMaker::~AliEMCALTrackSegmentMaker()
 {
+ //Remove this from the parental task before destroying
+  AliEMCALGetter::Instance()->EmcalLoader()->CleanTracker();
 }