00001 /********************************************************************************** 00002 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 00003 * Package: TMVA * 00004 * Class : BDTEventWrapper * 00005 * Web : http://tmva.sourceforge.net * 00006 * * 00007 * Description: * 00008 * * 00009 * * 00010 * Author: Doug Schouten (dschoute@sfu.ca) * 00011 * * 00012 * * 00013 * Copyright (c) 2007: * 00014 * CERN, Switzerland * 00015 * MPI-K Heidelberg, Germany * 00016 * U. of Texas at Austin, USA * 00017 * * 00018 * Redistribution and use in source and binary forms, with or without * 00019 * modification, are permitted according to the terms listed in LICENSE * 00020 * (http://tmva.sourceforge.net/LICENSE) * 00021 **********************************************************************************/ 00022 00023 #ifndef ROOT_TMVA_BDTEventWrapper 00024 #include "TMVA/BDTEventWrapper.h" 00025 #endif 00026 00027 using namespace TMVA; 00028 00029 Int_t BDTEventWrapper::fVarIndex = 0; 00030 00031 BDTEventWrapper::BDTEventWrapper(const Event* e) : fEvent(e) { 00032 // constuctor 00033 00034 fBkgWeight = 0.0; 00035 fSigWeight = 0.0; 00036 } 00037 00038 BDTEventWrapper::~BDTEventWrapper() { 00039 // destructor 00040 } 00041 00042 void BDTEventWrapper::SetCumulativeWeight(Bool_t type, Double_t weight) { 00043 // Set the accumulated weight, for sorted signal/background events 00044 /** 00045 * @param fType - true for signal, false for background 00046 * @param weight - the total weight 00047 */ 00048 00049 if(type) fSigWeight = weight; 00050 else fBkgWeight = weight; 00051 } 00052 00053 Double_t BDTEventWrapper::GetCumulativeWeight(Bool_t type) const { 00054 // Get the accumulated weight 00055 00056 if(type) return fSigWeight; 00057 return fBkgWeight; 00058 }