--- calo/flight/FQLOOK/macros/FCaloQLOOK.cxx 2006/07/17 08:51:11 1.12 +++ calo/flight/FQLOOK/macros/FCaloQLOOK.cxx 2006/08/04 15:24:01 1.14 @@ -43,6 +43,7 @@ #include #include #include +#include // #include #include @@ -85,13 +86,15 @@ return file2; } -void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){ +void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "png", Bool_t iactive =false, Bool_t w4i=false){ gStyle->SetPaperSize(19.,25.); const char* startingdir = gSystem->WorkingDirectory(); // printf(" basename is %s \n",gSystem->BaseName(filename.Data())); // printf(" getfilename is %s \n",getFilename(filename).Data()); if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; // + TApplication *app = 0; + if ( iactive ) app = new TApplication("app",0,0); // ifstream myfile; myfile.open(filename.Data()); @@ -995,10 +998,12 @@ Calstriphit->Draw("SAME"); // pd4->cd(); + gPad->SetLogy(); Dexy->SetXTitle("ADC channels"); Dexy->SetYTitle("Number of events"); Dexy->Draw(); - h1max = Dexy->GetMaximum()*1.05; + // h1max = Dexy->GetMaximum()*1.05; + h1max = Dexy->GetMaximum()*2.05; Double_t xd[4] = {2000.,5000.,5000.,2000.}; Double_t yd[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xd,yd); @@ -1034,10 +1039,12 @@ pd4->Draw(); // pd4->cd(); + gPad->SetLogy(); Dexy->SetXTitle("ADC channels"); Dexy->SetYTitle("Number of events"); Dexy->Draw(); - h1max = Dexy->GetMaximum()*1.05; + // h1max = Dexy->GetMaximum()*1.05; + h1max = Dexy->GetMaximum()*2.05; Double_t xd[4] = {2000.,5000.,5000.,2000.}; Double_t yd[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xd,yd); @@ -1505,5 +1512,11 @@ figsave << format; rapporto->SaveAs(figsave.str().c_str()); }; + if ( iactive && w4i ){ + while ( gROOT->GetListOfCanvases()->FindObject(rapporto) || gROOT->GetListOfCanvases()->FindObject(figura3) || gROOT->GetListOfCanvases()->FindObject(figura2) || gROOT->GetListOfCanvases()->FindObject(figura) ){ + gSystem->ProcessEvents(); + gSystem->Sleep(10); + }; + }; }