/[PAMELA software]/calo/flight/FQLOOK/macros/FCaloQLOOK.cxx
ViewVC logotype

Diff of /calo/flight/FQLOOK/macros/FCaloQLOOK.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by mocchiut, Mon Jul 17 08:51:11 2006 UTC revision 1.14 by mocchiut, Fri Aug 4 15:24:01 2006 UTC
# Line 43  Line 43 
43  #include <TPolyLine.h>  #include <TPolyLine.h>
44  #include <TStyle.h>  #include <TStyle.h>
45  #include <TSystem.h>  #include <TSystem.h>
46    #include <TApplication.h>
47  //  //
48  #include <PamelaRun.h>  #include <PamelaRun.h>
49  #include <physics/calorimeter/CalorimeterEvent.h>  #include <physics/calorimeter/CalorimeterEvent.h>
# Line 85  TString getFilename(const TString filena Line 86  TString getFilename(const TString filena
86    return file2;    return file2;
87  }  }
88    
89  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){
90    gStyle->SetPaperSize(19.,25.);    gStyle->SetPaperSize(19.,25.);
91    const char* startingdir = gSystem->WorkingDirectory();    const char* startingdir = gSystem->WorkingDirectory();
92    //  printf(" basename is %s \n",gSystem->BaseName(filename.Data()));    //  printf(" basename is %s \n",gSystem->BaseName(filename.Data()));
93    //  printf(" getfilename is %s \n",getFilename(filename).Data());    //  printf(" getfilename is %s \n",getFilename(filename).Data());
94    if ( !strcmp(outDir.Data(),"") ) outDir = startingdir;    if ( !strcmp(outDir.Data(),"") ) outDir = startingdir;
95    //    //
96      TApplication *app = 0;
97      if ( iactive ) app = new TApplication("app",0,0);
98    //    //
99    ifstream myfile;    ifstream myfile;
100    myfile.open(filename.Data());    myfile.open(filename.Data());
# Line 995  void FCaloQLOOK(TString filename, Int_t Line 998  void FCaloQLOOK(TString filename, Int_t
998      Calstriphit->Draw("SAME");      Calstriphit->Draw("SAME");
999      //      //
1000      pd4->cd();      pd4->cd();
1001        gPad->SetLogy();
1002      Dexy->SetXTitle("ADC channels");      Dexy->SetXTitle("ADC channels");
1003      Dexy->SetYTitle("Number of events");      Dexy->SetYTitle("Number of events");
1004      Dexy->Draw();      Dexy->Draw();
1005      h1max = Dexy->GetMaximum()*1.05;      //    h1max = Dexy->GetMaximum()*1.05;
1006        h1max = Dexy->GetMaximum()*2.05;
1007      Double_t xd[4] = {2000.,5000.,5000.,2000.};      Double_t xd[4] = {2000.,5000.,5000.,2000.};
1008      Double_t yd[4] = {0.,0.,h1max,h1max};      Double_t yd[4] = {0.,0.,h1max,h1max};
1009      banda1 = new TPolyLine(4,xd,yd);      banda1 = new TPolyLine(4,xd,yd);
# Line 1034  void FCaloQLOOK(TString filename, Int_t Line 1039  void FCaloQLOOK(TString filename, Int_t
1039      pd4->Draw();      pd4->Draw();
1040      //      //
1041      pd4->cd();      pd4->cd();
1042        gPad->SetLogy();
1043      Dexy->SetXTitle("ADC channels");      Dexy->SetXTitle("ADC channels");
1044      Dexy->SetYTitle("Number of events");      Dexy->SetYTitle("Number of events");
1045      Dexy->Draw();      Dexy->Draw();
1046      h1max = Dexy->GetMaximum()*1.05;      //    h1max = Dexy->GetMaximum()*1.05;
1047        h1max = Dexy->GetMaximum()*2.05;
1048      Double_t xd[4] = {2000.,5000.,5000.,2000.};      Double_t xd[4] = {2000.,5000.,5000.,2000.};
1049      Double_t yd[4] = {0.,0.,h1max,h1max};      Double_t yd[4] = {0.,0.,h1max,h1max};
1050      banda1 = new TPolyLine(4,xd,yd);      banda1 = new TPolyLine(4,xd,yd);
# Line 1505  void FCaloQLOOK(TString filename, Int_t Line 1512  void FCaloQLOOK(TString filename, Int_t
1512      figsave << format;      figsave << format;
1513      rapporto->SaveAs(figsave.str().c_str());          rapporto->SaveAs(figsave.str().c_str());    
1514    };    };
1515      if ( iactive && w4i ){
1516        while ( gROOT->GetListOfCanvases()->FindObject(rapporto) || gROOT->GetListOfCanvases()->FindObject(figura3) || gROOT->GetListOfCanvases()->FindObject(figura2) || gROOT->GetListOfCanvases()->FindObject(figura) ){
1517          gSystem->ProcessEvents();
1518          gSystem->Sleep(10);
1519        };
1520      };
1521  }  }
1522    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.23