本文整理汇总了C++中TClonesArray::ls方法的典型用法代码示例。如果您正苦于以下问题:C++ TClonesArray::ls方法的具体用法?C++ TClonesArray::ls怎么用?C++ TClonesArray::ls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TClonesArray
的用法示例。
在下文中一共展示了TClonesArray::ls方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ojtable
void ojtable(const char *className)
{
static int fTableOffset = 0;
if (!fTableOffset) fTableOffset = gObjectTable->IsA()->GetDataMemberOffset("fTable");
// gObjectTable->Print();
TClass *kl;
if (className && !*className) className=0;
const char *qwe = ".*";
if (className) qwe = className;
TRegexp regexp(qwe);
int regexpLen=0;
int sz = gObjectTable->GetSize();
int *ptr = new int[sz];
int *idx = new int[sz];
TObject **tab = *((TObject ***)((char*)gObjectTable+fTableOffset));
TObject *to;
printf ("tab %p[%d]\n",tab,sz);
int i,num=0;
double hSize=0;
int hNumb=0;
const char *info_name = 0;
for (i=0; i<sz; i++)
{
to = tab[i];
if (!to) continue;
if (!to->TestBit(TObject::kNotDeleted)) continue;
int hs = SizeOfH(to);
if (hs) {
hSize+=hs;
hNumb++;
}
if (className && regexp.Index(to->ClassName(),®expLen)<0) continue;
const char *mk = StMkDeb::GetUser(to);
if(mk && *mk) printf("%s(%p) in %s\n",to->ClassName(),to,mk);
ptr[num++]=int(to);
}
printf("TH1 N=%d, Size = %g\n",hNumb,hSize);
TMath::Sort(num,ptr,idx,0);
int last = 0;
printf("Selected %d objects\n",num);
for (i=0; i<num; i++) {
int ix = idx[i];
to = (TObject*)ptr[ix];
int dist = 0;
if (i) dist = ptr[ix]-last;
last = ptr[ix];
// if ((int)to == 0xc94ff34) {
// printf("Skipped %p\n",to); continue; }
info_name = "??";
info_name=typeid(*to).name();
kl = to->IsA();
printf ("%4d +%6d : obj = %p(%3d) %s::%s \tinfo=%s\n",i,dist,to,kl->Size(),kl->GetName(),to->GetName(),info_name);
if (strcmp("TClonesArray",kl->GetName())) continue;
TClonesArray *tcl = ((TClonesArray*)to);
printf(" Sizes = %d %d\n",tcl->GetLast()+1,tcl->Capacity());
tcl->ls("");
}
delete [] ptr;
delete [] idx;
}