ROOT logo
// @(#)root/tmva $Id: MethodBoost.cxx 29195 2009-06-24 10:39:49Z brun $   
// Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss,Or Cohen, Eckhard von Toerne 

/**********************************************************************************
 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
 * Package: TMVA                                                                  *
 * Class  : MethodCompositeBase                                                   *
 * Web    : http://tmva.sourceforge.net                                           *
 *                                                                                *
 * Description:                                                                   *
 *      Virtual base class for all MVA method                                     *
 *                                                                                *
 * Authors (alphabetical):                                                        *
 *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
 *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
 *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
 *      Kai Voss        <Kai.Voss@cern.ch>       - U. of Victoria, Canada         *
 *      Or Cohen        <orcohenor@gmail.com>    - Weizmann Inst., Israel         *
 *      Eckhard v. Toerne  <evt@uni-bonn.de>        - U of Bonn, Germany          *
 *                                                                                *
 * Copyright (c) 2005:                                                            *
 *      CERN, Switzerland                                                         * 
 *      U. of Victoria, Canada                    #include "TMVA/Timer.h"                                * 
 *      MPI-K Heidelberg, Germany                                                 * 
 *      U. of Bonn, Germany                                                      *
 *                                                                                *
 * Redistribution and use in source and binary forms, with or without             *
 * modification, are permitted according to the terms listed in LICENSE           *
 * (http://tmva.sourceforge.net/LICENSE)                                          *
 **********************************************************************************/

//_______________________________________________________________________
//
// This class is meant to boost a single classifier. Boosting means    //
// training the classifier a few times. Everytime the wieghts of the   //
// events are modified according to how well the classifier performed  //
// on the test sample.                                                 //
//_______________________________________________________________________
#include <algorithm>
#include <iomanip>
#include <vector>

#include "Riostream.h"
#include "TRandom3.h"
#include "TMath.h"
#include "TObjString.h"
#include "TH1F.h"
#include "TGraph.h"
#include "TSpline.h"
#include "TDirectory.h"

#include "TMVA/MethodCompositeBase.h"
#include "TMVA/MethodBase.h"
#include "TMVA/MethodBoost.h"
#include "TMVA/Tools.h"
#include "TMVA/ClassifierFactory.h"
#include "TMVA/Timer.h"
#include "TMVA/Types.h"
#include "TMVA/PDF.h"
#include "TMVA/Config.h"

REGISTER_METHOD(Boost)

ClassImp(TMVA::MethodBoost)

//_______________________________________________________________________
TMVA::MethodBoost::MethodBoost( const TString& jobName,
                                const TString& methodTitle,
                                DataSetInfo& theData,
                                const TString& theOption,
                                TDirectory* theTargetDir ) :
   TMVA::MethodCompositeBase( jobName, Types::kBoost, methodTitle, theData, theOption, theTargetDir ),
   fBoostedMethodTitle(methodTitle),
   fBoostedMethodOptions(theOption), 
   fMonitorHist(0)
{}

//_______________________________________________________________________
TMVA::MethodBoost::MethodBoost( DataSetInfo& dsi,
                                const TString& theWeightFile,
                                TDirectory* theTargetDir )
   : TMVA::MethodCompositeBase( Types::kBoost, dsi, theWeightFile, theTargetDir ),
     fBoostNum(0), fMonitorHist(0)
{}

//_______________________________________________________________________
TMVA::MethodBoost::~MethodBoost( void )
{
   // destructor
   fMethodWeight.clear();

   // the histogram themselves are deleted when the file is closed
   if (fMonitorHist != 0) delete fMonitorHist;
   fTrainSigMVAHist.clear();
   fTrainBgdMVAHist.clear();
   fBTrainSigMVAHist.clear();
   fBTrainBgdMVAHist.clear();
   fTestSigMVAHist.clear();
   fTestBgdMVAHist.clear();
}


//_______________________________________________________________________
Bool_t TMVA::MethodBoost::HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t /*numberTargets*/ )
{
   // Boost can handle classification with 2 classes and regression with one regression-target
   if( type == Types::kClassification && numberClasses == 2 ) return kTRUE;
   //   if( type == Types::kRegression && numberTargets == 1 ) return kTRUE;
   return kFALSE;
}


//_______________________________________________________________________
void TMVA::MethodBoost::DeclareOptions()
{
   DeclareOptionRef( fBoostNum = 1, "Boost_Num",
                     "Number of times the classifier is boosted");
   
   DeclareOptionRef( fMonitorBoostedMethod = kTRUE, "Boost_MonitorMethod",
                     "Whether to write monitoring histogram for each boosted classifier");

   DeclareOptionRef(fBoostType  = "AdaBoost", "Boost_Type", "Boosting type for the classifiers");
   AddPreDefVal(TString("AdaBoost"));
   AddPreDefVal(TString("Bagging"));

   DeclareOptionRef(fMethodWeightType = "ByError", "Boost_MethodWeightType",
                    "How to set the final weight of the boosted classifiers");
   AddPreDefVal(TString("ByError"));
   AddPreDefVal(TString("Average"));
   AddPreDefVal(TString("LastMethod"));

   DeclareOptionRef(fRecalculateMVACut = kTRUE, "Boost_RecalculateMVACut",
                    "Whether to recalculate the classifier MVA Signallike cut at every boost iteration");

   DeclareOptionRef(fADABoostBeta = 1.0, "Boost_AdaBoostBeta",
                    "The ADA boost parameter that sets the effect of every boost step on the events' weights");
   
   DeclareOptionRef(fTransformString = "step", "Boost_Transform",
                    "Type of transform applied to every boosted method linear, log, step");
   AddPreDefVal(TString("step"));
   AddPreDefVal(TString("linear"));
   AddPreDefVal(TString("log"));

   TMVA::MethodCompositeBase::fMethods.reserve(fBoostNum);;
}

//_______________________________________________________________________
Bool_t TMVA::MethodBoost::BookMethod( Types::EMVA theMethod, TString methodTitle, TString theOption ) 
{
   // just registering the string from which the boosted classifier will be created
   fBoostedMethodName = Types::Instance().GetMethodName( theMethod );
   fBoostedMethodTitle = methodTitle;
   fBoostedMethodOptions = theOption;
   return kTRUE;
}

//_______________________________________________________________________
void TMVA::MethodBoost::Init()
{}

//_______________________________________________________________________
void TMVA::MethodBoost::InitHistos()
{
   // initialisation routine
   fMonitorHist = new std::vector<TH1*>();
   fMonitorHist->push_back(new TH1F("MethodWeight","Normalized Classifier Weight",fBoostNum,0,fBoostNum));
   fMonitorHist->push_back(new TH1F("BoostWeight","Boost Weight",fBoostNum,0,fBoostNum));
   fMonitorHist->push_back(new TH1F("ErrFraction","Error Fraction (by boosted event weights)",fBoostNum,0,fBoostNum));
   fMonitorHist->push_back(new TH1F("OrigErrFraction","Error Fraction (by original event weights)",fBoostNum,0,fBoostNum));
   fDefaultHistNum = fMonitorHist->size();
   (*fMonitorHist)[0]->GetXaxis()->SetTitle("Index of boosted classifier");
   (*fMonitorHist)[0]->GetYaxis()->SetTitle("Classifier Weight");
   (*fMonitorHist)[1]->GetXaxis()->SetTitle("Index of boosted classifier");
   (*fMonitorHist)[1]->GetYaxis()->SetTitle("Boost Weight");
   (*fMonitorHist)[2]->GetXaxis()->SetTitle("Index of boosted classifier");
   (*fMonitorHist)[2]->GetYaxis()->SetTitle("Error Fraction");
   (*fMonitorHist)[3]->GetXaxis()->SetTitle("Index of boosted classifier");
   (*fMonitorHist)[3]->GetYaxis()->SetTitle("Error Fraction");

   fMonitorTree= new TTree("MonitorBoost","Boost variables");
   fMonitorTree->Branch("iMethod",&fMethodIndex,"iMethod/I");
   fMonitorTree->Branch("boostWeight",&fBoostWeight,"boostWeight/D");
   fMonitorTree->Branch("errorFraction",&fMethodError,"errorFraction/D");
   fMonitorBoostedMethod = kTRUE;
}


//_______________________________________________________________________
void TMVA::MethodBoost::CheckSetup()
{
   Log() << kDEBUG << "CheckSetup: fBoostType="<<fBoostType<<" fMethodWeightType=" << fMethodWeightType << Endl;
   Log() << kDEBUG << "CheckSetup: fADABoostBeta="<<fADABoostBeta<<Endl;
   Log() << kDEBUG << "CheckSetup: fBoostWeight="<<fBoostWeight<<Endl;
   Log() << kDEBUG << "CheckSetup: fMethodError="<<fMethodError<<Endl;
   Log() << kDEBUG << "CheckSetup: fOrigMethodError="<<fOrigMethodError<<Endl;
   Log() << kDEBUG << "CheckSetup: fBoostNum="<<fBoostNum<< " fMonitorHist="<< fMonitorHist<< Endl;              
   Log() << kDEBUG << "CheckSetup: fDefaultHistNum=" << fDefaultHistNum << " fRecalculateMVACut=" << (fRecalculateMVACut? "true" : "false") << Endl;
   Log() << kDEBUG << "CheckSetup: fTrainSigMVAHist.size()="<<fTrainSigMVAHist.size()<<Endl;
   Log() << kDEBUG << "CheckSetup: fTestSigMVAHist.size()="<<fTestSigMVAHist.size()<<Endl;
   Log() << kDEBUG << "CheckSetup: fMonitorBoostedMethod=" << (fMonitorBoostedMethod? "true" : "false") << Endl;
   Log() << kDEBUG << "CheckSetup: MName=" << fBoostedMethodName << " Title="<< fBoostedMethodTitle<< Endl;
   Log() << kDEBUG << "CheckSetup: MOptions="<< fBoostedMethodOptions << Endl;
   Log() << kDEBUG << "CheckSetup: fBoostStage=" << fBoostStage<<Endl;
   Log() << kDEBUG << "CheckSetup: fMonitorTree" << fMonitorTree<<Endl;
   Log() << kDEBUG << "CheckSetup: fMethodIndex=" <<fMethodIndex << Endl;
   if (fMethods.size()>0) Log() << kDEBUG << "CheckSetup: fMethods[0]" <<fMethods[0]<<Endl;
   Log() << kDEBUG << "CheckSetup: fMethodWeight.size()" << fMethodWeight.size() << Endl;
   if (fMethodWeight.size()>0) Log() << kDEBUG << "CheckSetup: fMethodWeight[0]="<<fMethodWeight[0]<<Endl;
   Log() << kDEBUG << "CheckSetup: gtrying to repair things" << Endl;

   //TMVA::MethodBase::CheckSetup();
   if (fMonitorHist == 0){
      InitHistos();
      CheckSetup();
   }
}
//_______________________________________________________________________
void TMVA::MethodBoost::Train()
{
   Double_t    AllMethodsWeight=0;
   TDirectory* methodDir( 0 );
   TString     dirName,dirTitle;
   Int_t       StopCounter=0;

   if (Data()->GetNTrainingEvents()==0) Log() << kFATAL << "<Train> Data() has zero events" << Endl;
   Data()->SetCurrentType(Types::kTraining);

   if (fMethods.size() > 0) fMethods.clear();

   Log() << kINFO << "Training "<< fBoostNum << " " << fBoostedMethodName << " Classifiers ... patience please" << Endl;
   Timer timer( fBoostNum, GetName() );

   ResetBoostWeights();

   // clean boosted method options
   CleanBoostOptions(); 
   //
   // training and boosting the classifiers
   for (fMethodIndex=0;fMethodIndex<fBoostNum;fMethodIndex++)
      {
         // the first classifier shows the option string output, the rest not
         if (fMethodIndex>0) TMVA::MsgLogger::InhibitOutput();
         IMethod* method = ClassifierFactory::Instance().Create(std::string(fBoostedMethodName),
                                                                GetJobName(),
                                                                Form("%s_B%04i", fBoostedMethodName.Data(),fMethodIndex),
                                                                DataInfo(),
                                                                fBoostedMethodOptions);
         TMVA::MsgLogger::EnableOutput();

         // supressing the rest of the classifier output the right way
         MethodBase *meth = (dynamic_cast<MethodBase*>(method));
         meth->SetMsgType(kWARNING);
         meth->SetupMethod();
         meth->ParseOptions();
         // put SetAnalysisType here for the needs of MLP
         meth->SetAnalysisType( GetAnalysisType() );
         meth->ProcessSetup();
         meth->CheckSetup();

         // creating the directory of the classifier
         if (fMonitorBoostedMethod)
            {
               methodDir=MethodBaseDir()->GetDirectory(dirName=Form("%s_B%04i",fBoostedMethodName.Data(),fMethodIndex));
               if (methodDir==0)
                  methodDir=BaseDir()->mkdir(dirName,dirTitle=Form("Directory Boosted %s #%04i", fBoostedMethodName.Data(),fMethodIndex));
               dynamic_cast<MethodBase*>(method)->SetMethodDir(methodDir);
               dynamic_cast<MethodBase*>(method)->BaseDir()->cd();
            }

         // training
         TMVA::MethodCompositeBase::fMethods.push_back(method);
         timer.DrawProgressBar( fMethodIndex );
         if (fMethodIndex==0) method->MonitorBoost(SetStage(Types::kBoostProcBegin));
         method->MonitorBoost(SetStage(Types::kBeforeTraining));
         TMVA::MsgLogger::InhibitOutput(); //supressing Logger outside the method
         SingleTrain();
         TMVA::MsgLogger::EnableOutput();
         method->WriteMonitoringHistosToFile();
         if (fMethodIndex==0 && fMonitorBoostedMethod) CreateMVAHistorgrams();

         // boosting
         method->MonitorBoost(SetStage(Types::kBeforeBoosting));
         SingleBoost();
         method->MonitorBoost(SetStage(Types::kAfterBoosting));
         (*fMonitorHist)[1]->SetBinContent(fMethodIndex+1,fBoostWeight);
         (*fMonitorHist)[2]->SetBinContent(fMethodIndex+1,fMethodError);
         (*fMonitorHist)[3]->SetBinContent(fMethodIndex+1,fOrigMethodError);
         AllMethodsWeight += fMethodWeight.back();
         fMonitorTree->Fill();

         // stop boosting if needed when error has reached 0.5
         // thought of counting a few steps, but it doesn't seem to be necessary
         if (fMethodError > 0.49999) StopCounter++; 
         if (StopCounter > 0 && fBoostType == "AdaBoost")
            {
               timer.DrawProgressBar( fBoostNum );
               fBoostNum = fMethodIndex+1; 
               Log() << kINFO << "Error rate has reached 0.5, boosting process stopped at #" << fBoostNum << " classifier" << Endl;
               if (fBoostNum < 5)
                  Log() << kINFO << "The classifier might be too strong to boost with Beta = " << fADABoostBeta << ", try reducing it." <<Endl;
               for (Int_t i=0;i<fDefaultHistNum;i++)
                  (*fMonitorHist)[i]->SetBins(fBoostNum,0,fBoostNum);
               break;
            }
      }
   if (fMethodWeightType == "LastMethod") { fMethodWeight.back() = AllMethodsWeight = 1.0; }

   ResetBoostWeights();
   Timer* timer1=new Timer();
   // normalizing the weights of the classifiers
   for (fMethodIndex=0;fMethodIndex<fBoostNum;fMethodIndex++) {
      // pefroming post-boosting actions
      if (fMethods[fMethodIndex]->MonitorBoost(SetStage(Types::kBoostValidation))) {
         if (fMethodIndex==0) timer1 = new Timer( fBoostNum, GetName() );

         timer1->DrawProgressBar( fMethodIndex );

         if (fMethodIndex==fBoostNum) {
            Log() << kINFO << "Elapsed time: " << timer1->GetElapsedTime() 
                  << "                              " << Endl;
         }
      }

      fMethodWeight[fMethodIndex] = fMethodWeight[fMethodIndex] / AllMethodsWeight;
      (*fMonitorHist)[0]->SetBinContent(fMethodIndex+1,fMethodWeight[fMethodIndex]);
   }

   fMethods.back()->MonitorBoost(SetStage(Types::kBoostProcEnd));
}

//_______________________________________________________________________
void TMVA::MethodBoost::CleanBoostOptions()
{
   fBoostedMethodOptions=GetOptions(); 
}

//_______________________________________________________________________
void TMVA::MethodBoost::CreateMVAHistorgrams()
{
   if (fBoostNum <=0) Log() << kFATAL << "CreateHistorgrams called before fBoostNum is initialized" << Endl;
   // calculating histograms boundries and creating histograms..
   // nrms = number of rms around the average to use for outline (of the 0 classifier)
   Double_t meanS, meanB, rmsS, rmsB, xmin, xmax, nrms = 10;
   std::vector <Float_t>* mvaRes = new std::vector <Float_t>(Data()->GetNEvents());
   for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
      Data()->GetEvent(ievt);
      (*mvaRes)[ievt] = fMethods[0]->GetMvaValue();
   }

   Int_t signalClass = 0;
   if (DataInfo().GetClassInfo("Signal") != 0) {
      signalClass = DataInfo().GetClassInfo("Signal")->GetNumber();
   }
   gTools().ComputeStat( Data()->GetEventCollection(), mvaRes,
                         meanS, meanB, rmsS, rmsB, xmin, xmax, signalClass );

   fNbins = gConfig().fVariablePlotting.fNbinsXOfROCCurve;
   xmin = TMath::Max( TMath::Min(meanS - nrms*rmsS, meanB - nrms*rmsB ), xmin );
   xmax = TMath::Min( TMath::Max(meanS + nrms*rmsS, meanB + nrms*rmsB ), xmax ) + 0.0001;

   // creating all the historgrams
   for (Int_t imtd=0; imtd<fBoostNum; imtd++) {
      fTrainSigMVAHist .push_back( new TH1F( Form("MVA_Train_S_%04i",imtd), "MVA_Train_S", fNbins, xmin, xmax ) );
      fTrainBgdMVAHist .push_back( new TH1F( Form("MVA_Train_B%04i",imtd), "MVA_Train_B", fNbins, xmin, xmax ) );
      fBTrainSigMVAHist.push_back( new TH1F( Form("MVA_BTrain_S%04i",imtd), "MVA_BoostedTrain_S", fNbins, xmin, xmax ) );
      fBTrainBgdMVAHist.push_back( new TH1F( Form("MVA_BTrain_B%04i",imtd), "MVA_BoostedTrain_B", fNbins, xmin, xmax ) );
      fTestSigMVAHist  .push_back( new TH1F( Form("MVA_Test_S%04i",imtd), "MVA_Test_S", fNbins, xmin, xmax ) );
      fTestBgdMVAHist  .push_back( new TH1F( Form("MVA_Test_B%04i",imtd), "MVA_Test_B", fNbins, xmin, xmax ) );
   }
   mvaRes->clear();
}

//_______________________________________________________________________
void TMVA::MethodBoost::ResetBoostWeights()
{
   // resetting back the boosted weights of the events to 1
   for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
      Event *ev = Data()->GetEvent(ievt);
      ev->SetBoostWeight( 1.0 );
   }
}

//_______________________________________________________________________
void TMVA::MethodBoost::WriteMonitoringHistosToFile( void ) const
{
   TDirectory* dir=0;
   if (fMonitorBoostedMethod) {
      for (Int_t imtd=0;imtd<fBoostNum;imtd++) {

         //writing the histograms in the specific classifier's directory
         dir = dynamic_cast<MethodBase*>(fMethods[imtd])->BaseDir();
         dir->cd();
         fTrainSigMVAHist[imtd]->SetDirectory(dir);
         fTrainSigMVAHist[imtd]->Write();
         fTrainBgdMVAHist[imtd]->SetDirectory(dir);
         fTrainBgdMVAHist[imtd]->Write();
         fBTrainSigMVAHist[imtd]->SetDirectory(dir);
         fBTrainSigMVAHist[imtd]->Write();
         fBTrainBgdMVAHist[imtd]->SetDirectory(dir);
         fBTrainBgdMVAHist[imtd]->Write();
      }
   }

   // going back to the original folder
   BaseDir()->cd();
   for (UInt_t i=0;i<fMonitorHist->size();i++) {
      ((*fMonitorHist)[i])->SetName(Form("Booster_%s",((*fMonitorHist)[i])->GetName()));
      ((*fMonitorHist)[i])->Write();
   }

   fMonitorTree->Write();
}

//_______________________________________________________________________
void TMVA::MethodBoost::TestClassification()
{
   MethodBase::TestClassification();
   if (fMonitorBoostedMethod) {
      UInt_t nloop = fTestSigMVAHist.size();
      if (fMethods.size()<nloop) nloop = fMethods.size(); 
      //running over all the events and populating the test MVA histograms
      Data()->SetCurrentType(Types::kTesting);
      for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
         Event* ev = Data()->GetEvent(ievt);
         Float_t w = ev->GetWeight();
         if (ev->IsSignal()) {
            for (UInt_t imtd=0; imtd<nloop; imtd++) {
               fTestSigMVAHist[imtd]->Fill(fMethods[imtd]->GetMvaValue(),w);
            }
         }
         else {
            for (UInt_t imtd=0; imtd<nloop; imtd++) {
               fTestBgdMVAHist[imtd]->Fill(fMethods[imtd]->GetMvaValue(),w);
            }
         }
      }
      Data()->SetCurrentType(Types::kTraining);
   }
}

//_______________________________________________________________________
void TMVA::MethodBoost::WriteEvaluationHistosToFile()
{
   MethodBase::WriteEvaluationHistosToFile();
   UInt_t nloop = fTestSigMVAHist.size();
   if (fMethods.size()<nloop) nloop = fMethods.size(); 
   if (fMonitorBoostedMethod) {
      TDirectory* dir=0;
      for (UInt_t imtd=0;imtd<nloop;imtd++) {
         //writing the histograms in the specific classifier's directory
         dir = dynamic_cast<MethodBase*>(fMethods[imtd])->BaseDir();
         dir->cd();
         fTestSigMVAHist[imtd]->SetDirectory(dir);
         fTestSigMVAHist[imtd]->Write();
         fTestBgdMVAHist[imtd]->SetDirectory(dir);
         fTestBgdMVAHist[imtd]->Write();
      }
   }
}

//_______________________________________________________________________
void TMVA::MethodBoost::ProcessOptions() 
{
   // process user options
}

//_______________________________________________________________________
void TMVA::MethodBoost::SingleTrain()
{
   // initialization 
   Data()->SetCurrentType(Types::kTraining);
   MethodBase* meth = dynamic_cast<MethodBase*>(GetLastMethod());
   meth->TrainMethod();
}

//_______________________________________________________________________
void TMVA::MethodBoost::FindMVACut()
{
   //Log() << kINFO << "FindMVACut "<<Endl;
   MethodBase* method=dynamic_cast<MethodBase*>(fMethods.back());
   if (method->GetMethodType() == Types::kDT ){ return;}
   if (!fRecalculateMVACut && fMethodIndex>0) {
      method->SetSignalReferenceCut(dynamic_cast<MethodBase*>(fMethods[0])->GetSignalReferenceCut());
   }
   else {
      // creating a fine histograms containing the error rate
      const Int_t nValBins=1000;
      Double_t* err=new Double_t[nValBins];
      const Double_t valmin=-1.;
      const Double_t valmax=1.;
      for (Int_t i=0;i<nValBins;i++) err[i]=0.; 
      Double_t sum = 0.;
      for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
         Double_t weight = GetEvent(ievt)->GetWeight();
         sum +=weight; 
         Double_t val=method->GetMvaValue(); 
         Int_t ibin = (Int_t) (((val-valmin)/(valmax-valmin))*nValBins);
         if (ibin>=nValBins) ibin = nValBins-1;
         if (ibin<0) ibin = 0;
         if (Data()->GetEvent(ievt)->IsSignal()){
            for (Int_t i=ibin;i<nValBins;i++) err[i]+=weight;
         }
         else {
            for (Int_t i=0;i<ibin;i++) err[i]+=weight;
         }
      }
      Double_t minerr=1.e6;
      Int_t minbin=-1;
      for (Int_t i=0;i<nValBins;i++){
         if (err[i]<minerr){
            minerr=err[i];
            minbin=i;
         }
      }
      Double_t sigCutVal = valmin + (valmax-valmin)*minbin/nValBins;
      method->SetSignalReferenceCut(sigCutVal);
      //std::cout << "Setting method cut to " <<method->GetSignalReferenceCut()<< " minerr=" << minerr/sum<<endl;
      delete err; 
   }
}

//_______________________________________________________________________
void TMVA::MethodBoost::SingleBoost()
{
   MethodBase* method =  dynamic_cast<MethodBase*>(fMethods.back());
   Event * ev; Float_t w,v,wo; Bool_t sig=kTRUE;
   Double_t sumAll=0, sumWrong=0, sumAllOrig=0, sumWrongOrig=0, sumAll1=0;
   Bool_t* WrongDetection=new Bool_t[Data()->GetNEvents()];

   // finding the MVA cut value for IsSignalLike, stored in the method
   FindMVACut();

   // finding the wrong events and calculating their total weights
   for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
      ev = Data()->GetEvent(ievt);
      sig=ev->IsSignal();
      v = method->GetMvaValue();
      w = ev->GetWeight();
      wo = ev->GetOriginalWeight();
      if (sig && fMonitorBoostedMethod) {
         fBTrainSigMVAHist[fMethodIndex]->Fill(v,w);
         fTrainSigMVAHist[fMethodIndex]->Fill(v,ev->GetOriginalWeight());
      }
      else if (fMonitorBoostedMethod) {
         fBTrainBgdMVAHist[fMethodIndex]->Fill(v,w);
         fTrainBgdMVAHist[fMethodIndex]->Fill(v,ev->GetOriginalWeight());
      }
      sumAll += w;
      sumAllOrig += wo;
      if (sig != method->IsSignalLike())
         {WrongDetection[ievt]=kTRUE; sumWrong+=w; sumWrongOrig+=wo;}
      else WrongDetection[ievt]=kFALSE;
   }
   fMethodError=sumWrong/sumAll;
   fOrigMethodError = sumWrongOrig/sumAllOrig;

   // calculating the fMethodError and the fBoostWeight out of it uses the formula 
   // w = ((1-err)/err)^beta
   if (fMethodError>0 && fADABoostBeta == 1.0) {
      fBoostWeight = (1.0-fMethodError)/fMethodError;
   }
   else if (fMethodError>0 && fADABoostBeta != 1.0) {
      fBoostWeight =  TMath::Power((1.0 - fMethodError)/fMethodError, fADABoostBeta);
   }
   else fBoostWeight = 1000;

   Double_t alphaWeight = TMath::Log(fBoostWeight);
   if (alphaWeight>5.) alphaWeight = 5.;
   if (alphaWeight<0.){
      //Log()<<kWARNING<<"alphaWeight is too small in AdaBoost alpha=" << alphaWeight<< Endl;
      alphaWeight = -alphaWeight;
   }
   if (fBoostType == "AdaBoost") {
      // ADA boosting, rescaling the weight of the wrong events according to the error level 
      // over the entire test sample rescaling all the weights to have the same sum, but without 
      // touching the original weights (changing only the boosted weight of all the events)
      // first reweight
      Double_t Factor=0., FactorOrig=0.;
      for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
         ev =  Data()->GetEvent(ievt);
         FactorOrig += ev->GetWeight();
         ev->ScaleBoostWeight(TMath::Exp(-alphaWeight*((WrongDetection[ievt])? -1.0 : 1.0)));
         Factor += ev->GetBoostWeight();
      }
      Factor = FactorOrig/Factor;
      // next normalize the weights 
      for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
         Data()->GetEvent(ievt)->ScaleBoostWeight(Factor); 
      }

   }
   else if (fBoostType == "Bagging") {
      // Bagging or Bootstrap boosting, gives new random weight for every event
      TRandom3*trandom   = new TRandom3(fMethods.size()-1);
      for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
         ev = Data()->GetEvent(ievt);
         ev->SetBoostWeight(trandom->Rndm());
         sumAll1+=ev->GetWeight();
      }
      // rescaling all the weights to have the same sum, but without touching the original 
      // weights (changing only the boosted weight of all the events)
      Double_t Factor=sumAll/sumAll1;
      for (Long64_t ievt=0; ievt<Data()->GetNEvents(); ievt++) {
         ev = Data()->GetEvent(ievt);
         ev->ScaleBoostWeight(Factor);
      }
   }

   if      (fMethodWeightType == "ByError") fMethodWeight.push_back(TMath::Log(fBoostWeight));
   else if (fMethodWeightType == "Average") fMethodWeight.push_back(1.0);
   else                                     fMethodWeight.push_back(0);

   delete WrongDetection;
}

//_______________________________________________________________________
void TMVA::MethodBoost::GetHelpMessage() const
{
   // Get help message text
   //
   // typical length of text line:
   //         "|--------------------------------------------------------------|"
   Log() << Endl;
   Log() << gTools().Color("bold") << "--- Short description:" << gTools().Color("reset") << Endl;
   Log() << Endl;
   Log() << "This method combines several classifier of one species in a "<<Endl;
   Log() << "single multivariate quantity via the boost algorithm." << Endl;
   Log() << "the output is a weighted sum over all individual classifiers" <<Endl;
   Log() << "By default, the AdaBoost method is employed, which gives " << Endl;
   Log() << "events that were misclassified in the previous tree a larger " << Endl;
   Log() << "weight in the training of the following classifier."<<Endl;
   Log() << "Optionally, Bagged boosting can also be applied." << Endl;
   Log() << Endl;
   Log() << gTools().Color("bold") << "--- Performance tuning via configuration options:" << gTools().Color("reset") << Endl;
   Log() << Endl;
   Log() << "The most important parameter in the configuration is the "<<Endl;
   Log() << "number of boosts applied (Boost_Num) and the choice of boosting"<<Endl;
   Log() << "(Boost_Type), which can be set to either AdaBoost or Bagging." << Endl;
   Log() << "AdaBoosting: The most important parameters in this configuration" <<Endl;
   Log() << "is the beta parameter (Boost_AdaBoostBeta)  " << Endl;
   Log() << "When boosting a linear classifier, it is sometimes advantageous"<<Endl; 
   Log() << "to transform the MVA output non-linearly. The following options" <<Endl;
   Log() << "are available: step, log, and minmax, the default is no transform."<<Endl;
   Log() <<Endl;
   Log() << "Some classifiers are hard to boost and do not improve much in"<<Endl; 
   Log() << "their performance by boosting them, some even slightly deteriorate"<< Endl;
   Log() << "due to the boosting." <<Endl;
   Log() << "The booking of the boost method is special since it requires"<<Endl;
   Log() << "the booing of the method to be boosted and the boost itself."<<Endl;
   Log() << "This is solved by booking the method to be boosted and to add"<<Endl;
   Log() << "all Boost parameters, which all begin with \"Boost_\" to the"<<Endl;
   Log() << "options string. The factory separates the options and initiates"<<Endl;
   Log() << "the boost process. The TMVA macro directory contains the example"<<Endl;
   Log() << "macro \"Boost.C\"" <<Endl;
}

//_______________________________________________________________________
const TMVA::Ranking* TMVA::MethodBoost::CreateRanking()
{ 
   return 0;
}

//_______________________________________________________________________
Double_t TMVA::MethodBoost::GetMvaValue( Double_t* err )
{
   // return boosted MVA response
   Double_t mvaValue = 0;
   Double_t epsilon = TMath::Exp(-1.);
   //Double_t fact    = TMath::Exp(-1.)+TMath::Exp(1.);
   for (UInt_t i=0;i< fMethods.size(); i++){
      Double_t val = fMethods[i]->GetMvaValue();
      Double_t sigcut = dynamic_cast<MethodBase*>(fMethods[i])->GetSignalReferenceCut();
      // default is no transform
      if (fTransformString == "linear"){

      }
      else if (fTransformString == "log"){
         if (val < sigcut) val = sigcut;

         val = TMath::Log((val-sigcut)+epsilon);
      }
      else if (fTransformString == "step" ){
         if (val < sigcut) val = -1.;
         else val = 1.;
      }
      else {
         Log() << kFATAL << "error unknown transformation " << fTransformString<<Endl;
      }
      mvaValue+=val*fMethodWeight[i];
   }
   // cannot determine error
   if (err != 0) *err = -1;

   return mvaValue;
}

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