]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSDigit.cxx
Add writing primary info to calocells
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDigit.cxx
index 1dc94df8419c6468e00dae56f81011793ee1e7c8..2ec6c6706cfbe139d0c2e633470c3f913d111df1 100644 (file)
@@ -47,7 +47,7 @@
 // --- AliRoot header files ---
 
 #include "AliPHOSDigit.h"
-
+#include "AliLog.h"
 
 
 
@@ -157,6 +157,12 @@ AliPHOSDigit::AliPHOSDigit(const AliPHOSDigit & digit) :
   fIndexInList = digit.fIndexInList ; 
 }
 
+//____________________________________________________________________________
+AliPHOSDigit & AliPHOSDigit::operator = (const AliPHOSDigit &)
+{
+  Fatal("operator =", "not implemented");
+  return *this;
+}
 //____________________________________________________________________________
 AliPHOSDigit::~AliPHOSDigit() 
 {
@@ -207,6 +213,7 @@ Int_t AliPHOSDigit::GetPrimary(Int_t index) const
 void AliPHOSDigit::SetALTROSamplesHG(Int_t nSamplesHG, Int_t *samplesHG)
 {
   fNSamplesHG = nSamplesHG;
+  if (fSamplesHG) delete [] fSamplesHG;
   fSamplesHG = new UShort_t[fNSamplesHG];
   UShort_t i;
   for (i=0; i<fNSamplesHG; i++) {
@@ -217,6 +224,7 @@ void AliPHOSDigit::SetALTROSamplesHG(Int_t nSamplesHG, Int_t *samplesHG)
 void AliPHOSDigit::SetALTROSamplesLG(Int_t nSamplesLG, Int_t *samplesLG)
 {
   fNSamplesLG = nSamplesLG;
+  if (fSamplesLG) delete [] fSamplesLG;
   fSamplesLG = new UShort_t[fNSamplesLG];
   UShort_t i;
   for (i=0; i<fNSamplesLG; i++) {
@@ -227,20 +235,21 @@ void AliPHOSDigit::SetALTROSamplesLG(Int_t nSamplesLG, Int_t *samplesLG)
 void AliPHOSDigit::Print(const Option_t *) const
 {
   // Print the digit together with list of primaries
-  printf("PHOS digit: E=%.3f, Id=%d, Time=%.3e, TimeR=%.3e, NPrim=%d, nHG=%d, nLG=%d \n",
-        fEnergy,fId,fTime,fTimeR,fNprimary,fNSamplesHG,fNSamplesLG);
-  printf("\tList of primaries: ");
+  TString line = Form("PHOS digit: E=%.3f, Id=%d, Time=%.3e, TimeR=%.3e, NPrim=%d, nHG=%d, nLG=%d \n",
+                     fEnergy,fId,fTime,fTimeR,fNprimary,fNSamplesHG,fNSamplesLG);
+  line += "\tList of primaries: ";
   for (Int_t index = 0; index <fNprimary; index ++ )
-    printf(" %d ",fPrimary[index]); 
-  printf("\n") ;
-  printf("\tHG samples: 0x%x: ",fSamplesHG);
+    line += Form(" %d ",fPrimary[index]); 
+  line += "\n";
+  line += "\tSamples HG: ";
   for (Int_t i = 0; i <fNSamplesHG; i++)
-    printf(" %d ",fSamplesHG[i]); 
-  printf("\n") ;
-  printf("\tLG samples: 0x%x: ",fSamplesLG);
+    line += Form(" %d ",fSamplesHG[i]); 
+  line += "\n";
+  line += "\tSamples LG: ";
   for (Int_t i = 0; i <fNSamplesLG; i++)
-    printf(" %d ",fSamplesLG[i]); 
-  printf("\n") ;
+    line += Form(" %d ",fSamplesLG[i]); 
+  line += "\n";
+  AliDebug(2,line);
 }
 //____________________________________________________________________________
 void AliPHOSDigit::ShiftPrimary(Int_t shift)