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

Detailed Description

Definition at line 19 of file PhysicsNtuple/HEAD/kNNAlg/Event.h.


Constructor & Destructor Documentation

Event::Event (  ) 

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

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

Event::Event ( const VarVec vvec,
double  weight,
short  type 
)

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

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

Event::Event ( const VarVec vvec,
double  weight,
short  type,
const VarVec tvec 
)

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

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

Event::~Event (  ) 

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

00043 {
00044 }


Member Function Documentation

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

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

References fTgt.

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

00073 { return fTgt.size(); }

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

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

References fVar.

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

00072 { return fVar.size(); }

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

Definition at line 54 of file PhysicsNtuple/HEAD/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 & Event::GetTgtVec (  )  const [inline]

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

References fTgt.

00076 { return fTgt; }

short Event::GetType (  )  const [inline]

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

References fType.

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

00079    {
00080       return fType;
00081    }

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

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

References fVar.

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

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

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

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

References fVar.

00075 { return fVar; }

double Event::GetWeight (  )  const [inline]

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

References fWeight.

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

00068    {
00069       return fWeight;
00070    }

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

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

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

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

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

Referenced by GetNTgt(), GetTgt(), and GetTgtVec().

short Lit::Event::fType [private]

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

Referenced by GetType(), and Print().

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

Referenced by GetNVar(), GetVar(), and GetVarVec().

double Lit::Event::fWeight [private]

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

Referenced by GetWeight(), and Print().


The documentation for this class was generated from the following files:

Generated on 15 Nov 2018 for loon by  doxygen 1.6.1