本文整理汇总了C++中TIter::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ TIter::Reset方法的具体用法?C++ TIter::Reset怎么用?C++ TIter::Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIter
的用法示例。
在下文中一共展示了TIter::Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw_network
void draw_network(TDirectory* d)
{
Bool_t __PRINT_LOGO__ = kTRUE;
// create canvas
TStyle* TMVAStyle = gROOT->GetStyle("TMVA"); // the TMVA style
Int_t canvasColor = TMVAStyle->GetCanvasColor(); // backup
TMVAStyle->SetCanvasColor( c_DarkBackground );
static icanvas = -1;
icanvas++;
TCanvas* c = new TCanvas( Form( "c%i", icanvas ), Form("Neural Network Layout for: %s", d->GetName()),
100 + (icanvas)*40, 0 + (icanvas+1)*20, 1000, 650 );
TIter next = d->GetListOfKeys();
TKey *key;
TString hName = "weights_hist";
Int_t numHists = 0;
// loop over all histograms with hName in name
while (key = (TKey*)next()) {
TClass *cl = gROOT->GetClass(key->GetClassName());
if (!cl->InheritsFrom("TH2F")) continue;
TH2F *h = (TH2F*)key->ReadObj();
if (TString(h->GetName()).Contains( hName )) {
numHists++;
}
}
// loop over all histograms with hName in name again
next.Reset();
Double_t maxWeight = 0;
// find max weight
while (key = (TKey*)next()) {
//cout << "Title: " << key->GetTitle() << endl;
TClass *cl = gROOT->GetClass(key->GetClassName());
if (!cl->InheritsFrom("TH2F")) continue;
TH2F* h = (TH2F*)key->ReadObj();
if (TString(h->GetName()).Contains( hName )){
Int_t n1 = h->GetNbinsX();
Int_t n2 = h->GetNbinsY();
for (Int_t i = 0; i < n1; i++) {
for (Int_t j = 0; j < n2; j++) {
Double_t weight = TMath::Abs(h->GetBinContent(i+1, j+1));
if (maxWeight < weight) maxWeight = weight;
}
}
}
}
// draw network
next.Reset();
Int_t count = 0;
while (key = (TKey*)next()) {
TClass *cl = gROOT->GetClass(key->GetClassName());
if (!cl->InheritsFrom("TH2F")) continue;
TH2F* h = (TH2F*)key->ReadObj();
if (TString(h->GetName()).Contains( hName )){
draw_layer(c, h, count++, numHists+1, maxWeight);
}
}
draw_layer_labels(numHists+1);
// ============================================================
if (__PRINT_LOGO__) TMVAGlob::plot_logo();
// ============================================================
c->Update();
TString fname = "plots/network";
TMVAGlob::imgconv( c, fname );
TMVAStyle->SetCanvasColor( canvasColor );
}