star-travex
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TStiHit.cxx
Go to the documentation of this file.
1 #include "StiRootIO/TStiHit.h"
2 
4 
5 
6 TStiHit::TStiHit() : TObject(),
7  fStiHit(nullptr),
8  fDetectorId(kUnknownId),
9  fVolumeName(""),
10  fPosition(),
11  fPositionLocal(),
12  fTimesUsed(0)
13 {
14 }
15 
16 
17 TStiHit::TStiHit(const StiHit & stiHit) : TObject(),
18  fStiHit(&stiHit),
19  fDetectorId( stiHit.detector() ? static_cast<StDetectorId>(stiHit.detector()->getGroupId()) : kUnknownId ),
20  fVolumeName( stiHit.detector() ? stiHit.detector()->getName() : "" ),
21  fPosition(stiHit.x_g(), stiHit.y_g(), stiHit.z_g()),
22  fPositionLocal(stiHit.x(), stiHit.y(), stiHit.z()),
23  fTimesUsed(stiHit.timesUsed())
24 {
25 }
26 
27 
28 void TStiHit::Print(Option_t *opt) const
29 {
30  fPosition.Print();
31 }
32 
33 
34 bool operator< (const TStiHit& lhs, const TStiHit& rhs)
35 {
36  if (lhs.fPosition.Perp() < rhs.fPosition.Perp() )
37  return true;
38  else if ( lhs.fPosition.Perp() == rhs.fPosition.Perp() &&
39  lhs.fPosition.Z() < rhs.fPosition.Z() )
40  return true;
41  else
42  return false;
43 }
ClassImp(TStiHit) TStiHit
Definition: TStiHit.cxx:3
bool operator<(const TStiHit &lhs, const TStiHit &rhs)
Definition: TStiHit.cxx:34
TVector3 fPosition
Global coordinates of the hit in the STAR CS.
Definition: TStiHit.h:36
virtual void Print(Option_t *opt="") const
Definition: TStiHit.cxx:28