]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMillePedeRecord.cxx
OADB classes and root files for the physics selection
[u/mrichter/AliRoot.git] / STEER / AliMillePedeRecord.cxx
index c6ff01ff4f17cb190b2989cca550a0412c0a9886..7a8d586c6e70cb594941a714e97f4ec6e9b7d0df 100644 (file)
@@ -24,11 +24,11 @@ ClassImp(AliMillePedeRecord)
 
 //_____________________________________________________________________________________________
 AliMillePedeRecord::AliMillePedeRecord() : 
-fSize(0),fNGroups(0),fGroupID(0),fIndex(0),fValue(0) {SetUniqueID(0);}
+fSize(0),fNGroups(0),fRunID(0),fGroupID(0),fIndex(0),fValue(0),fWeight(1) {SetUniqueID(0);}
 
 //_____________________________________________________________________________________________
 AliMillePedeRecord::AliMillePedeRecord(const AliMillePedeRecord& src) : 
-  TObject(src),fSize(src.fSize),fNGroups(src.fNGroups),fGroupID(0),fIndex(0),fValue(0),fWeight(src.fWeight)
+  TObject(src),fSize(src.fSize),fNGroups(src.fNGroups),fRunID(src.fRunID),fGroupID(0),fIndex(0),fValue(0),fWeight(src.fWeight)
 {
   fIndex = new Int_t[GetDtBufferSize()];
   memcpy(fIndex,src.fIndex,fSize*sizeof(Int_t));
@@ -50,6 +50,7 @@ AliMillePedeRecord& AliMillePedeRecord::operator=(const AliMillePedeRecord& rhs)
       AddIndexValue(ind,val);
     }
     fWeight = rhs.fWeight;
+    fRunID = rhs.fRunID;
     for (int i=0;i<rhs.GetNGroups();i++) MarkGroup(rhs.GetGroupID(i));
   }
   return *this;
@@ -64,6 +65,7 @@ void AliMillePedeRecord::Reset()
   fSize = 0;
   for (int i=fNGroups;i--;) fGroupID[i] = 0;
   fNGroups = 0;
+  fRunID = 0;
   fWeight = 1.;
 }
 
@@ -75,7 +77,7 @@ void AliMillePedeRecord::Print(const Option_t *) const
   //  
   if (fNGroups) printf("Groups: ");
   for (int i=0;i<fNGroups;i++) printf("%4d |",GetGroupID(i)); 
-  printf(" Weight: %+.2e\n",fWeight);
+  printf("Run: %9d Weight: %+.2e\n",fRunID,fWeight);
   while(cnt<fSize) {
     //
     Double_t resid = fValue[cnt++];
@@ -106,12 +108,12 @@ void AliMillePedeRecord::ExpandDtBuffer(Int_t bfsize)
   bfsize = TMath::Max(bfsize,GetDtBufferSize());
   Int_t *tmpI = new Int_t[bfsize];
   memcpy(tmpI,fIndex, fSize*sizeof(Int_t));
-  delete fIndex;
+  delete [] fIndex;
   fIndex = tmpI;
   //
   Double_t *tmpD = new Double_t[bfsize];
   memcpy(tmpD,fValue, fSize*sizeof(Double_t));
-  delete fValue;
+  delete [] fValue;
   fValue = tmpD;
   //
   SetDtBufferSize(bfsize);
@@ -124,7 +126,7 @@ void AliMillePedeRecord::ExpandGrBuffer(Int_t bfsize)
   bfsize = TMath::Max(bfsize,GetGrBufferSize());
   UShort_t *tmpI = new UShort_t[bfsize];
   memcpy(tmpI,fGroupID, fNGroups*sizeof(UShort_t));
-  delete[] fGroupID;
+  delete [] fGroupID;
   fGroupID = tmpI;
   for (int i=fNGroups;i<bfsize;i++) fGroupID[i] = 0;
   //