本文整理汇总了C++中TH2I::SetStats方法的典型用法代码示例。如果您正苦于以下问题:C++ TH2I::SetStats方法的具体用法?C++ TH2I::SetStats怎么用?C++ TH2I::SetStats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TH2I
的用法示例。
在下文中一共展示了TH2I::SetStats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: frameStack2_Mall
//.........这里部分代码省略.........
for(int x=0;x<width;x++){
for(int y=0;y<height;y++){
if(frame[x][y]>0){
frameHisto->Fill(x,y,frame[x][y]);
frameHistoAll->Fill(x,y,frame[x][y]);
if(y>580 && y<610){
chamber1->Fill(x,frame[x][y]);
chamber1All->Fill(x,frame[x][y]);
}
else if(y>400 && y<440){
chamber2->Fill(x,frame[x][y]);
chamber2All->Fill(x,frame[x][y]);
}
else if(y>240 && y<280){
chamber3->Fill(x,frame[x][y]);
chamber3All->Fill(x,frame[x][y]);
}
else if(y>50 && y<100){
chamber4->Fill(x,frame[x][y]);
chamber4All->Fill(x,frame[x][y]);
}
}
}
}
cout << "Stacking frame number " << pNum << "\r";//this overwrites the line every time
}
cout << endl;
//output the plot of the stacked images
TCanvas *pc2 = new TCanvas("pc2","Stacked Frames",0,0,600,800);
pc2->cd();
frameHisto->SetStats(false);
frameHisto->Draw("colz");
frameHisto->GetXaxis()->SetTitle("X position (px)");
//frameHisto->GetXaxis()->SetTitleSize(0.055);
//frameHisto->GetXaxis()->SetTitleOffset(1.0);
//frameHisto->GetXaxis()->SetLabelSize(0.055);
frameHisto->GetXaxis()->CenterTitle();
frameHisto->GetYaxis()->SetTitle("Y position (px)");
//frameHisto->GetYaxis()->SetTitleSize(0.055);
//frameHisto->GetYaxis()->SetTitleOffset(0.9);
//frameHisto->GetYaxis()->SetLabelSize(0.055);
frameHisto->GetYaxis()->CenterTitle();
gPad->Update();
// pc2->Print("chamberStack.png");//output to a graphics file
//plot the projection onto the Y axis (so we can find our cuts in Y to select each chamber)
TCanvas *projC = new TCanvas("projC","",0,0,800,600);
projC->cd();
TH1D *ydist = frameHisto->ProjectionY("ydist");
ydist->Draw();
ydist->GetYaxis()->SetTitle("Entries");
ydist->GetYaxis()->CenterTitle();
TCanvas *sliceX = new TCanvas("sliceX","",0,0,800,600);
sliceX->Divide(2,2);
sliceX->cd(1);
chamber1->Draw();
chamber1->GetXaxis()->SetTitle("X position (px)");
chamber1->GetXaxis()->CenterTitle();
chamber1->GetYaxis()->SetTitle("Y position (px)");