// @(#)root/roostats:$Id$
// Author: 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.             *
 *************************************************************************/

/**
   HypoTestInverterPlot class
**/

#include <cmath>

// include other header files
#include "RooStats/HybridResult.h"

// include header file of this class 
#include "RooStats/HypoTestInverterPlot.h"
#include "RooStats/HypoTestInverterResult.h"
#include "RooStats/HypoTestPlot.h"

#include "TGraphErrors.h"
#include "TGraphAsymmErrors.h"
#include "TMultiGraph.h"
#include "TROOT.h"
#include "TLine.h"
#include "TAxis.h"
#include "TLegend.h"
#include "TH1.h"
#include "TPad.h"
#include "Math/DistFuncMathCore.h"

using namespace std;

ClassImp(RooStats::HypoTestInverterPlot)

using namespace RooStats;


HypoTestInverterPlot::HypoTestInverterPlot(HypoTestInverterResult* results ) :
   TNamed( results->GetName(), results->GetTitle() ),
   fResults(results)
{
   // constructor from a HypoTestInverterResult class 
   // name and title are taken from the result class 
}


HypoTestInverterPlot::HypoTestInverterPlot( const char* name,
					    const char* title,
					    HypoTestInverterResult* results ) :
   TNamed( TString(name), TString(title) ),
   fResults(results)
{
  // constructor with name and title from a HypoTestInverterResult class 
}


TGraphErrors* HypoTestInverterPlot::MakePlot(Option_t * opt)
{
   // Make the plot of the result of the scan 
   // using the observed data
   // By default plot CLs or CLsb depending if the flag UseCLs is set 
   //
   // If Option = "CLb"  return  CLb plot
   //           = "CLs+b" return  CLs+b plot  independently of the flag 
   //           = "CLs"   return  CLs plot  independently of the flag 

   TString option(opt);
   option.ToUpper();
   int type = 0; // use default
   if (option.Contains("CLB")) type = 1; // CLb
   else if (option.Contains("CLS+B") || option.Contains("CLSPLUSB")) type = 2; // CLs+b
   else if (option.Contains("CLS" )) type = 3; // CLs
   
   const int nEntries = fResults->ArraySize();

   // sort the arrays based on the x values
   std::vector<unsigned int> index(nEntries);
   TMath::SortItr(fResults->fXValues.begin(), fResults->fXValues.end(), index.begin(), false);

   // copy result in sorted arrays
   std::vector<Double_t> xArray(nEntries);
   std::vector<Double_t> yArray(nEntries);
   std::vector<Double_t> yErrArray(nEntries);
   for (int i=0; i<nEntries; i++) {
      xArray[i] = fResults->GetXValue(index[i]);
      if (type == 0) { 
         yArray[i] = fResults->GetYValue(index[i]);
         yErrArray[i] = fResults->GetYError(index[i]);
      } else if (type == 1) { 
         yArray[i] = fResults->CLb(index[i]);
         yErrArray[i] = fResults->CLbError(index[i]);
      } else if (type == 2) { 
         yArray[i] = fResults->CLsplusb(index[i]);
         yErrArray[i] = fResults->CLsplusbError(index[i]);
      } else if (type == 3) { 
         yArray[i] = fResults->CLs(index[i]);
         yErrArray[i] = fResults->CLsError(index[i]);
      }
   }

   TGraphErrors* graph = new TGraphErrors(nEntries,&xArray.front(),&yArray.front(),0,&yErrArray.front());
   TString pValueName = "CLs";
   if (type == 1 ) pValueName = "CLb"; 
   if (type == 2 || (type == 0 && !fResults->fUseCLs) ) pValueName = "CLs+b"; 
   TString name = pValueName + TString("_observed");
   TString title = TString("Observed ") + pValueName; 
   graph->SetName(name);
   graph->SetTitle(title);
   graph->SetMarkerStyle(20);
   graph->SetLineWidth(2);
   return graph;
}

TMultiGraph* HypoTestInverterPlot::MakeExpectedPlot(double nsig1, double nsig2 )
{
   // Make the expected plot and the bands 
   // nsig1 and nsig2 indicates the n-sigma value for the bands
   // if nsig1 = 0 no band is drawn (only expected value)
   // if nsig2 > nsig1 (default is nsig1=1 and nsig2=2) the second band is also drawn
   // The first band is drawn in green while the second in yellow 
   // THe return result is a TMultiGraph object



   const int nEntries = fResults->ArraySize();
   bool doFirstBand = (nsig1 > 0);
   bool doSecondBand = (nsig2 > nsig1);

   nsig1 = std::abs(nsig1);
   nsig2 = std::abs(nsig2);

   // sort the arrays based on the x values
   std::vector<unsigned int> index(nEntries);
   TMath::SortItr(fResults->fXValues.begin(), fResults->fXValues.end(), index.begin(), false);

   // create the graphs 
   TGraph * g0 = new TGraph;
   TString pValueName = "CLs";
   if (!fResults->fUseCLs) pValueName = "CLs+b";
   g0->SetTitle(TString::Format("Expected %s - Median",pValueName.Data()) );
   TGraphAsymmErrors * g1 = 0;
   TGraphAsymmErrors * g2 = 0; 
   if (doFirstBand) {
      g1 = new TGraphAsymmErrors;
      if (nsig1 - int(nsig1) < 0.01) 
         g1->SetTitle(TString::Format("Expected %s #pm %d #sigma",pValueName.Data(),int(nsig1)) );
      else
         g1->SetTitle(TString::Format("Expected %s #pm %3.1f #sigma",pValueName.Data(),nsig1) );
   }
   if (doSecondBand) { 
      g2 = new TGraphAsymmErrors;
      if (nsig2 - int(nsig2) < 0.01) 
         g2->SetTitle(TString::Format("Expected %s #pm %d #sigma",pValueName.Data(),int(nsig2)) );
      else 
         g2->SetTitle(TString::Format("Expected %s #pm %3.1f #sigma",pValueName.Data(),nsig2) );
   }
   double p[7]; 
   double q[7];
   p[0] = ROOT::Math::normal_cdf(-nsig2);
   p[1] = ROOT::Math::normal_cdf(-nsig1);
   p[2] = 0.5;
   p[3] = ROOT::Math::normal_cdf(nsig1);
   p[4] = ROOT::Math::normal_cdf(nsig2);

   bool resultIsAsymptotic = ( !fResults->GetNullTestStatDist(0) && !fResults->GetAltTestStatDist(0) ); 
   int np = 0;
   for (int j=0; j<nEntries; ++j) {
      int i = index[j]; // i is the order index 
      SamplingDistribution * s = fResults->GetExpectedPValueDist(i);
      if ( !s)  continue; 
      const std::vector<double> & values = s->GetSamplingDistribution();
      // special case for asymptotic results (cannot use TMath::quantile in that case)
      if (resultIsAsymptotic) { 
         double maxSigma = fResults->fgAsymptoticMaxSigma;
         double dsig = 2* maxSigma/ (values.size() -1) ;         
         int  i0 = (int) TMath::Floor ( ( -nsig2 +  maxSigma )/dsig + 0.5);
         int  i1 = (int) TMath::Floor ( (-nsig1 +  maxSigma )/dsig + 0.5);
         int  i2 = (int) TMath::Floor ( ( maxSigma)/dsig + 0.5);
         int  i3 = (int) TMath::Floor ( ( nsig1 + maxSigma)/dsig + 0.5);
         int  i4 = (int) TMath::Floor ( ( nsig2 + maxSigma)/dsig + 0.5);
         q[0] = values[i0];
         q[1] = values[i1];
         q[2] = values[i2];
         q[3] = values[i3];
         q[4] = values[i4];
      }
      else { 
         double * x = const_cast<double *>(&values[0]); // need to change TMath::Quantiles
         TMath::Quantiles(values.size(), 5, x,q,p,false);
      }

      g0->SetPoint(np, fResults->GetXValue(i),  q[2]);
      if (g1) { 
         g1->SetPoint(np, fResults->GetXValue(i),  q[2]);
         g1->SetPointEYlow(np, q[2] - q[1]); // -1 sigma errorr   
         g1->SetPointEYhigh(np, q[3] - q[2]);//+1 sigma error
      }
      if (g2) {
         g2->SetPoint(np, fResults->GetXValue(i), q[2]);

         g2->SetPointEYlow(np, q[2]-q[0]);   // -2 -- -1 sigma error
         g2->SetPointEYhigh(np, q[4]-q[2]);
      }
      if (s) delete s;
      np++;
   }



   TString name = GetName() + TString("_expected");
   TString title = TString("Expected ") + GetTitle(); 
   TMultiGraph* graph = new TMultiGraph(name,title);
  
   // set the graphics options and add in multi graph
   // orderof adding is drawing order 
   if (g2) { 
      g2->SetFillColor(kYellow);
      graph->Add(g2,"3");
   }
   if (g1) { 
      g1->SetFillColor(kGreen);
      graph->Add(g1,"3");
   }
   g0->SetLineStyle(2);
   g0->SetLineWidth(2);
   graph->Add(g0,"L");

   return graph;
}

HypoTestInverterPlot::~HypoTestInverterPlot()
{
   // destructor
}

void HypoTestInverterPlot::Draw(Option_t * opt) { 
   // Draw the result in the current canvas 
   // Possible options: 
   //   SAME : draw in the current axis 
   //   OBS  :  draw only the observed plot 
   //   EXP  :  draw only the expected plot 
   // 
   //   CLB  : draw also the CLB
   //   2CL  : drow both clsplusb and cls
   //
   // default draw observed + expected with 1 and 2 sigma bands 

   TString option(opt);
   option.ToUpper();
   bool drawAxis = !option.Contains("SAME");
   bool drawObs = option.Contains("OBS") || !option.Contains("EXP");
   bool drawExp = option.Contains("EXP") || !option.Contains("OBS");     
   bool drawCLb = option.Contains("CLB");
   bool draw2CL = option.Contains("2CL");
   
   TGraphErrors * gobs = 0;
   TGraph * gplot = 0;
   if (drawObs) { 
      gobs = MakePlot(); 
      // add object to top-level directory to avoid mem leak
      if (gROOT) gROOT->Add(gobs); 
      if (drawAxis) { 
         gobs->Draw("APL");        
         gplot = gobs;
         gplot->GetHistogram()->SetTitle( GetTitle() );
      }
      else gobs->Draw("PL");

   }
   TMultiGraph * gexp = 0;
   if (drawExp) { 
      gexp = MakeExpectedPlot(); 
      // add object to current directory to avoid mem leak
      if (gROOT) gROOT->Add(gexp); 
      if (drawAxis && !drawObs) { 
         gexp->Draw("A");
         if (gexp->GetHistogram()) gexp->GetHistogram()->SetTitle( GetTitle() );
         gplot = (TGraph*) gexp->GetListOfGraphs()->First();
      }
      else 
         gexp->Draw();

   }

   // draw also an horizontal  line at the desired conf level
   if (gplot) {     
      double alpha = 1.-fResults->ConfidenceLevel();
      double x1 = gplot->GetXaxis()->GetXmin();
      double x2 = gplot->GetXaxis()->GetXmax();
      TLine * line = new TLine(x1, alpha, x2,alpha);
      line->SetLineColor(kRed);
      line->Draw();
      // put axis labels 
      RooAbsArg * arg = fResults->fParameters.first();
      if (arg) gplot->GetXaxis()->SetTitle(arg->GetName());
      gplot->GetYaxis()->SetTitle("p value");
   }


   TGraph *gclb = 0;
   if (drawCLb) { 
      gclb = MakePlot("CLb");
      if (gROOT) gROOT->Add(gclb); 
      gclb->SetMarkerColor(kBlue+4);
      gclb->Draw("PL");
      // draw in red observed cls or clsb
      if (gobs) gobs->SetMarkerColor(kRed);
   }
   TGraph * gclsb = 0;
   TGraph * gcls = 0;
   if (draw2CL) { 
      if (fResults->fUseCLs) {
         gclsb = MakePlot("CLs+b");
         if (gROOT) gROOT->Add(gclsb); 
         gclsb->SetMarkerColor(kBlue);
         gclsb->Draw("PL");
         gclsb->SetLineStyle(3);
      }
      else { 
         gcls = MakePlot("CLs");
         if (gROOT) gROOT->Add(gcls); 
         gcls->SetMarkerColor(kBlue);
         gcls->Draw("PL");
         gcls->SetLineStyle(3);
      }
   }
   // draw again observed values otherwise will be covered by the bands
   if (gobs) { 
      gobs->Draw("PL"); 
   }


   double y0 = 0.6;
   double verticalSize = (gexp || draw2CL || drawCLb ) ? 0.3 : 0.15;
   double y1 = y0 + verticalSize;
   TLegend * l = new TLegend(0.6,y0,0.9,y1);
   if (gobs) l->AddEntry(gobs,"","PEL");
   if (gclsb) l->AddEntry(gclsb,"","PEL");
   if (gcls) l->AddEntry(gcls,"","PEL");
   if (gclb) l->AddEntry(gclb,"","PEL");
   if (gexp) { 
      // loop in reverse order (opposite to drawing one)
      int ngraphs =  gexp->GetListOfGraphs()->GetSize();
      for (int i = ngraphs-1; i>=0; --i) {
         TObject * obj =  gexp->GetListOfGraphs()->At(i);
         TString lopt = "F";
         if (i == ngraphs-1) lopt = "L";   
         if (obj)  l->AddEntry(obj,"",lopt);
      }
   }
   l->Draw();
   // redraw the axis 
   if (gPad) gPad->RedrawAxis();

}

SamplingDistPlot * HypoTestInverterPlot::MakeTestStatPlot(int index, int type, int nbins) { 
   // plot the test statistic distributions
   // type =0  null and alt 
   // type = 1 only null (S+B)
   // type = 2 only alt  (B)
   SamplingDistPlot * pl = 0;
   if (type == 0) {  
      HypoTestResult * result = (HypoTestResult*) fResults->fYObjects.At(index);
      if (result) 
         pl = new HypoTestPlot(*result, nbins );
      return pl;
   }
   if (type == 1) { 
      SamplingDistribution * sbDist = fResults->GetSignalAndBackgroundTestStatDist(index);
      if (sbDist) { 
         pl = new SamplingDistPlot( nbins);
         pl->AddSamplingDistribution(sbDist);
         return pl;
      }
   }
   if (type == 2) { 
      SamplingDistribution * bDist = fResults->GetBackgroundTestStatDist(index);
      if (bDist) { 
         pl = new SamplingDistPlot( nbins);
         pl->AddSamplingDistribution(bDist);
         return pl;
      }
   }
   return 0; 
}
 HypoTestInverterPlot.cxx:1
 HypoTestInverterPlot.cxx:2
 HypoTestInverterPlot.cxx:3
 HypoTestInverterPlot.cxx:4
 HypoTestInverterPlot.cxx:5
 HypoTestInverterPlot.cxx:6
 HypoTestInverterPlot.cxx:7
 HypoTestInverterPlot.cxx:8
 HypoTestInverterPlot.cxx:9
 HypoTestInverterPlot.cxx:10
 HypoTestInverterPlot.cxx:11
 HypoTestInverterPlot.cxx:12
 HypoTestInverterPlot.cxx:13
 HypoTestInverterPlot.cxx:14
 HypoTestInverterPlot.cxx:15
 HypoTestInverterPlot.cxx:16
 HypoTestInverterPlot.cxx:17
 HypoTestInverterPlot.cxx:18
 HypoTestInverterPlot.cxx:19
 HypoTestInverterPlot.cxx:20
 HypoTestInverterPlot.cxx:21
 HypoTestInverterPlot.cxx:22
 HypoTestInverterPlot.cxx:23
 HypoTestInverterPlot.cxx:24
 HypoTestInverterPlot.cxx:25
 HypoTestInverterPlot.cxx:26
 HypoTestInverterPlot.cxx:27
 HypoTestInverterPlot.cxx:28
 HypoTestInverterPlot.cxx:29
 HypoTestInverterPlot.cxx:30
 HypoTestInverterPlot.cxx:31
 HypoTestInverterPlot.cxx:32
 HypoTestInverterPlot.cxx:33
 HypoTestInverterPlot.cxx:34
 HypoTestInverterPlot.cxx:35
 HypoTestInverterPlot.cxx:36
 HypoTestInverterPlot.cxx:37
 HypoTestInverterPlot.cxx:38
 HypoTestInverterPlot.cxx:39
 HypoTestInverterPlot.cxx:40
 HypoTestInverterPlot.cxx:41
 HypoTestInverterPlot.cxx:42
 HypoTestInverterPlot.cxx:43
 HypoTestInverterPlot.cxx:44
 HypoTestInverterPlot.cxx:45
 HypoTestInverterPlot.cxx:46
 HypoTestInverterPlot.cxx:47
 HypoTestInverterPlot.cxx:48
 HypoTestInverterPlot.cxx:49
 HypoTestInverterPlot.cxx:50
 HypoTestInverterPlot.cxx:51
 HypoTestInverterPlot.cxx:52
 HypoTestInverterPlot.cxx:53
 HypoTestInverterPlot.cxx:54
 HypoTestInverterPlot.cxx:55
 HypoTestInverterPlot.cxx:56
 HypoTestInverterPlot.cxx:57
 HypoTestInverterPlot.cxx:58
 HypoTestInverterPlot.cxx:59
 HypoTestInverterPlot.cxx:60
 HypoTestInverterPlot.cxx:61
 HypoTestInverterPlot.cxx:62
 HypoTestInverterPlot.cxx:63
 HypoTestInverterPlot.cxx:64
 HypoTestInverterPlot.cxx:65
 HypoTestInverterPlot.cxx:66
 HypoTestInverterPlot.cxx:67
 HypoTestInverterPlot.cxx:68
 HypoTestInverterPlot.cxx:69
 HypoTestInverterPlot.cxx:70
 HypoTestInverterPlot.cxx:71
 HypoTestInverterPlot.cxx:72
 HypoTestInverterPlot.cxx:73
 HypoTestInverterPlot.cxx:74
 HypoTestInverterPlot.cxx:75
 HypoTestInverterPlot.cxx:76
 HypoTestInverterPlot.cxx:77
 HypoTestInverterPlot.cxx:78
 HypoTestInverterPlot.cxx:79
 HypoTestInverterPlot.cxx:80
 HypoTestInverterPlot.cxx:81
 HypoTestInverterPlot.cxx:82
 HypoTestInverterPlot.cxx:83
 HypoTestInverterPlot.cxx:84
 HypoTestInverterPlot.cxx:85
 HypoTestInverterPlot.cxx:86
 HypoTestInverterPlot.cxx:87
 HypoTestInverterPlot.cxx:88
 HypoTestInverterPlot.cxx:89
 HypoTestInverterPlot.cxx:90
 HypoTestInverterPlot.cxx:91
 HypoTestInverterPlot.cxx:92
 HypoTestInverterPlot.cxx:93
 HypoTestInverterPlot.cxx:94
 HypoTestInverterPlot.cxx:95
 HypoTestInverterPlot.cxx:96
 HypoTestInverterPlot.cxx:97
 HypoTestInverterPlot.cxx:98
 HypoTestInverterPlot.cxx:99
 HypoTestInverterPlot.cxx:100
 HypoTestInverterPlot.cxx:101
 HypoTestInverterPlot.cxx:102
 HypoTestInverterPlot.cxx:103
 HypoTestInverterPlot.cxx:104
 HypoTestInverterPlot.cxx:105
 HypoTestInverterPlot.cxx:106
 HypoTestInverterPlot.cxx:107
 HypoTestInverterPlot.cxx:108
 HypoTestInverterPlot.cxx:109
 HypoTestInverterPlot.cxx:110
 HypoTestInverterPlot.cxx:111
 HypoTestInverterPlot.cxx:112
 HypoTestInverterPlot.cxx:113
 HypoTestInverterPlot.cxx:114
 HypoTestInverterPlot.cxx:115
 HypoTestInverterPlot.cxx:116
 HypoTestInverterPlot.cxx:117
 HypoTestInverterPlot.cxx:118
 HypoTestInverterPlot.cxx:119
 HypoTestInverterPlot.cxx:120
 HypoTestInverterPlot.cxx:121
 HypoTestInverterPlot.cxx:122
 HypoTestInverterPlot.cxx:123
 HypoTestInverterPlot.cxx:124
 HypoTestInverterPlot.cxx:125
 HypoTestInverterPlot.cxx:126
 HypoTestInverterPlot.cxx:127
 HypoTestInverterPlot.cxx:128
 HypoTestInverterPlot.cxx:129
 HypoTestInverterPlot.cxx:130
 HypoTestInverterPlot.cxx:131
 HypoTestInverterPlot.cxx:132
 HypoTestInverterPlot.cxx:133
 HypoTestInverterPlot.cxx:134
 HypoTestInverterPlot.cxx:135
 HypoTestInverterPlot.cxx:136
 HypoTestInverterPlot.cxx:137
 HypoTestInverterPlot.cxx:138
 HypoTestInverterPlot.cxx:139
 HypoTestInverterPlot.cxx:140
 HypoTestInverterPlot.cxx:141
 HypoTestInverterPlot.cxx:142
 HypoTestInverterPlot.cxx:143
 HypoTestInverterPlot.cxx:144
 HypoTestInverterPlot.cxx:145
 HypoTestInverterPlot.cxx:146
 HypoTestInverterPlot.cxx:147
 HypoTestInverterPlot.cxx:148
 HypoTestInverterPlot.cxx:149
 HypoTestInverterPlot.cxx:150
 HypoTestInverterPlot.cxx:151
 HypoTestInverterPlot.cxx:152
 HypoTestInverterPlot.cxx:153
 HypoTestInverterPlot.cxx:154
 HypoTestInverterPlot.cxx:155
 HypoTestInverterPlot.cxx:156
 HypoTestInverterPlot.cxx:157
 HypoTestInverterPlot.cxx:158
 HypoTestInverterPlot.cxx:159
 HypoTestInverterPlot.cxx:160
 HypoTestInverterPlot.cxx:161
 HypoTestInverterPlot.cxx:162
 HypoTestInverterPlot.cxx:163
 HypoTestInverterPlot.cxx:164
 HypoTestInverterPlot.cxx:165
 HypoTestInverterPlot.cxx:166
 HypoTestInverterPlot.cxx:167
 HypoTestInverterPlot.cxx:168
 HypoTestInverterPlot.cxx:169
 HypoTestInverterPlot.cxx:170
 HypoTestInverterPlot.cxx:171
 HypoTestInverterPlot.cxx:172
 HypoTestInverterPlot.cxx:173
 HypoTestInverterPlot.cxx:174
 HypoTestInverterPlot.cxx:175
 HypoTestInverterPlot.cxx:176
 HypoTestInverterPlot.cxx:177
 HypoTestInverterPlot.cxx:178
 HypoTestInverterPlot.cxx:179
 HypoTestInverterPlot.cxx:180
 HypoTestInverterPlot.cxx:181
 HypoTestInverterPlot.cxx:182
 HypoTestInverterPlot.cxx:183
 HypoTestInverterPlot.cxx:184
 HypoTestInverterPlot.cxx:185
 HypoTestInverterPlot.cxx:186
 HypoTestInverterPlot.cxx:187
 HypoTestInverterPlot.cxx:188
 HypoTestInverterPlot.cxx:189
 HypoTestInverterPlot.cxx:190
 HypoTestInverterPlot.cxx:191
 HypoTestInverterPlot.cxx:192
 HypoTestInverterPlot.cxx:193
 HypoTestInverterPlot.cxx:194
 HypoTestInverterPlot.cxx:195
 HypoTestInverterPlot.cxx:196
 HypoTestInverterPlot.cxx:197
 HypoTestInverterPlot.cxx:198
 HypoTestInverterPlot.cxx:199
 HypoTestInverterPlot.cxx:200
 HypoTestInverterPlot.cxx:201
 HypoTestInverterPlot.cxx:202
 HypoTestInverterPlot.cxx:203
 HypoTestInverterPlot.cxx:204
 HypoTestInverterPlot.cxx:205
 HypoTestInverterPlot.cxx:206
 HypoTestInverterPlot.cxx:207
 HypoTestInverterPlot.cxx:208
 HypoTestInverterPlot.cxx:209
 HypoTestInverterPlot.cxx:210
 HypoTestInverterPlot.cxx:211
 HypoTestInverterPlot.cxx:212
 HypoTestInverterPlot.cxx:213
 HypoTestInverterPlot.cxx:214
 HypoTestInverterPlot.cxx:215
 HypoTestInverterPlot.cxx:216
 HypoTestInverterPlot.cxx:217
 HypoTestInverterPlot.cxx:218
 HypoTestInverterPlot.cxx:219
 HypoTestInverterPlot.cxx:220
 HypoTestInverterPlot.cxx:221
 HypoTestInverterPlot.cxx:222
 HypoTestInverterPlot.cxx:223
 HypoTestInverterPlot.cxx:224
 HypoTestInverterPlot.cxx:225
 HypoTestInverterPlot.cxx:226
 HypoTestInverterPlot.cxx:227
 HypoTestInverterPlot.cxx:228
 HypoTestInverterPlot.cxx:229
 HypoTestInverterPlot.cxx:230
 HypoTestInverterPlot.cxx:231
 HypoTestInverterPlot.cxx:232
 HypoTestInverterPlot.cxx:233
 HypoTestInverterPlot.cxx:234
 HypoTestInverterPlot.cxx:235
 HypoTestInverterPlot.cxx:236
 HypoTestInverterPlot.cxx:237
 HypoTestInverterPlot.cxx:238
 HypoTestInverterPlot.cxx:239
 HypoTestInverterPlot.cxx:240
 HypoTestInverterPlot.cxx:241
 HypoTestInverterPlot.cxx:242
 HypoTestInverterPlot.cxx:243
 HypoTestInverterPlot.cxx:244
 HypoTestInverterPlot.cxx:245
 HypoTestInverterPlot.cxx:246
 HypoTestInverterPlot.cxx:247
 HypoTestInverterPlot.cxx:248
 HypoTestInverterPlot.cxx:249
 HypoTestInverterPlot.cxx:250
 HypoTestInverterPlot.cxx:251
 HypoTestInverterPlot.cxx:252
 HypoTestInverterPlot.cxx:253
 HypoTestInverterPlot.cxx:254
 HypoTestInverterPlot.cxx:255
 HypoTestInverterPlot.cxx:256
 HypoTestInverterPlot.cxx:257
 HypoTestInverterPlot.cxx:258
 HypoTestInverterPlot.cxx:259
 HypoTestInverterPlot.cxx:260
 HypoTestInverterPlot.cxx:261
 HypoTestInverterPlot.cxx:262
 HypoTestInverterPlot.cxx:263
 HypoTestInverterPlot.cxx:264
 HypoTestInverterPlot.cxx:265
 HypoTestInverterPlot.cxx:266
 HypoTestInverterPlot.cxx:267
 HypoTestInverterPlot.cxx:268
 HypoTestInverterPlot.cxx:269
 HypoTestInverterPlot.cxx:270
 HypoTestInverterPlot.cxx:271
 HypoTestInverterPlot.cxx:272
 HypoTestInverterPlot.cxx:273
 HypoTestInverterPlot.cxx:274
 HypoTestInverterPlot.cxx:275
 HypoTestInverterPlot.cxx:276
 HypoTestInverterPlot.cxx:277
 HypoTestInverterPlot.cxx:278
 HypoTestInverterPlot.cxx:279
 HypoTestInverterPlot.cxx:280
 HypoTestInverterPlot.cxx:281
 HypoTestInverterPlot.cxx:282
 HypoTestInverterPlot.cxx:283
 HypoTestInverterPlot.cxx:284
 HypoTestInverterPlot.cxx:285
 HypoTestInverterPlot.cxx:286
 HypoTestInverterPlot.cxx:287
 HypoTestInverterPlot.cxx:288
 HypoTestInverterPlot.cxx:289
 HypoTestInverterPlot.cxx:290
 HypoTestInverterPlot.cxx:291
 HypoTestInverterPlot.cxx:292
 HypoTestInverterPlot.cxx:293
 HypoTestInverterPlot.cxx:294
 HypoTestInverterPlot.cxx:295
 HypoTestInverterPlot.cxx:296
 HypoTestInverterPlot.cxx:297
 HypoTestInverterPlot.cxx:298
 HypoTestInverterPlot.cxx:299
 HypoTestInverterPlot.cxx:300
 HypoTestInverterPlot.cxx:301
 HypoTestInverterPlot.cxx:302
 HypoTestInverterPlot.cxx:303
 HypoTestInverterPlot.cxx:304
 HypoTestInverterPlot.cxx:305
 HypoTestInverterPlot.cxx:306
 HypoTestInverterPlot.cxx:307
 HypoTestInverterPlot.cxx:308
 HypoTestInverterPlot.cxx:309
 HypoTestInverterPlot.cxx:310
 HypoTestInverterPlot.cxx:311
 HypoTestInverterPlot.cxx:312
 HypoTestInverterPlot.cxx:313
 HypoTestInverterPlot.cxx:314
 HypoTestInverterPlot.cxx:315
 HypoTestInverterPlot.cxx:316
 HypoTestInverterPlot.cxx:317
 HypoTestInverterPlot.cxx:318
 HypoTestInverterPlot.cxx:319
 HypoTestInverterPlot.cxx:320
 HypoTestInverterPlot.cxx:321
 HypoTestInverterPlot.cxx:322
 HypoTestInverterPlot.cxx:323
 HypoTestInverterPlot.cxx:324
 HypoTestInverterPlot.cxx:325
 HypoTestInverterPlot.cxx:326
 HypoTestInverterPlot.cxx:327
 HypoTestInverterPlot.cxx:328
 HypoTestInverterPlot.cxx:329
 HypoTestInverterPlot.cxx:330
 HypoTestInverterPlot.cxx:331
 HypoTestInverterPlot.cxx:332
 HypoTestInverterPlot.cxx:333
 HypoTestInverterPlot.cxx:334
 HypoTestInverterPlot.cxx:335
 HypoTestInverterPlot.cxx:336
 HypoTestInverterPlot.cxx:337
 HypoTestInverterPlot.cxx:338
 HypoTestInverterPlot.cxx:339
 HypoTestInverterPlot.cxx:340
 HypoTestInverterPlot.cxx:341
 HypoTestInverterPlot.cxx:342
 HypoTestInverterPlot.cxx:343
 HypoTestInverterPlot.cxx:344
 HypoTestInverterPlot.cxx:345
 HypoTestInverterPlot.cxx:346
 HypoTestInverterPlot.cxx:347
 HypoTestInverterPlot.cxx:348
 HypoTestInverterPlot.cxx:349
 HypoTestInverterPlot.cxx:350
 HypoTestInverterPlot.cxx:351
 HypoTestInverterPlot.cxx:352
 HypoTestInverterPlot.cxx:353
 HypoTestInverterPlot.cxx:354
 HypoTestInverterPlot.cxx:355
 HypoTestInverterPlot.cxx:356
 HypoTestInverterPlot.cxx:357
 HypoTestInverterPlot.cxx:358
 HypoTestInverterPlot.cxx:359
 HypoTestInverterPlot.cxx:360
 HypoTestInverterPlot.cxx:361
 HypoTestInverterPlot.cxx:362
 HypoTestInverterPlot.cxx:363
 HypoTestInverterPlot.cxx:364
 HypoTestInverterPlot.cxx:365
 HypoTestInverterPlot.cxx:366
 HypoTestInverterPlot.cxx:367
 HypoTestInverterPlot.cxx:368
 HypoTestInverterPlot.cxx:369
 HypoTestInverterPlot.cxx:370
 HypoTestInverterPlot.cxx:371
 HypoTestInverterPlot.cxx:372
 HypoTestInverterPlot.cxx:373
 HypoTestInverterPlot.cxx:374
 HypoTestInverterPlot.cxx:375
 HypoTestInverterPlot.cxx:376
 HypoTestInverterPlot.cxx:377
 HypoTestInverterPlot.cxx:378
 HypoTestInverterPlot.cxx:379
 HypoTestInverterPlot.cxx:380
 HypoTestInverterPlot.cxx:381
 HypoTestInverterPlot.cxx:382
 HypoTestInverterPlot.cxx:383
 HypoTestInverterPlot.cxx:384
 HypoTestInverterPlot.cxx:385
 HypoTestInverterPlot.cxx:386
 HypoTestInverterPlot.cxx:387
 HypoTestInverterPlot.cxx:388
 HypoTestInverterPlot.cxx:389
 HypoTestInverterPlot.cxx:390
 HypoTestInverterPlot.cxx:391