fTOF(0.),
fTracksMatched(),
fNCells(0),
- fCellsAbsId(),
- fCellsAmpFraction()
+ fCellsAbsId(0x0),
+ fCellsAmpFraction(0x0)
{
// default constructor
fTOF(0.),
fTracksMatched(),
fNCells(0),
- fCellsAbsId(),
- fCellsAmpFraction()
+ fCellsAbsId(0x0),
+ fCellsAmpFraction(0x0)
{
// constructor
fTOF(0.),
fTracksMatched(),
fNCells(0),
- fCellsAbsId(),
- fCellsAmpFraction()
+ fCellsAbsId(0x0),
+ fCellsAmpFraction(0x0)
{
// constructor
}
{
// destructor
if(fCellsAmpFraction) delete[] fCellsAmpFraction; fCellsAmpFraction=0;
- if(fCellsAbsId) delete[] fCellsAbsId; fCellsAbsId = 0;
+ if(fCellsAbsId) delete[] fCellsAbsId; fCellsAbsId = 0;
}
+//______________________________________________________________________________
+void AliAODCaloCluster::Clear(const Option_t*)
+{
+ // clear
+ RemoveLabel();
+ if(fCellsAmpFraction) delete[] fCellsAmpFraction; fCellsAmpFraction=0;
+ if(fCellsAbsId) delete[] fCellsAbsId; fCellsAbsId = 0;
+}
//______________________________________________________________________________
AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) :
fTOF(clus.fTOF),
fTracksMatched(clus.fTracksMatched),
fNCells(clus.fNCells),
- fCellsAbsId(),
- fCellsAmpFraction()
+ fCellsAbsId(0x0),
+ fCellsAmpFraction(0x0)
{
// Copy constructor
fTracksMatched = clus.fTracksMatched;
fNCells= clus. fNCells;
+ // delete anyway
+ if(fCellsAbsId)delete [] fCellsAbsId;
+ if(fCellsAmpFraction)delete [] fCellsAmpFraction;
+
if (clus.fNCells > 0) {
if(clus.fCellsAbsId){
//" Double_t vertex[3] ; esd->GetVertex()->GetXYZ(vertex) ; "
Double32_t energy = E();
- Double32_t pos[3];
+ Float_t pos[3];
GetPosition(pos);
if(vertex){//calculate direction from vertex
{
// 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];
+ if(!fCellsAbsId)fCellsAbsId = new UShort_t[fNCells];
+ for (Int_t i = 0; i < fNCells; i++) fCellsAbsId[i] = array[i];
}
}
{
// 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];
+ if(!fCellsAmpFraction)fCellsAmpFraction = new Double32_t[fNCells];
+ for (Int_t i = 0; i < fNCells; i++) fCellsAmpFraction[i] = array[i];
}
}