StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMeasuredPoint.cxx
1 /***************************************************************************
2  *
3  * $Id: StMeasuredPoint.cxx,v 2.4 2009/11/09 22:38:15 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Sep 1999
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StMeasuredPoint.cxx,v $
13  * Revision 2.4 2009/11/09 22:38:15 ullrich
14  * Changed format of print out.
15  *
16  * Revision 2.3 2005/07/06 18:58:15 fisyak
17  * Add print out
18  *
19  * Revision 2.2 2001/04/05 04:00:51 ullrich
20  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
21  *
22  * Revision 2.1 1999/10/13 19:44:56 ullrich
23  * Initial Revision
24  *
25  **************************************************************************/
26 #include "StMeasuredPoint.h"
27 #include "TString.h"
28 
29 static const char rcsid[] = "$Id: StMeasuredPoint.cxx,v 2.4 2009/11/09 22:38:15 ullrich Exp $";
30 
31 ClassImp(StMeasuredPoint)
32 
33 StMeasuredPoint::StMeasuredPoint() {/* noop */}
34 
35 StMeasuredPoint::StMeasuredPoint(const StThreeVectorF& p)
36  : mPosition(p) { /* noop */ }
37 
38 StMeasuredPoint::~StMeasuredPoint() { /* noop */ }
39 
40 int
41 StMeasuredPoint::operator==(const StMeasuredPoint& p) const
42 {
43  return p.mPosition == mPosition;
44 }
45 
46 int
47 StMeasuredPoint::operator!=(const StMeasuredPoint& p) const
48 {
49  return !(*this == p); // use operator==()
50 }
51 
52 void
53 StMeasuredPoint::setPosition(const StThreeVectorF& val) { mPosition = val; }
54 
55 const StThreeVectorF&
56 StMeasuredPoint::position() const { return mPosition; }
57 
58 ostream& operator<<(ostream& os, const StMeasuredPoint& v)
59 {
60  return os << Form("xyz:%10.3f%10.3f%10.3f",
61  v.position().x(),
62  v.position().y(),
63  v.position().z());
64 }
65 
66 void StMeasuredPoint::Print(Option_t *option) const {cout << *this << endl;}