/* $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"
#include "AliObjectArray.h"
#include "AliDataType.h"
-//-----------------------------------------------------
-// A Branch for the case of an array of clone objects.
-//-----------------------------------------------------
-
-//*KEND.
R__EXTERN TTree *gTree;
}
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{
}
//______________________________________________________________________________
-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
//*-* ====================================================================
}
//______________________________________________________________________________
-void AliArrayBranch::Print(Option_t *option)
+void AliArrayBranch::Print(Option_t *option) const
{
//*-*-*-*-*-*-*-*-*-*-*-*Print TBranch parameters*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-* ========================
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;
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;
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;
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) {