/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id$ */ /* $Log $ */ //----------------------------------------------------------------- // Implementation of the ESD Calorimeter cluster class // ESD = Event Summary Data // This is the class to deal with during the phisics analysis of data // // J.L. Klay (LLNL) //----------------------------------------------------------------- #include #include "AliESDCaloCluster.h" ClassImp(AliESDCaloCluster) //_______________________________________________________________________ AliESDCaloCluster::AliESDCaloCluster() : TObject(), fTracksMatched(0x0), fLabels(0x0), fDigitAmplitude(0x0), fDigitTime(0x0), fDigitIndex(0x0), fEnergy(0), fDispersion(0), fChi2(0), fM20(0), fM02(0), fM11(0), fEmcCpvDistance(1024), fDistToBadChannel(1024), fID(0), fNExMax(0), fClusterType(kUndef) { // // The default ESD constructor // fGlobalPos[0] = fGlobalPos[1] = fGlobalPos[2] = 0.; for(Int_t i=0; i=0) { sum+=p[i]; fPID[i] = p[i]; } else { fPID[i] = 0; } if(sum>0) for (Int_t i=0; iGetVertex()->GetXYZ(vertex) ; " if(vertex){//calculate direction from vertex fGlobalPos[0]-=vertex[0]; fGlobalPos[1]-=vertex[1]; fGlobalPos[2]-=vertex[2]; } Double_t r = TMath::Sqrt(fGlobalPos[0]*fGlobalPos[0]+ fGlobalPos[1]*fGlobalPos[1]+ fGlobalPos[2]*fGlobalPos[2] ) ; p.SetPxPyPzE( fEnergy*fGlobalPos[0]/r, fEnergy*fGlobalPos[1]/r, fEnergy*fGlobalPos[2]/r, fEnergy) ; } // Sep 7, 2007 Int_t AliESDCaloCluster::GetTrueDigitAmplitude(Int_t i, Double_t cc) { static Int_t amp=0; // amp is integer now amp = 0; if(i>=0 && iGetSize() && cc>0.0) { // true formula amp = Int_t(Double_t(fDigitAmplitude->At(i))/500./cc+0.5); } return amp; } Double_t AliESDCaloCluster::GetTrueDigitEnergy(Int_t i, Double_t cc) { return Double_t(GetTrueDigitAmplitude(i,cc)) * cc; } Double_t AliESDCaloCluster::GetRecalibratedDigitEnergy(Int_t i, Double_t ccOld, Double_t ccNew) { return Double_t(GetTrueDigitAmplitude(i,ccOld)) * ccNew; }