当前位置: 首页>>代码示例>>C++>>正文


C++ TBranch::SetCompressionLevel方法代码示例

本文整理汇总了C++中TBranch::SetCompressionLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ TBranch::SetCompressionLevel方法的具体用法?C++ TBranch::SetCompressionLevel怎么用?C++ TBranch::SetCompressionLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TBranch的用法示例。


在下文中一共展示了TBranch::SetCompressionLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UpdateTag

//_____________________________________//
Bool_t UpdateTag(TString faliroot, TString froot, TString fgeant, 
		 TString turl, TString guid,
		 TString fperiod, TString fpass, TString fname) {
  cout<<"> Updating tags...."<<endl;

  const char * tagPattern = "tag.root";
  // Open the working directory
  void * dirp = gSystem->OpenDirectory(gSystem->pwd());
  const char * name = 0x0;
  // Add all files matching *pattern* to the chain
  while((name = gSystem->GetDirEntry(dirp))) {
    cout<<">>> Adding to chain file " << name << "...." << endl;
    if (strstr(name,tagPattern)) {
      TFile *f = TFile::Open(name,"read") ;
 
      AliRunTag *tag = 0x0;
      AliFileTag *flTag = 0x0;
      TTree *fTree = (TTree *)f->Get("T");
      if (!fTree) { f->Close(); continue; }
      fTree->SetBranchAddress("AliTAG",&tag);
   
      //Defining new tag objects
      AliRunTag *newTag = 0x0;
      TTree ttag("T","A Tree with event tags");
      TBranch * btag = ttag.Branch("AliTAG", &newTag);
      btag->SetCompressionLevel(9);
      
      cout<<">>>>> Found " << fTree->GetEntries() << " entries...." << endl;
      for(Int_t iTagFiles = 0; iTagFiles < fTree->GetEntries(); iTagFiles++) {
	fTree->GetEntry(0);
	newTag = new AliRunTag(*tag);
	newTag->SetAlirootVersion(faliroot);
	newTag->SetRootVersion(froot);
	newTag->SetGeant3Version(fgeant);
	newTag->SetLHCPeriod(fperiod);
	newTag->SetReconstructionPass(fpass);
	newTag->SetProductionName(fname);
 	cout << "Found " << newTag->GetNFiles() << " file tags" << endl;
 	for(Int_t j = 0; j < newTag->GetNFiles(); j++) {
 	  flTag = (AliFileTag *) newTag->GetFileTag(j);
 	  flTag->SetTURL(turl);
 	  flTag->SetGUID(guid);
 	}
	ttag.Fill();

	delete tag;
	delete newTag;
      }//tag file loop 

      TFile* ftag = TFile::Open(name, "recreate");
      ftag->cd();
      ttag.Write();
      ftag->Close();

    }//pattern check
  }//directory loop
  return kTRUE;
}
开发者ID:JanFSchulte,项目名称:monalisa,代码行数:59,代码来源:tag.C

示例2: UpdateWithRCT

void UpdateWithRCT(const char *inrun, const char *inrct)
{
  TFile *inrunfile = new TFile(inrun);
  TTree *runtree = (TTree *) inrunfile->Get("T");
  IlcRunTag *runt = new IlcRunTag();
  runtree->SetBranchAddress("IlcTAG", &runt);

  TFile *inrctfile = new TFile(inrct);
  TTree *rcttree = (TTree *) inrctfile->Get("T");
  IlcRunTag *rctt = new IlcRunTag();
  rcttree->SetBranchAddress("IlcTAG", &rctt);

  runtree->GetEntry(0);

  cout << "Looking for RCT match for run " << runt->GetRunId() << endl;

  for (int iter=0; iter<rcttree->GetEntries(); iter++) {
    rcttree->GetEntry(iter);
    if (rctt->GetRunId() == runt->GetRunId()) {
      cout << "Found match in RCT for run " << rctt->GetRunId() << endl;
      cout << "Updating " << endl;

      runt->UpdateFromRunTable(rctt);
    }

  }

  TFile* ftag = TFile::Open("Updated.root", "recreate");

  TTree * ttag = new TTree("T","A Tree with event tags");
  TBranch * btag = ttag->Branch("IlcTAG", &runt);
  ttag->Fill();
  
  btag->SetCompressionLevel(9);

  ftag->cd();
  ttag->Write();
  ftag->Close();


}
开发者ID:brettviren,项目名称:ORKA-ILCRoot,代码行数:41,代码来源:UpdateWithRCT.C


注:本文中的TBranch::SetCompressionLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。