]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSReconstructor.cxx
Class to produce PHOS digits from raw data stream.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstructor.cxx
index 13d5c53f5e7c9e2d4179ce8d70f8a5b9713e2c10..cdd3cae2cabac351952b60ef25c1a4eed0e32bf5 100644 (file)
@@ -150,6 +150,8 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader, AliESD* esd) const
       timeList[iDigit] = (UShort_t)(digit->GetTime()*1e9*100); // time in units of 0.01 ns
       digiList[iDigit] = (UShort_t)(digit->GetId());
     }
+
+    ec->SetPHOS(kTRUE);
     ec->SetGlobalPosition(xyz);                 //rec.point position in MARS
     ec->SetClusterEnergy(rp->Energy());         //total particle energy
     ec->SetClusterDisp(emcRP->GetDispersion()); //cluster dispersion
@@ -172,6 +174,7 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader, AliESD* esd) const
   }  
 }
 
+//____________________________________________________________________________
 void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader,
                                   AliRawReader* rawReader, AliESD* esd) const
 {
@@ -180,19 +183,8 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader,
 
   Int_t eventNumber = runLoader->GetEventNumber() ;
 
-  if(eventNumber==0) {
-    rawReader->RewindEvents();
-    rawReader->NextEvent();
-  }
-
   AliPHOSGetter *gime = AliPHOSGetter::Instance();
-
-  Bool_t isOldRCUFormat = kFALSE;
-  TString opt = GetOption();
-  if(opt.Contains("OldRCUFormat"))
-    isOldRCUFormat = kTRUE;
-
-  gime->ReadRaw(rawReader,isOldRCUFormat) ;
+  gime->Event(eventNumber, "DRTP") ; 
 
   TClonesArray *recParticles  = gime->RecParticles();
   Int_t nOfRecParticles = recParticles->GetEntries();
@@ -228,11 +220,12 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader,
        AliFatal(Form("Digit not found at the expected position %d!",iDigit));
       }
       else {
-       amplList[iDigit] = (UShort_t)(digit->GetEnergy()*500); // Energy in units of GeV/500
+       amplList[iDigit] = (UShort_t)digit->GetEnergy();
        digiList[iDigit] = (UShort_t)(digit->GetId());
       }
     }
 
+    ec->SetPHOS(kTRUE);
     ec->SetGlobalPosition(xyz);                 //rec.point position in MARS
     ec->SetClusterEnergy(rp->Energy());         //total particle energy
     ec->SetClusterDisp(emcRP->GetDispersion()); //cluster dispersion
@@ -241,7 +234,7 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader,
     ec->SetM20(emcRP->GetM2z()) ;               //second moment M2z
     ec->SetNExMax(emcRP->GetNExMax());          //number of local maxima
     ec->SetNumberOfDigits(digitMult);           //digit multiplicity
-    ec->SetDigitAmplitude(amplList);            //energies in 1/500 of GeV
+    ec->SetDigitAmplitude(amplList);            //digit energies
     ec->SetDigitIndex(digiList);                //abs id of the cell
     ec->SetEmcCpvDistance(-1);                  //not yet implemented
     ec->SetClusterChi2(-1);                     //not yet implemented