]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Aux.getter for weights
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 May 2012 23:27:31 +0000 (23:27 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 May 2012 23:27:31 +0000 (23:27 +0000)
STEER/STEER/AliMillePedeRecord.cxx
STEER/STEER/AliMillePedeRecord.h

index fc07b161e2ef460744ead6fbb3edea012716e266..e68f60468fae195da3229b8d27df8a00882971ff 100644 (file)
@@ -197,6 +197,26 @@ Double_t AliMillePedeRecord::GetResidual(Int_t pnt) const
   //
 }
 
+//_____________________________________________________________________________________________
+Double_t AliMillePedeRecord::GetWeight(Int_t pnt) const
+{
+  // get weight of point pnt
+  if (!fSize) {AliError("No data"); return 0;}
+  int cnt=0,point=0;
+  //  
+  while(cnt<fSize) {
+    //
+    Double_t resid = fValue[cnt++];
+    while(!IsWeight(cnt)) cnt++;
+    if (point==pnt) return GetValue(cnt);;
+    cnt++;
+    while(!IsResidual(cnt) && cnt<fSize) cnt++;
+    point++;
+  }
+  return -1;
+  //
+}
+
 //_____________________________________________________________________________________________
 void AliMillePedeRecord::ExpandDtBuffer(Int_t bfsize)
 {
index 11bdc55182b83e1ad00e41a453e4ee1356617bd5..97cba03ad614807a2eae78823bf6d23721acdbe9 100644 (file)
@@ -59,6 +59,7 @@ class AliMillePedeRecord : public TObject
   Double_t   GetLocalDeriv(Int_t pnt, Int_t indx)            const;
   Double_t   GetResidual(Int_t pnt)                          const;
   Double_t   GetGloResWProd(Int_t indx)                      const;
+  Double_t   GetWeight(Int_t indx)                           const;
   //
  protected:
   Int_t      GetDtBufferSize()                               const {return GetUniqueID()&0x0000ffff;}