]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDdataArrayF.cxx
Compiler warnings and coding conventions, next round
[u/mrichter/AliRoot.git] / TRD / AliTRDdataArrayF.cxx
index aa1eb0ebcaba63a04b9aa106a32fc9ce7a6f5ff3..1037942dd99622c549d43c7a6dcfad203601aa6d 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  2000/06/08 18:32:58  cblume
+Make code compliant to coding conventions
+
 Revision 1.2  2000/05/08 16:17:27  cblume
 Merge TRD-develop
 
@@ -59,13 +62,13 @@ AliTRDdataArrayF::AliTRDdataArrayF(Int_t nrow, Int_t ncol, Int_t ntime)
 }
 
 //_____________________________________________________________________________
-AliTRDdataArrayF::AliTRDdataArrayF(AliTRDdataArrayF &a)
+AliTRDdataArrayF::AliTRDdataArrayF(const AliTRDdataArrayF &a)
 {
   //
   // AliTRDdataArrayF copy constructor
   //
 
-  a.Copy(*this);
+  ((AliTRDdataArrayF &) a).Copy(*this);
 
 }
 
@@ -606,3 +609,67 @@ Float_t AliTRDdataArrayF::GetData1(Int_t idx1, Int_t idx2)
 
 }
 
+//____________________________________________________________________________
+Float_t AliTRDdataArrayF::GetDataFast(Int_t idx1, Int_t idx2)
+{
+  //
+  // Returns the value at a given position in the array
+  //
+
+  return fElements->At(fIndex->At(idx2) + idx1); 
+
+}
+
+//_____________________________________________________________________________
+void AliTRDdataArrayF::SetData(Int_t row, Int_t col, Int_t time, Float_t value)
+{
+  //
+  // Sets the data value at a given position of the array
+  // Includes boundary checking
+  //
+
+  if ((row >= 0) && (col >= 0) && (time >= 0)) {
+    Int_t idx1 = GetIdx1(row,col);
+    if ((idx1 >= 0) && (time < fNdim2)) {
+      SetDataFast(idx1,time,value);
+    }
+    else {
+      if (idx1 >= 0) {
+        TObject::Error("SetData"
+                      ,"time %d out of bounds (size: %d, this: 0x%08x)"
+                      ,time,fNdim2,this);
+      }
+    }
+  }
+
+}
+
+//_____________________________________________________________________________
+void  AliTRDdataArrayF::SetDataFast(Int_t idx1, Int_t idx2, Float_t value)
+{
+  //
+  // Set the value at a given position in the array
+  //
+
+  if ((idx1 < 0) || (idx1 >= fNdim1) || 
+      (idx2 < 0) || (idx2 >= fNdim2)) { 
+    TObject::Error("SetDataFast"
+                  ,"idx1 %d  idx2 %d out of bounds (size: %d x %d, this: 0x%08x)"
+                  ,idx1,idx2,fNdim1,fNdim2,this);
+  }
+
+  (*fElements)[fIndex->fArray[idx2] + idx1] = value; 
+
+}
+
+//_____________________________________________________________________________
+AliTRDdataArrayF &AliTRDdataArrayF::operator=(const AliTRDdataArrayF &a)
+{
+  //
+  // Assignment operator
+  //
+
+  if (this != &a) ((AliTRDdataArrayF &) a).Copy(*this);
+  return *this;
+
+}