int nRebin = 5; /* ======================================================== */ void PlotData(const char *rootFile) { /* Plots of the results of one measurement rootFile = root file name with the plots as canvas */ char fname[200]; char hname[200]; char file[200]; /* ****************************************/ /* Opening the root file */ TFile *fRoot = new TFile(rootFile); //fRoot->ls(); /********************************************/ /* Root canvas */ TCanvas *c1 = new TCanvas("c1", ""); int nx = 3; int ny = 2; c1->Divide(nx, ny); /*******************************************************/ /* file pdf */ sprintf(fname, "%s.pdf", rootFile); c1->Print(Form("%s[", fname)); /* Getting the canvas of the spot */ sprintf(hname, "grSpot"); TCanvas *cSpot = (TCanvas*)fRoot->Get(hname); c1->cd(1); cSpot->SetLogz(); //cSpot->DrawClonePad(); gStyle->SetOptStat(0); TH2F *Spot = (TH2F*)cSpot->GetPrimitive("Spot"); Spot->RebinX(nRebin); Spot->RebinY(nRebin); gPad->SetLogz(); Spot->Draw("colz"); /* Getting the projections of the spot */ sprintf(hname, "PrX"); TCanvas *cPrX = (TCanvas*)fRoot->Get(hname); c1->cd(4); cPrX->SetGrid(); cPrX->DrawClonePad(); sprintf(hname, "PrY"); TCanvas *cPrY = (TCanvas*)fRoot->Get(hname); c1->cd(2); cPrY->SetGrid(); cPrY->DrawClonePad(); /* Getting the canvas of the D0 */ sprintf(hname, "grD0"); TCanvas *cD0 = (TCanvas*)fRoot->Get(hname); c1->cd(3); cD0->SetGrid(); cD0->DrawClonePad(); /* Getting the canvas of the running intensity */ sprintf(hname, "Int"); TCanvas *cInt = (TCanvas*)fRoot->Get(hname); c1->cd(6); cInt->SetGrid(); cInt->DrawClonePad(); c1->Print(Form("%s", fname)); /*******************************************/ /* END */ c1->Print(Form("%s]", fname)); c1->Close(); fRoot->Close(); return; }