// //
///////////////////////////////////////////////////////////////////////////////
+#include "AliLog.h"
+
#include "AliTRDdataArrayI.h"
#include "AliTRDarrayI.h"
ClassImp(AliTRDdataArrayI)
//_____________________________________________________________________________
-AliTRDdataArrayI::AliTRDdataArrayI():AliTRDdataArray()
+AliTRDdataArrayI::AliTRDdataArrayI()
+ :AliTRDdataArray()
+ ,fElements(0)
+ ,fThreshold(0)
{
//
// Default constructor
//
- fElements = 0;
-
}
//_____________________________________________________________________________
AliTRDdataArrayI::AliTRDdataArrayI(Int_t nrow, Int_t ncol, Int_t ntime)
- :AliTRDdataArray(nrow,ncol,ntime)
+ :AliTRDdataArray(nrow,ncol,ntime)
+ ,fElements(0)
+ ,fThreshold(0)
{
//
// Creates a AliTRDdataArrayI with the dimensions <nrow>, <ncol>, and <ntime>.
// The row- and column dimensions are compressible.
//
- fElements = 0;
-
Allocate(nrow,ncol,ntime);
}
//_____________________________________________________________________________
-AliTRDdataArrayI::AliTRDdataArrayI(const AliTRDdataArrayI &a):AliTRDdataArray(a)
+AliTRDdataArrayI::AliTRDdataArrayI(const AliTRDdataArrayI &a)
+ :AliTRDdataArray(a)
+ ,fElements(a.fElements)
+ ,fThreshold(a.fThreshold)
{
//
// AliTRDdataArrayI copy constructor
//
- ((AliTRDdataArrayI &) 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 AliTRDarrayI();
fElements->Set(fNelems);
}
//_____________________________________________________________________________
-void AliTRDdataArrayI::Copy(TObject &a)
+void AliTRDdataArrayI::Copy(TObject &a) const
{
//
// Copy function
// Reset the array (old content gets deleted)
//
- if (fElements) delete fElements;
+ if (fElements) {
+ delete fElements;
+ }
+
+
fElements = new AliTRDarrayI();
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("AliTRDdataArrayI::Compress","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
if (fBufType == bufferType) {
Expand();
}
if (fBufType !=0) {
- Error("AliTRDdataArrayI::Compress","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
//
if (fBufType < 0) {
- Error("AliTRDdataArrayI::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));
}
}
}