StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuFwdTrack.h
1 /***************************************************************************
2  *
3  * Author: jdb, Feb 2022
4  ***************************************************************************
5  *
6  * Description: StMuFwdTrack stores the Forward tracks built from Fst and Ftt
7  *
8  **************************************************************************/
9 #ifndef StMuFwdTrack_hh
10 #define StMuFwdTrack_hh
11 
12 #include <TObject.h>
13 #include <vector>
14 #include "TVector3.h"
15 #include "TRefArray.h"
16 
17 #include "StMuFcsCluster.h"
18 
19 
20 class StFwdTrack;
21 
22 
23 struct StMuFwdTrackProjection : public TObject {
26  mXYZ = other.mXYZ;
27  mMom = other.mMom;
28  mDetId = other.mDetId;
29  memcpy( mCov, other.mCov, sizeof( mCov ) );
30  }
31  StMuFwdTrackProjection( unsigned short detId,
32  TVector3 xyz,
33  TVector3 mom,
34  float c[9] ) {
35  set( detId, xyz, mom, c );
36  }
37 
38  void set( unsigned short detId,
39  TVector3 xyz,
40  TVector3 mom,
41  float c[9]) {
42  mDetId = detId;
43  mXYZ = xyz;
44  mMom = mom;
45  memcpy( mCov, c, sizeof(mCov) );
46  }
47  void set( StMuFwdTrackProjection &other ){
48  mDetId = other.mDetId;
49  mXYZ = other.mXYZ;
50  mMom = other.mMom;
51  memcpy( mCov, other.mCov, sizeof(mCov) );
52  }
53  TVector3 mXYZ;
54  TVector3 mMom;
55  unsigned char mDetId;
56  float mCov[9];
57 
58  float dx(){
59  return sqrt( mCov[0] );
60  }
61  float dy(){
62  return sqrt( mCov[4] );
63  }
64  float dz(){
65  return sqrt( mCov[8] );
66  }
67 
68  ClassDef(StMuFwdTrackProjection, 1)
69 };
70 
71 struct StMuFwdTrackSeedPoint : public TObject{
73  StMuFwdTrackSeedPoint( TVector3 xyz,
74  short sec,
75  unsigned short trackId,
76  float cov[9] ){
77  mXYZ = xyz;
78  mSector = sec;
79  mTrackId = trackId;
80  memcpy( mCov, cov, sizeof( mCov ));
81  }
82 
83  TVector3 mXYZ;
84  unsigned short mTrackId;
85  short mSector;
86  float mCov[9];
87  ClassDef(StMuFwdTrackSeedPoint,1)
88 };
89 
90 class StMuFwdTrack : public TObject {
91 
92 public:
93  StMuFwdTrack( );
94 
95  void set( StFwdTrack* );
96 
97  std::vector<StMuFwdTrackProjection> mProjections;
98  std::vector<StMuFwdTrackSeedPoint> mFTTPoints;
99  std::vector<StMuFwdTrackSeedPoint> mFSTPoints;
100 
101  bool getProjectionFor( int detectorId,
102  StMuFwdTrackProjection &rProj,
103  size_t index = 0 );
104 
105  TVector3 momentum() const;
106  TVector3 momentumAt(size_t _id = 0) const;
107  char charge() const;
108 
109 
110  // Quality of the fit
111  bool didFitConverge() const;
112  bool didFitConvergeFully() const;
113  short numberOfFailedPoints() const;
114  double chi2() const;
115  double ndf() const;
116  double pval() const;
117 
118  // Number of fit points used by GenFit
119  short numberOfFitPoints() const;
120  // unsigned int numberOfPossibleFitPoints() const;
121 
122  // Number of points used in the track seed step
123  short numberOfSeedPoints() const;
124 
125 
126  void setPrimaryMomentum( TVector3 mom ) { mPrimaryMomentum = mom; }
127  void setDidFitConverge( bool lDidFitConverge ) { mDidFitConverge = lDidFitConverge; }
128  void setDidFitConvergeFully( bool lDidFitConvergeFully ) { mDidFitConvergeFully = lDidFitConvergeFully;}
129  void setNumberOfFailedPoints( short lNumberOfFailedPoints ) { mNumberOfFailedPoints = lNumberOfFailedPoints;}
130  void setNumberOfSeedPoints( short lNumberOfSeedPoints ) { mNumberOfSeedPoints = lNumberOfSeedPoints;}
131  void setNumberOfFitPoints( short lNumberOfFitPoints ) { mNumberOfFitPoints = lNumberOfFitPoints;}
132  void setChi2( float lChi2 ) { mChi2 = lChi2;}
133  void setNDF( float lNDF ) { mNDF = lNDF;}
134  void setPval( float lPval ) { mPval = lPval;}
135  void setCharge( short lCharge ) { mCharge = lCharge;}
136 
137  // ECAL clusters
138  // StPtrVecFcsCluster& ecalClusters();
139  // const StPtrVecFcsCluster& ecalClusters() const;
140  // void addEcalCluster(StFcsCluster* p);
141  // void sortEcalClusterByET();
142  // // HCAL clusters
143  // StPtrVecFcsCluster& hcalClusters();
144  // const StPtrVecFcsCluster& hcalClusters() const;
145  // void addHcalCluster(StFcsCluster* p);
146  // void sortHcalClusterByET();
147 
148  // vector<StMuFcsCluster*>
149 
150  void addEcalCluster( StMuFcsCluster* clu);
151  void addHcalCluster( StMuFcsCluster* clu);
152 
153  TRefArray mEcalClusters;
154  TRefArray mHcalClusters;
155 
156 protected:
157 
158  // Track quality and convergence
159  bool mDidFitConverge;
160  bool mDidFitConvergeFully;
161  short mNumberOfFailedPoints;
162  short mNumberOfSeedPoints;
163  short mNumberOfFitPoints;
164  float mChi2;
165  float mNDF;
166  float mPval;
167  short mCharge;
168  TVector3 mPrimaryMomentum;
169 
170 
171  // StPtrVecFcsCluster mEcalClusters;
172  // StPtrVecFcsCluster mHcalClusters;
173 
174  ClassDef(StMuFwdTrack,2)
175 
176 };
177 
178 #endif
179