SVEvent.cxx

Go to the documentation of this file.
00001 // @(#)root/tmva $Id: SVEvent.cxx 37252 2010-12-04 09:57:53Z evt $    
00002 // Author: Andrzej Zemla
00003 
00004 /**********************************************************************************
00005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
00006  * Package: TMVA                                                                  *
00007  * Class  : SVEvent                                                               *
00008  * Web    : http://tmva.sourceforge.net                                           *
00009  *                                                                                *
00010  * Description:                                                                   *
00011  *      Implementation                                                            *
00012  *                                                                                *
00013  * Authors (alphabetical):                                                        *
00014  *      Marcin Wolter  <Marcin.Wolter@cern.ch> - IFJ PAN, Krakow, Poland          *
00015  *      Andrzej Zemla  <azemla@cern.ch>        - IFJ PAN, Krakow, Poland          *
00016  *      (IFJ PAN: Henryk Niewodniczanski Inst. Nucl. Physics, Krakow, Poland)     *   
00017  *                                                                                *
00018  * Copyright (c) 2005:                                                            *
00019  *      CERN, Switzerland                                                         * 
00020  *      MPI-K Heidelberg, Germany                                                 * 
00021  *      PAN, Krakow, Poland                                                       *
00022  *                                                                                *
00023  * Redistribution and use in source and binary forms, with or without             *
00024  * modification, are permitted according to the terms listed in LICENSE           *
00025  * (http://tmva.sourceforge.net/LICENSE)                                          *
00026  **********************************************************************************/
00027 
00028 #include "TMVA/SVEvent.h"
00029 #include "TMVA/Event.h"
00030 
00031 #include <iostream>
00032 
00033 ClassImp(TMVA::SVEvent)
00034 
00035 TMVA::SVEvent::SVEvent()
00036    : fDataVector(0),
00037      fCweight(1.), 
00038      fAlpha(0),
00039      fAlpha_p(0),
00040      fErrorCache(0),
00041      fNVar(0),
00042      fTypeFlag(0),
00043      fIdx(0),
00044      fNs(0),
00045      fIsShrinked(0),
00046      fLine(0),
00047      fTarget(0)   
00048 {
00049 }
00050 
00051 //_______________________________________________________________________
00052 TMVA::SVEvent::SVEvent( const Event* event, Float_t C_par )
00053    : fDataVector(event->GetValues()),
00054      fCweight(C_par*event->GetWeight()),
00055      fAlpha(0),
00056      fAlpha_p(0),
00057      fErrorCache(0),
00058      fNVar(event->GetNVariables()),
00059      fTypeFlag(2*event->GetClass()-1),
00060      fIdx(2*event->GetClass()-1),
00061      fNs(0),
00062      fIsShrinked(0),
00063      fLine(0),
00064      fTarget((event->GetNTargets() > 0 ? event->GetTarget(0) : 0))
00065 {
00066    // constructor
00067 }
00068 
00069 //_______________________________________________________________________
00070 TMVA::SVEvent::SVEvent( const std::vector<Float_t>* svector, Float_t alpha, Int_t typeFlag, UInt_t ns )
00071    : fDataVector(*svector),
00072      fCweight(-1.),
00073      fAlpha(alpha),
00074      fAlpha_p(0),
00075      fErrorCache(-1.),
00076      fNVar(svector->size()),
00077      fTypeFlag(typeFlag),
00078      fIdx(-1),
00079      fNs(ns),
00080      fIsShrinked(0),
00081      fLine(0),
00082      fTarget(0)
00083 {
00084    // constructor
00085 }
00086 
00087 //_______________________________________________________________________
00088 TMVA::SVEvent::SVEvent( const std::vector<Float_t>* svector, Float_t alpha, Float_t alpha_p,Int_t typeFlag)
00089    : fDataVector(*svector),
00090      fCweight(-1.),
00091      fAlpha(alpha),
00092      fAlpha_p(alpha_p),
00093      fErrorCache(-1.),
00094      fNVar(svector->size()),
00095      fTypeFlag(typeFlag),
00096      fIdx(-1),
00097      fNs(0),
00098      fIsShrinked(0),
00099      fLine(0),
00100      fTarget(0)
00101 {
00102    // constructor
00103 }
00104 
00105 //_______________________________________________________________________
00106 TMVA::SVEvent::~SVEvent()
00107 {
00108    // destructor
00109    if (fLine != 0) {
00110       delete fLine; 
00111       fLine = 0;
00112    }
00113 }
00114 
00115 //_______________________________________________________________________
00116 void TMVA::SVEvent::Print( std::ostream& os ) const
00117 {
00118    // printout 
00119    os << "type::" << fTypeFlag <<" target::"<< fTarget << " alpha::" << fAlpha <<" alpha_p::"<< fAlpha_p<< " values::" ;
00120    for (UInt_t j =0; j < fDataVector.size();j++) os<<fDataVector.at(j)<<" ";
00121    os << std::endl;
00122 }
00123 
00124 //_______________________________________________________________________
00125 void TMVA::SVEvent::PrintData()
00126 {
00127    // printout 
00128    for (UInt_t i = 0; i < fNVar; i++) std::cout<<fDataVector.at(i)<<" ";
00129    std::cout<<std::endl;
00130 }

Generated on Tue Jul 5 15:25:36 2011 for ROOT_528-00b_version by  doxygen 1.5.1