本文整理汇总了C++中TImage::Flip方法的典型用法代码示例。如果您正苦于以下问题:C++ TImage::Flip方法的具体用法?C++ TImage::Flip怎么用?C++ TImage::Flip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TImage
的用法示例。
在下文中一共展示了TImage::Flip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TFile
void eventviewer::viewEvent_1() //Event viewer
{
//open beta
gStyle->SetOptStat(0);
aida_beta.GetTreeBETA(sinfile);
if (aida_beta.fChain==0) return;
//output
TFile* rootfile=new TFile(soutfile,"RECREATE");
//histograms
TCanvas* c1=new TCanvas("ss","ss",600,600);
TCanvas *c2rot = new TCanvas("c2rot","c2rot",300,300);
c1->Divide(2,2);
TH1F* hisx=new TH1F("hisX","hisX",128,0,128);
TH1F* hisy=new TH1F("hisY","hisY",128,0,128);
TH2F* hisxy=new TH2F("hisXY","hisXY",128,0,128,128,0,128);
TH1I* hisTX=new TH1I("hisTX","hisTX",200,-1500,1500);
TH1I* hisTY=new TH1I("hisTY","hisTY",200,-1500,1500);
//Start reading input file!
Long64_t nentries = aida_beta.GetEntries();
cout<<"Total entries="<<nentries<<endl;
Long64_t nbytes = 0, nb = 0;
Long64_t entriestobreak=nentries+10;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
Long64_t ientry=aida_beta.LoadTree(jentry);
if (ientry<0) break;
nb=aida_beta.GetEntry(jentry);nbytes+=nb;
Double_t percent_complete=(Double_t)jentry/(Double_t)nentries*100;
if (jentry%3000==0) cout<<percent_complete<<" % data piece proceeded"<<endl;
//if (rawaida.Cut(ientry) < 0) continue;
if (jentry>entriestobreak) break;
hisx->Reset();
hisy->Reset();
hisxy->Reset();
hisTX->Reset();
hisTY->Reset();
hisx->SetTitle(Form("hisX%d",(Int_t)jentry));
hisy->SetTitle(Form("hisY%d",(Int_t)jentry));
hisxy->SetTitle(Form("hisXY%d",(Int_t)jentry));
Double_t totalExy=0;
//if (aida_beta.dssd_Z_mult[0]>0){
//if (aida_beta.pos_index_beta[0]==0&&aida_beta.npos_beta[0]>0){
for (Int_t i=0;i<128;i++){
Double_t ex=(Double_t)aida_beta.dssdH_E_X[0][i][0];
Double_t ey=(Double_t)aida_beta.dssdH_E_Y[0][i][0];
if (ex<0) ex=0.;
if (ey<0) ey=0.;
hisx->Fill(i,ex);
hisy->Fill(i,ey);
if (ex>0) hisTX->Fill(aida_beta.dssdH_T_X[0][i][0]-aida_beta.timestamp,ex);
if (ey>0) hisTY->Fill(aida_beta.dssdH_T_Y[0][i][0]-aida_beta.timestamp,ey);
for (Int_t j=0;j<128;j++){
Double_t eyy=(Double_t)aida_beta.dssdH_E_Y[0][j][0];
if (eyy<0) eyy=0.;
Double_t exy=ex+eyy;
hisxy->Fill(i,j,exy);
totalExy+=exy;
}
}
//perform operation here
//Draw to Canvas
//if (totalExy>0){
//if (aida_beta.dssd_Z_mult[0]>0){
c2rot->cd();
hisy->SetFillColor(3);
hisy->SetLineColor(3);
hisy->GetYaxis()->SetRangeUser(0,3000);
hisy->Draw();
c2rot->Update();
TImage *img = TImage::Create();
img->FromPad(c2rot);
cout<<"Entry="<<jentry<<endl;
c1->cd(1);
img->Flip(90);
img->Draw("x");
//hisy->Draw("his");
c1->cd(2);
hisxy->SetMaximum(3000);
hisxy->Draw("colz");
//Draw hit position
/*
//Get Hit position
Int_t beta_mult;
map<Int_t, vector<pair<pair<Double_t,Double_t>,pair<Double_t,Double_t> > > > map_beta;
map<Int_t, vector<pair<pair<Double_t,Double_t>,pair<Double_t,Double_t> > > >::iterator imap_beta;
map_beta.clear();
aida_beta.BetaGetPosNEW(0.3,beta_mult,map_beta);
TMarker* mk[beta_mult];
imap_beta = map_beta.find(0);
if(imap_beta != map_beta.end()){
Int_t beta_x = -1,beta_y = -1;
for(unsigned int jj=0; jj<imap_beta->second.size(); jj++){
beta_x=imap_beta->second[jj].first.first;
beta_y=imap_beta->second[jj].second.first;
//.........这里部分代码省略.........