StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StVertex.h
1 
5 /***************************************************************************
6  *
7  * $Id: StVertex.h,v 2.20 2017/06/01 23:46:27 smirnovd Exp $
8  *
9  * Author: Thomas Ullrich, Sep 1999
10  ***************************************************************************
11  *
12  * Description:
13  *
14  ***************************************************************************
15  *
16  * $Log: StVertex.h,v $
17  * Revision 2.20 2017/06/01 23:46:27 smirnovd
18  * StVertex: Convenience getter for covariance matrix as array of doubles
19  *
20  * Revision 2.19 2017/05/04 23:52:35 smirnovd
21  * StVertex: Convenience setter for covariance matrix from array of doubles
22  *
23  * Revision 2.18 2015/10/09 17:46:15 ullrich
24  * Changed type of mIdTruth from ushort to int.
25  *
26  * Revision 2.17 2013/07/23 11:21:49 jeromel
27  * Undo past week changes
28  *
29  * Revision 2.15 2013/04/10 19:15:53 jeromel
30  * Step back from StEvent changes - previous change recoverable [Thomas OK-ed]
31  *
32  * Revision 2.13 2012/05/07 14:42:58 fisyak
33  * Add handilings for Track to Fast Detectors Matching
34  *
35  * Revision 2.12 2011/10/17 00:13:49 fisyak
36  * Add handles for IdTruth info
37  *
38  * Revision 2.11 2011/03/31 19:29:01 fisyak
39  * Add IdTruth information for tracks and vertices
40  *
41  * Revision 2.10 2009/11/23 16:34:08 fisyak
42  * Cleanup, remove dependence on dst tables, clean up software monitors
43  *
44  * Revision 2.9 2002/11/26 02:19:11 perev
45  * StEventMaker ITTF modif
46  *
47  * Revision 2.8 2002/02/22 22:56:53 jeromel
48  * Doxygen basic documentation in all header files. None of this is required
49  * for QM production.
50  *
51  * Revision 2.7 2001/05/30 17:45:55 perev
52  * StEvent branching
53  *
54  * Revision 2.6 2001/04/05 04:00:46 ullrich
55  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
56  *
57  * Revision 2.5 2000/03/08 14:29:56 ullrich
58  * New method probChiSquared() added.
59  *
60  * Revision 2.4 2000/02/10 18:49:08 ullrich
61  * Fixed typo introduced at last check-in.
62  *
63  * Revision 2.3 2000/02/10 16:32:21 ullrich
64  * flag changed from unsigned to signed long
65  *
66  * Revision 2.2 2000/01/11 19:22:14 ullrich
67  * Added non-const parent() method.
68  *
69  * Revision 2.1 1999/10/28 22:28:09 ullrich
70  * Adapted new StArray version. First version to compile on Linux and Sun.
71  *
72  * Revision 2.0 1999/10/12 18:43:32 ullrich
73  * Completely Revised for New Version
74  *
75  **************************************************************************/
76 #ifndef StVertex_hh
77 #define StVertex_hh
78 #include "Riostream.h"
79 #include "StMeasuredPoint.h"
80 #include "StEnumerations.h"
81 #include "StMatrixF.hh"
82 #include "StContainers.h"
83 #include "StEnumerations.h"
84 class StTrack;
85 class StTrackFilter;
86 
87 class StVertex : public StMeasuredPoint {
88 public:
89  StVertex();
90  virtual ~StVertex() {}
91 
92  int operator==(const StVertex&) const;
93  int operator!=(const StVertex&) const;
94 
95  virtual StVertexId type() const {return mType; }
96  int flag() const {return mFlag; }
97  float chiSquared() const { return mChiSquared; }
98  float probChiSquared() const { return mProbChiSquared; }
99  StMatrixF covariantMatrix() const; // overwrite inherited
100  void covarianceMatrix(double covM[6]) const { std::copy(mCovariantMatrix, mCovariantMatrix + 6, covM); }
101  StThreeVectorF positionError() const; // overwrite inherited
102  StTrack* parent() { return mParent; }
103  const StTrack* parent() const { return mParent; }
104  virtual unsigned int numberOfDaughters() const {NotImplemented("numberOfDaughters"); return 0;}
105  virtual unsigned int numberOfGoodTracks() const {NotImplemented("numberOfGoodTracks"); return 0;}
106  virtual StTrack* daughter(unsigned int) {NotImplemented("daughter"); return 0;}
107  virtual const StTrack* daughter(unsigned int) const {NotImplemented("daughter"); return 0;}
108  virtual StPtrVecTrack daughters(StTrackFilter&) {NotImplemented("daughters"); return 0;}
109 
110  virtual void setFlag(int val) { mFlag = val; }
111  virtual void setCovariantMatrix(float[6]);
112  void setCovariantMatrix(const double val[6]) { std::copy(val, val+6, mCovariantMatrix); }
113  virtual void setChiSquared(float val) { mChiSquared = val; }
114  virtual void setProbChiSquared(float val) { mProbChiSquared = val; }
115  virtual void setParent(StTrack*);
116  virtual void addDaughter(StTrack*) = 0;
117  virtual void removeDaughter(StTrack*) = 0;
118  int idTruth() const { return mIdTruth;}
119  int qaTruth() const { return mQuality; }
120  int idParent() const { return mIdParent;}
121  void setIdTruth(int idtru, int qatru=0) {mIdTruth = idtru; mQuality = static_cast<unsigned short>(qatru);}
122  void setIdParent(Int_t id) {mIdParent = id;}
123  void setIdTruth(); //setting on track info
124 
125  virtual void setPrimaryVtx() {SETBIT(mFlag,kPrimaryVtxId);}
126  virtual void setV0Vtx() {SETBIT(mFlag,kV0VtxId);}
127  virtual void setXiVtx() {SETBIT(mFlag,kXiVtxId);}
128  virtual void setKinkVertex() {SETBIT(mFlag,kKinkVtxId);}
129  virtual void setBeamConstrained() {SETBIT(mFlag,kBEAMConstrVtxId);}
130  virtual void setRejected() {SETBIT(mFlag,kRejectedVtxId);}
131 
132  bool isPrimaryVtx() const {return TESTBIT(mFlag,kPrimaryVtxId);}
133  bool isV0Vtx() const {return TESTBIT(mFlag,kV0VtxId);}
134  bool isXiVtx() const {return TESTBIT(mFlag,kXiVtxId);}
135  bool isKinkVertex() const {return TESTBIT(mFlag,kKinkVtxId);}
136  bool isBeamConstrained() const {return TESTBIT(mFlag,kBEAMConstrVtxId);}
137  bool isRejected() const {return TESTBIT(mFlag,kRejectedVtxId);}
138  void Print(Option_t *option="") const {cout << option << *this << endl; }
139  static void SetNoFitPointCutForGoodTrack(UInt_t val) {fgNoFitPointCutForGoodTrack = val;}
140  static UInt_t NoFitPointCutForGoodTrack() {return fgNoFitPointCutForGoodTrack;}
141 
142 protected:
143  void NotImplemented(const char *method) const;
144 
145 protected:
146  StVertexId mType;
147  Char_t mBeg[1];
148  Int_t mFlag;
149  Float_t mCovariantMatrix[6];
150  Float_t mChiSquared;
151  Float_t mProbChiSquared;
152  Int_t mIdTruth; // MC vertex id if any
153  UShort_t mQuality; // quality of this information (percentage of tracks coming the above MC Vertex)
154  Int_t mIdParent;// Id of MC parent track
155  Char_t mEnd[1];
156  static UInt_t fgNoFitPointCutForGoodTrack;
157 #ifdef __CINT__
158  StObjLink mParent;
159 #else
160  StLink<StTrack> mParent;
161 #endif //__CINT__
162 
163  ClassDef(StVertex,5)
164 };
165 #endif