EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FwdMatchCandidate.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FwdMatchCandidate.h
1 //
2 // AYK (ayk@bnl.gov)
3 //
4 // STAR forward track candidate class;
5 //
6 //
7 
8 #include <TVector3.h>
9 
10 #include <Math/DistFunc.h>
11 
12 #include <MatchCandidate.h>
13 
14 #ifndef _FWD_MATCH_CANDIDATE_
15 #define _FWD_MATCH_CANDIDATE_
16 
17 class HoughTree;
18 
20  public:
21  FwdMatchCandidate(const HoughTree *tree = 0): MatchCandidate(tree),
25  {
26 #if _LATER_
27  //mAlreadyAccountedAsGoodTrack(false),
28  mPassedKalmanFilter(false),
29 #endif
30 #if _LATER_
31  mUsedInFit = new int[gdim];
32 #endif
33 
34  //memset(mCoord, 0x00, sizeof(mCoord));
35  //memset(mSlope, 0x00, sizeof(mSlope));
36  memset(mCoordSigma, 0x00, sizeof(mCoordSigma));
37  memset(mSlopeSigma, 0x00, sizeof(mSlopeSigma));
38  };
40 
41  void ShapeItUpForInspection(const HoughTree *tree, const unsigned id[]) {
43 
45  };
47  bool IsReadyForFinalFit() const {
49  };
50 
51  void SetFilterChiSquare(double chiSquare, double chiSquareCCDF, unsigned ndf) {
52  mNdf = ndf;
53  mFilterChiSquare = chiSquare;
54 
55  mFilterChiSquareCCDF = chiSquareCCDF;
56  };
57 
58  void SetMcTrackId(int id) { mMcTrackId = id; };
59  int GetMcTrackId() const { return mMcTrackId; };
60  void SetWrongHitCount(unsigned count) { mWrongHitCount = count; };
61  unsigned GetWrongHitCount() const { return mWrongHitCount; };
62  void SetAmbiguityFlag(bool flag) { mMcTrackAssociationAmbiguous = flag; };
63  bool IsAmbiguous() const { return mMcTrackAssociationAmbiguous; };
64 
65  void SetVtxCoord(double x, double y, double z) { mVertex = TVector3(x, y, z); };
66  void SetVtxMomentum(double sx, double sy, double invp);
67  void SetVtxCoordSigma(double sigmaX, double sigmaY) {
68  mCoordSigma[0] = sigmaX;
69  mCoordSigma[1] = sigmaY;
70  };
71  void SetVtxSlopeSigma(double sigmaX, double sigmaY) {
72  mSlopeSigma[0] = sigmaX;
73  mSlopeSigma[1] = sigmaY;
74  };
75 
76  double GetX() const { return mVertex[0]; };
77  double GetY() const { return mVertex[1]; };
78  double GetZ() const { return mVertex[2]; };
79  double GetVtxCoordSigma(unsigned xy) const { return xy <= 1 ? mCoordSigma[xy] : 0.0; };
80  double GetVtxSlopeSigma(unsigned xy) const { return xy <= 1 ? mSlopeSigma[xy] : 0.0; };
81 
82  int GetFilterNdf() const { return mNdf; };
83  double GetFilterChiSquareCCDF() const { return mFilterChiSquareCCDF; };
84  // NB: this is defined as a pure virtual method in the base MatchCandidate class;
85  double GetTrackQualityParameter() const { return GetFilterChiSquareCCDF(); };
86 
87  const TVector3 &GetMomentum() const { return mMomentum; };
88  double GetSlopeX() const { return mMomentum[2] ? mMomentum[0]/mMomentum[2] : 0.0; };
89  double GetSlopeY() const { return mMomentum[2] ? mMomentum[1]/mMomentum[2] : 0.0; };
90  double GetP() const { return mMomentum.Mag(); };
91  int GetCharge() const { return mCharge; };
92 
93  private:
94  // Fit results; chi^2, ndf (assume can not go negative for a good track),
95  // respective CCDF value;
96  unsigned mNdf;
98 
99  // MC track ID (based on the highest hit count);
101  // Number of hits from other track(s);
102  unsigned mWrongHitCount;
103  // Well, basically 2 MC tracks have equal hit count in this track;
104  // FIXME: eventually may want to distribute RC tracks over MC ones in such
105  // a way, that to maximize found MC tracks (in cases of heavy ambiguities);
106  // say if two RC tracks have 5+5 hits from wto MC tracks, makes sense to
107  // force 1->1 relationship rather than one of the MC tracks will occasionally
108  // remain "idle"; yet I guess track parameters in this case will be totally
109  // screwed up, so why bother?;
111 
112  // Estimated vertex location (well, Z-vertex was fixed) and 3D momentum;
113  TVector3 mVertex, mMomentum;
114  // Estimated slope and coordinate errors at the nominal vertex location;
115  double mCoordSigma[2], mSlopeSigma[2];
116 
117  int mCharge;
118 
119  // Indicates that this track candidate passed through KF chain;
121 
122 #if _LATER_
123 
124  // Once a given track candidate was selected to be BEST during one of the
125  // iterations in launchHtreePatternFinder(), it is marked by this flag and
126  // will not be considered for further BEST comparisons any longer;
127  //bool mAlreadyAccountedAsGoodTrack;
128 
129  // Either member ID or -1 (if had to discard this plane); for now assume, that
130  // only one hit per plane group can survive; FIXME: may want to account >1 later;
131  int *mUsedInFit;
132 #endif
133 
135 };
136 
137 #endif