+
+//_______________________________________________________________________
+void AliAODCaloCluster::GetMomentum(TLorentzVector& p, Double_t *vertex ) {
+ // Returns TLorentzVector with momentum of the cluster. Only valid for clusters
+ // identified as photons or pi0 (overlapped gamma) produced on the vertex
+ //Vertex can be recovered with esd pointer doing:
+ //" Double_t vertex[3] ; esd->GetVertex()->GetXYZ(vertex) ; "
+
+ Double32_t energy = E();
+ Float_t pos[3];
+ GetPosition(pos);
+
+ if(vertex){//calculate direction from vertex
+ pos[0]-=vertex[0];
+ pos[1]-=vertex[1];
+ pos[2]-=vertex[2];
+ }
+
+ Double_t r = TMath::Sqrt(pos[0]*pos[0]+
+ pos[1]*pos[1]+
+ pos[2]*pos[2] ) ;
+
+ p.SetPxPyPzE( energy*pos[0]/r, energy*pos[1]/r, energy*pos[2]/r, energy) ;
+
+}
+
+
+void AliAODCaloCluster::SetCellsAbsId(UShort_t *array)
+{
+ // Set the array of cell absId numbers
+ if (fNCells) {
+ if(!fCellsAbsId)fCellsAbsId = new UShort_t[fNCells];
+ for (Int_t i = 0; i < fNCells; i++) fCellsAbsId[i] = array[i];
+ }
+}
+
+void AliAODCaloCluster::SetCellsAmplitudeFraction(Double32_t *array)
+{
+ // Set the array of cell amplitude fraction
+ if (fNCells) {
+ if(!fCellsAmpFraction)fCellsAmpFraction = new Double32_t[fNCells];
+ for (Int_t i = 0; i < fNCells; i++) fCellsAmpFraction[i] = array[i];
+ }
+}