#include <cassert>#include <iostream>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | Lit |
Classes | |
| class | Lit::Event |
Typedefs | |
| typedef float | VarType |
| typedef std::vector< VarType > | VarVec |
Functions | |
| VarType | Distance (const VarType var1, const VarType var2) |
| VarType | Distance (const Event &event1, const Event &event2) |
| std::ostream & | operator<< (std::ostream &os, const Event &event) |
|
|
Definition at line 16 of file PhysicsNtuple/kNNAlg/Event.h. Referenced by Lit::Node::Add(), Lit::LikeModule::Balance(), Lit::Distance(), Lit::Find(), Lit::LikeModule::Find(), Lit::Node::GetVarDis(), Lit::Node::GetVarMax(), and Lit::Node::GetVarMin(). |
|
|
Definition at line 17 of file PhysicsNtuple/kNNAlg/Event.h. Referenced by Lit::LikeModule::Balance(), Lit::LikeModule::Find(), Lit::Event::GetTgtVec(), Lit::Event::GetVarVec(), and Lit::LikeModule::Scale(). |
|
||||||||||||
|
Definition at line 61 of file PhysicsNtuple/kNNAlg/Event.cxx. References Lit::Distance(), Lit::Event::GetNVar(), Lit::Event::GetVar(), and Lit::VarType. 00062 {
00063 const unsigned int size = event1.GetNVar();
00064
00065 if(size != event2.GetNVar())
00066 {
00067 std::cerr << "Distance: two events have different dimensions" << std::endl;
00068 return -1.0;
00069 }
00070
00071 VarType sum = 0.0;
00072 for(unsigned int ivar = 0; ivar != size; ++ivar)
00073 {
00074 sum += Distance(event1.GetVar(ivar), event2.GetVar(ivar));
00075 }
00076
00077 return sum;
00078 }
|
|
||||||||||||
|
Definition at line 54 of file PhysicsNtuple/kNNAlg/Event.h. References Lit::VarType. Referenced by Lit::Distance(), and Lit::Find(). 00055 {
00056 return (var1 - var2) * (var1 - var2);
00057 }
|
|
||||||||||||
|
Definition at line 135 of file PhysicsNtuple/kNNAlg/Event.cxx. References Lit::Event::Print(). 00136 {
00137 event.Print(os);
00138 return os;
00139 }
|
1.3.9.1