ctor changed to create the task PHOS
[u/mrichter/AliRoot.git] / PHOS / AliPHOS.cxx
index 8e622f3..ac9a7dc 100644 (file)
@@ -28,6 +28,9 @@
 // --- ROOT system ---
 class TFile;
 #include "TTree.h"
+#include "TTask.h"
+#include "TROOT.h"
+#include "TFolder.h"
 
 // --- Standard library ---
 
@@ -44,6 +47,24 @@ ClassImp(AliPHOS)
 
 
 //____________________________________________________________________________
+  AliPHOS::AliPHOS():AliDetector()
+{
+  // ctor. creates task PHOS
+  TTask * phosTask = new TTask("PHOS","");
+  TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ; 
+  roottasks->Add(phosTask) ; 
+}
+
+//____________________________________________________________________________
+  AliPHOS::AliPHOS(const char* name, const char* title=""):AliDetector(name, title)
+{
+  // ctor. creates task PHOS
+  TTask * phosTask = new TTask("PHOS","");
+  TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ; 
+  roottasks->Add(phosTask) ; 
+}
+
+//____________________________________________________________________________
 void AliPHOS::CreateMaterials()
 {
   // Definitions of materials to build PHOS and associated tracking media.
@@ -307,7 +328,6 @@ void AliPHOS::CreateMaterials()
 void AliPHOS::SetTreeAddress()
 { 
   // called by AliRun
-
   // TBranch *branch;
   //  AliDetector::SetTreeAddress();