本文整理汇总了C++中TBranch::GetSplitLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ TBranch::GetSplitLevel方法的具体用法?C++ TBranch::GetSplitLevel怎么用?C++ TBranch::GetSplitLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBranch
的用法示例。
在下文中一共展示了TBranch::GetSplitLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verifyBranch
template <class HolderClass> bool verifyBranch(const char *testname, TTree *chain, const char *bname, int type = 0) {
static HolderClass *gHolder = new HolderClass;
HolderClass **add = 0;
HolderClass *holder = 0;
TBranch *branch = chain->GetBranch(bname);
if (branch==0) {
TestError("treeReading",Form("Missing branch: %s",bname));
return false;
}
if (branch->InheritsFrom("TBranchObject")) {
TLeafObject *tbo = dynamic_cast<TLeafObject*>(branch->GetListOfLeaves()->At(0));
holder = (HolderClass*)(tbo->GetObject());
if (holder==0) {
TestError("treeReading",Form("BranchObject %s with holder == 0!",bname));
return false;
}
} else {
add = (HolderClass**)branch->GetAddress();
if (add==0) {
TestError("treeReading",Form("Branch %s with add == 0!",bname));
return false;
}
void **p;
switch (type) {
case 0: holder = *add; break;
case 1: p = (void**) &(gHolder->fScalarPtr); *p = ((TBranchElement*)branch)->GetObject(); break;
case 2: p = (void**) &(gHolder->fObjectPtr); *p = ((TBranchElement*)branch)->GetObject(); break;
case 3: p = (void**) &(gHolder->fNestedPtr); *p = ((TBranchElement*)branch)->GetObject(); break;
}
}
int splitlevel = branch->GetSplitLevel();
switch (type) {
case 0: return holder->Verify(chain->GetTree()->GetReadEntry(),Form("%s %s",testname,bname),splitlevel);
case 1: return gHolder->VerifyScalarPtr(chain->GetTree()->GetReadEntry(),Form("%s %s",testname,bname),splitlevel);
case 2: return gHolder->VerifyObjectPtr(chain->GetTree()->GetReadEntry(),Form("%s %s",testname,bname),splitlevel);
case 3: return gHolder->VerifyNestedPtr(chain->GetTree()->GetReadEntry(),Form("%s %s",testname,bname),splitlevel);
default:
TestError("treeReading",Form("Unknown type %d in verifyBranch",type));
return false;
}
}