#ifndef ROOT_TMVA_Event
#define ROOT_TMVA_Event
#include <vector>
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
#ifndef ROOT_TMVA_VariableInfo
#include "TMVA/VariableInfo.h"
#endif
class TTree;
class TBranch;
namespace TMVA {
   class Event;
   ostream& operator<<( ostream& os, const Event& event );
   ostream& operator<<( ostream& os, const Event* event );
   class Event {
      friend ostream& operator<<( ostream& os, const Event& event );
      friend ostream& operator<<( ostream& os, const Event* event );
   public:
      Event( const std::vector<TMVA:: VariableInfo>&, Bool_t AllowExternalLinks = kTRUE );
      Event( const Event& );
      ~Event();
      
      void SetBranchAddresses(TTree* tr);
      std::vector<TBranch*>& Branches() { return fBranches; }
      Bool_t  IsSignal()       const { return (fType==1); }
      Float_t GetWeight()      const { return fWeight*fBoostWeight; }
      Float_t GetBoostWeight() const { return fBoostWeight; }
      Int_t   Type()           const { return fType; }
      void    SetWeight(Float_t w)      { fWeight=w; }
      void    SetBoostWeight(Float_t w) { fBoostWeight=w; }
      void    SetType(Int_t t)          { fType=t; }
      void    SetType(Types::ESBType t) { fType=(t==Types::kSignal)?1:0; }
      void    SetVal(UInt_t ivar, Float_t val);
      void    SetValFloatNoCheck(UInt_t ivar, Float_t val) { *((Float_t*)fVarPtr[ivar]) = val; }
      void    CopyVarValues( const Event& other );
      Char_t  GetVarType (UInt_t ivar)        const { return fVariables[ivar].GetVarType(); }
      Bool_t  IsInt      (UInt_t ivar)        const { return (fVariables[ivar].GetVarType()=='I'); }
      Bool_t  IsFloat    (UInt_t ivar)        const { return (fVariables[ivar].GetVarType()=='F'); }
      Float_t GetVal     (UInt_t ivar)        const;
      Float_t GetValFloat(UInt_t ivar)        const { return *((Float_t*)fVarPtr[ivar]); }
      UInt_t  GetNVars()                      const { return fVariables.size(); }
      Float_t GetValueNormalized(UInt_t ivar) const;
      void*   GetExternalLink(UInt_t ivar)    const { return fVariables[ivar].GetExternalLink(); }
      void Print(std::ostream & o) const;
      Int_t GetMemSize() const { 
         Int_t size = sizeof(*this);
         size += GetNVars() * (sizeof(void*)+sizeof(Int_t)+sizeof(Float_t));
         return size;
      }
   private:
      void InitPointers(bool AllowExternalLink = kTRUE);
   
      const std::vector<TMVA::VariableInfo>& fVariables; 
      void **   fVarPtr;          
      
      Float_t*  fVarPtrF;         
      Int_t     fType;            
      Float_t   fWeight;          
      Float_t   fBoostWeight;     
      UInt_t    fCountI;          
      UInt_t    fCountF;          
      std::vector<TBranch*> fBranches; 
      static Int_t fgCount;       
   };
}
#endif
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.