// Some of the original files this macro was developed with // plane004 000deg 2008_11_06 09_26_26.root // plane999 999deg 2008_10_26 20_28_06.root // plane999 999deg 2008_10_30 22_43_12.root // plane999 999deg 2008_11_06 08_01_58.root // plane999 999deg 2008_11_06 08_31_51.root // plane999 999deg 2008_11_06 08_51_09.root //---------------- // fdc_rms //---------------- void fdc_rms(const char *fname="plane004 000deg 2008_11_06 09_26_26.root") { gROOT->Reset(); gStyle->SetPalette(1); gStyle->SetPadRightMargin(0.125); // Open ROOT file and get pointer to scan TTree TFile *f = new TFile(fname); TH2D *depth_rms = (TH2D*)gROOT->FindObject("depth_rms"); // Create a canvas to draw in later TCanvas *c1 = new TCanvas("c1", "", 650, 600); c1->SetTickx(); c1->SetTicky(); // Plot the rms depth_rms->GetZaxis()->SetRangeUser(0.0, 100.0); depth_rms->Draw("colz"); // Draw a circle indicating the active area double x_center=56.0; double y_center=51.5; TEllipse *e = new TEllipse(x_center, y_center, 48.5, 48.5); e->SetLineColor(kBlack); e->SetLineWidth(3); e->SetLineStyle(2); e->SetFillStyle(0); e->Draw(); // Label color ramp units TLatex *lab = new TLatex(120, 105, "microns"); lab->SetTextSize(0.03); lab->SetTextAlign(21); lab->Draw(); // Define output directory and make sure it exists char imagesdir[512]; sprintf(imagesdir,"images/%s",fname); imagesdir[strlen(imagesdir)-5] = 0; char cmd[256]; sprintf(cmd, "mkdir -p \"%s\"", imagesdir); system(cmd); // Write plots to output directory char filename[256]; sprintf(filename,"%s/fdc_rms.gif", imagesdir); c1->SaveAs(filename); sprintf(filename,"%s/fdc_rms.pdf", imagesdir); c1->SaveAs(filename); }