/************************************************************************** * 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), fNCells(0), fCellsAbsId(0x0), fCellsAmpFraction(0x0), fDigitAmplitude(0x0),//not in use fDigitTime(0x0),//not in use fDigitIndex(0x0),//not in use fEnergy(0), fDispersion(0), fChi2(0), fM20(0), fM02(0), fEmcCpvDistance(1024), fDistToBadChannel(1024), fID(0), fNExMax(0), fClusterType(kUndef), fTOF(0.) { // // The default ESD constructor // fGlobalPos[0] = fGlobalPos[1] = fGlobalPos[2] = 0.; for(Int_t i=0; i 0) { if(clus.fCellsAbsId){ fCellsAbsId = new UShort_t[clus.fNCells]; for (Int_t i=0; i 0) { if(source.fCellsAbsId){ if(fNCells != source.fNCells||!fCellsAbsId){ if(fCellsAbsId)delete [] fCellsAbsId; fCellsAbsId = new UShort_t[source.fNCells]; } for (Int_t i=0; i(&obj); if(!robj)return; // not an AliESDCluster *robj = *this; } //_______________________________________________________________________ AliESDCaloCluster::~AliESDCaloCluster(){ // // This is destructor according Coding Conventions // if(fTracksMatched)delete fTracksMatched;fTracksMatched = 0; if(fLabels) delete fLabels; fLabels = 0; delete fDigitAmplitude; //not in use delete fDigitTime; //not in use delete fDigitIndex; //not in use if(fCellsAmpFraction){ delete[] fCellsAmpFraction; fCellsAmpFraction=0;} if(fCellsAbsId){ delete[] fCellsAbsId; fCellsAbsId = 0;} } //_______________________________________________________________________ void AliESDCaloCluster::SetPid(const Float_t *p) { // Sets the probability of each particle type // Copied from AliESDtrack SetPIDValues // This function copies "n" PID weights from "scr" to "dest" // and normalizes their sum to 1 thus producing conditional // probabilities. // The negative weights are set to 0. // In case all the weights are non-positive they are replaced by // uniform probabilities Int_t n = AliPID::kSPECIESN; Float_t uniform = 1./(Float_t)n; Float_t sum = 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) ; } //_______________________________________________________________________ void AliESDCaloCluster::SetCellsAbsId(UShort_t *array) { // Set the array of cell absId numbers if (fNCells) { fCellsAbsId = new UShort_t[fNCells]; for (Int_t i = 0; i < fNCells; i++) fCellsAbsId[i] = array[i]; } } //_______________________________________________________________________ void AliESDCaloCluster::SetCellsAmplitudeFraction(Double32_t *array) { // Set the array of cell amplitude fraction if (fNCells) { fCellsAmpFraction = new Double32_t[fNCells]; for (Int_t i = 0; i < fNCells; i++) fCellsAmpFraction[i] = array[i]; } }