Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Lit::Event Class Reference

#include <Event.h>

List of all members.

Public Member Functions

 Event ()
 Event (const VarVec &vvec, double weight, short type)
 Event (const VarVec &vvec, double weight, short type, const VarVec &tvec)
 ~Event ()
double GetWeight () const
VarType GetVar (unsigned int i) const
VarType GetTgt (unsigned int i) const
unsigned int GetNVar () const
unsigned int GetNTgt () const
const VarVecGetVarVec () const
const VarVecGetTgtVec () const
short GetType () const
void Print (std::ostream &os=std::cout, unsigned int w=5, unsigned int p=3) const

Private Attributes

VarVec fVar
VarVec fTgt
double fWeight
short fType


Constructor & Destructor Documentation

Lit::Event::Event  ) 
 

Definition at line 10 of file PhysicsNtuple/kNNAlg/Event.cxx.

00011    :fVar(),
00012     fTgt(),
00013     fWeight(-1.0),
00014     fType(-1)
00015 {
00016 }

Lit::Event::Event const VarVec vvec,
double  weight,
short  type
 

Definition at line 19 of file PhysicsNtuple/kNNAlg/Event.cxx.

00022    :fVar(vvec),
00023     fTgt(),
00024     fWeight(weight),
00025     fType(type)
00026 {
00027 }

Lit::Event::Event const VarVec vvec,
double  weight,
short  type,
const VarVec tvec
 

Definition at line 30 of file PhysicsNtuple/kNNAlg/Event.cxx.

00034    :fVar(vvec),
00035     fTgt(tvec),
00036     fWeight(weight),
00037     fType(type)
00038 {
00039 }

Lit::Event::~Event  ) 
 

Definition at line 42 of file PhysicsNtuple/kNNAlg/Event.cxx.

00043 {
00044 }


Member Function Documentation

unsigned int Lit::Event::GetNTgt  )  const [inline]
 

Definition at line 73 of file PhysicsNtuple/kNNAlg/Event.h.

Referenced by Anp::FillkNN::Find(), and Print().

00073 { return fTgt.size(); }

unsigned int Lit::Event::GetNVar  )  const [inline]
 

Definition at line 72 of file PhysicsNtuple/kNNAlg/Event.h.

Referenced by Lit::Node::Add(), Lit::LikeModule::Add(), Lit::Distance(), Lit::LikeModule::Find(), Lit::Print(), Print(), and Lit::LikeModule::Scale().

00072 { return fVar.size(); }

Lit::VarType Lit::Event::GetTgt unsigned int  i  )  const
 

Definition at line 54 of file PhysicsNtuple/kNNAlg/Event.cxx.

References fTgt.

Referenced by Anp::FillkNN::Find(), and Print().

00055 {
00056    assert(i < fTgt.size() && "index is out of range");
00057    return fTgt[i];
00058 }

const VarVec & Lit::Event::GetTgtVec  )  const [inline]
 

Definition at line 76 of file PhysicsNtuple/kNNAlg/Event.h.

References Lit::VarVec.

Referenced by Lit::LikeModule::Scale().

00076 { return fTgt; }

short Lit::Event::GetType  )  const [inline]
 

Definition at line 78 of file PhysicsNtuple/kNNAlg/Event.h.

Referenced by Lit::LikeModule::Add(), Lit::Node::GetType(), and Lit::LikeModule::Scale().

00079    {
00080       return fType;
00081    }

Lit::VarType Lit::Event::GetVar unsigned int  i  )  const
 

Definition at line 47 of file PhysicsNtuple/kNNAlg/Event.cxx.

References fVar.

Referenced by Lit::Node::Add(), Lit::LikeModule::Add(), Lit::Distance(), Lit::Find(), Lit::Print(), Print(), and Lit::LikeModule::Scale().

00048 {
00049    assert(i < fVar.size() && "index is out of range");
00050    return fVar[i];
00051 }

const VarVec & Lit::Event::GetVarVec  )  const [inline]
 

Definition at line 75 of file PhysicsNtuple/kNNAlg/Event.h.

References Lit::VarVec.

00075 { return fVar; }

double Lit::Event::GetWeight  )  const [inline]
 

Definition at line 67 of file PhysicsNtuple/kNNAlg/Event.h.

Referenced by Anp::FillkNN::Find(), Lit::Node::GetWeight(), and Lit::LikeModule::Scale().

00068    {
00069       return fWeight;
00070    }

void Lit::Event::Print std::ostream &  os = std::cout,
unsigned int  w = 5,
unsigned int  p = 3
const
 

Definition at line 81 of file PhysicsNtuple/kNNAlg/Event.cxx.

References fType, fWeight, GetNTgt(), GetNVar(), GetTgt(), and GetVar().

Referenced by Lit::operator<<().

00082 {
00083    os << "Event  (weight, type) = ("
00084       << std::setw(w) << std::setprecision(p) << fWeight << ", "
00085       << fType << ") ";
00086 
00087    for(unsigned int ivar = 0; ivar != GetNVar(); ++ivar)
00088    {
00089       if(ivar == 0)
00090       {
00091          os << "var = (";
00092       }
00093       else
00094       {
00095          os << ", ";
00096       }
00097 
00098       os << std::setfill(' ') << std::setw(5) << std::setprecision(3) << GetVar(ivar);
00099    }
00100 
00101    if(GetNVar() > 0)
00102    {
00103       os << ")";
00104    }
00105    else
00106    {
00107       os << " no variables";
00108    }
00109 
00110    for(unsigned int itgt = 0; itgt != GetNTgt(); ++itgt)
00111    {
00112       if(itgt == 0)
00113       {
00114          os << "tgt = (";
00115       }
00116       else
00117       {
00118          os << ", ";
00119       }
00120 
00121       os << std::setfill(' ') << std::setw(5) << std::setprecision(3) << GetTgt(itgt);
00122    }
00123 
00124    if(GetNTgt() > 0)
00125    {
00126       os << ")";
00127    }
00128    else
00129    {
00130       os << " no targets";
00131    }
00132 }


Member Data Documentation

VarVec Lit::Event::fTgt [private]
 

Definition at line 46 of file PhysicsNtuple/kNNAlg/Event.h.

Referenced by GetTgt().

short Lit::Event::fType [private]
 

Definition at line 48 of file PhysicsNtuple/kNNAlg/Event.h.

Referenced by Print().

VarVec Lit::Event::fVar [private]
 

Definition at line 45 of file PhysicsNtuple/kNNAlg/Event.h.

Referenced by GetVar().

double Lit::Event::fWeight [private]
 

Definition at line 47 of file PhysicsNtuple/kNNAlg/Event.h.

Referenced by Print().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:37 2010 for loon by  doxygen 1.3.9.1