]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - CONTAINERS/AliArrayBranch.cxx
Removing extra namespace (alpha)
[u/mrichter/AliRoot.git] / CONTAINERS / AliArrayBranch.cxx
index a4461f0847ea5aff36386c4120e9773066643e31..e37dcf58e7a8d0c0d80d66407c643201bbb359dd 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.1  2000/11/01 16:01:22  kowal2
-Classes for handling the new hits structures
+/* $Id$ */
+
+//-----------------------------------------------------
+// A Branch for the case of an array of clone objects. 
+//-----------------------------------------------------
+// Author M.Ivanov
+//*KEND.
 
-*/
 #include "TROOT.h"
 #include "AliArrayBranch.h"
 #include "TFile.h"
@@ -43,11 +45,6 @@ Classes for handling the new hits structures
 #include "AliObjectArray.h"
 #include "AliDataType.h"
 
-//-----------------------------------------------------
-// A Branch for the case of an array of clone objects. 
-//-----------------------------------------------------
-
-//*KEND.
 
 R__EXTERN TTree *gTree;
 
@@ -58,7 +55,7 @@ ClassImp(AliTree)
 
 
 
-Int_t AliArraySubBranch::GetEntryExport(Int_t entry, Int_t getall, AliObjectArray *list, Int_t nentries)
+  Int_t AliArraySubBranch::GetEntryExport(Int_t entry, Int_t /*getall*/, AliObjectArray *list, Int_t nentries)
 {
 //*-*-*-*-*-*Read all leaves of entry and return total number of bytes*-*-*
 //*-* export buffers to real objects in the AliObjectArray list.
@@ -344,7 +341,7 @@ AliArrayBranch::AliArrayBranch(const Text_t *name, void *pointer, TTree * tree,
    }
    else if (clinfo->IsA()->InheritsFrom("AliDataType")){ //branch for basic type
      Int_t type = (((AliDataType*)clinfo)->GetDataType())->GetType();
-     char *itype = 0;
+     const char *itype = 0;
      if (type <=0) 
        Warning("BranchClones","Cannot process member:%s",clinfo->GetName());       
      else{
@@ -435,7 +432,7 @@ Int_t AliArrayBranch::Fill()
 }
 
 //______________________________________________________________________________
-Int_t AliArrayBranch::GetEntry(Int_t entry, Int_t getall)
+Int_t AliArrayBranch::GetEntry(Long64_t entry, Int_t getall)
 {
 //*-*-*-*-*Read all branches of a BranchClones and return total number of bytes
 //*-*      ====================================================================
@@ -467,7 +464,7 @@ Int_t AliArrayBranch::GetEntry(Int_t entry, Int_t getall)
 }
 
 //______________________________________________________________________________
-void AliArrayBranch::Print(Option_t *option)
+void AliArrayBranch::Print(Option_t *option) const
 {
 //*-*-*-*-*-*-*-*-*-*-*-*Print TBranch parameters*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
 //*-*                    ========================
@@ -661,42 +658,45 @@ void AliArrayBranch::Streamer(TBuffer &b)
 
 void AliArrayBranch::Import(TLeaf * leaf, Int_t n)
 {
+  //
+  // Import leaf n from the branch
+  //
 
   const Int_t kIntUndefined = -9999;
   Int_t j = 0;
   char *clone;
   Int_t len    = leaf->GetLenStatic();
-  Int_t fOffset = leaf->GetOffset();
+  Int_t offset = leaf->GetOffset();
   void *value  = leaf->GetValuePointer();
   //
   for (Int_t i=0;i<n;i++) {
     clone = (char*)fList->UncheckedAt(i);
     //8bit int
     if (leaf->IsA()==TLeafB::Class()){  
-      memcpy(&((Char_t*)value)[j],clone + fOffset, len);
+      memcpy(&((Char_t*)value)[j],clone + offset, len);
     }
     //var size
     if (leaf->IsA()==TLeafC::Class()){  
-      memcpy(&((Char_t*)value)[j],clone + fOffset, 1);
+      memcpy(&((Char_t*)value)[j],clone + offset, 1);
     }
     //double
     if (leaf->IsA()==TLeafD::Class()){  
-      if (clone) memcpy(&((Double_t*)value)[j],clone + fOffset, 8*len);
+      if (clone) memcpy(&((Double_t*)value)[j],clone + offset, 8*len);
       else       memcpy(&((Double_t*)value)[j],&kIntUndefined,  8*len);      
     }
     //float
     if (leaf->IsA()==TLeafF::Class()){   
-      if (clone) memcpy(&((Float_t*)value)[j],clone + fOffset, 4*len);
+      if (clone) memcpy(&((Float_t*)value)[j],clone + offset, 4*len);
       else       memcpy(&((Float_t*)value)[j],&kIntUndefined,  4*len);     
     }    
     //int
     if (leaf->IsA()==TLeafI::Class()){  
-      if (clone) memcpy(&((Int_t*)value)[j],clone + fOffset, 4*len);
+      if (clone) memcpy(&((Int_t*)value)[j],clone + offset, 4*len);
       else       memcpy(&((Int_t*)value)[j],&kIntUndefined,  4*len);
     }
    //short
     if (leaf->IsA()==TLeafS::Class()){  
-      if (clone) memcpy(&((Short_t*)value)[j],clone + fOffset, 2*len);
+      if (clone) memcpy(&((Short_t*)value)[j],clone + offset, 2*len);
       else       memcpy(&((Short_t*)value)[j],&kIntUndefined,  2*len);
     }     
     j += len;  
@@ -730,9 +730,17 @@ AliObjectBranch::AliObjectBranch(const Text_t *name, const Text_t *classname, vo
    fBasketSize     = basketsize;
    fAddress        = (char*)addobj;
    fClassName      = classname;
+#if ROOT_VERSION_CODE >= 262401
+   fBasketEntry    = new Long64_t[fMaxBaskets];
+#else
    fBasketEntry    = new Int_t[fMaxBaskets];
+#endif
    fBasketBytes    = new Int_t[fMaxBaskets];
+#if ROOT_VERSION_CODE >= 262146
+   fBasketSeek     = new Long64_t[fMaxBaskets];
+#else
    fBasketSeek     = new Seek_t[fMaxBaskets];
+#endif
    fOldObject      = 0;
 
    fBasketEntry[0] = fEntryNumber;
@@ -992,6 +1000,9 @@ AliTree::AliTree(const char *name,const char *title, Int_t maxvirtualsize):
 TBranch * AliTree::AliBranch(const char *name, void *clonesaddress, Int_t bufsize, Int_t splitlevel,
                             Int_t compres)
 {
+  //
+  // Create an AliBranch and returns a reference to the TBranch
+  //
   if (clonesaddress == 0) return 0;
   char *cpointer =(char*)clonesaddress;
   char **ppointer =(char**)cpointer;
@@ -1012,6 +1023,9 @@ TBranch * AliTree::AliBranch(const char *name, void *clonesaddress, Int_t bufsiz
 TBranch* AliTree::AliBranch(const char *name, const char *classname, void *addobj, 
                     Int_t bufsize, Int_t splitlevel)
 {
+  //
+  // Create an AliBranch and returns a reference to the TBranch
+  //
   gTree = this;
   TClass *cl = gROOT->GetClass(classname);
   if (!cl) {