本文整理匯總了C++中TList::GetName方法的典型用法代碼示例。如果您正苦於以下問題:C++ TList::GetName方法的具體用法?C++ TList::GetName怎麽用?C++ TList::GetName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TList
的用法示例。
在下文中一共展示了TList::GetName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: GetIncludeList
af::TList Scheme::GetIncludeList()
{
if(Root.IsNull())
{
throw NoLabelInicialisationException("Scheme: label do not inicialised.");
}
// return IncludeList;
TIterator TITER;
TList valls;
TITER.Init(Root, false);
while (TITER.More())
{
TList val = (TList)TITER.Value();
QString name = val.GetName();
if(name == "IncludeList")
{
return val;
}
TITER.Next();
}
TElement e(Root);
throw NoExistException("Scheme: Include List do not exists.", e);
return valls;
}
示例2: addn2
void addn2() {
// open existing f1:
char* fn[99];
int ni;
// SR90 maps, mod D003
ni = -1;
ni++; fn[ni] = "SR90-map-00a.root";
ni++; fn[ni] = "SR90-map-00b.root";
ni++; fn[ni] = "SR90-map-01a.root";
ni++; fn[ni] = "SR90-map-01b.root";
ni++; fn[ni] = "SR90-map-02.root";
ni++; fn[ni] = "SR90-map-03.root";
ni++; fn[ni] = "SR90-map-05a.root";
ni++; fn[ni] = "SR90-map-05b.root";
ni++; fn[ni] = "SR90-map-07a.root";
ni++; fn[ni] = "SR90-map-07b.root";
ni++; fn[ni] = "SR90-map-07c.root";
ni++; fn[ni] = "SR90-map-07d.root";
// direct X-rays 9.4.2014 module D0003
ni = -1;
ni++; fn[ni] = "X-ray-20-modtd40000.root";
ni++; fn[ni] = "X-ray-20-vthr60-modtd1000.root";
ni++; fn[ni] = "X-ray-27-vthr60-modtd1000.root";
ni++; fn[ni] = "X-ray-35-modtd40000.root";
ni++; fn[ni] = "X-ray-35-vthr60-close-modtd65000.root";
ni++; fn[ni] = "X-ray-35-vthr60-midpos-0p1mA-modtd10000.root";
ni++; fn[ni] = "X-ray-35-vthr60-midpos-halfcur-modtd40000.root";
ni++; fn[ni] = "X-ray-35-vthr60-modtd40000.root";
int nmax = ni;
TFile f1(fn[0]);
if( f1.IsZombie() ) {
cout << "Error opening " << fn[0] << endl;
return;
}
cout << "opened " << fn[0] << endl;
//--------------------------------------------------------------------
// create f0:
TFile f0("fileA.root", "RECREATE");
cout << "created ";
gDirectory->pwd();
/*
TFile options:
NEW or CREATE create a new file and open it for writing,
if the file already exists the file is
not opened.
RECREATE create a new file, if the file already
exists it will be overwritten.
UPDATE open an existing file for writing.
if no file exists, it is created.
READ open an existing file for reading (default).
NET used by derived remote file access
classes, not a user callable option
WEB used by derived remote http access
class, not a user callable option
"" (default), READ is assumed.
*/
//--------------------------------------------------------------------
// copy f1 to f0:
f1.cd();
cout << "keys:\n";
f1.GetListOfKeys()->Print();
cout << "pwd: ";
f1.pwd();
cout << "ls: \n";
f1.ls();
// f1 has sub-dir:
cout << "First: " << f1.GetListOfKeys()->First()->GetName() << endl;
cout << "First: " << f1.GetListOfKeys()->First()->ClassName() << endl;
char* dir1 = f1.GetListOfKeys()->First()->GetName();
cout << "cd to " << dir1 << endl;
f1.cd( dir1 );
cout << "we are in ";
gDirectory->pwd();
gDirectory->ReadAll(); // load histos
TList * lst = gDirectory->GetList();
cout << lst->GetName() << endl;
cout << lst->GetTitle() << endl;
cout << "size " << lst->GetSize() << endl;
cout << "entries " << lst->GetEntries() << endl;
//.........這裏部分代碼省略.........
示例3: readMCPerform
//.........這裏部分代碼省略.........
fHistZvtxRes2[2]->Draw("sames");
leg2->Draw();
ccr->SaveAs("plotXYZVtxRMS.png");
TCanvas *ccc = new TCanvas("ccc", "ccc", 1200, 800);
ccc->Divide(3, 2);
ccc->cd(1);
fHistDecLen[0]->GetYaxis()->SetTitleOffset(1.45);
fHistDecLen[0]->Draw();
fHistDecLen[2]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistDecLen[4]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistDecLen[6]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistDecLen[8]->Draw("sames");
leg3->Draw();
ccc->cd(2);
fHistCosp[0]->GetYaxis()->SetTitleOffset(1.45);
fHistCosp[0]->Draw();
fHistCosp[2]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistCosp[4]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistCosp[6]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistCosp[8]->Draw("sames");
leg4->Draw();
ccc->cd(3);
hEffPt[0]->GetYaxis()->SetTitleOffset(1.45);
hEffPt[0]->Draw();
hEffPt[2]->Draw("sames");
if (drawOnlyDzerDplus == 0)
hEffPt[4]->Draw("sames");
if (drawOnlyDzerDplus == 0)
hEffPt[6]->Draw("sames");
if (drawOnlyDzerDplus == 0)
hEffPt[8]->Draw("sames");
leg3->Draw();
ccc->cd(4);
fHistDecLen[1]->GetYaxis()->SetTitleOffset(1.45);
fHistDecLen[1]->Draw();
fHistDecLen[3]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistDecLen[5]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistDecLen[7]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistDecLen[9]->Draw("sames");
leg3->Draw();
ccc->cd(5);
fHistCosp[1]->GetYaxis()->SetTitleOffset(1.45);
fHistCosp[1]->Draw();
fHistCosp[3]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistCosp[5]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistCosp[7]->Draw("sames");
if (drawOnlyDzerDplus == 0)
fHistCosp[9]->Draw("sames");
leg4->Draw();
ccc->cd(6);
hEffPt[1]->GetYaxis()->SetTitleOffset(1.45);
hEffPt[1]->Draw();
hEffPt[3]->Draw("sames");
if (drawOnlyDzerDplus == 0)
hEffPt[5]->Draw("sames");
if (drawOnlyDzerDplus == 0)
hEffPt[7]->Draw("sames");
if (drawOnlyDzerDplus == 0)
hEffPt[9]->Draw("sames");
leg3->Draw();
ccc->SaveAs("plot_DL_cosp_Eff_prompt_fd.png");
}
}
trtree->Fill();
if(runNumber>0){
TFile* foutfile=new TFile("trendingHF.root","recreate");
trtree->Write();
TDirectory* outdir=foutfile->mkdir(dirD2H->GetName());
outdir->cd();
listD2H->Write(listD2H->GetName(),1);
foutfile->cd();
if(dir && list){
TDirectory* outdir2=foutfile->mkdir(dir->GetName());
outdir2->cd();
list->Write(list->GetName(),1);
}
foutfile->Close();
delete foutfile;
}
}