本文整理汇总了C++中TList::Remove方法的典型用法代码示例。如果您正苦于以下问题:C++ TList::Remove方法的具体用法?C++ TList::Remove怎么用?C++ TList::Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TList
的用法示例。
在下文中一共展示了TList::Remove方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectPad
void
Pick(Int_t canvas_index)
{
TObject *o;
TCanvas* c = ((TCanvas*) gROOT->GetListOfCanvases()->At(canvas_index));
c->cd();
// std::cout << "______PICKED______\n\t"
// << c->GetName() << " canvas_index=" << canvas_index << std::endl;
// ((TCanvas*) gROOT->GetListOfCanvases()->At(canvas_index))->cd();
TList *ll = toolcanvas->GetListOfPrimitives();
// std::cout << ll->GetEntries() << std::endl;
for (Int_t ii=ll->GetEntries()-1; ii>=0; ii--)
{
o = ll->At(ii);
// std::cout << ii << " removing " << ll->At(ii)->GetName() << std::endl;
ll->Remove(o);
}
toolcanvas->cd();
toolcanvas->SetWindowSize(toolw-28, toolh-8);
// toolcanvas->SetCanvasSize(toolw, toolh);
pt->Draw();
toolcanvas->Modified();
toolcanvas->Update();
canvas = ((TCanvas*) gROOT->GetListOfCanvases()->At(canvas_index));
//Enlarge();
SelectPad();
}
示例2: TObjArray
void
SelectPad()
{
notDeleted = kTRUE;
toolcanvas->cd();
// Clear buttons from toolcanvas
TObject *o;
TList *ll = toolcanvas->GetListOfPrimitives();
for (Int_t ii=ll->GetEntries()-1; ii>=0; ii--)
{
o = ll->At(ii);
ll->Remove(o);
}
Double_t buttonheight = 50;
TList *li = canvas->GetListOfPrimitives();
Int_t nentries = li->GetEntries();
if (nentries==1)
return;
toolcanvas->SetWindowSize(toolw,(nentries+1)*buttonheight);
toolcanvas->Modified();
toolcanvas->Update();
pt->SetY1NDC(1.0-1.0/(nentries+1));
pt->Draw();
toolcanvas->Update();
// toolcanvas->cd();
if (b) {delete b;}
Int_t count=0;
b = new TObjArray(nentries);
for (Int_t i=0; i<nentries; i++)
{
b->Add(new TButton(Form("pad%i",i+1),Form("Enlarge(%i);",i),0,(1-(count+1.)/(nentries+1)),1,(1-(count+2.)/(nentries+1))));
b->At(i)->Draw();
count++;
}
toolcanvas->Modified();
toolcanvas->Update();
// if (display) {display->Modified(); display->Update();}
}
示例3: if
void
Enlarge(Int_t i)
{
// toolcanvas->cd();
TObject *o;
TList *ll = toolcanvas->GetListOfPrimitives();
for (Int_t ii=ll->GetEntries()-1; ii>=0; ii--)
{
o = ll->At(ii);
ll->Remove(o);
}
toolcanvas->SetWindowSize(toolw-28, toolh-8);
toolcanvas->cd();
bclose->Draw();
// canvas->cd();
vp = (TPad*)canvas->GetListOfPrimitives()->At(i);
if (!vp) return;
// else
// cout << "selected pad name " << vp->GetName() << endl;
TList *alist;
if (vp->GetListOfPrimitives()->GetEntries() > 1)
{
graph0 = (TH1*) vp->GetListOfPrimitives()->At(1);
// graph1 = (TH1*) graph0->Clone("graph1");
alist = vp->GetListOfPrimitives();
}
else
return;
Char_t opt[50];
strcpy(opt,graph0->GetDrawOption());
// display->Draw();
display = SafeConstructCanvas("display");
display->Draw();
display->cd();
gROOT->SetSelectedPad(display);
// std::cout << "______Drawing Pad______\n\t"
// << gPad->GetName() << std::endl;
TString option;
TH1* anh, *anhh;
TObject *oo;
for (Int_t i=1; i<alist->GetEntries(); i++)
{
oo = alist->At(i);
if (oo->InheritsFrom(TH1::Class()))
{
anh = static_cast<TH1*>(oo);
option = anh->GetDrawOption();
option += "HE";
if (i>1)
option += "same";
if (oo->InheritsFrom(TH2::Class()))
anhh = anh->DrawCopy("colz");
else
anhh = anh->DrawCopy(option.Data());
anhh->SetFillStyle(0);
anhh->SetLineColor(anh->GetLineColor());
cout << anhh->GetName() << " with option=\""
<< option.Data() << "\""
<< " lcolor=" << anhh->GetLineColor()
<< " fcolor=" << anhh->GetFillColor()
<< " fstyle=" << anhh->GetFillStyle()
<< flush << endl;
display->Modified();
display->Update();
// gSystem->Sleep(5000);
// anhh->SetFillColor(anh->GetFillColor());
// anhh->SetFillStyle(anh->GetFillStyle());
}
else if (i<alist->GetEntries()-1)
oo->Draw();
}
display->Modified();
display->Update();
}
示例4: plot_efficiencies
//.........这里部分代码省略.........
frame->GetXaxis()->SetTitle( xtit );
frame->GetYaxis()->SetTitle( ytit );
TMVAGlob::SetFrameStyle( frame, 1.0 );
frame->Draw();
Int_t color = 1;
Int_t nmva = 0;
TKey *key, *hkey;
TString hNameRef = "effBvsS";
if (type == 2) hNameRef = "rejBvsS";
TList hists;
TList methods;
UInt_t nm = TMVAGlob::GetListOfMethods( methods );
// TIter next(file->GetListOfKeys());
TIter next(&methods);
// loop over all methods
while (key = (TKey*)next()) {
TDirectory * mDir = (TDirectory*)key->ReadObj();
TList titles;
UInt_t ninst = TMVAGlob::GetListOfTitles(mDir,titles);
TIter nextTitle(&titles);
TKey *titkey;
TDirectory *titDir;
while ((titkey = TMVAGlob::NextKey(nextTitle,"TDirectory"))) {
titDir = (TDirectory *)titkey->ReadObj();
TString methodTitle;
TMVAGlob::GetMethodTitle(methodTitle,titDir);
TIter nextKey( titDir->GetListOfKeys() );
while ((hkey = TMVAGlob::NextKey(nextKey,"TH1"))) {
TH1 *h = (TH1*)hkey->ReadObj();
TString hname = h->GetName();
if (hname.Contains( hNameRef ) && hname.BeginsWith( "MVA_" )) {
h->SetLineWidth(3);
h->SetLineColor(color);
color++; if (color == 5 || color == 10 || color == 11) color++;
h->Draw("csame");
hists.Add(h);
nmva++;
}
}
}
}
while (hists.GetSize()) {
TListIter hIt(&hists);
TH1* hist(0);
Double_t largestInt=-1;
TH1* histWithLargestInt(0);
while ((hist = (TH1*)hIt())!=0) {
Double_t integral = hist->Integral(1,hist->FindBin(0.9999));
if (integral>largestInt) {
largestInt = integral;
histWithLargestInt = hist;
}
}
if (histWithLargestInt == 0) {
cout << "ERROR - unknown hist \"histWithLargestInt\" --> serious problem in ROOT file" << endl;
break;
}
legend->AddEntry(histWithLargestInt,TString(histWithLargestInt->GetTitle()).ReplaceAll("MVA_",""),"l");
hists.Remove(histWithLargestInt);
}
// rescale legend box size
// current box size has been tuned for 3 MVAs + 1 title
if (type == 1) {
dyH *= (1.0 + Float_t(nmva - 3.0)/4.0);
legend->SetY1( y0H - dyH );
}
else {
dyH *= (Float_t(nmva - 3.0)/4.0);
legend->SetY2( y0H + dyH);
}
// redraw axes
frame->Draw("sameaxis");
legend->Draw("same");
// ============================================================
if (__PLOT_LOGO__) TMVAGlob::plot_logo();
// ============================================================
c->Update();
TString fname = "plots/" + hNameRef;
if (TString(BinDir->GetName()).Contains("multicut")){
TString fprepend(BinDir->GetName());
fprepend.ReplaceAll("multicutMVA_","");
fname = "plots/" + fprepend + "_" + hNameRef;
}
if (__SAVE_IMAGE__) TMVAGlob::imgconv( c, fname );
return;
}
示例5: RemoveChannel
void RemoveChannel(ChatTarget channel)
{
m_listChannels.Remove(channel);
UpdateContents();
}
示例6: q4gep_jan2009
//.........这里部分代码省略.........
}
mgrThry->Draw("c");
#ifdef PQCD
ff->Draw("same");
legThry->AddEntry(ff,"F2/F1 #propto ln^{2}(Q^{2}/#Lambda^{2})/Q^{2}","l");
#endif// PQCD
legThry->Draw();
cn->Modified();
cn->Update();
TFrame* frame = gPad->GetFrame();
// draw a line at 1
TLine *line1 = new TLine(frame->GetX1(),1.,frame->GetX2(),1.);
line1->SetLineStyle(1);
line1->Draw();
return;
cn->Update();
cn->SaveAs(Form("%s.eps",psfile));
cn->SaveAs(Form("%s.root",psfile));
gSystem->Exec(Form("./replace_symbols.pl %s.eps",psfile));
// now an overlay, hopefully matching dimensions
// remove everything except the frame
cn->Update();
TList *clist = cn->GetListOfPrimitives();
frame = cn->GetFrame();
for (int i=0; i<clist->GetSize(); ) {
if (clist->At(i) != frame) {
clist->RemoveAt(i);
} else i++;
}
// draw markers in the corners
TMarker *mkr = new TMarker(frame->GetX1(),frame->GetY1(),2);
mkr->Draw();
mkr = new TMarker(frame->GetX2(),frame->GetY1(),2);
mkr->Draw();
mkr = new TMarker(frame->GetX1(),frame->GetY2(),2);
mkr->Draw();
mkr = new TMarker(frame->GetX2(),frame->GetY2(),2);
mkr->Draw();
frame->SetLineColor(10);
{
datafile_t goeckeler = { "figure_input/Goeckeler/goeckeler.dat","Goeckeler",
"[0]","[1]","[1]-[2]","[3]-[1]",0,0,1,4,"F" };
gr = OneGraph(&goeckeler);
TGraphAsymmErrors *egr = dynamic_cast<TGraphAsymmErrors*>(gr);
if (egr && egr->GetEYhigh() && egr->GetEYhigh()[egr->GetN()/2]>0) {
gr = toerror_band(egr);
gr->SetLineStyle(1);
gr->SetFillColor(gr->GetLineColor());
gr->SetFillStyle(3000+goeckeler.style);
}
gr->Draw("F");
cn->Update();
cn->SaveAs("mup_gep_gmp_goeckeler_Overlay.eps");
cn->SaveAs("mup_gep_gmp_goeckeler_Overlay.root");
示例7: RemoveKeyboardInputFilter
void Window::RemoveKeyboardInputFilter(IKeyboardInput* pkeyboardInput)
{
g_listKeyboardInputFilters.Remove(pkeyboardInput);
}
示例8: q4gmn_jan2009
//.........这里部分代码省略.........
wgr->Add(gr,"p");
wlg->AddEntry(gr,f->label,"p");
}
else {
wgr->Add(gr,"l");
wlg->AddEntry(gr,f->label,"l");
}
}
f++;
}
mgrThry->Draw("c");
legThry->Draw();
// draw a line at 1
cn->Modified();
cn->Update();
TFrame* frame = gPad->GetFrame();
TLine *line1 = new TLine(frame->GetX1(),1.,frame->GetX2(),1.);
line1->SetLineStyle(1);
line1->Draw();
cn->Update();
cn->SaveAs(Form("%s.eps",psfile));
cn->SaveAs(Form("%s.root",psfile));
gSystem->Exec(Form("./replace_symbols.pl %s.eps",psfile));
return;
// remove everything but the graph
cn->Update();
TList *clist = cn->GetListOfPrimitives();
frame = cn->GetFrame();
for (int i=0; i<clist->GetSize(); ) {
if (clist->At(i) != frame) {
clist->RemoveAt(i);
} else i++;
}
// draw markers in the corners
TMarker *mkr = new TMarker(frame->GetX1(),frame->GetY1(),2);
mkr->Draw();
mkr = new TMarker(frame->GetX2(),frame->GetY1(),2);
mkr->Draw();
mkr = new TMarker(frame->GetX1(),frame->GetY2(),2);
mkr->Draw();
mkr = new TMarker(frame->GetX2(),frame->GetY2(),2);
mkr->Draw();
frame->SetLineColor(10);
cn->Update();
{
datafile_t miller = { "figure_input/Miller/lattice.GMn.rtf","Miller",
"[0]","[1]/(-1.91)*(1+[0]/.71)*(1+[0]/.71)",
"([3]-[1])/(-1.91)*(1+[0]/.71)*(1+[0]/.71)",
"([1]-[2])/(-1.91)*(1+[0]/.71)*(1+[0]/.71)",
0,0,1,3,"F" };
gr = OneGraph(&miller);
TGraphAsymmErrors* egr = dynamic_cast<TGraphAsymmErrors*>(gr);
if (egr && egr->GetEYhigh() && egr->GetEYhigh()[egr->GetN()/2]>0) {
gr = toerror_band(egr);
gr->SetLineStyle(1);
gr->SetFillColor(gr->GetLineColor());
gr->SetFillStyle(3000+miller.style);
}
gr->Draw("F");
cn->Update();
cn->SaveAs("gmngd_Miller_Overlay.eps");
cn->SaveAs("gmngd_Miller_Overlay.root");
clist->Remove(gr);
}
{
datafile_t miller_spl = { "figure_input/Miller/lattice.GMn.spl3","Miller",
"[0]","[1]/(-1.91)*(1+[0]/.71)*(1+[0]/.71)",
"([3]-[1])/(-1.91)*(1+[0]/.71)*(1+[0]/.71)",
"([1]-[2])/(-1.91)*(1+[0]/.71)*(1+[0]/.71)",
0,0,1,3,"F" };
gr = OneGraph(&miller_spl);
TGraphAsymmErrors* egr = dynamic_cast<TGraphAsymmErrors*>(gr);
if (egr && egr->GetEYhigh() && egr->GetEYhigh()[egr->GetN()/2]>0) {
gr = toerror_band(egr);
gr->SetLineStyle(1);
gr->SetFillColor(gr->GetLineColor());
gr->SetFillStyle(3000+miller_spl.style);
}
gr->Draw("F");
cn->Update();
cn->SaveAs("gmngd_Miller_Overlay_spl.eps");
cn->SaveAs("gmngd_Miller_Overlay_spl.root");
clist->Remove(gr);
}
}