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

BFLNode.cxx

Go to the documentation of this file.
00001 
00002 //                                                                   //
00003 //authors: Costas Andreopoulos, Elias Athanasopoulos, George Tzanakos//
00004 //                Physics Department, University of Athens           //
00005 //                                                  October 11, 1999 //
00007 
00008 #include <iostream>
00009 using std::cout;
00010 using std::endl;
00011 
00012 #include "TROOT.h"
00013 #include "TVector2.h"
00014 
00015 #include "BField/BFLNode.h"
00016 
00017 ClassImp(BFLNode)
00018 
00019 BFLNode::BFLNode(Int_t nid, Float_t x, Float_t y):
00020   fNodeID(nid),
00021   fx(x),
00022   fy(y) 
00023 {
00024 }
00025 
00026 BFLNode::BFLNode(Float_t x, Float_t y):
00027   fNodeID(-1),
00028   fx(x),
00029   fy(y)
00030 {
00031 }
00032 
00033 BFLNode::~BFLNode()
00034 {
00035 //      cout << " node deleted "<< endl;
00036 }
00037 
00038 TVector2 * BFLNode::GetXY(void) const
00039 { 
00040         return(new TVector2(fx,fy));
00041 }
00042 
00043 void BFLNode::SetXY(TVector2 & PositionVector)
00044 {
00045         SetX( PositionVector.X() );
00046         SetY( PositionVector.Y() );
00047 }
00048 
00049 void BFLNode::Print(Option_t *) const
00050 {
00051   cout << endl;
00052   cout << "node " << fNodeID   
00053        << " is at (" << fx << "," << fy << ") " << endl;
00054 }
00055 
00056 Int_t BFLNode::Compare(const TObject * node) const
00057 {
00058   if( fx < ((BFLNode *)node)->GetX() ) {
00059     return -1;
00060   } else if( fx > ((BFLNode *)node)->GetX() ) {
00061     return 1;
00062   } else {
00063     if( fy < ((BFLNode *)node)->GetY() ) {
00064         return -1;
00065     } else if( fy > ((BFLNode *)node)->GetY() ) {
00066         return 1;
00067     } else {
00068         return 0;
00069     }
00070   }
00071 }

Generated on Mon Feb 15 11:06:26 2010 for loon by  doxygen 1.3.9.1