本文整理汇总了C++中TFile::GetCompressionSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ TFile::GetCompressionSettings方法的具体用法?C++ TFile::GetCompressionSettings怎么用?C++ TFile::GetCompressionSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFile
的用法示例。
在下文中一共展示了TFile::GetCompressionSettings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testSimpleFile
int testSimpleFile(const char *filename, Long64_t entries, Int_t compSetting, Long64_t fileSize, UInt_t tolerance = 0)
{
fprintf(stdout,"Checking %s\n",filename);
TFile *file = TFile::Open(filename);
if (file == nullptr || file->IsZombie()) {
Error("testSimpleFile", "Could not open %s.",filename);
return 1;
}
//file->ls();
if (file->GetCompressionSettings() != compSetting) {
Error("testSimpleFile","Compression level of %s should have been %d but is %d\n",file->GetName(), 206, file->GetCompressionSettings() );
return 3;
}
if (abs(file->GetSize()-fileSize) > tolerance) {
Error("testSimpleFile","Disk size of %s should have been %lld but is %lld (tolerance %u bytes)\n",file->GetName(), fileSize, file->GetSize(), tolerance);
return 4;
}
TTree *ntuple;
file->GetObject("ntuple",ntuple);
if (ntuple == 0) {
Error("testSimpleFile", "Could not retrieve ntuple from %s.",file->GetName());
return 2;
}
if (ntuple->GetEntries() != entries) {
Error("testSimpleFile","Number of entries in ntuple in %s should have been %lld but is %lld\n",file->GetName(), entries, ntuple->GetEntries());
return 4;
}
delete file;
return 0;
}
示例2: testMergedFile
int testMergedFile(const char *filename, Int_t compSetting, Long64_t fileSize)
{
TFile *file = TFile::Open(filename);
if (file == nullptr || file->IsZombie()) {
Error("testSimpleFile", "Could not open %s.",filename);
return 1;
}
file->ls();
file->cd("hist");
gDirectory->ls();
gDirectory->Get("Gaus")->Print();
file->cd("named");
gDirectory->ls();
file->Get("MyList")->Print();
if (file->GetCompressionSettings() != compSetting) {
Error("execTestMultiMerge","Compression level of %s should have been %d but is %d\n",file->GetName(), 206, file->GetCompressionSettings() );
return 3;
}
if (file->GetSize() != fileSize) {
Error("execTestMultiMerge","Disk size of %s should have been %lld but is %lld\n",file->GetName(), fileSize, file->GetSize() );
return 4;
}
delete file;
return 0;
}