ROOT logo
// @(#)root/roostats:$Id$
// Authors: Sven Kreiss    June 2010
// Authors: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke
/*************************************************************************
 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//____________________________________________________________________
/*
SamplingDistPlot : 

This class provides simple and straightforward utilities to plot SamplingDistribution
objects.
*/

#include "RooStats/SamplingDistPlot.h"

#include "RooRealVar.h"
#include "TStyle.h"
#include "TLine.h"
#include "TFile.h"
#include "TVirtualPad.h"  // for gPad

#include <algorithm>
#include <iostream>


#ifndef ROO_MSG_SERVICE
#include "RooMsgService.h"
#endif

#include <limits>
#define NaN std::numeric_limits<float>::quiet_NaN()
#include "TMath.h"
#define IsNaN(a) TMath::IsNaN(a)


/// ClassImp for building the THtml documentation of the class 
ClassImp(RooStats::SamplingDistPlot);

using namespace RooStats;
using namespace std;

//_______________________________________________________
SamplingDistPlot::SamplingDistPlot(Int_t nbins) :
   fHist(0),
   fLegend(NULL),
   fItems(),
   fOtherItems(),
   fRooPlot(NULL),
   fLogXaxis(kFALSE),
   fLogYaxis(kFALSE),
   fXMin(NaN), fXMax(NaN), fYMin(NaN), fYMax(NaN),
   fApplyStyle(kTRUE),
   fFillStyle(3004)
{
  // SamplingDistPlot default constructor with bin size
  fIterator = fItems.MakeIterator();
  fIsWeighted = kFALSE;
  fBins = nbins;
  fMarkerType = 20;
  fColor = 1;
}

//_______________________________________________________
SamplingDistPlot::SamplingDistPlot(Int_t nbins, Double_t min, Double_t max) :
   fHist(0),
   fLegend(NULL),
   fItems(),
   fOtherItems(),
   fRooPlot(NULL),
   fLogXaxis(kFALSE),
   fLogYaxis(kFALSE),
   fXMin(NaN), fXMax(NaN), fYMin(NaN), fYMax(NaN),
   fApplyStyle(kTRUE),
   fFillStyle(3004)
{
  // SamplingDistPlot constructor with bin size, min and max
  fIterator = fItems.MakeIterator();
  fIsWeighted = kFALSE;
  fBins = nbins;
  fMarkerType = 20;
  fColor = 1;
  
  SetXRange( min, max );
}



//_______________________________________________________
Double_t SamplingDistPlot::AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions) {
   // adds sampling distribution (and normalizes if "NORMALIZE" is given as an option)

   fSamplingDistr = samplingDist->GetSamplingDistribution();
   if( fSamplingDistr.empty() ) {
      coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
      return 0.0;
   }
   SetSampleWeights(samplingDist);

   TString options(drawOptions);
   options.ToUpper();

   Double_t xmin(TMath::Infinity()), xmax(-TMath::Infinity()); 
   // remove cases where xmin and xmax are +/- inf
   for( unsigned int i=0; i < fSamplingDistr.size(); i++ ) {
      if( fSamplingDistr[i] < xmin  &&  fSamplingDistr[i] != -TMath::Infinity() ) {
         xmin = fSamplingDistr[i];
      }
      if( fSamplingDistr[i] > xmax  &&  fSamplingDistr[i] != TMath::Infinity() ) {
         xmax = fSamplingDistr[i];
      }
   }
   if( xmin >= xmax ) {
      coutW(Plotting) << "Could not determine xmin and xmax of sampling distribution that was given to plot." << endl;
      xmin = -1.0;
      xmax = 1.0;
   }

   
   // add 1.5 bins left and right
   assert(fBins > 1);
   double binWidth = (xmax-xmin)/(fBins);
   Double_t xlow = xmin - 1.5*binWidth;
   Double_t xup  = xmax + 1.5*binWidth;
   if( !IsNaN(fXMin) ) xlow = fXMin;
   if( !IsNaN(fXMax) ) xup = fXMax;

   fHist = new TH1F(samplingDist->GetName(), samplingDist->GetTitle(), fBins, xlow, xup);

   if( fVarName.Length() == 0 ) fVarName = samplingDist->GetVarName();
   fHist->GetXaxis()->SetTitle(fVarName.Data());


   std::vector<Double_t>::iterator valuesIt = fSamplingDistr.begin();
   for (int w_idx = 0; valuesIt != fSamplingDistr.end(); ++valuesIt, ++w_idx) {
      if (fIsWeighted) fHist->Fill(*valuesIt, fSampleWeights[w_idx]);
      else fHist->Fill(*valuesIt);
   }

   // NORMALIZATION
   fHist->Sumw2();
   double weightSum = 1.0;
   if(options.Contains("NORMALIZE")) {
      weightSum = fHist->Integral("width");
      fHist->Scale(1./weightSum);

      options.ReplaceAll("NORMALIZE", "");
      options.Strip();
   }


   //some basic aesthetics
   fHist->SetMarkerStyle(fMarkerType);
   fHist->SetMarkerColor(fColor);
   fHist->SetLineColor(fColor);

   fMarkerType++;
   fColor++;

   fHist->SetStats(kFALSE);

   addObject(fHist, options.Data());

   TString title = samplingDist->GetTitle();
   if(fLegend  &&  title.Length() > 0) fLegend->AddEntry(fHist, title, "L");

   return 1./weightSum;
}

//_______________________________________________________
Double_t SamplingDistPlot::AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, Double_t minShaded, Double_t maxShaded, Option_t *drawOptions) {
   if( samplingDist->GetSamplingDistribution().empty() ) {
      coutW(Plotting) << "Empty sampling distribution given to plot. Skipping." << endl;
      return 0.0;
   }
   Double_t scaleFactor = AddSamplingDistribution(samplingDist, drawOptions);

   TH1F *shaded = (TH1F*)fHist->Clone((string(samplingDist->GetName())+string("_shaded")).c_str());
   shaded->SetFillStyle(fFillStyle++);
   shaded->SetLineWidth(0);

   for (int i=0; i<shaded->GetNbinsX(); ++i) {
      if (shaded->GetBinCenter(i) < minShaded || shaded->GetBinCenter(i) > maxShaded){
         shaded->SetBinContent(i,0);
      }
   }

   TString options(drawOptions);
   options.ToUpper();
   if(options.Contains("NORMALIZE")) {
      options.ReplaceAll("NORMALIZE", "");
      options.Strip();
   }
   addObject(shaded, options.Data());

   return scaleFactor;
}

void SamplingDistPlot::AddLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const char* title) {
   TLine *line = new TLine(x1, y1, x2, y2);
   line->SetLineWidth(3);
   line->SetLineColor(kBlack);

   if(fLegend  &&  title) fLegend->AddEntry(line, title, "L");

   addOtherObject(line, ""); // no options
}

void SamplingDistPlot::AddTH1(TH1* h, Option_t *drawOptions) {
   if(fLegend  &&  h->GetTitle()) fLegend->AddEntry(h, h->GetTitle(), "L");
   addObject(h, drawOptions);
}
void SamplingDistPlot::AddTF1(TF1* f, const char* title, Option_t *drawOptions) {
   if(fLegend  &&  title) fLegend->AddEntry(f, title, "L");
   addOtherObject(f, drawOptions);
}


//_______________________________________________________
void SamplingDistPlot::SetSampleWeights(const SamplingDistribution* samplingDist)
{
  //Determine if the sampling distribution has weights and store them

  fIsWeighted = kFALSE;

  if(samplingDist->GetSampleWeights().size() != 0){
    fIsWeighted = kTRUE;
    fSampleWeights = samplingDist->GetSampleWeights();
  }  

  return;
}

void SamplingDistPlot::addObject(TObject *obj, Option_t *drawOptions) 
{
  // Add a generic object to this plot. The specified options will be
  // used to Draw() this object later. The caller transfers ownership
  // of the object with this call, and the object will be deleted
  // when its containing plot object is destroyed.

  if(0 == obj) {
    std::cerr << fName << "::addObject: called with a null pointer" << std::endl;
    return;
  }

  fItems.Add(obj,drawOptions);

  return;
}
void SamplingDistPlot::addOtherObject(TObject *obj, Option_t *drawOptions)
{
  // Add a generic object to this plot. The specified options will be
  // used to Draw() this object later. The caller transfers ownership
  // of the object with this call, and the object will be deleted
  // when its containing plot object is destroyed.

  if(0 == obj) {
     oocoutE(this,InputArguments) << fName << "::addOtherObject: called with a null pointer" << std::endl;
     return;
  }

  fOtherItems.Add(obj,drawOptions);

  return;
}

//_____________________________________________________________________________
void SamplingDistPlot::Draw(Option_t * /*options */) {
   // Draw this plot and all of the elements it contains. The specified options
   // only apply to the drawing of our frame. The options specified in our add...()
   // methods will be used to draw each object we contain.

   ApplyDefaultStyle();

   Double_t theMin(0.), theMax(0.), theYMin(NaN), theYMax(0.);
   GetAbsoluteInterval(theMin, theMax, theYMax);
   if( !IsNaN(fXMin) ) theMin = fXMin;
   if( !IsNaN(fXMax) ) theMax = fXMax;
   if( !IsNaN(fYMin) ) theYMin = fYMin;
   if( !IsNaN(fYMax) ) theYMax = fYMax;

   RooRealVar xaxis("xaxis", fVarName.Data(), theMin, theMax);

   //L.M. by drawing many times we create a memory leak ???
   if (fRooPlot) delete fRooPlot;
   

   fRooPlot = xaxis.frame();
   if (!fRooPlot) { 
     oocoutE(this,InputArguments) << "invalid variable to plot" << std::endl;
     return;      
   }
   fRooPlot->SetTitle("");
   if( !IsNaN(theYMax) ) {
      //coutI(InputArguments) << "Setting maximum to " << theYMax << endl;
      fRooPlot->SetMaximum(theYMax);
   }
   if( !IsNaN(theYMin) ) {
      //coutI(InputArguments) << "Setting minimum to " << theYMin << endl;
      fRooPlot->SetMinimum(theYMin);
   }

   fIterator->Reset();
   TH1F *obj = 0;
   while ((obj = (TH1F*) fIterator->Next())) {
      //obj->Draw(fIterator->GetOption());
      // add cloned objects to avoid mem leaks
      TH1 * cloneObj = (TH1*)obj->Clone();
      if( !IsNaN(theYMax) ) {
         //coutI(InputArguments) << "Setting maximum of TH1 to " << theYMax << endl;
         cloneObj->SetMaximum(theYMax);
      }
      if( !IsNaN(theYMin) ) {
         //coutI(InputArguments) << "Setting minimum of TH1 to " << theYMin << endl;
         cloneObj->SetMinimum(theYMin);
      }
      cloneObj->SetDirectory(0);
      fRooPlot->addTH1(cloneObj, fIterator->GetOption());
   }

   TIterator *otherIt = fOtherItems.MakeIterator();
   TObject *otherObj = NULL;
   while ((otherObj = otherIt->Next())) {
      TObject * cloneObj = otherObj->Clone();
      fRooPlot->addObject(cloneObj, otherIt->GetOption());
   }
   delete otherIt;


   if(fLegend) fRooPlot->addObject(fLegend);

   if(bool(gStyle->GetOptLogx()) != fLogXaxis) {
      if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogx(...)" << endl;
      gStyle->SetOptLogx(fLogXaxis);
   }
   if(bool(gStyle->GetOptLogy()) != fLogYaxis) {
      if(!fApplyStyle) coutW(Plotting) << "gStyle will be changed to adjust SetOptLogy(...)" << endl;
      gStyle->SetOptLogy(fLogYaxis);
   }
   fRooPlot->Draw();

   // apply this since gStyle does not work for RooPlot
   if (gPad) { 
      gPad->SetLogx(fLogXaxis);
      gPad->SetLogy(fLogYaxis);
   }

   return;
}

void SamplingDistPlot::ApplyDefaultStyle(void) {
   if(fApplyStyle) {
      // use plain black on white colors
      Int_t icol = 0;
      gStyle->SetFrameBorderMode( icol );
      gStyle->SetCanvasBorderMode( icol );
      gStyle->SetPadBorderMode( icol );
      gStyle->SetPadColor( icol );
      gStyle->SetCanvasColor( icol );
      gStyle->SetStatColor( icol );
      gStyle->SetFrameFillStyle( 0 );

      // set the paper & margin sizes
      gStyle->SetPaperSize( 20, 26 );

      if(fLegend) {
         fLegend->SetFillColor(0);
         fLegend->SetBorderSize(1);
      }
   }
}

//_____________________________________________________________________________
void SamplingDistPlot::GetAbsoluteInterval(Double_t &theMin, Double_t &theMax, Double_t &theYMax) const
{
   Double_t tmpmin = TMath::Infinity();
   Double_t tmpmax = -TMath::Infinity();
   Double_t tmpYmax = -TMath::Infinity();


  fIterator->Reset();
  TH1F *obj = 0;
  while((obj = (TH1F*)fIterator->Next())) {
    if(obj->GetXaxis()->GetXmin() < tmpmin) tmpmin = obj->GetXaxis()->GetXmin();
    if(obj->GetXaxis()->GetXmax() > tmpmax) tmpmax = obj->GetXaxis()->GetXmax();
    if(obj->GetMaximum() > tmpYmax) tmpYmax = obj->GetMaximum() + 0.1*obj->GetMaximum();
  }

  theMin = tmpmin;
  theMax = tmpmax;
  theYMax = tmpYmax;

  return;
}

//_____________________________________________________________________________
void SamplingDistPlot::SetLineColor(Color_t color, const SamplingDistribution *samplDist) {
   // Sets line color for given sampling distribution and
   // fill color for the associated shaded TH1F.

   if (samplDist == 0) {
      fHist->SetLineColor(color);

      fIterator->Reset();
      TH1F *obj = 0;

      TString shadedName(fHist->GetName());
      shadedName += "_shaded";

      while ((obj = (TH1F*) fIterator->Next())) {
         if (!strcmp(obj->GetName(), shadedName.Data())) {
            obj->SetLineColor(color);
            obj->SetFillColor(color);
            //break;
         }
      }
   } else {
      fIterator->Reset();
      TH1F *obj = 0;

      TString shadedName(samplDist->GetName());
      shadedName += "_shaded";

      while ((obj = (TH1F*) fIterator->Next())) {
         if (!strcmp(obj->GetName(), samplDist->GetName())) {
            obj->SetLineColor(color);
            //break;
         }
         if (!strcmp(obj->GetName(), shadedName.Data())) {
            obj->SetLineColor(color);
            obj->SetFillColor(color);
            //break;
         }
      }
   }

   return;
}

//_____________________________________________________________________________
void SamplingDistPlot::SetLineWidth(Width_t lwidth, const SamplingDistribution *samplDist)
{
  if(samplDist == 0){
    fHist->SetLineWidth(lwidth);
  }
  else{
    fIterator->Reset();
    TH1F *obj = 0;
    while((obj = (TH1F*)fIterator->Next())) {
      if(!strcmp(obj->GetName(),samplDist->GetName())){
	obj->SetLineWidth(lwidth);
	break;
      }
    }
  }

  return;
}

//_____________________________________________________________________________
void SamplingDistPlot::SetLineStyle(Style_t style, const SamplingDistribution *samplDist)
{
  if(samplDist == 0){
    fHist->SetLineStyle(style);
  }
  else{
    fIterator->Reset();
    TH1F *obj = 0;
    while((obj = (TH1F*)fIterator->Next())) {
      if(!strcmp(obj->GetName(),samplDist->GetName())){
	obj->SetLineStyle(style);
	break;
      }
    }
  }

  return;
}

//_____________________________________________________________________________
void SamplingDistPlot::SetMarkerStyle(Style_t style, const SamplingDistribution *samplDist)
{
  if(samplDist == 0){
    fHist->SetMarkerStyle(style);
  }
  else{
    fIterator->Reset();
    TH1F *obj = 0;
    while((obj = (TH1F*)fIterator->Next())) {
      if(!strcmp(obj->GetName(),samplDist->GetName())){
	obj->SetMarkerStyle(style);
	break;
      }
    }
  }

  return;
}

//_____________________________________________________________________________
void SamplingDistPlot::SetMarkerColor(Color_t color, const SamplingDistribution *samplDist)
{
  if(samplDist == 0){
    fHist->SetMarkerColor(color);
  }
  else{
    fIterator->Reset();
    TH1F *obj = 0;
    while((obj = (TH1F*)fIterator->Next())) {
      if(!strcmp(obj->GetName(),samplDist->GetName())){
	obj->SetMarkerColor(color);
	break;
      }
    }
  }

  return;
}

//_____________________________________________________________________________
void SamplingDistPlot::SetMarkerSize(Size_t size, const SamplingDistribution *samplDist)
{
  if(samplDist == 0){
    fHist->SetMarkerSize(size);
  }
  else{
    fIterator->Reset();
    TH1F *obj = 0;
    while((obj = (TH1F*)fIterator->Next())) {
      if(!strcmp(obj->GetName(),samplDist->GetName())){
	obj->SetMarkerSize(size);
	break;
      }
    }
  }

  return;
}

//_____________________________________________________________________________
TH1F* SamplingDistPlot::GetTH1F(const SamplingDistribution *samplDist)
{
  if(samplDist == NULL){
    return fHist;
  }else{
    fIterator->Reset();
    TH1F *obj = 0;
    while((obj = (TH1F*)fIterator->Next())) {
      if(!strcmp(obj->GetName(),samplDist->GetName())){
        return obj;
      }
    }
  }

  return NULL;
}


//_____________________________________________________________________________
void SamplingDistPlot::RebinDistribution(Int_t rebinFactor, const SamplingDistribution *samplDist)
{
  if(samplDist == 0){
    fHist->Rebin(rebinFactor);
  }
  else{
    fIterator->Reset();
    TH1F *obj = 0;
    while((obj = (TH1F*)fIterator->Next())) {
      if(!strcmp(obj->GetName(),samplDist->GetName())){
	obj->Rebin(rebinFactor);
	break;
      }
    }
  }

  return;
}


// TODO test
void SamplingDistPlot::DumpToFile(const char* RootFileName, Option_t *option, const char *ftitle, Int_t compress) {
   // All the objects are written to rootfile

   if(!fRooPlot) {
      cout << "Plot was not drawn yet. Dump can only be saved after it was drawn with Draw()." << endl;
      return;
   }

   TFile ofile(RootFileName, option, ftitle, compress);
   ofile.cd();
   fRooPlot->Write();
   ofile.Close();
}

 SamplingDistPlot.cxx:1
 SamplingDistPlot.cxx:2
 SamplingDistPlot.cxx:3
 SamplingDistPlot.cxx:4
 SamplingDistPlot.cxx:5
 SamplingDistPlot.cxx:6
 SamplingDistPlot.cxx:7
 SamplingDistPlot.cxx:8
 SamplingDistPlot.cxx:9
 SamplingDistPlot.cxx:10
 SamplingDistPlot.cxx:11
 SamplingDistPlot.cxx:12
 SamplingDistPlot.cxx:13
 SamplingDistPlot.cxx:14
 SamplingDistPlot.cxx:15
 SamplingDistPlot.cxx:16
 SamplingDistPlot.cxx:17
 SamplingDistPlot.cxx:18
 SamplingDistPlot.cxx:19
 SamplingDistPlot.cxx:20
 SamplingDistPlot.cxx:21
 SamplingDistPlot.cxx:22
 SamplingDistPlot.cxx:23
 SamplingDistPlot.cxx:24
 SamplingDistPlot.cxx:25
 SamplingDistPlot.cxx:26
 SamplingDistPlot.cxx:27
 SamplingDistPlot.cxx:28
 SamplingDistPlot.cxx:29
 SamplingDistPlot.cxx:30
 SamplingDistPlot.cxx:31
 SamplingDistPlot.cxx:32
 SamplingDistPlot.cxx:33
 SamplingDistPlot.cxx:34
 SamplingDistPlot.cxx:35
 SamplingDistPlot.cxx:36
 SamplingDistPlot.cxx:37
 SamplingDistPlot.cxx:38
 SamplingDistPlot.cxx:39
 SamplingDistPlot.cxx:40
 SamplingDistPlot.cxx:41
 SamplingDistPlot.cxx:42
 SamplingDistPlot.cxx:43
 SamplingDistPlot.cxx:44
 SamplingDistPlot.cxx:45
 SamplingDistPlot.cxx:46
 SamplingDistPlot.cxx:47
 SamplingDistPlot.cxx:48
 SamplingDistPlot.cxx:49
 SamplingDistPlot.cxx:50
 SamplingDistPlot.cxx:51
 SamplingDistPlot.cxx:52
 SamplingDistPlot.cxx:53
 SamplingDistPlot.cxx:54
 SamplingDistPlot.cxx:55
 SamplingDistPlot.cxx:56
 SamplingDistPlot.cxx:57
 SamplingDistPlot.cxx:58
 SamplingDistPlot.cxx:59
 SamplingDistPlot.cxx:60
 SamplingDistPlot.cxx:61
 SamplingDistPlot.cxx:62
 SamplingDistPlot.cxx:63
 SamplingDistPlot.cxx:64
 SamplingDistPlot.cxx:65
 SamplingDistPlot.cxx:66
 SamplingDistPlot.cxx:67
 SamplingDistPlot.cxx:68
 SamplingDistPlot.cxx:69
 SamplingDistPlot.cxx:70
 SamplingDistPlot.cxx:71
 SamplingDistPlot.cxx:72
 SamplingDistPlot.cxx:73
 SamplingDistPlot.cxx:74
 SamplingDistPlot.cxx:75
 SamplingDistPlot.cxx:76
 SamplingDistPlot.cxx:77
 SamplingDistPlot.cxx:78
 SamplingDistPlot.cxx:79
 SamplingDistPlot.cxx:80
 SamplingDistPlot.cxx:81
 SamplingDistPlot.cxx:82
 SamplingDistPlot.cxx:83
 SamplingDistPlot.cxx:84
 SamplingDistPlot.cxx:85
 SamplingDistPlot.cxx:86
 SamplingDistPlot.cxx:87
 SamplingDistPlot.cxx:88
 SamplingDistPlot.cxx:89
 SamplingDistPlot.cxx:90
 SamplingDistPlot.cxx:91
 SamplingDistPlot.cxx:92
 SamplingDistPlot.cxx:93
 SamplingDistPlot.cxx:94
 SamplingDistPlot.cxx:95
 SamplingDistPlot.cxx:96
 SamplingDistPlot.cxx:97
 SamplingDistPlot.cxx:98
 SamplingDistPlot.cxx:99
 SamplingDistPlot.cxx:100
 SamplingDistPlot.cxx:101
 SamplingDistPlot.cxx:102
 SamplingDistPlot.cxx:103
 SamplingDistPlot.cxx:104
 SamplingDistPlot.cxx:105
 SamplingDistPlot.cxx:106
 SamplingDistPlot.cxx:107
 SamplingDistPlot.cxx:108
 SamplingDistPlot.cxx:109
 SamplingDistPlot.cxx:110
 SamplingDistPlot.cxx:111
 SamplingDistPlot.cxx:112
 SamplingDistPlot.cxx:113
 SamplingDistPlot.cxx:114
 SamplingDistPlot.cxx:115
 SamplingDistPlot.cxx:116
 SamplingDistPlot.cxx:117
 SamplingDistPlot.cxx:118
 SamplingDistPlot.cxx:119
 SamplingDistPlot.cxx:120
 SamplingDistPlot.cxx:121
 SamplingDistPlot.cxx:122
 SamplingDistPlot.cxx:123
 SamplingDistPlot.cxx:124
 SamplingDistPlot.cxx:125
 SamplingDistPlot.cxx:126
 SamplingDistPlot.cxx:127
 SamplingDistPlot.cxx:128
 SamplingDistPlot.cxx:129
 SamplingDistPlot.cxx:130
 SamplingDistPlot.cxx:131
 SamplingDistPlot.cxx:132
 SamplingDistPlot.cxx:133
 SamplingDistPlot.cxx:134
 SamplingDistPlot.cxx:135
 SamplingDistPlot.cxx:136
 SamplingDistPlot.cxx:137
 SamplingDistPlot.cxx:138
 SamplingDistPlot.cxx:139
 SamplingDistPlot.cxx:140
 SamplingDistPlot.cxx:141
 SamplingDistPlot.cxx:142
 SamplingDistPlot.cxx:143
 SamplingDistPlot.cxx:144
 SamplingDistPlot.cxx:145
 SamplingDistPlot.cxx:146
 SamplingDistPlot.cxx:147
 SamplingDistPlot.cxx:148
 SamplingDistPlot.cxx:149
 SamplingDistPlot.cxx:150
 SamplingDistPlot.cxx:151
 SamplingDistPlot.cxx:152
 SamplingDistPlot.cxx:153
 SamplingDistPlot.cxx:154
 SamplingDistPlot.cxx:155
 SamplingDistPlot.cxx:156
 SamplingDistPlot.cxx:157
 SamplingDistPlot.cxx:158
 SamplingDistPlot.cxx:159
 SamplingDistPlot.cxx:160
 SamplingDistPlot.cxx:161
 SamplingDistPlot.cxx:162
 SamplingDistPlot.cxx:163
 SamplingDistPlot.cxx:164
 SamplingDistPlot.cxx:165
 SamplingDistPlot.cxx:166
 SamplingDistPlot.cxx:167
 SamplingDistPlot.cxx:168
 SamplingDistPlot.cxx:169
 SamplingDistPlot.cxx:170
 SamplingDistPlot.cxx:171
 SamplingDistPlot.cxx:172
 SamplingDistPlot.cxx:173
 SamplingDistPlot.cxx:174
 SamplingDistPlot.cxx:175
 SamplingDistPlot.cxx:176
 SamplingDistPlot.cxx:177
 SamplingDistPlot.cxx:178
 SamplingDistPlot.cxx:179
 SamplingDistPlot.cxx:180
 SamplingDistPlot.cxx:181
 SamplingDistPlot.cxx:182
 SamplingDistPlot.cxx:183
 SamplingDistPlot.cxx:184
 SamplingDistPlot.cxx:185
 SamplingDistPlot.cxx:186
 SamplingDistPlot.cxx:187
 SamplingDistPlot.cxx:188
 SamplingDistPlot.cxx:189
 SamplingDistPlot.cxx:190
 SamplingDistPlot.cxx:191
 SamplingDistPlot.cxx:192
 SamplingDistPlot.cxx:193
 SamplingDistPlot.cxx:194
 SamplingDistPlot.cxx:195
 SamplingDistPlot.cxx:196
 SamplingDistPlot.cxx:197
 SamplingDistPlot.cxx:198
 SamplingDistPlot.cxx:199
 SamplingDistPlot.cxx:200
 SamplingDistPlot.cxx:201
 SamplingDistPlot.cxx:202
 SamplingDistPlot.cxx:203
 SamplingDistPlot.cxx:204
 SamplingDistPlot.cxx:205
 SamplingDistPlot.cxx:206
 SamplingDistPlot.cxx:207
 SamplingDistPlot.cxx:208
 SamplingDistPlot.cxx:209
 SamplingDistPlot.cxx:210
 SamplingDistPlot.cxx:211
 SamplingDistPlot.cxx:212
 SamplingDistPlot.cxx:213
 SamplingDistPlot.cxx:214
 SamplingDistPlot.cxx:215
 SamplingDistPlot.cxx:216
 SamplingDistPlot.cxx:217
 SamplingDistPlot.cxx:218
 SamplingDistPlot.cxx:219
 SamplingDistPlot.cxx:220
 SamplingDistPlot.cxx:221
 SamplingDistPlot.cxx:222
 SamplingDistPlot.cxx:223
 SamplingDistPlot.cxx:224
 SamplingDistPlot.cxx:225
 SamplingDistPlot.cxx:226
 SamplingDistPlot.cxx:227
 SamplingDistPlot.cxx:228
 SamplingDistPlot.cxx:229
 SamplingDistPlot.cxx:230
 SamplingDistPlot.cxx:231
 SamplingDistPlot.cxx:232
 SamplingDistPlot.cxx:233
 SamplingDistPlot.cxx:234
 SamplingDistPlot.cxx:235
 SamplingDistPlot.cxx:236
 SamplingDistPlot.cxx:237
 SamplingDistPlot.cxx:238
 SamplingDistPlot.cxx:239
 SamplingDistPlot.cxx:240
 SamplingDistPlot.cxx:241
 SamplingDistPlot.cxx:242
 SamplingDistPlot.cxx:243
 SamplingDistPlot.cxx:244
 SamplingDistPlot.cxx:245
 SamplingDistPlot.cxx:246
 SamplingDistPlot.cxx:247
 SamplingDistPlot.cxx:248
 SamplingDistPlot.cxx:249
 SamplingDistPlot.cxx:250
 SamplingDistPlot.cxx:251
 SamplingDistPlot.cxx:252
 SamplingDistPlot.cxx:253
 SamplingDistPlot.cxx:254
 SamplingDistPlot.cxx:255
 SamplingDistPlot.cxx:256
 SamplingDistPlot.cxx:257
 SamplingDistPlot.cxx:258
 SamplingDistPlot.cxx:259
 SamplingDistPlot.cxx:260
 SamplingDistPlot.cxx:261
 SamplingDistPlot.cxx:262
 SamplingDistPlot.cxx:263
 SamplingDistPlot.cxx:264
 SamplingDistPlot.cxx:265
 SamplingDistPlot.cxx:266
 SamplingDistPlot.cxx:267
 SamplingDistPlot.cxx:268
 SamplingDistPlot.cxx:269
 SamplingDistPlot.cxx:270
 SamplingDistPlot.cxx:271
 SamplingDistPlot.cxx:272
 SamplingDistPlot.cxx:273
 SamplingDistPlot.cxx:274
 SamplingDistPlot.cxx:275
 SamplingDistPlot.cxx:276
 SamplingDistPlot.cxx:277
 SamplingDistPlot.cxx:278
 SamplingDistPlot.cxx:279
 SamplingDistPlot.cxx:280
 SamplingDistPlot.cxx:281
 SamplingDistPlot.cxx:282
 SamplingDistPlot.cxx:283
 SamplingDistPlot.cxx:284
 SamplingDistPlot.cxx:285
 SamplingDistPlot.cxx:286
 SamplingDistPlot.cxx:287
 SamplingDistPlot.cxx:288
 SamplingDistPlot.cxx:289
 SamplingDistPlot.cxx:290
 SamplingDistPlot.cxx:291
 SamplingDistPlot.cxx:292
 SamplingDistPlot.cxx:293
 SamplingDistPlot.cxx:294
 SamplingDistPlot.cxx:295
 SamplingDistPlot.cxx:296
 SamplingDistPlot.cxx:297
 SamplingDistPlot.cxx:298
 SamplingDistPlot.cxx:299
 SamplingDistPlot.cxx:300
 SamplingDistPlot.cxx:301
 SamplingDistPlot.cxx:302
 SamplingDistPlot.cxx:303
 SamplingDistPlot.cxx:304
 SamplingDistPlot.cxx:305
 SamplingDistPlot.cxx:306
 SamplingDistPlot.cxx:307
 SamplingDistPlot.cxx:308
 SamplingDistPlot.cxx:309
 SamplingDistPlot.cxx:310
 SamplingDistPlot.cxx:311
 SamplingDistPlot.cxx:312
 SamplingDistPlot.cxx:313
 SamplingDistPlot.cxx:314
 SamplingDistPlot.cxx:315
 SamplingDistPlot.cxx:316
 SamplingDistPlot.cxx:317
 SamplingDistPlot.cxx:318
 SamplingDistPlot.cxx:319
 SamplingDistPlot.cxx:320
 SamplingDistPlot.cxx:321
 SamplingDistPlot.cxx:322
 SamplingDistPlot.cxx:323
 SamplingDistPlot.cxx:324
 SamplingDistPlot.cxx:325
 SamplingDistPlot.cxx:326
 SamplingDistPlot.cxx:327
 SamplingDistPlot.cxx:328
 SamplingDistPlot.cxx:329
 SamplingDistPlot.cxx:330
 SamplingDistPlot.cxx:331
 SamplingDistPlot.cxx:332
 SamplingDistPlot.cxx:333
 SamplingDistPlot.cxx:334
 SamplingDistPlot.cxx:335
 SamplingDistPlot.cxx:336
 SamplingDistPlot.cxx:337
 SamplingDistPlot.cxx:338
 SamplingDistPlot.cxx:339
 SamplingDistPlot.cxx:340
 SamplingDistPlot.cxx:341
 SamplingDistPlot.cxx:342
 SamplingDistPlot.cxx:343
 SamplingDistPlot.cxx:344
 SamplingDistPlot.cxx:345
 SamplingDistPlot.cxx:346
 SamplingDistPlot.cxx:347
 SamplingDistPlot.cxx:348
 SamplingDistPlot.cxx:349
 SamplingDistPlot.cxx:350
 SamplingDistPlot.cxx:351
 SamplingDistPlot.cxx:352
 SamplingDistPlot.cxx:353
 SamplingDistPlot.cxx:354
 SamplingDistPlot.cxx:355
 SamplingDistPlot.cxx:356
 SamplingDistPlot.cxx:357
 SamplingDistPlot.cxx:358
 SamplingDistPlot.cxx:359
 SamplingDistPlot.cxx:360
 SamplingDistPlot.cxx:361
 SamplingDistPlot.cxx:362
 SamplingDistPlot.cxx:363
 SamplingDistPlot.cxx:364
 SamplingDistPlot.cxx:365
 SamplingDistPlot.cxx:366
 SamplingDistPlot.cxx:367
 SamplingDistPlot.cxx:368
 SamplingDistPlot.cxx:369
 SamplingDistPlot.cxx:370
 SamplingDistPlot.cxx:371
 SamplingDistPlot.cxx:372
 SamplingDistPlot.cxx:373
 SamplingDistPlot.cxx:374
 SamplingDistPlot.cxx:375
 SamplingDistPlot.cxx:376
 SamplingDistPlot.cxx:377
 SamplingDistPlot.cxx:378
 SamplingDistPlot.cxx:379
 SamplingDistPlot.cxx:380
 SamplingDistPlot.cxx:381
 SamplingDistPlot.cxx:382
 SamplingDistPlot.cxx:383
 SamplingDistPlot.cxx:384
 SamplingDistPlot.cxx:385
 SamplingDistPlot.cxx:386
 SamplingDistPlot.cxx:387
 SamplingDistPlot.cxx:388
 SamplingDistPlot.cxx:389
 SamplingDistPlot.cxx:390
 SamplingDistPlot.cxx:391
 SamplingDistPlot.cxx:392
 SamplingDistPlot.cxx:393
 SamplingDistPlot.cxx:394
 SamplingDistPlot.cxx:395
 SamplingDistPlot.cxx:396
 SamplingDistPlot.cxx:397
 SamplingDistPlot.cxx:398
 SamplingDistPlot.cxx:399
 SamplingDistPlot.cxx:400
 SamplingDistPlot.cxx:401
 SamplingDistPlot.cxx:402
 SamplingDistPlot.cxx:403
 SamplingDistPlot.cxx:404
 SamplingDistPlot.cxx:405
 SamplingDistPlot.cxx:406
 SamplingDistPlot.cxx:407
 SamplingDistPlot.cxx:408
 SamplingDistPlot.cxx:409
 SamplingDistPlot.cxx:410
 SamplingDistPlot.cxx:411
 SamplingDistPlot.cxx:412
 SamplingDistPlot.cxx:413
 SamplingDistPlot.cxx:414
 SamplingDistPlot.cxx:415
 SamplingDistPlot.cxx:416
 SamplingDistPlot.cxx:417
 SamplingDistPlot.cxx:418
 SamplingDistPlot.cxx:419
 SamplingDistPlot.cxx:420
 SamplingDistPlot.cxx:421
 SamplingDistPlot.cxx:422
 SamplingDistPlot.cxx:423
 SamplingDistPlot.cxx:424
 SamplingDistPlot.cxx:425
 SamplingDistPlot.cxx:426
 SamplingDistPlot.cxx:427
 SamplingDistPlot.cxx:428
 SamplingDistPlot.cxx:429
 SamplingDistPlot.cxx:430
 SamplingDistPlot.cxx:431
 SamplingDistPlot.cxx:432
 SamplingDistPlot.cxx:433
 SamplingDistPlot.cxx:434
 SamplingDistPlot.cxx:435
 SamplingDistPlot.cxx:436
 SamplingDistPlot.cxx:437
 SamplingDistPlot.cxx:438
 SamplingDistPlot.cxx:439
 SamplingDistPlot.cxx:440
 SamplingDistPlot.cxx:441
 SamplingDistPlot.cxx:442
 SamplingDistPlot.cxx:443
 SamplingDistPlot.cxx:444
 SamplingDistPlot.cxx:445
 SamplingDistPlot.cxx:446
 SamplingDistPlot.cxx:447
 SamplingDistPlot.cxx:448
 SamplingDistPlot.cxx:449
 SamplingDistPlot.cxx:450
 SamplingDistPlot.cxx:451
 SamplingDistPlot.cxx:452
 SamplingDistPlot.cxx:453
 SamplingDistPlot.cxx:454
 SamplingDistPlot.cxx:455
 SamplingDistPlot.cxx:456
 SamplingDistPlot.cxx:457
 SamplingDistPlot.cxx:458
 SamplingDistPlot.cxx:459
 SamplingDistPlot.cxx:460
 SamplingDistPlot.cxx:461
 SamplingDistPlot.cxx:462
 SamplingDistPlot.cxx:463
 SamplingDistPlot.cxx:464
 SamplingDistPlot.cxx:465
 SamplingDistPlot.cxx:466
 SamplingDistPlot.cxx:467
 SamplingDistPlot.cxx:468
 SamplingDistPlot.cxx:469
 SamplingDistPlot.cxx:470
 SamplingDistPlot.cxx:471
 SamplingDistPlot.cxx:472
 SamplingDistPlot.cxx:473
 SamplingDistPlot.cxx:474
 SamplingDistPlot.cxx:475
 SamplingDistPlot.cxx:476
 SamplingDistPlot.cxx:477
 SamplingDistPlot.cxx:478
 SamplingDistPlot.cxx:479
 SamplingDistPlot.cxx:480
 SamplingDistPlot.cxx:481
 SamplingDistPlot.cxx:482
 SamplingDistPlot.cxx:483
 SamplingDistPlot.cxx:484
 SamplingDistPlot.cxx:485
 SamplingDistPlot.cxx:486
 SamplingDistPlot.cxx:487
 SamplingDistPlot.cxx:488
 SamplingDistPlot.cxx:489
 SamplingDistPlot.cxx:490
 SamplingDistPlot.cxx:491
 SamplingDistPlot.cxx:492
 SamplingDistPlot.cxx:493
 SamplingDistPlot.cxx:494
 SamplingDistPlot.cxx:495
 SamplingDistPlot.cxx:496
 SamplingDistPlot.cxx:497
 SamplingDistPlot.cxx:498
 SamplingDistPlot.cxx:499
 SamplingDistPlot.cxx:500
 SamplingDistPlot.cxx:501
 SamplingDistPlot.cxx:502
 SamplingDistPlot.cxx:503
 SamplingDistPlot.cxx:504
 SamplingDistPlot.cxx:505
 SamplingDistPlot.cxx:506
 SamplingDistPlot.cxx:507
 SamplingDistPlot.cxx:508
 SamplingDistPlot.cxx:509
 SamplingDistPlot.cxx:510
 SamplingDistPlot.cxx:511
 SamplingDistPlot.cxx:512
 SamplingDistPlot.cxx:513
 SamplingDistPlot.cxx:514
 SamplingDistPlot.cxx:515
 SamplingDistPlot.cxx:516
 SamplingDistPlot.cxx:517
 SamplingDistPlot.cxx:518
 SamplingDistPlot.cxx:519
 SamplingDistPlot.cxx:520
 SamplingDistPlot.cxx:521
 SamplingDistPlot.cxx:522
 SamplingDistPlot.cxx:523
 SamplingDistPlot.cxx:524
 SamplingDistPlot.cxx:525
 SamplingDistPlot.cxx:526
 SamplingDistPlot.cxx:527
 SamplingDistPlot.cxx:528
 SamplingDistPlot.cxx:529
 SamplingDistPlot.cxx:530
 SamplingDistPlot.cxx:531
 SamplingDistPlot.cxx:532
 SamplingDistPlot.cxx:533
 SamplingDistPlot.cxx:534
 SamplingDistPlot.cxx:535
 SamplingDistPlot.cxx:536
 SamplingDistPlot.cxx:537
 SamplingDistPlot.cxx:538
 SamplingDistPlot.cxx:539
 SamplingDistPlot.cxx:540
 SamplingDistPlot.cxx:541
 SamplingDistPlot.cxx:542
 SamplingDistPlot.cxx:543
 SamplingDistPlot.cxx:544
 SamplingDistPlot.cxx:545
 SamplingDistPlot.cxx:546
 SamplingDistPlot.cxx:547
 SamplingDistPlot.cxx:548
 SamplingDistPlot.cxx:549
 SamplingDistPlot.cxx:550
 SamplingDistPlot.cxx:551
 SamplingDistPlot.cxx:552
 SamplingDistPlot.cxx:553
 SamplingDistPlot.cxx:554
 SamplingDistPlot.cxx:555
 SamplingDistPlot.cxx:556
 SamplingDistPlot.cxx:557
 SamplingDistPlot.cxx:558
 SamplingDistPlot.cxx:559
 SamplingDistPlot.cxx:560
 SamplingDistPlot.cxx:561
 SamplingDistPlot.cxx:562
 SamplingDistPlot.cxx:563
 SamplingDistPlot.cxx:564
 SamplingDistPlot.cxx:565
 SamplingDistPlot.cxx:566
 SamplingDistPlot.cxx:567
 SamplingDistPlot.cxx:568
 SamplingDistPlot.cxx:569
 SamplingDistPlot.cxx:570
 SamplingDistPlot.cxx:571
 SamplingDistPlot.cxx:572
 SamplingDistPlot.cxx:573
 SamplingDistPlot.cxx:574
 SamplingDistPlot.cxx:575
 SamplingDistPlot.cxx:576
 SamplingDistPlot.cxx:577
 SamplingDistPlot.cxx:578
 SamplingDistPlot.cxx:579
 SamplingDistPlot.cxx:580
 SamplingDistPlot.cxx:581
 SamplingDistPlot.cxx:582
 SamplingDistPlot.cxx:583
 SamplingDistPlot.cxx:584
 SamplingDistPlot.cxx:585
 SamplingDistPlot.cxx:586
 SamplingDistPlot.cxx:587
 SamplingDistPlot.cxx:588
 SamplingDistPlot.cxx:589
 SamplingDistPlot.cxx:590
 SamplingDistPlot.cxx:591
 SamplingDistPlot.cxx:592
 SamplingDistPlot.cxx:593
 SamplingDistPlot.cxx:594
 SamplingDistPlot.cxx:595
 SamplingDistPlot.cxx:596
 SamplingDistPlot.cxx:597
 SamplingDistPlot.cxx:598
 SamplingDistPlot.cxx:599