本文整理汇总了C++中TDirectoryFile::FindObjectAny方法的典型用法代码示例。如果您正苦于以下问题:C++ TDirectoryFile::FindObjectAny方法的具体用法?C++ TDirectoryFile::FindObjectAny怎么用?C++ TDirectoryFile::FindObjectAny使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDirectoryFile
的用法示例。
在下文中一共展示了TDirectoryFile::FindObjectAny方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filechk
int filechk(string fname)
{
//TFile f("DQM_V0001_SiStrip_R000062940.root");
TFile f(fname.c_str());
if (f.IsZombie()){
//cout << "File corrupted" << endl;
return -1;
}
else
{
if ( fname.find("_SiStrip_") != string::npos ){
TString rnStr = fname.substr(fname.find("_R") + 2, 9);
TString runDirStr("Run ");
runDirStr += rnStr.Atoi();
TDirectoryFile* runDir = (TDirectoryFile*)f.FindObjectAny(runDirStr);
if ( runDir == 0 )
return 0;
TDirectoryFile* tracking = (TDirectoryFile*)runDir->FindObjectAny("Tracking");
if ( tracking == 0 )
return 0;
TDirectoryFile* sistrip = (TDirectoryFile*)runDir->FindObjectAny("SiStrip");
if ( sistrip == 0 )
return 0;
TDirectoryFile* hist = (TDirectoryFile*)tracking->FindObjectAny("reportSummaryMap");
if ( hist == 0 )
return 0;
hist = (TDirectoryFile*)sistrip->FindObjectAny("reportSummaryMap");
if ( hist == 0 )
return 0;
return 1;
}
//TH2F* hist;
//hist = (TH2F*)f.FindObjectAny("reportSummaryMap");
TDirectoryFile* hist;
//hist = (TDirectoryFile*)f.FindObjectAny("reportSummaryContents");
hist = (TDirectoryFile*)f.FindObjectAny("reportSummaryMap");
if (0 == hist)
{
TDirectoryFile* hist2;
hist2 = (TDirectoryFile*)f.FindObjectAny("EventInfo");
if (0 != hist2)
return 1;
//cout << "File is incomplete" << endl;
return 0;
}
else
{
//cout << "File is OK" << endl;
return 1;
}
}
}