Ejemplo n.º 1
0
void HiggsPlot::PlotChi2(){
  styles style; style.setPadsStyle(1); 
  style.PadLeftMargin = 0.14; style.PadBottomMargin = 0.17; 
  style.yTitleOffset = 0.7;   style.xTitleOffset = 0.7; 
  style.TitleSize = 0.1; style.LabelSize = 0.1;
  style.setDefaultStyle();
  TCanvas can("can","Likelihood scan");
  TPad *cPad = static_cast<TPad *>(can.cd(0));
  TString xTitle[] = {"R(D)", "R(D*)"};

  double nSig = 4.2;
  int nBins = 60;
  _varyRD = 0;

  double RD[2], RDs[2], frac=0.018;
  Compute(0,RD,1); Compute(0,RDs,2);
  double Limit[2][2] = {{Measurement[1][0]-nSig*Measurement[1][1], Measurement[1][0]+nSig*Measurement[1][1]},
			{Measurement[2][0]-nSig*Measurement[2][1], Measurement[2][0]+nSig*Measurement[2][1]}};
  TH2F hChi2("hChi2","",nBins, Limit[0][0],Limit[0][1], nBins, Limit[1][0],Limit[1][1]);

  for(int iRD=1; iRD<=nBins; iRD++){
    for(int iRDs=1; iRDs<=nBins; iRDs++){
      RD[0] = hChi2.GetXaxis()->GetBinCenter(iRD);
      RDs[0] = hChi2.GetYaxis()->GetBinCenter(iRDs);
      hChi2.SetBinContent(iRD, iRDs, ProbChi2(3, 0, RD, RDs));
      //cout<<1-ProbChi2(3, 0, RD, RDs)<<endl;
    }
    //cout<<endl;
  }

  hChi2.SetXTitle(xTitle[0]); hChi2.SetYTitle(xTitle[1]); 
  //int colors[] = {kBlue+2, kBlue+1, kBlue-4, kBlue-7, kBlue-9, kBlue-10, 0};
  int colors[] = {kBlue-3, kBlue-4, kBlue-7, kBlue-9, kBlue-10, 0};
  gStyle->SetPalette(Nsigma, colors);
  double zCont[Nsigma];
  for(int ns=1; ns<=Nsigma; ns++) zCont[ns] = IntG(0,1,-ns,ns);//cout<<endl<<zCont[ns]<<endl;}
  hChi2.SetContour(Nsigma,zCont);
  hChi2.GetXaxis()->CenterTitle(true); hChi2.GetYaxis()->CenterTitle(true);
  hChi2.SetLabelOffset(0.009,"xy");
  hChi2.SetLabelSize(0.09,"xy");
  hChi2.SetTitleOffset(1,"x");
  hChi2.SetTitleOffset(0.6,"y");
  hChi2.Draw("cont4");

  double padL[2][2] = {{cPad->GetLeftMargin(),   1-cPad->GetRightMargin()}, // Margins are reversed for x-y!
		       {cPad->GetBottomMargin(), 1-cPad->GetTopMargin()}};
  double SMyield[2];
  Compute(0,RD,1); Compute(0,RDs,2); RD[1] = RDs[0];
  TLine line; line.SetLineWidth(2); line.SetLineColor(1);
  for(int chan=0; chan<2; chan++){
    double range = Limit[chan][1]-Limit[chan][0];
    SMyield[chan] = padL[chan][0] + (padL[chan][1]-padL[chan][0])*(RD[chan]-Limit[chan][0])/range;
  }
  line.DrawLineNDC(SMyield[0]-frac, SMyield[1], SMyield[0]+frac, SMyield[1]);
  line.DrawLineNDC(SMyield[0], SMyield[1]-2*frac, SMyield[0], SMyield[1]+2*frac);

  TLatex latex; latex.SetNDC(kTRUE); latex.SetTextAlign(33); latex.SetTextSize(style.TitleSize);
  latex.DrawLatex(SMyield[0]-frac,SMyield[1]-frac,"SM");

  line.SetLineColor(0);
  for(int chan=0; chan<2; chan++){
    double range = Limit[chan][1]-Limit[chan][0];
    SMyield[chan] = padL[chan][0] + (padL[chan][1]-padL[chan][0])*(Measurement[1+chan][0]-Limit[chan][0])/range;
  }
  line.DrawLineNDC(SMyield[0]-frac, SMyield[1], SMyield[0]+frac, SMyield[1]);
  line.DrawLineNDC(SMyield[0], SMyield[1]-2*frac, SMyield[0], SMyield[1]+2*frac);
  
  TH1F *histo[Nsigma];
  double legW = 0.08, legH = 0.07*Nsigma;
  double legX = 1-style.PadRightMargin-0.02, legY = 1-style.PadTopMargin-0.02;
  TLegend *leg = new TLegend(legX-legW, legY-legH, legX, legY);
  leg->SetTextSize(0.08); leg->SetFillColor(0); leg->SetTextFont(style.nFont);
  for(int ileg=0; ileg<Nsigma-1; ileg++) {
    TString label = "histo"; label += ileg+1; 
    histo[ileg] = new TH1F(label,"histo",10,0,10);
    histo[ileg]->SetLineColor(colors[ileg]);histo[ileg]->SetFillColor(colors[ileg]);
    label = " "; label += ileg+1; label += "#sigma";
    leg->AddEntry(histo[ileg],label);
  }
  leg->Draw(); 

  
  TString pName = "public_html/Higgs_Chi2.eps"; 
  can.SaveAs(pName);

  for(int ileg=0; ileg<Nsigma-1; ileg++) histo[ileg]->Delete();
}
Ejemplo n.º 2
0
void vs_PlotQCDcomp() {

  Bool_t saveC  = false;
  Bool_t diJets = true;
  Bool_t isMC   = false;

  TString vsSave;
  vsSave = "_T07w";

  TString jSave;
  if(diJets) jSave = "2j";
  else       jSave = "3j";

  TString sample;
  if(diJets) sample = "select_1ph_2jets";
  else       sample = "select_1ph_3jets";

  TString FOtag;
  if(isMC) FOtag = "_FO_CorrMC";
  //  else     FOtag = "_FO_Corr";
  else     FOtag = "_FO";

  TString sysu = "SYSTUP_";
  TString sysd = "SYSTDOWN_";

  TString outDir;
  outDir = "Plots_PhotonSusyAnalysis/QCDweights/";


  //  string inputFile1 = "/data/user/vsola/CMSSW_Releases/CMSSW_5_3_9/src/Plots_PhotonSusyAnalysis/Merged_QCD_PhotonJet_T07w_PAT/mergedHistos.root";
  //  string inputFile1 = "/data/user/vsola/CMSSW_Releases/CMSSW_5_3_9/src/Plots_PhotonSusyAnalysis/Merged_Data_V05w_PAT/mergedHistos.root";
  string inputFile1 = "/data/user/vsola/CMSSW_Releases/CMSSW_5_3_9/src/Plots_PhotonSusyAnalysis/PhotonHadReReco_22Jan2013_V05_PAT/mergedHistos.root";
  
  
  setMyTDRStyle();
  gROOT->SetStyle("mytdrStyle");
  
  //  gStyle->SetHistMinimumZero();
  //  gStyle->SetPaintTextFormat("4.2f");

  gStyle->SetHistLineWidth(2);
  gStyle->UseCurrentStyle();

  //  gStyle->SetPadTopMargin(1.0);
  //  gStyle->SetPadLeftMargin(3.2);
  //  gStyle->SetPadRightMargin(4.5);
  //  gStyle->SetPadBottomMargin(3.2);

  gROOT->ForceStyle(1);


  static const Int_t nHt  =  7;
  static const Int_t nPt  = 13;
  static const Int_t nMet = 16;
  static const Int_t nJet = 15;

  Double_t binPt[nPt+1]   = {0.,75.,90.,120.,160.,210.,260.,320.,400.,500.,650.,800.,1000.,1500.};
  Double_t binHt[nHt+1]   = {0.,400.,450.,550.,700.,900.,1200.,1500.};
  Double_t binMet[nMet+1] = {0.,10.,20.,30.,40.,50.,60.,70.,80.,90.,100.,120.,160.,200.,270.,350.,500.};
  Double_t binJet[nJet+1] = {0.,1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15};


  TLatex *as = new TLatex();
  as->SetNDC(true);
  as->SetTextColor(12);
  as->SetTextFont(43);
  as->SetTextSize(19);

  TLegend *legend = new TLegend(0.60, 0.70, 0.75, 0.85, "");
  legend->SetFillColor(10);
  legend->SetFillStyle(1001);
  legend->SetTextSize(0.04);
  legend->SetBorderSize(0);
  legend->SetShadowColor(0);

  std::string outLumi  = "CMS Work in Progress - QCD MC #sqrt{s} = 8 TeV - #geq 1 #gamma, #geq 2 j";

  TFile* f1 = TFile::Open( inputFile1.c_str() );

  //photon Pt
  TCanvas * cPt = new TCanvas("cPt","cPt");

  TH1F* hpt   = (TH1F*) f1->Get( sample+"/PreselCut_photonPt" );
  TH1F* hptFO = (TH1F*) f1->Get( sample+FOtag+"/PreselCut_photonPt" );

  TH1F *hptR = (TH1F*) hpt->Rebin(nPt,hpt->GetTitle(),binPt);
  if (hptR->GetSumw2N() == 0)
    hptR->Sumw2();

  TH1F *hptFOR = (TH1F*) hptFO->Rebin(nPt,hptFO->GetTitle(),binPt);
  if (hptFOR->GetSumw2N() == 0)
    hptFOR->Sumw2();

  TH1F* hptSU = (TH1F*) f1->Get( sample+FOtag+"/PreselCut_"+sysu+"photonPt" );
  TH1F* hptSD = (TH1F*) f1->Get( sample+FOtag+"/PreselCut_"+sysd+"photonPt" );

  TH1F *hptSUR = (TH1F*) hptSU->Rebin(nPt,hptSU->GetTitle(),binPt);
  if (hptSUR->GetSumw2N() == 0)
    hptSUR->Sumw2();

  TH1F *hptSDR = (TH1F*) hptSD->Rebin(nPt,hptSD->GetTitle(),binPt);
  if (hptSDR->GetSumw2N() == 0)
    hptSDR->Sumw2();

  if ( hptFOR != 0 ) {
    for (int b = 0; b < hptFOR->GetNbinsX(); b++) {

      Double_t mainHistoContent   = hptFOR->GetBinContent(b);
      Double_t systUpHistoContent = hptSUR->GetBinContent(b);
      Double_t systDnHistoContent = hptSDR->GetBinContent(b);
      Double_t systDiffUp = fabs( (double) systUpHistoContent - mainHistoContent );
      Double_t systDiffDn = fabs( (double) mainHistoContent - systDnHistoContent );

      // use average error for histogram
      Double_t systDiff = ( systDiffUp + systDiffDn ) / 2.;
      
      Double_t statErr   = hptFOR->GetBinError(b);
      Double_t combError = sqrt( systDiff * systDiff + statErr * statErr );
      hptFOR->SetBinError(b, combError);
    } //for
  }//if
    
  cPt->SetLogy(1);
  gPad->Update();
  cPt->Update();

  //  hptR->Scale(1,"width");
  //  hptR->SetMinimum(0.02);
  //  hptR->SetMaximum(1000); 
  hptR->GetXaxis()->SetTitle("1^{st} photon p_{T} [GeV]");
  hptR->GetYaxis()->SetTitle("Number of Events / GeV");

  if(isMC) hptR->SetMarkerSize(0);
  if(isMC) hptR->Draw("histE");
  else     hptR->Draw("E X0");


  hptFOR->SetMarkerSize(0);
  hptFOR->SetLineColor(2);
  hptFOR->SetFillColor(2);
  hptFOR->SetFillStyle(3004);
  hptFOR->Draw("same hist ][ E2");

  legend->Clear();
  if(isMC) legend->SetHeader("#gamma/QCD (Sim)");
  else     legend->SetHeader("#gamma/QCD (Data)");
  if(isMC) legend->AddEntry(hptR, "#gamma", "l");
  else     legend->AddEntry(hptR, "#gamma", "p");
  legend->AddEntry(hptFOR, "Pred (from #gamma_{jet})", "f");
  legend->Draw();

  as->DrawLatex(0.17, 0.93, outLumi.c_str() );
  cPt->Update();
  cPt->SetBottomMargin(0.2 + 0.8 * cPt->GetBottomMargin() - 0.2 * cPt->GetTopMargin());

  TPad *ratioPt = new TPad("BottomPad", "", 0, 0, 1, 1);
  ratioPt->SetTopMargin(0.8 - 0.8 * ratioPt->GetBottomMargin() + 0.2 * ratioPt->GetTopMargin());
  ratioPt->SetFillStyle(0);
  ratioPt->SetFrameFillColor(10);
  ratioPt->SetFrameBorderMode(0);
  ratioPt->Draw();

  ratioPt->cd();
  ratioPt->SetLogy(0);

  TH1F *hptRat = (TH1F*) divideHistosForRatio(hptR,hptFOR);
  hptRat->SetMinimum(0.);
  hptRat->SetMaximum(10.);
  hptRat->GetXaxis()->SetNdivisions(505);
  if(isMC) hptRat->GetYaxis()->SetTitle("Sim/Pred");
  else     hptRat->GetYaxis()->SetTitle("Data/Pred");
  hptRat->GetYaxis()->SetTitleSize(0.04);
  hptRat->GetYaxis()->SetLabelSize(0.03);
  hptRat->GetYaxis()->SetTitleOffset(1.3);
  hptRat->GetYaxis()->SetNdivisions(505);
  hptRat->SetMarkerStyle(20);
  hptRat->SetMarkerSize(1);
  hptRat->SetMarkerColor(1);
  hptRat->SetLineColor(1);
  hptRat->Draw("E X0");

  TH1F *hptFRat = (TH1F*) getSystErrForRatio(hptFOR);
  hptFRat->SetLineColor(2);
  hptFRat->SetFillColor(2);
  hptFRat->SetFillStyle(3004);
  hptFRat->Draw("same hist ][ E2");


  TLine * line = new TLine( hptRat->GetXaxis()->GetXmin(), 1., hptRat->GetXaxis()->GetXmax(), 1. );
  line->SetLineColor(1);
  line->SetLineWidth(0.5);
  line->SetLineStyle(1);
  line->Draw("same");

  hptR->GetXaxis()->SetLabelSize(0);
  hptR->GetXaxis()->SetTitle("");
  cPt->RedrawAxis();
  gPad->Update();
  cPt->Update();


  return;
}
Ejemplo n.º 3
0
void compareInDir(TFile* f1, TFile* f2, std::string dirName,unsigned int logmod=0, unsigned int dOpt=1){
  TCanvas* cv = 0;
  TPad* pH = 0;
  TPad* pD = 0;

  TPaveText* pt = 0;

  //  std::cout<<"Start with "<<dirName.c_str()<<std::endl;
  //  cv->Print("diff.ps[");
  
  TDirectory* d1 = f1->GetDirectory(dirName.c_str());
  TDirectory* d2 = f2->GetDirectory(dirName.c_str());

  if (d1==0 || d2 == 0){
    std::cout<<"ERROR: "<<dirName.c_str()<<" not found"<<std::endl;
    return;
  }
  //  std::cout<<"\t\t "<<d1->GetName()<<std::endl;

  TList* list1 = d1->GetListOfKeys();
  
  TIterator* keyIt1 = list1->MakeIterator();

  TObject* obj;  
  while ((obj = keyIt1->Next())){
    TObject* obj1 = d1->Get(obj->GetName());    
    if(obj1 == 0){
      //      std::cout<<"ERROR: failed to read in "<<d1->GetName()<<" / "<<obj->GetName()<<std::endl;
      continue;
    }
    //    std::cout<<d1->GetName()<<"/"<<obj->GetName()<<std::endl;
    if (! obj1->InheritsFrom(TH1::Class())) continue;
    
    TObject* obj2 = d2->Get(obj1->GetName());
    if (obj2 == 0){
      //      std::cout<<"WARNING: failed to get"<<d1->GetName()<<"/"<<obj1->GetName()<<std::endl;
      continue;
    }

    TH1* h1 = (TH1*)obj1;
    TH1* h2 = (TH1*)obj2;
    //    std::cout<<"Will check "<<dirName.c_str()<<"/"<<h1->GetName()<<" dOpt "<<dOpt<<std::endl;
    if(h1->Integral() == 0 && h2->Integral() == 0){
      //      std::cout<<"Integral is 0: "<<d1->GetName()<<"/"<<obj1->GetName()<<std::endl;
      continue;
    }
    //    if (TString(h1->GetTitle()).Index("ffic")<0) continue;
    bool isProf = obj1->InheritsFrom(TProfile::Class());
    bool isH2   = obj1->InheritsFrom(TH2::Class());
    double bDiff = 0;
    if(!isH2){
      unsigned int nX1 = h1->GetNbinsX();
      //      std::cout<<"\t is 1D with nBins "<<nX1<<std::endl;
      for(unsigned int iB=0; iB<=nX1+1; ++iB){
	if(h1->GetBinError(iB)==0 && h1->GetBinContent(iB)!=0) h1->SetBinError(iB,1e-3*fabs(h1->GetBinContent(iB)));
	if(h2->GetBinError(iB)==0 && h2->GetBinContent(iB)!=0) h2->SetBinError(iB,1e-3*fabs(h2->GetBinContent(iB)));
	bDiff +=fabs(h1->GetBinContent(iB) - h2->GetBinContent(iB));
      }
    } else {
      unsigned int nX1 = h1->GetNbinsX();
      unsigned int nY1 = h1->GetNbinsY();
      //      std::cout<<"\t is 2D with nBins "<<nX1<<" : "<<nY1<<std::endl;
      for(unsigned int iB=0; iB<=nX1+1; ++iB){
	for(unsigned int jB=0; jB<=nY1+1; ++jB){
	  if(h1->GetBinError(iB,jB)==0 && h1->GetBinContent(iB,jB)!=0) h1->SetBinError(iB,jB,1e-3*fabs(h1->GetBinContent(iB,jB)));
	  if(h2->GetBinError(iB,jB)==0 && h2->GetBinContent(iB,jB)!=0) h2->SetBinError(iB,jB,1e-3*fabs(h2->GetBinContent(iB,jB)));
	  bDiff +=fabs(h1->GetBinContent(iB,jB) - h2->GetBinContent(iB,jB));
	}
      }
    }

    double ksProb = 0;
    if (bDiff == 0) ksProb = 1;
    else ksProb = h1->KolmogorovTest(h2);
    if (dOpt%10 == 0 && bDiff ==0 ) continue;
    if (dOpt%10 == 1 && (bDiff ==0 || 1.-ksProb <1e-12) ) continue;
    if (dOpt%10 == 2 && (bDiff ==0 || ksProb >0.1 )) continue;
    if (dOpt%10 == 3 && (bDiff ==0 || 1.-ksProb < 0.001 )) continue;
    if (dOpt%10 == 4 && (bDiff ==0 || ksProb >0.9 )) continue;
    if (dOpt%10 == 5 && (bDiff ==0 || ksProb >0.5 )) continue;

    if (cv == 0){
      cv = new TCanvas(dirName.c_str(),dirName.c_str());
      cv->cd();
      pH = new TPad("head","head", 0, 0.93, 1, 1);
      pH->Draw();
      pH->cd();
      pt = new TPaveText(0,0,1,1); pt->SetFillColor(0);
      pt->AddText(dirName.c_str());
      pt->Draw();
      cv->cd();
      pD = new TPad("dis","dis", 0, 0.0, 1, 0.93);
      pD->Draw();
      pD->cd();
    }
    
    pD->Clear();
    pD->cd();
    std::cout<<"Save : "<<dirName.c_str()<<"/"<<h1->GetName()<<std::endl;

    if (! isH2){
      h1->SetLineWidth(2);
      h1->SetLineColor(1);
      h1->SetMarkerColor(1);
      h2->SetLineColor(2);
      h2->SetMarkerColor(2);
      //      if (h1->GetNbinsX() > 25) h1 = h1->Rebin();
 //     if (h2->GetNbinsX() > 25) h2 = h2->Rebin();
      //      if (h1->GetNbinsX() > 50) h1 = h1->Rebin(5);
      //      if (h2->GetNbinsX() > 50) h2 = h2->Rebin(5);
      double max1 = h1->GetMaximum();
      double max2 = h2->GetMaximum();
      double min1 = h1->GetMinimum();
      double min2 = h2->GetMinimum();
      if (max2> max1) h1->SetMaximum(max2+0.15*fabs(max2));
      if (min2 < min1) h1->SetMinimum(min2-0.15*fabs(min2));
      //      pD->SetLogy();
      if ((logmod&1)) pD->SetLogx();
      if ((logmod&2)) pD->SetLogy();
      h1->Draw();
      h2->Draw("sames");   

      if (std::string(h1->GetName())==std::string("reconstruction_step_module_total")
	  || std::string(h1->GetName())==std::string("validation_step_module_total")){
	TPaveText ksPt(0,0, 0.35, 0.04, "NDC"); ksPt.SetBorderSize(0); ksPt.SetFillColor(0);
	ksPt.AddText(Form("P(KS)=%g, diffBins=%g, eblk %g ered %g",ksProb, bDiff, h1->GetEntries(), h2->GetEntries()));
	//	ksPt.AddText(h1->GetName());
	ksPt.Draw();
	cv->Print("diff.ps");

	int nX = h1->GetNbinsX();
	TAxis* h1Ax = h1->GetXaxis();
	int nRanges = nX/20 + 1;
	double h1Int = h1->Integral();
	float curBMargin = pD->GetBottomMargin(); 
	pD->SetBottomMargin(0.3);
	for (int iR = 0; iR < nRanges; iR++){
	  h1Ax->SetRange(iR*20+1, iR*20+20);
	  double bDiffL = 0;
	  double max1L = -1;
	  double max2L = -1;
	  double min1L = h1->GetMaximum();
	  double min2L = h2->GetMaximum();
	  for (int iBL = iR*20+1; iBL<= iR*20+20; ++iBL){
	    double h1L = h1->GetBinContent(iBL);
	    double h2L = h2->GetBinContent(iBL);
	    bDiffL += std::abs(h1L-h2L);
	    if (max1L < h1L) max1L = h1L;
	    if (max2L < h2L) max2L = h2L;
	    if (min1L > h1L) min1L = h1L;
	    if (min2L > h2L) min2L = h2L;
	  }
	  if (max2L> max1L)  h1->SetMaximum(max2L+0.15*std::abs(max2L));
	  else h1->SetMaximum(max1L+0.15*std::abs(max1L));
	  if (min2L < min1L) h1->SetMinimum(min2L-0.15*std::abs(min2L));
	  else h1->SetMinimum(min1L-0.15*std::abs(min1L));
	  h1->Draw();
	  h2->Draw("sames");
	  TPaveText ksPtL(0,0, 0.35, 0.04, "NDC"); ksPtL.SetBorderSize(0); ksPtL.SetFillColor(0);
	  ksPtL.AddText(Form("P(KS)=%g, diffBinsL=%g(%g), eblk %g ered %g",ksProb, bDiffL, bDiffL/h1Int, h1->GetEntries(), h2->GetEntries()));
	  ksPtL.Draw();
	  cv->Print("diff.ps");
	}
	pD->SetBottomMargin(curBMargin);

      }
    }
    if (isH2){
      pD->Divide(2);
      pD->cd(1);
      h1->Draw("colz");
      pD->cd(2);
      h2->Draw("colz");
    }
    TPaveText ksPt(0,0, 0.55, 0.06, "NDC"); ksPt.SetBorderSize(0); ksPt.SetFillColor(0);
    ksPt.AddText(Form("P(KS)=%g, diffBins=%g, eblk %g ered %g",ksProb, bDiff, h1->GetEntries(), h2->GetEntries()));
    ksPt.AddText(h1->GetName());
    ksPt.Draw();
    cv->Print("diff.ps");
    cv->Print("diff.pdf");


  }

  //  std::cout<<"Done in "<<dirName.c_str()<<std::endl;
  //  delete pH; delete pD;
  if (cv) delete cv;
  //  cv->Print("diff.ps]");
}
Ejemplo n.º 4
0
void boostcontrolplots( TDirectory *boostdir ) {

   const Int_t nPlots = 4;

   Int_t width  = 900;
   Int_t height = 900;
   char cn[100];
   const TString titName = boostdir->GetName();
   sprintf( cn, "cv_%s", titName.Data() );
   TCanvas *c = new TCanvas( cn,  Form( "%s Control Plots", titName.Data() ),
                             width, height ); 
   c->Divide(2,3);


   const TString titName = boostdir->GetName();

   TString hname[nPlots]={"Booster_BoostWeight","Booster_MethodWeight","Booster_ErrFraction","Booster_OrigErrFraction"};

   for (Int_t i=0; i<nPlots; i++){
      Int_t color = 4; 
      TPad * cPad = (TPad*)c->cd(i+1);
      TH1 *h = (TH1*) boostdir->Get(hname[i]);
      TString plotname = h->GetName();
      h->SetMaximum(h->GetMaximum()*1.3);
      h->SetMinimum( 0 );
      h->SetMarkerColor(color);
      h->SetMarkerSize( 0.7 );
      h->SetMarkerStyle( 24 );
      h->SetLineWidth(2);
      h->SetLineColor(color);
      h->Draw();
      c->Update();
   }

   // draw combined ROC plots

   TString hname_roctest[2] ={"Booster_ROCIntegral_test",  "Booster_ROCIntegralBoosted_test"};
   TString hname_roctrain[2]={"Booster_ROCIntegral_train", "Booster_ROCIntegralBoosted_train"};
   TString htitle[2] = {"ROC integral of single classifier", "ROC integral of boosted method"}

   for (Int_t i=0; i<2; i++){
      Int_t color = 4; 
      TPad * cPad = (TPad*)c->cd(nPlots+i+1);
      TH1 *htest  = (TH1*) boostdir->Get(hname_roctest[i]);
      TH1 *htrain = (TH1*) boostdir->Get(hname_roctrain[i]);

      // check if filled 
      Bool_t histFilled = (htest->GetMaximum() > 0 || htrain->GetMaximum() > 0);

      htest->SetTitle(htitle[i]);
      htest->SetMaximum(1.0);
      htest->SetMinimum(0.0);
      htest->SetMarkerColor(color);
      htest->SetMarkerSize( 0.7 );
      htest->SetMarkerStyle( 24 );
      htest->SetLineWidth(2);
      htest->SetLineColor(color);
      htest->Draw();
      htrain->SetMaximum(1.0);
      htrain->SetMinimum(0.0);
      htrain->SetMarkerColor(color-2);
      htrain->SetMarkerSize( 0.7 );
      htrain->SetMarkerStyle( 24 );
      htrain->SetLineWidth(2);
      htrain->SetLineColor(color-2);
      htrain->Draw("same");

      if (histFilled) {
         TLegend *legend= new TLegend( cPad->GetLeftMargin(), 
                                       0.2 + cPad->GetBottomMargin(),
                                       cPad->GetLeftMargin() + 0.6, 
                                       cPad->GetBottomMargin() );
         legend->AddEntry(htest,  TString("testing sample"),  "L");
         legend->AddEntry(htrain, TString("training sample (orig. weights)"), "L");
         legend->SetFillStyle( 1 );
         legend->SetBorderSize(1);
         legend->SetMargin( 0.3 );
         legend->Draw("same");
      }
      else {
         TText* t = new TText();
         t->SetTextSize( 0.056 );
         t->SetTextColor( 2 );
         t->DrawText( 1, 0.6, "Use MethodBoost option: \"DetailedMonitoring\" " );        
         t->DrawText( 1, 0.51, "to fill this histograms" );        
      }

      c->Update();
   }

   // write to file
   TString fname = Form( "plots/%s_ControlPlots", titName.Data() );
   TMVAGlob::imgconv( c, fname );
   
}