7 #include "TObjectTable.h"
10 #include "TClonesArray.h"
16 void ojtable(
const char *className=0);
19 int SizeOfH(TObject *to);
21 void ojtable(
const char *className)
23 static int fTableOffset = 0;
24 if (!fTableOffset) fTableOffset = gObjectTable->IsA()->GetDataMemberOffset(
"fTable");
27 if (className && !*className) className=0;
29 const char *qwe =
".*";
30 if (className) qwe = className;
31 TRegexp regexp(qwe);
int regexpLen=0;
33 int sz = gObjectTable->GetSize();
34 int *ptr =
new int[sz];
35 int *idx =
new int[sz];
37 TObject **tab = *((TObject ***)((
char*)gObjectTable+fTableOffset));
39 printf (
"tab %p[%d]\n",tab,sz);
43 const char *info_name = 0;
48 if (!to->TestBit(TObject::kNotDeleted))
continue;
50 if (hs) {hSize+=hs; hNumb++;}
51 if (className && regexp.Index(to->ClassName(),®expLen)<0)
continue;
52 const char *mk = StMkDeb::GetUser(to);
53 if(mk && *mk) printf(
"%s(%p) in %s\n",to->ClassName(),to,mk);
56 printf(
"TH1 N=%d, Size = %g\n",hNumb,hSize);
58 TMath::Sort(num,ptr,idx,0);
60 printf(
"Selected %d objects\n",num);
63 to = (TObject*)ptr[ix];
65 if (i) dist = ptr[ix]-last;
72 info_name=
typeid(*to).name();
74 printf (
"%4d +%6d : obj = %p(%3d) %s::%s \tinfo=%s\n",i,dist,to,kl->Size(),kl->GetName(),to->GetName(),info_name);
76 if (strcmp(
"TClonesArray",kl->GetName()))
continue;
77 TClonesArray *tcl = ((TClonesArray*)to);
78 printf(
" Sizes = %d %d\n",tcl->GetLast()+1,tcl->Capacity());
89 int SizeOfH(TObject *to)
91 TClass *kl = to->IsA();
93 if (!kl->InheritsFrom(TH1::Class()))
return 0;
96 int nbins = h->GetNbinsX()*h->GetNbinsY()*h->GetNbinsZ();
98 if (kl->InheritsFrom(
"TArrayC")) szw=1;
99 else if (kl->InheritsFrom(
"TArrayS")) szw=2;
100 else if (kl->InheritsFrom(
"TArrayI")) szw=4;
101 else if (kl->InheritsFrom(
"TArrayF")) szw=4;
102 else if (kl->InheritsFrom(
"TArrayD")) szw=8;
103 return s0 + nbins*szw;