// //
///////////////////////////////////////////////////////////////////////////////
+#include "AliLog.h"
+
#include "AliTRDdataArrayF.h"
#include "AliTRDarrayI.h"
#include "AliTRDarrayF.h"
ClassImp(AliTRDdataArrayF)
//_____________________________________________________________________________
-AliTRDdataArrayF::AliTRDdataArrayF():AliTRDdataArray()
+AliTRDdataArrayF::AliTRDdataArrayF()
+ :AliTRDdataArray()
+ ,fElements(0)
+ ,fThreshold(0)
{
//
// Default constructor
//
- fElements = 0;
-
}
//_____________________________________________________________________________
AliTRDdataArrayF::AliTRDdataArrayF(Int_t nrow, Int_t ncol, Int_t ntime)
- :AliTRDdataArray(nrow,ncol,ntime)
+ :AliTRDdataArray(nrow,ncol,ntime)
+ ,fElements(0)
+ ,fThreshold(0)
{
//
// Creates a AliTRDdataArrayF with the dimensions <nrow>, <ncol>, and <ntime>.
// The row- and column dimensions are compressible.
//
- fElements = 0;
-
Allocate(nrow,ncol,ntime);
}
//_____________________________________________________________________________
AliTRDdataArrayF::AliTRDdataArrayF(const AliTRDdataArrayF &a)
+ :AliTRDdataArray(a)
+ ,fElements(a.fElements)
+ ,fThreshold(a.fThreshold)
{
//
// AliTRDdataArrayF copy constructor
//
- ((AliTRDdataArrayF &) a).Copy(*this);
-
}
//_____________________________________________________________________________
// Destructor
//
- if (fElements) delete fElements;
+ if (fElements) {
+ delete fElements;
+ fElements = 0;
+ }
}
// The row- and column dimensions are compressible.
//
- if (fNelems < 0) AliTRDdataArray::Allocate(nrow,ncol,ntime);
+ if (fNelems < 0) {
+ AliTRDdataArray::Allocate(nrow,ncol,ntime);
+ }
+
+ if (fElements) {
+ delete fElements;
+ }
- if (fElements) delete fElements;
fElements = new AliTRDarrayF();
fElements->Set(fNelems);
}
//_____________________________________________________________________________
-void AliTRDdataArrayF::Copy(TObject &a)
+void AliTRDdataArrayF::Copy(TObject &a) const
{
//
// Copy function
// Reset the array (old content gets deleted)
//
- if (fElements) delete fElements;
+ if (fElements) {
+ delete fElements;
+ }
+
fElements = new AliTRDarrayF();
fElements->Set(0);
}
else {
if (idx1 >= 0) {
- TObject::Error("GetData"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNdim2,this);
+ AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+ ,time,fNdim2,this));
}
}
}
//
if (fBufType < 0) {
- Error("AliTRDdataArrayF::Compress","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
if (fBufType == bufferType) {
Expand();
}
if (fBufType !=0) {
- Error("AliTRDdataArrayF::Compress","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
//
if (fBufType < 0) {
- Error("AliTRDdataArrayF::Expand","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
if (fBufType == 0) {
}
else {
if (idx1 >= 0) {
- TObject::Error("SetData"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNdim2,this);
+ AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+ ,time,fNdim2,this));
}
}
}