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 fc07b16..e68f604 100644 (file)
@@ -198,6 +198,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)
 {
   // add extra space for derivatives data
index 11bdc55..97cba03 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;}