StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuRpsTrack.h
1 #ifndef __StMuRpsTrack_hh__
2 #define __StMuRpsTrack_hh__
3 
4 #include "TObject.h"
5 #include "TVector3.h"
6 #include "TRef.h"
7 #include <vector>
8 
9 using namespace std;
10 
11 class StRpsTrackPoint;
12 class StRpsTrack;
13 
14 class StMuRpsTrack : public TObject {
15 public:
16  enum StMuRpsTrackType { rpsLocal, rpsGlobal, rpsUndefined };
17  enum StMuRpsAngles { rpsAngleThetaX, rpsAngleThetaY, rpsAngleTheta, mNumberOfAngleTypes };
18  enum {mNumberOfStationsInBranch = 2};
19 
20 protected:
21  TRef mTrackPoints[mNumberOfStationsInBranch]; // reference to track points (local tracks)
22  TVector3 mP; // three-vector with reconstructed track momentum
23  Int_t mBranch; // detectors branch, EU=0, ED=1, WU=2, WD=3
24  StMuRpsTrackType mType; // type of the track
25 
26 public:
27  StMuRpsTrack();
28  StMuRpsTrack(const StMuRpsTrack&);
29  ~StMuRpsTrack();
30 
31  StMuRpsTrack& operator=(const StMuRpsTrack&);
32 
33  const StMuRpsTrackPoint* trackPoint(unsigned int)const ;
34  TVector3 pVec() const;
35  int branch() const;
36  StMuRpsTrackType type() const;
37  unsigned int planesUsed() const;
38 
39  double theta(unsigned int = rpsAngleTheta) const;
40  double thetaRp(unsigned int = rpsAngleTheta) const;
41  double phi() const;
42  double phiRp() const;
43  double t(double) const;
44  double xi(double) const;
45  double p() const;
46  double pt() const;
47  double eta() const;
48  double time() const;
49 
50  void setTrackPoint( StMuRpsTrackPoint*, unsigned int);
51  void setP(const TVector3&);
52  void setBranch(int);
53  void setType(StMuRpsTrackType type);
54 
55  ClassDef(StMuRpsTrack, 1)
56 };
57 
58 inline const StMuRpsTrackPoint* StMuRpsTrack::trackPoint(unsigned int station) const {
59  return station < mNumberOfStationsInBranch ? static_cast<const StMuRpsTrackPoint*>(mTrackPoints[station].GetObject()) : nullptr;
60 }
61 inline TVector3 StMuRpsTrack::pVec() const { return mP; }
62 inline int StMuRpsTrack::branch() const { return mBranch; }
63 inline StMuRpsTrack::StMuRpsTrackType StMuRpsTrack::type() const { return mType; }
64 inline double StMuRpsTrack::phi() const { return mP.Phi(); }
65 inline double StMuRpsTrack::t(double beamMomentum) const {
66  return -2*beamMomentum*beamMomentum*(1-xi(beamMomentum))*(1-cos(theta(rpsAngleTheta)));
67 }
68 inline double StMuRpsTrack::xi(double beamMomentum) const {
69  return (beamMomentum - mP.Mag())/beamMomentum;
70 }
71 inline double StMuRpsTrack::p() const { return mP.Mag(); }
72 inline double StMuRpsTrack::pt() const { return mP.Perp(); }
73 inline double StMuRpsTrack::eta() const { return mP.PseudoRapidity(); }
74 
75 inline void StMuRpsTrack::setTrackPoint(StMuRpsTrackPoint* trackPoint, unsigned int station) {
76  if (station<mNumberOfStationsInBranch)
77  mTrackPoints[station] = trackPoint;
78 }
79 inline void StMuRpsTrack::setP(const TVector3& P) { mP = P; }
80 inline void StMuRpsTrack::setBranch(int branch) { mBranch = branch; }
81 inline void StMuRpsTrack::setType(StMuRpsTrackType type) { mType = type; }
82 
83 #endif