Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:32:54

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // Macro to compare histograms from the GlobalRecHitsProducer for validation
0003 //
0004 // root -b -q MakeValidation.C
0005 ///////////////////////////////////////////////////////////////////////////////
0006 #include "TFile.h"
0007 #include "TTree.h"
0008 #include "TBranch.h"
0009 #include "TString.h"
0010 
0011 void MakeValidation(TString sfilename = "GlobalRecHitsHistograms.root",
0012             TString rfilename = 
0013             "GlobalRecHitsHistograms.root",
0014             TString filename = "GlobalRecHitsHistogramsCompare")
0015 {
0016   gROOT->Reset();
0017 
0018   // zoom in on x-axis of plots
0019   bool zoomx = false;
0020 
0021   // create new histograms for comparison
0022   //gROOT->LoadMacro("MakeHistograms.C");
0023   //MakeHistograms();
0024 
0025   // setup names
0026   //TString sfilename = "GlobalRecHitsHistograms.root";
0027   //TString rfilename = "GlobalRecHitsHistograms-reference.root";
0028 
0029   // clear memory of file names
0030   delete gROOT->GetListOfFiles()->FindObject(sfilename);
0031   delete gROOT->GetListOfFiles()->FindObject(rfilename);
0032 
0033   // open reference file
0034   TFile *sfile = new TFile(sfilename);
0035   TFile *rfile = new TFile(rfilename);
0036 
0037   // create canvas
0038   Int_t cWidth = 928, cHeight = 1218;
0039   TCanvas *myCanvas = new TCanvas("globalrechits","globalrechits");
0040 
0041   // open output ps file
0042   //TString filename = "GlobalRecHitsHistogramsCompare";
0043   TString psfile = filename+".ps";
0044   TString psfileopen = filename+".ps[";
0045   TString psfileclose = filename+".ps]";
0046   myCanvas->Print(psfileopen);
0047 
0048   // create label
0049   TLatex *label = new TLatex();
0050   label->SetNDC();
0051   label->SetTextSize(0.03);
0052   label->SetTextAlign(22);
0053   TString labeltitle;
0054 
0055   // ceate text
0056   TText* te = new TText();
0057   te->SetTextSize(0.075);
0058 
0059   // create attributes
0060   Int_t rcolor = kBlue;
0061   Int_t rtype = kSolid;
0062   Int_t stype = kSolid;
0063   Int_t scolor = kBlack;
0064   Int_t rlinewidth = 6;
0065   Int_t slinewidth = 2;
0066 
0067   vector<Int_t> histnames;
0068 
0069   vector<string> eehistname;
0070   eehistname.push_back("hEcaln_EE");
0071   eehistname.push_back("hEcalRes_EE");
0072   histnames.push_back(0);
0073 
0074   vector<string> ebhistname;
0075   ebhistname.push_back("hEcaln_EB");
0076   ebhistname.push_back("hEcalRes_EB");
0077   histnames.push_back(1);
0078 
0079   vector<string> eshistname;
0080   eshistname.push_back("hEcaln_ES");
0081   eshistname.push_back("hEcalRes_ES");
0082   histnames.push_back(2);
0083 
0084   vector<string> hbhistname;
0085   hbhistname.push_back("hHcaln_HB");
0086   hbhistname.push_back("hHcalRes_HB");
0087   histnames.push_back(3);
0088 
0089   vector<string> hehistname;
0090   hehistname.push_back("hHcaln_HE");
0091   hehistname.push_back("hHcalRes_HE");
0092   histnames.push_back(4);
0093 
0094   vector<string> hohistname;
0095   hohistname.push_back("hHcaln_HO");
0096   hohistname.push_back("hHcalRes_HO");
0097   histnames.push_back(5);
0098 
0099   vector<string> hfhistname;
0100   hfhistname.push_back("hHcaln_HF");
0101   hfhistname.push_back("hHcalRes_HF");
0102   histnames.push_back(6);
0103 
0104   vector<string> tibl1histname;
0105   tibl1histname.push_back("hSiStripn_TIBL1");
0106   tibl1histname.push_back("hSiStripResX_TIBL1");
0107   tibl1histname.push_back("hSiStripResY_TIBL1");
0108   histnames.push_back(7);
0109 
0110   vector<string> tibl2histname;
0111   tibl2histname.push_back("hSiStripn_TIBL2");
0112   tibl2histname.push_back("hSiStripResX_TIBL2");
0113   tibl2histname.push_back("hSiStripResY_TIBL2");
0114   histnames.push_back(8);
0115 
0116   vector<string> tibl3histname;
0117   tibl3histname.push_back("hSiStripn_TIBL3");
0118   tibl3histname.push_back("hSiStripResX_TIBL3");
0119   tibl3histname.push_back("hSiStripResY_TIBL3");
0120   histnames.push_back(9);
0121 
0122   vector<string> tibl4histname;
0123   tibl4histname.push_back("hSiStripn_TIBL4");
0124   tibl4histname.push_back("hSiStripResX_TIBL4");
0125   tibl4histname.push_back("hSiStripResY_TIBL4");
0126   histnames.push_back(10);
0127 
0128   vector<string> tobl1histname;
0129   tobl1histname.push_back("hSiStripn_TOBL1");
0130   tobl1histname.push_back("hSiStripResX_TOBL1");
0131   tobl1histname.push_back("hSiStripResY_TOBL1");
0132   histnames.push_back(11);
0133 
0134   vector<string> tobl2histname;
0135   tobl2histname.push_back("hSiStripn_TOBL2");
0136   tobl2histname.push_back("hSiStripResX_TOBL2");
0137   tobl2histname.push_back("hSiStripResY_TOBL2");
0138   histnames.push_back(12);
0139 
0140   vector<string> tobl3histname;
0141   tobl3histname.push_back("hSiStripn_TOBL3");
0142   tobl3histname.push_back("hSiStripResX_TOBL3");
0143   tobl3histname.push_back("hSiStripResY_TOBL3");
0144   histnames.push_back(13);
0145 
0146   vector<string> tobl4histname;
0147   tobl4histname.push_back("hSiStripn_TOBL4");
0148   tobl4histname.push_back("hSiStripResX_TOBL4");
0149   tobl4histname.push_back("hSiStripResY_TOBL4");
0150   histnames.push_back(14);
0151 
0152   vector<string> tidw1histname;
0153   tidw1histname.push_back("hSiStripn_TIDW1");
0154   tidw1histname.push_back("hSiStripResX_TIDW1");
0155   tidw1histname.push_back("hSiStripResY_TIDW1");
0156   histnames.push_back(15);
0157 
0158   vector<string> tidw2histname;
0159   tidw2histname.push_back("hSiStripn_TIDW2");
0160   tidw2histname.push_back("hSiStripResX_TIDW2");
0161   tidw2histname.push_back("hSiStripResY_TIDW2");
0162   histnames.push_back(16);
0163 
0164   vector<string> tidw3histname;
0165   tidw3histname.push_back("hSiStripn_TIDW3");
0166   tidw3histname.push_back("hSiStripResX_TIDW3");
0167   tidw3histname.push_back("hSiStripResY_TIDW3");
0168   histnames.push_back(17);
0169 
0170   vector<string> tecw1histname;
0171   tecw1histname.push_back("hSiStripn_TECW1");
0172   tecw1histname.push_back("hSiStripResX_TECW1");
0173   tecw1histname.push_back("hSiStripResY_TECW1");
0174   histnames.push_back(18);
0175 
0176   vector<string> tecw2histname;
0177   tecw2histname.push_back("hSiStripn_TECW2");
0178   tecw2histname.push_back("hSiStripResX_TECW2");
0179   tecw2histname.push_back("hSiStripResY_TECW2");
0180   histnames.push_back(19);
0181 
0182   vector<string> tecw3histname;
0183   tecw3histname.push_back("hSiStripn_TECW3");
0184   tecw3histname.push_back("hSiStripResX_TECW3");
0185   tecw3histname.push_back("hSiStripResY_TECW3");
0186   histnames.push_back(20);
0187 
0188   vector<string> tecw4histname;
0189   tecw4histname.push_back("hSiStripn_TECW4");
0190   tecw4histname.push_back("hSiStripResX_TECW4");
0191   tecw4histname.push_back("hSiStripResY_TECW4");
0192   histnames.push_back(21);
0193 
0194   vector<string> tecw5histname;
0195   tecw5histname.push_back("hSiStripn_TECW5");
0196   tecw5histname.push_back("hSiStripResX_TECW5");
0197   tecw5histname.push_back("hSiStripResY_TECW5");
0198   histnames.push_back(22);
0199 
0200   vector<string> tecw6histname;
0201   tecw6histname.push_back("hSiStripn_TECW6");
0202   tecw6histname.push_back("hSiStripResX_TECW6");
0203   tecw6histname.push_back("hSiStripResY_TECW6");
0204   histnames.push_back(23);
0205 
0206   vector<string> tecw7histname;
0207   tecw7histname.push_back("hSiStripn_TECW7");
0208   tecw7histname.push_back("hSiStripResX_TECW7");
0209   tecw7histname.push_back("hSiStripResY_TECW7");
0210   histnames.push_back(24);
0211 
0212   vector<string> tecw8histname;
0213   tecw8histname.push_back("hSiStripn_TECW8");
0214   tecw8histname.push_back("hSiStripResX_TECW8");
0215   tecw8histname.push_back("hSiStripResY_TECW8");
0216   histnames.push_back(25);
0217 
0218   vector<string> brl1histname;
0219   brl1histname.push_back("hSiPixeln_BRL1");
0220   brl1histname.push_back("hSiPixelResX_BRL1");
0221   brl1histname.push_back("hSiPixelResY_BRL1");
0222   histnames.push_back(26);
0223 
0224   vector<string> brl2histname;
0225   brl2histname.push_back("hSiPixeln_BRL2");
0226   brl2histname.push_back("hSiPixelResX_BRL2");
0227   brl2histname.push_back("hSiPixelResY_BRL2");
0228   histnames.push_back(27);
0229 
0230   vector<string> brl3histname;
0231   brl3histname.push_back("hSiPixeln_BRL3");
0232   brl3histname.push_back("hSiPixelResX_BRL3");
0233   brl3histname.push_back("hSiPixelResY_BRL3");
0234   histnames.push_back(28);
0235 
0236   vector<string> fwd1phistname;
0237   fwd1phistname.push_back("hSiPixeln_FWD1p");
0238   fwd1phistname.push_back("hSiPixelResX_FWD1p");
0239   fwd1phistname.push_back("hSiPixelResY_FWD1p");
0240   histnames.push_back(29);
0241 
0242   vector<string> fwd1nhistname;
0243   fwd1nhistname.push_back("hSiPixeln_FWD1n");
0244   fwd1nhistname.push_back("hSiPixelResX_FWD1n");
0245   fwd1nhistname.push_back("hSiPixelResY_FWD1n");
0246   histnames.push_back(30);
0247 
0248   vector<string> fwd2phistname;
0249   fwd2phistname.push_back("hSiPixeln_FWD2p");
0250   fwd2phistname.push_back("hSiPixelResX_FWD2p");
0251   fwd2phistname.push_back("hSiPixelResY_FWD2p");
0252   histnames.push_back(31);
0253 
0254   vector<string> fwd2nhistname;
0255   fwd2nhistname.push_back("hSiPixeln_FWD2n");
0256   fwd2nhistname.push_back("hSiPixelResX_FWD2n");
0257   fwd2nhistname.push_back("hSiPixelResY_FWD2n");
0258   histnames.push_back(32);
0259 
0260   vector<string> dthistname;
0261   dthistname.push_back("hDtMuonn");
0262   dthistname.push_back("hDtMuonRes");
0263   histnames.push_back(33);
0264 
0265   vector<string> cschistname;
0266   cschistname.push_back("hCSCn");
0267   cschistname.push_back("CSCResRDPhi");
0268   histnames.push_back(34);
0269 
0270   vector<string> rpchistname;
0271   rpchistname.push_back("hRPCn");
0272   rpchistname.push_back("hRPCResX");
0273   histnames.push_back(35);
0274 
0275   //loop through histograms to prepare output
0276   for (Int_t i = 0; i < histnames.size(); ++i) {
0277 
0278     Int_t page = histnames[i];
0279 
0280     vector<string> names;
0281     //bool logy3 = kFALSE;
0282     //bool logy2 = kFALSE;
0283 
0284     // setup canvas depending on group of plots
0285     TCanvas *Canvas;
0286 
0287     if (page == 0) {
0288       //logy3 = kTRUE;
0289       names = eehistname;
0290       Canvas = new TCanvas("eecal","eecal" );
0291       Canvas->Divide(2,2);
0292       myCanvas = Canvas; myCanvas->cd(0);
0293     }
0294     if (page == 1) {
0295       //logy3 = kTRUE;
0296       names = ebhistname;
0297       Canvas = new TCanvas("ebcal","ebcal" );
0298       Canvas->Divide(2,2);
0299       myCanvas = Canvas; myCanvas->cd(0);
0300     }
0301     if (page == 2) {
0302       names = eshistname;
0303       Canvas = new TCanvas("escal","escal");
0304       Canvas->Divide(2,2);
0305       myCanvas = Canvas; myCanvas->cd(0);
0306     }
0307     if (page == 3) {
0308       //logy3 = kTRUE;
0309       names = hbhistname;
0310       Canvas = new TCanvas("hbcal","hbcal" );
0311       Canvas->Divide(2,2);
0312       myCanvas = Canvas; myCanvas->cd(0);
0313     }
0314     if (page == 4) {
0315       //logy3 = kTRUE;
0316       names = hehistname;
0317       Canvas = new TCanvas("hecal","hecal" );
0318       Canvas->Divide(2,2);
0319       myCanvas = Canvas; myCanvas->cd(0);
0320     }
0321     if (page == 5) {
0322       //logy3 = kTRUE;
0323       names = hohistname;
0324       Canvas = new TCanvas("hocal","hocal" );
0325       Canvas->Divide(2,2);
0326       myCanvas = Canvas; myCanvas->cd(0);
0327     }
0328     if (page == 6) {
0329       //logy3 = kTRUE;
0330       names = hfhistname;
0331       Canvas = new TCanvas("hfcal","hfcal");
0332       Canvas->Divide(2,2);
0333       myCanvas = Canvas; myCanvas->cd(0);
0334     }
0335     if (page == 7) {
0336       names = tibl1histname;
0337       Canvas = new TCanvas("tibl1","tibl1" );
0338       Canvas->Divide(2,2);
0339       myCanvas = Canvas; myCanvas->cd(0);
0340     }
0341     if (page == 8) {
0342       names = tibl2histname;
0343       Canvas = new TCanvas("tibl2","tibl2" );
0344       Canvas->Divide(2,2);
0345       myCanvas = Canvas; myCanvas->cd(0);
0346     }
0347     if (page == 9) {
0348       names = tibl3histname;
0349       Canvas = new TCanvas("tibl3","tibl3" );
0350       Canvas->Divide(2,2);
0351       myCanvas = Canvas; myCanvas->cd(0);
0352     }
0353     if (page == 10) {
0354       names = tibl4histname;
0355       Canvas = new TCanvas("tibl4","tibl4" );
0356       Canvas->Divide(2,2);
0357       myCanvas = Canvas; myCanvas->cd(0);
0358     }
0359     if (page == 11) {
0360       names = tobl1histname;
0361       Canvas = new TCanvas("tobl1","tobl1" );
0362       Canvas->Divide(2,2);
0363       myCanvas = Canvas; myCanvas->cd(0);
0364     }
0365     if (page == 12) {
0366       names = tobl2histname;
0367       Canvas = new TCanvas("tobl2","tobl2" );
0368       Canvas->Divide(2,2);
0369       myCanvas = Canvas; myCanvas->cd(0);
0370     }
0371     if (page == 13) {
0372       names = tobl3histname;
0373       Canvas = new TCanvas("tobl3","tobl3" );
0374       Canvas->Divide(2,2);
0375       myCanvas = Canvas; myCanvas->cd(0);
0376     }
0377     if (page == 14) {
0378       names = tobl4histname;
0379       Canvas = new TCanvas("tobl4","tobl4" );
0380       Canvas->Divide(2,2);
0381       myCanvas = Canvas; myCanvas->cd(0);
0382     }
0383     if (page == 15) {
0384       names = tidw1histname;
0385       Canvas = new TCanvas("tidw1","tidw1" );
0386       Canvas->Divide(2,2);
0387       myCanvas = Canvas; myCanvas->cd(0);
0388     }
0389     if (page == 16) {
0390       names = tidw2histname;
0391       Canvas = new TCanvas("tidw2","tidw2" );
0392       Canvas->Divide(2,2);
0393       myCanvas = Canvas; myCanvas->cd(0);
0394     }
0395     if (page == 17) {
0396       names = tidw3histname;
0397       Canvas = new TCanvas("tidw3","tidw3" );
0398       Canvas->Divide(2,2);
0399       myCanvas = Canvas; myCanvas->cd(0);
0400     }
0401     if (page == 18) {
0402       names = tecw1histname;
0403       Canvas = new TCanvas("tecw1","tecw1" );
0404       Canvas->Divide(2,2);
0405       myCanvas = Canvas; myCanvas->cd(0);
0406     }
0407     if (page == 19) {
0408       names = tecw2histname;
0409       Canvas = new TCanvas("tecw2","tecw2" );
0410       Canvas->Divide(2,2);
0411       myCanvas = Canvas; myCanvas->cd(0);
0412     }
0413     if (page == 20) {
0414       names = tecw3histname;
0415       Canvas = new TCanvas("tecw3","tecw3" );
0416       Canvas->Divide(2,2);
0417       myCanvas = Canvas; myCanvas->cd(0);
0418     }
0419     if (page == 21) {
0420       names = tecw4histname;
0421       Canvas = new TCanvas("tecw4","tecw4" );
0422       Canvas->Divide(2,2);
0423       myCanvas = Canvas; myCanvas->cd(0);
0424     }
0425     if (page == 22) {
0426       names = tecw5histname;
0427       Canvas = new TCanvas("tecw5","tecw5" );
0428       Canvas->Divide(2,2);
0429       myCanvas = Canvas; myCanvas->cd(0);
0430     }
0431     if (page == 23) {
0432       names = tecw6histname;
0433       Canvas = new TCanvas("tecw6","tecw6" );
0434       Canvas->Divide(2,2);
0435       myCanvas = Canvas; myCanvas->cd(0);
0436     }
0437     if (page == 24) {
0438       names = tecw7histname;
0439       Canvas = new TCanvas("tecw7","tecw7" );
0440       Canvas->Divide(2,2);
0441       myCanvas = Canvas; myCanvas->cd(0);
0442     }
0443     if (page == 25) {
0444       names = tecw8histname;
0445       Canvas = new TCanvas("tecw8","tecw8" );
0446       Canvas->Divide(2,2);
0447       myCanvas = Canvas; myCanvas->cd(0);
0448     }
0449     if (page == 26) {
0450       //logy2 = kTRUE;
0451       names = brl1histname;
0452       Canvas = new TCanvas("brl1","brl1" );
0453       Canvas->Divide(2,2);
0454       myCanvas = Canvas; myCanvas->cd(0);
0455     }
0456     if (page == 27) {
0457       //logy2 = kTRUE;
0458       names = brl2histname;
0459       Canvas = new TCanvas("brl2","brl2" );
0460       Canvas->Divide(2,2);
0461       myCanvas = Canvas; myCanvas->cd(0);
0462     }
0463     if (page == 28) {
0464       //logy2 = kTRUE;
0465       names = brl3histname;
0466       Canvas = new TCanvas("brl3","brl3" );
0467       Canvas->Divide(2,2);
0468       myCanvas = Canvas; myCanvas->cd(0);
0469     }
0470     if (page == 29) {
0471       //logy2 = kTRUE;
0472       names = fwd1phistname;
0473       Canvas = new TCanvas("fwd1p","fwd1p" );
0474       Canvas->Divide(2,2);
0475       myCanvas = Canvas; myCanvas->cd(0);
0476     }
0477     if (page == 30) {
0478       //logy2 = kTRUE;
0479       names = fwd1nhistname;
0480       Canvas = new TCanvas("fwd1n","fwd1n" );
0481       Canvas->Divide(2,2);
0482       myCanvas = Canvas; myCanvas->cd(0);
0483     }
0484     if (page == 31) {
0485       //logy2 = kTRUE;
0486       names = fwd2phistname;
0487       Canvas = new TCanvas("fwd2p","fwd2p" );
0488       Canvas->Divide(2,2);
0489       myCanvas = Canvas; myCanvas->cd(0);
0490     }
0491     if (page == 32) {
0492       //logy2 = kTRUE;
0493       names = fwd2nhistname;
0494       Canvas = new TCanvas("fwd2n","fwd2n" );
0495       Canvas->Divide(2,2);
0496       myCanvas = Canvas; myCanvas->cd(0);
0497     }
0498     if (page == 33) {
0499       names = dthistname;
0500       Canvas = new TCanvas("dt","dt" );
0501       Canvas->Divide(2,2);
0502       myCanvas = Canvas; myCanvas->cd(0);
0503     }
0504     if (page == 34) {
0505       names = cschistname;
0506       Canvas = new TCanvas("csc","csc" );
0507       Canvas->Divide(2,2);
0508       myCanvas = Canvas; myCanvas->cd(0);
0509     }
0510     if (page == 35) {
0511       names = rpchistname;
0512       Canvas = new TCanvas("rpc","rpc" );
0513       Canvas->Divide(2,2);
0514       myCanvas = Canvas; myCanvas->cd(0);
0515     }
0516 
0517     // loop through plots
0518     for (Int_t j = 0; j < names.size(); ++j) {
0519 
0520       // extract plot from both files
0521       //TH1F *sh = (TH1F*)sfile->Get(names[j].c_str());
0522       TH1F *sh; TH1F *rh;
0523       if(page >= 0 && page < 3)
0524     {
0525       TString hpath = "DQMData/GlobalRecHitsV/ECals/"+names[j];
0526     }
0527       if(page >= 3 && page < 7)
0528     {
0529       TString hpath = "DQMData/GlobalRecHitsV/HCals/"+names[j];
0530     }
0531       if(page >=7 && page < 26)
0532     {
0533       TString hpath = "DQMData/GlobalRecHitsV/SiStrips/"+names[j];
0534     }
0535       if(page >= 26 && page < 33)
0536     {
0537       TString hpath = "DQMData/GlobalRecHitsV/SiPixels/"+names[j];
0538     }
0539       if(page >= 33 && page < 36)
0540     {
0541       TString hpath = "DQMData/GlobalRecHitsV/Muons/"+names[j];
0542     }
0543     sh = (TH1F*)sfile->Get(hpath);
0544     rh = (TH1F*)rfile->Get(hpath);
0545 
0546 
0547       if (!sh) cout << names[j].c_str() << "doesn't exist" << endl;
0548       sh->SetLineColor(scolor);
0549       sh->SetLineWidth(slinewidth);
0550       sh->SetLineStyle(stype);
0551       Double_t smax = sh->GetMaximum();
0552       //TH1F *rh = (TH1F*)rfile->Get(names[j].c_str());
0553       rh->SetLineColor(rcolor);
0554       rh->SetLineWidth(rlinewidth);
0555       rh->SetLineStyle(rtype);
0556       Double_t rmax = rh->GetMaximum();
0557 
0558       // find the probability value for the two plots being from the same
0559       // source
0560       //double pv = rh->Chi2Test(sh,"OU");
0561       double pv = rh->KolmogorovTest(sh);
0562       std::strstream buf;
0563       std::string value;
0564       buf << "PV=" << pv <<std::endl;
0565       buf >> value;
0566 
0567       // set maximum of y axis
0568       Double_t max = smax;
0569       if (rmax > smax) max = rmax;
0570       max *= 1.10;
0571       rh->SetMaximum(max);
0572 
0573       // zoom in on x axis
0574       if (zoomx) {
0575     Int_t nbins = rh->GetNbinsX();
0576     Int_t rlbin, slbin;
0577     Int_t rfbin = -1, sfbin = -1;
0578     for (Int_t k = 1; k < nbins; ++k) {
0579       Int_t rbincont = rh->GetBinContent(k);
0580       if (rbincont != 0) {
0581         rlbin = k;
0582         if (rfbin == -1) rfbin = k;
0583       }
0584       Int_t sbincont = sh->GetBinContent(k);
0585       if (sbincont != 0) {
0586         slbin = k;
0587         if (sfbin == -1) sfbin = k;
0588       }
0589     }
0590     Int_t binmin = rfbin, binmax = rlbin+1;
0591     if (sfbin < binmin) binmin = sfbin;
0592     if (slbin > binmax) binmax = slbin+1;
0593     rh->SetAxisRange(rh->GetBinLowEdge(binmin),rh->GetBinLowEdge(binmax));
0594       }
0595 
0596       // make plots
0597       myCanvas->cd(j+1);
0598       //if (j == 0) gPad->SetLogy();
0599       //if (logy2 && j == 1) gPad->SetLogy();
0600       //if (logy3 && j == 2) gPad->SetLogy();
0601       rh->Draw();
0602       sh->Draw("sames");
0603 
0604       te->DrawTextNDC(0.15,0.8, value.c_str());
0605       std::cout << "[OVAL] " << rh->GetName() 
0606         << " PV = " << pv << std::endl;
0607     }
0608     myCanvas->Print(psfile);
0609 
0610   } 
0611 
0612   // close output ps file
0613   myCanvas->Print(psfileclose);
0614 
0615   // close root files
0616   rfile->Close();
0617   sfile->Close();
0618 
0619 TString cmnd;
0620   cmnd = "ps2pdf "+psfile+" "+filename+".pdf";
0621   gSystem->Exec(cmnd);
0622   cmnd = "rm "+psfile;
0623   gSystem->Exec(cmnd); 
0624 
0625   return;
0626 }