StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRpsTrack.h
1 /***************************************************************************
2  *
3  * $Id: StRpsTrack.h,v 2.4 2015/10/22 20:31:31 ullrich Exp $
4  *
5  * Author: Rafal Sikora, 1 Oct 2015
6  *
7  ***************************************************************************
8  *
9  * Description: StRpsTrack class representing reconstructed track in
10  * the Roman Pot system, with all associated observables, such as
11  * momentum (px, py, pz) etc..
12  *
13  ***************************************************************************
14  *
15  * $Log: StRpsTrack.h,v $
16  * Revision 2.4 2015/10/22 20:31:31 ullrich
17  * StRpsTrack.cxx
18  *
19  * Revision 2.3 2015/10/08 20:53:34 ullrich
20  * Changed comment of mBranch
21  *
22  * Revision 2.2 2015/10/07 17:30:13 ullrich
23  * Changed const to enums and related changes.
24  *
25  * Revision 2.1 2015/10/02 19:48:14 ullrich
26  * Initial Revision.
27  *
28  ***************************************************************************/
29 #ifndef StRpsTrack_hh
30 #define StRpsTrack_hh
31 
32 #include "StObject.h"
33 #include "StContainers.h"
34 #include "StThreeVectorF.hh"
35 
36 class StRpsTrackPoint;
37 
38 class StRpsTrack : public StObject {
39 public:
40  StRpsTrack();
41  StRpsTrack(const StRpsTrack&);
42  ~StRpsTrack();
43 
44  StRpsTrack& operator=(const StRpsTrack&);
45  enum StRpsTrackType { rpsLocal, rpsGlobal, rpsUndefined };
46  enum StRpsAngles { rpsAngleThetaX, rpsAngleThetaY, rpsAngleTheta, mNumberOfAngleTypes };
47 
48  StRpsTrackPoint* trackPoint(unsigned int) const;
49  StThreeVectorF pVec() const;
50  int branch() const;
51  StRpsTrackType type() const;
52  unsigned int planesUsed() const;
53 
54  double theta(unsigned int = rpsAngleTheta) const;
55  double thetaRp(unsigned int = rpsAngleTheta) const;
56  double phi() const;
57  double phiRp() const;
58  double t(double) const;
59  double xi(double) const;
60  double p() const;
61  double pt() const;
62  double eta() const;
63  double time() const;
64 
65  void setTrackPoint(StRpsTrackPoint*, unsigned int);
66  void setP(const StThreeVectorF&);
67  void setBranch(int);
68  void setType(StRpsTrackType);
69 
70  enum {mNumberOfStationsInBranch = 2};
71 
72 private:
73  StPtrVecRpsTrackPoint mTrackPoints; // pointers to track points (local tracks)
74  StThreeVectorF mP; // three-vector with reconstructed track momentum
75  Int_t mBranch; // detectors branch, EU=0, ED=1, WU=2, WD=3
76  StRpsTrackType mType; // type of the track
77 
78  ClassDef(StRpsTrack, 1)
79 };
80 
81 inline StRpsTrackPoint* StRpsTrack::trackPoint(unsigned int station) const
82 {
83  return station < mNumberOfStationsInBranch ? mTrackPoints[station] : nullptr;
84 }
85 inline StThreeVectorF StRpsTrack::pVec() const { return mP; }
86 inline int StRpsTrack::branch() const { return mBranch; }
87 inline StRpsTrack::StRpsTrackType StRpsTrack::type() const { return mType; }
88 inline double StRpsTrack::phi() const { return mP.phi(); }
89 inline double StRpsTrack::t(double beamMomentum) const
90 {
91  return -2*beamMomentum*beamMomentum*(1-xi(beamMomentum))*(1-cos(theta(rpsAngleTheta)));
92 }
93 inline double StRpsTrack::xi(double beamMomentum) const
94 {
95  return (beamMomentum - mP.mag())/beamMomentum;
96 }
97 inline double StRpsTrack::p() const { return mP.mag(); }
98 inline double StRpsTrack::pt() const { return mP.perp(); }
99 inline double StRpsTrack::eta() const { return mP.pseudoRapidity(); }
100 
101 inline void StRpsTrack::setTrackPoint(StRpsTrackPoint* trackPoint, unsigned int station)
102 {
103  if (station<mNumberOfStationsInBranch)
104  mTrackPoints[station] = trackPoint;
105 }
106 inline void StRpsTrack::setP(const StThreeVectorF& P) { mP = P; }
107 inline void StRpsTrack::setBranch(int branch) { mBranch = branch; }
108 inline void StRpsTrack::setType(StRpsTrack::StRpsTrackType type) { mType = type; }
109 
110 #endif