本文整理汇总了C++中TH3D::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ TH3D::Delete方法的具体用法?C++ TH3D::Delete怎么用?C++ TH3D::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TH3D
的用法示例。
在下文中一共展示了TH3D::Delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScanChain
//.........这里部分代码省略.........
// Loop over events to Analyze
unsigned int nEventsTotal = 0;
unsigned int nEventsChain = chain->GetEntries();
if( nEvents >= 0 ) nEventsChain = nEvents;
TObjArray *listOfFiles = chain->GetListOfFiles();
TIter fileIter(listOfFiles);
TFile *currentFile = 0;
//get the reweighting histograms
TIter fileIterFirst(listOfFiles);
TFile *currentFileFirst = 0;
TH3D* counterhistSig;
TH2F* histNEvts;
bool thisisfirst = true;
// File Loop for adding correct histograms
while ( (currentFileFirst = (TFile*)fileIterFirst.Next()) ) {
TFile *file = new TFile( currentFileFirst->GetTitle() );
file->cd();
if(thisisfirst){
counterhistSig = (TH3D*)file->Get("h_counterSMS");
counterhistSig->SetDirectory(0);
histNEvts = (TH2F*)file->Get("histNEvts");
histNEvts->SetDirectory(0);
thisisfirst = false;
} else {
TH3D *tempcounterhistSig = (TH3D*)file->Get("h_counterSMS");
tempcounterhistSig->SetDirectory(0);
TH2F *temphistNEvts = (TH2F*)file->Get("histNEvts");
temphistNEvts->SetDirectory(0);
counterhistSig->Add(tempcounterhistSig);
histNEvts->Add(temphistNEvts);
tempcounterhistSig->Delete();
temphistNEvts->Delete();
}
file->Close();
delete file;
}
// File Loop
while ( (currentFile = (TFile*)fileIter.Next()) ) {
// Get File Content
TFile *file = new TFile( currentFile->GetTitle() );
TTree *tree = (TTree*)file->Get("t");
if(fast) TTreeCache::SetLearnEntries(10);
if(fast) tree->SetCacheSize(128*1024*1024);
cms3.Init(tree);
// Loop over Events in current file
if( nEventsTotal >= nEventsChain ) continue;
unsigned int nEventsTree = tree->GetEntriesFast();
for( unsigned int event = 0; event < nEventsTree; ++event) {
// Get Event Content
if( nEventsTotal >= nEventsChain ) continue;
if(fast) tree->LoadTree(event);
cms3.GetEntry(event);
++nEventsTotal;
// Progress
CMS3::progress( nEventsTotal, nEventsChain );
// Analysis Code