- ec->SetGlobalPosition(xyz);
- ec->SetClusterEnergy(rp->Energy());
- ec->SetPid (rp->GetPID()) ;
-// ec->SetPrimaryIndex (rp->GetPrimaryIndex()); // for dry events only
+
+ Int_t digitMult = emcRP->GetDigitsMultiplicity();
+ Int_t *digitsList = emcRP->GetDigitsList();
+ UShort_t *amplList = new UShort_t[digitMult];
+ UShort_t *timeList = new UShort_t[digitMult];
+ UShort_t *digiList = new UShort_t[digitMult];
+
+ // Convert Float_t* and Int_t* to UShort_t* to save memory
+ for (Int_t iDigit=0; iDigit<digitMult; iDigit++) {
+ AliPHOSDigit *digit = gime->Digit(digitsList[iDigit]);
+ amplList[iDigit] = (UShort_t)(digit->GetEnergy()*500); // Energy in units of GeV/500
+ timeList[iDigit] = (UShort_t)(digit->GetTime()*1e9*100); // time in units of 0.01 ns
+ digiList[iDigit] = (UShort_t)(digit->GetId());
+ }
+ ec->SetGlobalPosition(xyz); //rec.point position in MARS
+ ec->SetClusterEnergy(rp->Energy()); //total particle energy
+ ec->SetClusterDisp(emcRP->GetDispersion()); //cluster dispersion
+ ec->SetPid (rp->GetPID()) ; //array of particle identification
+ ec->SetPrimaryIndex (rp->GetPrimaryIndex());//index of primary particle (for simulations)
+ ec->SetM02(emcRP->GetM2x()) ; //second moment M2x
+ 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->SetDigitTime(timeList); //times in 1/100 on ns
+ ec->SetDigitIndex(digiList); //abs id of the cell
+ ec->SetEmcCpvDistance(-1); //not yet implemented
+ ec->SetClusterChi2(-1); //not yet implemented
+ ec->SetM11(-1) ; //not yet implemented
+