#include "TMVA/mvaeffs.h"
#include <iostream>
#include <iomanip>
using std::cout;
using std::endl;
using std::setfill;
using std::setw;



#include "RQ_OBJECT.h"

#include "TH1.h"
#include "TROOT.h"
#include "TList.h"
#include "TIterator.h"
#include "TStyle.h"
#include "TPad.h"
#include "TCanvas.h"
#include "TLatex.h"
#include "TLegend.h"
#include "TLine.h"
#include "TH2.h"
#include "TFormula.h"
#include "TFile.h"
#include "TApplication.h"
#include "TKey.h"
#include "TClass.h"
#include "TGaxis.h"

#include "TGWindow.h"
#include "TGButton.h"
#include "TGLabel.h"
#include "TGNumberEntry.h"

// this macro plots the signal and background efficiencies
// as a function of the MVA cut.

TMVA::MethodInfo::~MethodInfo() 
{
   delete sigE;
   delete bgdE;
   delete purS;
   delete sSig;
   delete effpurS;
   if(gROOT->GetListOfCanvases()->FindObject(canvas))
      delete canvas;
}

void TMVA::MethodInfo::SetResultHists() 
{
   TString pname    = "purS_"         + methodTitle;
   TString epname   = "effpurS_"      + methodTitle;
   TString ssigname = "significance_" + methodTitle;
   
   sigE = (TH1*)origSigE->Clone("sigEffi");
   bgdE = (TH1*)origBgdE->Clone("bgdEffi");
   
   Int_t nbins = sigE->GetNbinsX();
   Double_t low = sigE->GetBinLowEdge(1);
   Double_t high = sigE->GetBinLowEdge(nbins+1);
   purS    = new TH1F(pname, pname, nbins, low, high);
   sSig    = new TH1F(ssigname, ssigname, nbins, low, high);
   effpurS = new TH1F(epname, epname, nbins, low, high);        
   
   // chop off useless stuff
   sigE->SetTitle( Form("Cut efficiencies for %s classifier", methodTitle.Data()) );
   
   // set the histogram style
   TMVAGlob::SetSignalAndBackgroundStyle( sigE, bgdE );
   TMVAGlob::SetSignalAndBackgroundStyle( purS, bgdE );
   TMVAGlob::SetSignalAndBackgroundStyle( effpurS, bgdE );
   sigE->SetFillStyle( 0 );
   bgdE->SetFillStyle( 0 );
   sSig->SetFillStyle( 0 );
   sigE->SetLineWidth( 3 );
   bgdE->SetLineWidth( 3 );
   sSig->SetLineWidth( 3 );
   
   // the purity and quality
   purS->SetFillStyle( 0 );
   purS->SetLineWidth( 2 );
   purS->SetLineStyle( 5 );
   effpurS->SetFillStyle( 0 );
   effpurS->SetLineWidth( 2 );
   effpurS->SetLineStyle( 6 );
}

void TMVA::StatDialogMVAEffs::SetNSignal() 
{
   fNSignal = fSigInput->GetNumber();
}

void TMVA::StatDialogMVAEffs::SetNBackground() 
{
   fNBackground = fBkgInput->GetNumber();
}

TString TMVA::StatDialogMVAEffs::GetFormula() 
{
   TString f = fFormula;
   f.ReplaceAll("S","x");
   f.ReplaceAll("B","y");
   return f;
}


TString TMVA::StatDialogMVAEffs::GetLatexFormula() 
{
   TString f = fFormula;
   f.ReplaceAll("(","{");
   f.ReplaceAll(")","}");
   f.ReplaceAll("sqrt","#sqrt");
   return f;
}

void TMVA::StatDialogMVAEffs::Redraw() 
{
   UpdateSignificanceHists();
   UpdateCanvases();
}

void TMVA::StatDialogMVAEffs::Close() 
{
   delete this;
}

TMVA::StatDialogMVAEffs::~StatDialogMVAEffs() 
{
   if (fInfoList) { 
      TIter next(fInfoList);
      MethodInfo *info(0);
      while ( (info = (MethodInfo*)next()) ) {
         delete info;
      }
      delete fInfoList;
      fInfoList=0;
   }


   fSigInput->Disconnect();
   fBkgInput->Disconnect();
   fDrawButton->Disconnect();
   fCloseButton->Disconnect();

   fMain->CloseWindow();
   fMain->Cleanup();
   fMain = 0;
}

TMVA::StatDialogMVAEffs::StatDialogMVAEffs(const TGWindow* p, Float_t ns, Float_t nb) :
   fNSignal(ns),
   fNBackground(nb),
   fFormula(""),
   fInfoList(0),
   fSigInput(0),
   fBkgInput(0),
   fButtons(0),
   fDrawButton(0),
   fCloseButton(0),
   maxLenTitle(0)
{
   UInt_t totalWidth  = 500;
   UInt_t totalHeight = 300;

   // main frame
   fMain = new TGMainFrame(p, totalWidth, totalHeight, kMainFrame | kVerticalFrame);

   TGLabel *sigLab = new TGLabel(fMain,"Signal events");
   fMain->AddFrame(sigLab, new TGLayoutHints(kLHintsLeft | kLHintsTop,5,5,5,5));

   fSigInput = new TGNumberEntry(fMain, (Double_t) fNSignal,5,-1,(TGNumberFormat::EStyle) 5);
   fSigInput->SetLimits(TGNumberFormat::kNELLimitMin,0,1);
   fMain->AddFrame(fSigInput, new TGLayoutHints(kLHintsLeft | kLHintsTop,5,5,5,5));
   fSigInput->Resize(100,24);

   TGLabel *bkgLab = new TGLabel(fMain, "Background events");
   fMain->AddFrame(bkgLab, new TGLayoutHints(kLHintsLeft | kLHintsTop,5,5,5,5));

   fBkgInput = new TGNumberEntry(fMain, (Double_t) fNBackground,5,-1,(TGNumberFormat::EStyle) 5);
   fBkgInput->SetLimits(TGNumberFormat::kNELLimitMin,0,1);
   fMain->AddFrame(fBkgInput, new TGLayoutHints(kLHintsLeft | kLHintsTop,5,5,5,5));
   fBkgInput->Resize(100,24);

   fButtons = new TGHorizontalFrame(fMain, totalWidth,30);

   fCloseButton = new TGTextButton(fButtons,"&Close");
   fButtons->AddFrame(fCloseButton, new TGLayoutHints(kLHintsLeft | kLHintsTop));

   fDrawButton = new TGTextButton(fButtons,"&Draw");
   fButtons->AddFrame(fDrawButton, new TGLayoutHints(kLHintsRight | kLHintsTop,15));
  
   fMain->AddFrame(fButtons,new TGLayoutHints(kLHintsLeft | kLHintsBottom,5,5,5,5));

   fMain->SetWindowName("Significance");
   fMain->SetWMPosition(0,0);
   fMain->MapSubwindows();
   fMain->Resize(fMain->GetDefaultSize());
   fMain->MapWindow();

   fSigInput->Connect("ValueSet(Long_t)","TMVA::StatDialogMVAEffs",this, "SetNSignal()");
   fBkgInput->Connect("ValueSet(Long_t)","TMVA::StatDialogMVAEffs",this, "SetNBackground()");

   fDrawButton->Connect("Clicked()","TGNumberEntry",fSigInput, "ValueSet(Long_t)");
   fDrawButton->Connect("Clicked()","TGNumberEntry",fBkgInput, "ValueSet(Long_t)");
   fDrawButton->Connect("Clicked()", "TMVA::StatDialogMVAEffs", this, "Redraw()");   

   fCloseButton->Connect("Clicked()", "TMVA::StatDialogMVAEffs", this, "Close()");
}

void TMVA::StatDialogMVAEffs::UpdateCanvases() 
{
   if (fInfoList==0) return;
   if (fInfoList->First()==0) return;
   MethodInfo* info = (MethodInfo*)fInfoList->First();
   if ( info->canvas==0 ) {
      DrawHistograms();
      return;
   }
   TIter next(fInfoList);
   while ( (info = (MethodInfo*)next()) ) {
      info->canvas->Update();
      info->rightAxis->SetWmax(1.1*info->maxSignificance);
      info->canvas->Modified(kTRUE);
      info->canvas->Update();
      info->canvas->Paint();
   }
}

void TMVA::StatDialogMVAEffs::UpdateSignificanceHists() 
{
   TFormula f("sigf",GetFormula());
   TIter next(fInfoList);
   MethodInfo* info(0);
   TString cname = "Classifier";
   if (cname.Length() >  maxLenTitle)  maxLenTitle = cname.Length();
   TString str = Form( "%*s   (  #signal, #backgr.)  Optimal-cut  %s      NSig      NBkg   EffSig   EffBkg", 
                       maxLenTitle, cname.Data(), GetFormulaString().Data() );
   cout << "--- " << setfill('=') << setw(str.Length()) << "" << setfill(' ') << endl;
   cout << "--- " << str << endl;
   cout << "--- " << setfill('-') << setw(str.Length()) << "" << setfill(' ') << endl;
   Double_t maxSig    = -1;
   Double_t maxSigErr = -1;
   while ((info = (MethodInfo*)next())) {
      for (Int_t i=1; i<=info->origSigE->GetNbinsX(); i++) {
         Float_t eS = info->origSigE->GetBinContent( i );
         Float_t S = eS * fNSignal;
         Float_t B = info->origBgdE->GetBinContent( i ) * fNBackground;
         info->purS->SetBinContent( i, (S+B==0)?0:S/(S+B) );
         
         Double_t sig = f.Eval(S,B);
         if (sig > maxSig) {
            maxSig    = sig;
            if (GetFormulaString() == "S/sqrt(B)") {
               maxSigErr = sig * sqrt( 1./S + 1./(2.*B));
            }
         }
         info->sSig->SetBinContent( i, sig );
         info->effpurS->SetBinContent( i, eS*info->purS->GetBinContent( i ) );
      }
      
      info->maxSignificance    = info->sSig->GetMaximum();
      info->maxSignificanceErr = (maxSigErr > 0) ? maxSigErr : 0;
      info->sSig->Scale(1/info->maxSignificance);

      // update the text in the lower left corner
      PrintResults( info );
   }
   cout << "--- " << setfill('-') << setw(str.Length()) << "" << setfill(' ') << endl << endl;
}

void TMVA::StatDialogMVAEffs::ReadHistograms(TFile* file) 
{
   if (fInfoList) { 
      TIter next(fInfoList);
      MethodInfo *info(0);
      while ( (info = (MethodInfo*)next()) ) {
         delete info;
      }
      delete fInfoList;
      fInfoList=0;
   }
   fInfoList = new TList;

   // search for the right histograms in full list of keys
   TIter next(file->GetListOfKeys());
   TKey *key(0);   
   while( (key = (TKey*)next()) ) {

      if (!TString(key->GetName()).BeginsWith("Method_")) continue;
      if( ! gROOT->GetClass(key->GetClassName())->InheritsFrom("TDirectory") ) continue;

      cout << "--- Found directory: " << ((TDirectory*)key->ReadObj())->GetName() << endl;

      TDirectory* mDir = (TDirectory*)key->ReadObj();

      TIter keyIt(mDir->GetListOfKeys());
      TKey *titkey;
      while((titkey = (TKey*)keyIt())) {
         if( ! gROOT->GetClass(titkey->GetClassName())->InheritsFrom("TDirectory") ) continue;
        
         MethodInfo* info = new MethodInfo();
         TDirectory* titDir = (TDirectory *)titkey->ReadObj();

         TMVAGlob::GetMethodName(info->methodName,key);
         TMVAGlob::GetMethodTitle(info->methodTitle,titDir);        
         if (info->methodTitle.Length() > maxLenTitle) maxLenTitle = info->methodTitle.Length();
         TString hname = "MVA_" + info->methodTitle;
        
         cout << "--- Classifier: " << info->methodTitle << endl;
        
         info->sig = dynamic_cast<TH1*>(titDir->Get( hname + "_S" ));
         info->bgd = dynamic_cast<TH1*>(titDir->Get( hname + "_B" ));
         info->origSigE = dynamic_cast<TH1*>(titDir->Get( hname + "_effS" ));
         info->origBgdE = dynamic_cast<TH1*>(titDir->Get( hname + "_effB" ));      
         if (info->origSigE==0 || info->origBgdE==0) { delete info; continue; }

         info->SetResultHists();
         fInfoList->Add(info);
      }
   }
   return;
}

void TMVA::StatDialogMVAEffs::DrawHistograms() 
{
   // counter variables
   Int_t countCanvas = 0;

   // define Canvas layout here!
   const Int_t width = 600;   // size of canvas
   Int_t signifColor = TColor::GetColor( "#00aa00" );

   TIter next(fInfoList);
   MethodInfo* info(0);
   while ( (info = (MethodInfo*)next()) ) {

      // create new canvas
      TCanvas *c = new TCanvas( Form("canvas%d", countCanvas+1), 
                                Form("Cut efficiencies for %s classifier",info->methodTitle.Data()), 
                                countCanvas*50+200, countCanvas*20, width, Int_t(width*0.78) ); 
      info->canvas = c;

      // draw grid
      c->SetGrid(1);
      c->SetTickx(0);
      c->SetTicky(0);

      TStyle *TMVAStyle = gROOT->GetStyle("Plain"); // our style is based on Plain
      TMVAStyle->SetLineStyleString( 5, "[32 22]" );
      TMVAStyle->SetLineStyleString( 6, "[12 22]" );
         
      c->SetTopMargin(.2);
      
      // and the signal purity and quality
      info->effpurS->SetTitle("Cut efficiencies and optimal cut value");
      if (info->methodTitle.Contains("Cuts")) {
         info->effpurS->GetXaxis()->SetTitle( "Signal Efficiency" );
      }
      else {
         info->effpurS->GetXaxis()->SetTitle( TString("Cut value applied on ") + info->methodTitle + " output" );
      }
      info->effpurS->GetYaxis()->SetTitle( "Efficiency (Purity)" );
      TMVAGlob::SetFrameStyle( info->effpurS );

      c->SetTicks(0,0);
      c->SetRightMargin ( 2.0 );

      info->effpurS->SetMaximum(1.1);
      info->effpurS->Draw("histl");

      info->purS->Draw("samehistl");      

      // overlay signal and background histograms
      info->sigE->Draw("samehistl");
      info->bgdE->Draw("samehistl");

      info->sSig->SetLineColor( signifColor );
      info->sSig->Draw("samehistl");

      // redraw axes
      info->effpurS->Draw( "sameaxis" );

      // Draw legend               
      TLegend *legend1= new TLegend( c->GetLeftMargin(), 1 - c->GetTopMargin(), 
                                     c->GetLeftMargin() + 0.4, 1 - c->GetTopMargin() + 0.12 );
      legend1->SetFillStyle( 1 );
      legend1->AddEntry(info->sigE,"Signal efficiency","L");
      legend1->AddEntry(info->bgdE,"Background efficiency","L");
      legend1->Draw("same");
      legend1->SetBorderSize(1);
      legend1->SetMargin( 0.3 );

      TLegend *legend2= new TLegend( c->GetLeftMargin() + 0.4, 1 - c->GetTopMargin(), 
                                     1 - c->GetRightMargin(), 1 - c->GetTopMargin() + 0.12 );
      legend2->SetFillStyle( 1 );
      legend2->AddEntry(info->purS,"Signal purity","L");
      legend2->AddEntry(info->effpurS,"Signal efficiency*purity","L");
      legend2->AddEntry(info->sSig,GetLatexFormula().Data(),"L");
      legend2->Draw("same");
      legend2->SetBorderSize(1);
      legend2->SetMargin( 0.3 );
         
      // line to indicate maximum efficiency
      TLine* effline = new TLine( info->sSig->GetXaxis()->GetXmin(), 1, info->sSig->GetXaxis()->GetXmax(), 1 );
      effline->SetLineWidth( 1 );
      effline->SetLineColor( 1 );
      effline->Draw();

      // print comments
      TLatex tl;
      tl.SetNDC();
      tl.SetTextSize( 0.033 );
      Int_t maxbin = info->sSig->GetMaximumBin();
      info->line1 = tl.DrawLatex( 0.15, 0.23, Form("For %1.0f signal and %1.0f background", fNSignal, fNBackground));
      tl.DrawLatex( 0.15, 0.19, "events the maximum "+GetLatexFormula()+" is");

      if (info->maxSignificanceErr > 0) {
         info->line2 = tl.DrawLatex( 0.15, 0.15, Form("%5.2f +- %4.2f when cutting at %5.2f", 
                                                      info->maxSignificance, 
                                                      info->maxSignificanceErr, 
                                                      info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
      }
      else {
         info->line2 = tl.DrawLatex( 0.15, 0.15, Form("%4.2f when cutting at %5.2f", 
                                                      info->maxSignificance, 
                                                      info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
      }

      // add comment for Method cuts
      if (info->methodTitle.Contains("Cuts")){
         tl.DrawLatex( 0.13, 0.77, "Method Cuts provides a bundle of cut selections, each tuned to a");
         tl.DrawLatex(0.13, 0.74, "different signal efficiency. Shown is the purity for each cut selection.");
      }
      // save canvas to file
      c->Update();

      // Draw second axes
      info->rightAxis = new TGaxis(c->GetUxmax(), c->GetUymin(),
                                   c->GetUxmax(), c->GetUymax(),0,1.1*info->maxSignificance,510,"+L");
      info->rightAxis->SetLineColor ( signifColor );
      info->rightAxis->SetLabelColor( signifColor );
      info->rightAxis->SetTitleColor( signifColor );

      info->rightAxis->SetTitleSize( info->sSig->GetXaxis()->GetTitleSize() );
      info->rightAxis->SetTitle( "Significance" );
      info->rightAxis->Draw();

      c->Update();

      // switches
      const Bool_t Save_Images = kTRUE;

      if (Save_Images) {
         TMVAGlob::imgconv( c, Form("plots/mvaeffs_%s", info->methodTitle.Data()) ); 
      }
      countCanvas++;
   }
}

void TMVA::StatDialogMVAEffs::PrintResults( const MethodInfo* info )
{
   Int_t maxbin = info->sSig->GetMaximumBin();
   if (info->line1 !=0 )
      info->line1->SetText( 0.15, 0.23, Form("For %1.0f signal and %1.0f background", fNSignal, fNBackground));
   
   if (info->line2 !=0 ) {
      if (info->maxSignificanceErr > 0) {
         info->line2->SetText( 0.15, 0.15, Form("%3.2g +- %3.2g when cutting at %3.2g", 
                                                info->maxSignificance, 
                                                info->maxSignificanceErr, 
                                                info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
      }
      else {
         info->line2->SetText( 0.15, 0.15, Form("%3.4f when cutting at %3.4f", info->maxSignificance, 
                                                info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
      }

   }

   if (info->maxSignificanceErr <= 0) {
      TString opt = Form( "%%%is:  (%%9.8g,%%9.8g)    %%9.4f   %%10.6g  %%8.7g  %%8.7g %%8.4g %%8.4g", 
                          maxLenTitle );
      cout << "--- " 
           << Form( opt.Data(),
                    info->methodTitle.Data(), fNSignal, fNBackground, 
                    info->sSig->GetXaxis()->GetBinCenter( maxbin ),
                    info->maxSignificance,
                    info->origSigE->GetBinContent( maxbin )*fNSignal,   
                    info->origBgdE->GetBinContent( maxbin )*fNBackground,
                    info->origSigE->GetBinContent( maxbin ),
                    info->origBgdE->GetBinContent( maxbin ) )
           << endl;
   }
   else {
      TString opt = Form( "%%%is:  (%%9.8g,%%9.8g)    %%9.4f   (%%8.3g  +-%%6.3g)  %%8.7g  %%8.7g %%8.4g %%8.4g", 
                          maxLenTitle );
      cout << "--- " 
           << Form( opt.Data(),
                    info->methodTitle.Data(), fNSignal, fNBackground, 
                    info->sSig->GetXaxis()->GetBinCenter( maxbin ),
                    info->maxSignificance,
                    info->maxSignificanceErr,
                    info->origSigE->GetBinContent( maxbin )*fNSignal,   
                    info->origBgdE->GetBinContent( maxbin )*fNBackground,
                    info->origSigE->GetBinContent( maxbin ),
                    info->origBgdE->GetBinContent( maxbin ) )
           << endl;
   }
}

void TMVA::mvaeffs( TString fin , 
              Bool_t useTMVAStyle, TString formula )
{
   TMVAGlob::Initialize( useTMVAStyle );

   StatDialogMVAEffs* gGui = new StatDialogMVAEffs(gClient->GetRoot(), 1000, 1000);

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