StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StKinkLocalTrack.cc
1 
10 #include "StKinkLocalTrack.hh"
11 #include "SystemOfUnits.h"
12 #include "StTrackGeometry.h"
13 #include "StTrack.h"
14 #include <iostream>
15 using namespace std;
16 #ifndef ST_NO_NAMESPACES
17 using namespace units;
18 #endif
19 
20 
21 StKinkLocalTrack::StKinkLocalTrack()
22 {
23  mEndRadius2D = 0.;
24  mStartRadius2D = 0.;
25 }
26 
27 StKinkLocalTrack::StKinkLocalTrack(StTrack* trk)
28 {
29  StTrackGeometry* trkGeom = trk->geometry();
30  mStartPoint = trkGeom->origin();//origin of the track
31  mStartRadius2D = mStartPoint.perp();//r at start
32 
33  StTrackGeometry* trkGeomo = trk->outerGeometry();
34  mLastPoint = trkGeomo->origin();//last point of the track
35  mEndRadius2D = mLastPoint.perp();//r at his last point
36 
37  mTrack = trk;
38 }
39 
40 Int_t StKinkLocalTrack::Compare(const TObject *obj) const
41 {
42  if( mStartRadius2D == ((StKinkLocalTrack*)obj)->mStartRadius2D ) return 0;
43  if( mStartRadius2D < ((StKinkLocalTrack*)obj)->mStartRadius2D ) return -1;
44  return 1;
45 }
46 
47 Bool_t StKinkLocalTrack::IsEqual(const TObject *obj) const
48 {
49  if (this == obj) return 1;
50  if (StKinkLocalTrack::Class() != obj->IsA()) return 0;
51  return mStartRadius2D == ((StKinkLocalTrack*)obj)->mStartRadius2D;
52 }
auxiliary class for the kink finder