parameters have been redistributed; Hits2SDigits etc ... introduce
[u/mrichter/AliRoot.git] / PHOS / AliPHOS.cxx
index 0c180e494a28918f726ae1ac8a697530152e401b..af959462ba55d2477ed1717858b53ef2119948c2 100644 (file)
@@ -32,6 +32,7 @@ class TFile;
 
 // --- Standard library ---
 
+#include <strstream.h>
 // --- AliRoot header files ---
 
 #include "AliPHOS.h"
@@ -348,11 +349,22 @@ void AliPHOS::CreateMaterials()
 //____________________________________________________________________________
 void AliPHOS::SetTreeAddress()
 { 
+
   // TBranch *branch;
   AliDetector::SetTreeAddress();
 
   TBranch * branch ;
 
+  if(fSDigits)
+    fSDigits->Clear();
+  else
+    fSDigits = new TClonesArray("AliPHOSDigit",1) ;
+
+  if (gAlice->TreeS()  && fSDigits ) {
+    branch = gAlice->TreeS()->GetBranch("PHOS");
+    if (branch) branch->SetAddress(&fSDigits) ;
+  } 
+
   if(fDigits)
     fDigits->Clear();
   else