00001 00005 /*************************************************************************** 00006 * 00007 * $Id: StHit.h,v 2.28 2012/01/24 03:04:22 perev Exp $ 00008 * 00009 * Author: Thomas Ullrich, Jan 1999 00010 *************************************************************************** 00011 * 00012 * Description: 00013 * 00014 *************************************************************************** 00015 * 00016 * $Log: StHit.h,v $ 00017 * Revision 2.28 2012/01/24 03:04:22 perev 00018 * Cleanup 00019 * 00020 * Revision 2.27 2011/10/17 00:13:49 fisyak 00021 * Add handles for IdTruth info 00022 * 00023 * Revision 2.26 2011/05/12 22:25:48 fisyak 00024 * Restore hit errors as persistent, add sort to TpcHit 00025 * 00026 * Revision 2.25 2011/01/21 18:30:45 fisyak 00027 * fix setFlag with UShort_t 00028 * 00029 * Revision 2.24 2011/01/21 16:14:40 fisyak 00030 * change mFlag type from UChar_t to UShort_t (bug #2058) 00031 * 00032 * Revision 2.23 2009/11/10 00:40:17 ullrich 00033 * Changed print-out format. 00034 * 00035 * Revision 2.22 2008/04/02 20:43:58 fisyak 00036 * Don't store mPositionError in file 00037 * 00038 * Revision 2.21 2006/01/19 21:50:02 ullrich 00039 * Made detector() virtual method. 00040 * 00041 * Revision 2.20 2005/12/07 19:03:23 perev 00042 * mId short ==> int 00043 * 00044 * Revision 2.19 2005/07/19 21:34:24 perev 00045 * quality ==> qaTruth to avoid misleading 00046 * 00047 * Revision 2.18 2005/07/06 18:57:48 fisyak 00048 * Add StHit print out 00049 * 00050 * Revision 2.17 2005/01/26 23:04:12 perev 00051 * const for Sthit* nextHit() 00052 * 00053 * Revision 2.16 2004/08/19 21:58:53 ullrich 00054 * Fixed omitted implementation of nextHit(). 00055 * 00056 * Revision 2.15 2004/08/18 19:00:19 ullrich 00057 * Added access function hardwarePosition(). 00058 * 00059 * Revision 2.14 2004/08/06 15:37:09 fisyak 00060 * Add clster id 00061 * 00062 * Revision 2.13 2004/07/30 22:28:31 fisyak 00063 * Add transient pointer to next Hit 00064 * 00065 * Revision 2.12 2004/07/15 16:36:24 ullrich 00066 * Removed all clone() declerations and definitions. Use StObject::clone() only. 00067 * 00068 * Revision 2.11 2004/03/30 15:59:08 calderon 00069 * Added method to set mFitFlag (new chain no longer uses tables, so must set 00070 * this by hand). 00071 * 00072 * Revision 2.10 2004/01/13 21:01:32 fisyak 00073 * Add Truth and Quality information from simulation 00074 * 00075 * Revision 2.9 2002/02/22 22:56:48 jeromel 00076 * Doxygen basic documentation in all header files. None of this is required 00077 * for QM production. 00078 * 00079 * Revision 2.8 2001/04/25 17:46:56 jeromel 00080 * Remove last change. There is another way to fix the problems seen (the right way 00081 * actually) which Thomas will take care off. 00082 * 00083 * Revision 2.7 2001/04/25 15:57:22 jeromel 00084 * Fixed cint problem with StContainers.h 00085 * 00086 * Revision 2.6 2001/04/05 04:00:38 ullrich 00087 * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs. 00088 * 00089 * Revision 2.5 2001/03/24 03:34:50 perev 00090 * clone() -> clone() const 00091 * 00092 * Revision 2.4 2000/07/28 23:29:42 calderon 00093 * Added handling of Fit Flag: use this flag to tell if the point 00094 * is used in the fit. 00095 * 00096 * Revision 2.3 2000/06/07 09:43:21 ullrich 00097 * Changed return type of flag() to unsigned int 00098 * 00099 * Revision 2.2 2000/06/01 21:38:56 ullrich 00100 * Added member mFlag and access member flag() and setFlag(). 00101 * 00102 * Revision 2.1 1999/10/28 22:25:50 ullrich 00103 * Adapted new StArray version. First version to compile on Linux and Sun. 00104 * 00105 * Revision 2.0 1999/10/12 18:42:21 ullrich 00106 * Completely Revised for New Version 00107 * 00108 **************************************************************************/ 00109 #ifndef StHit_hh 00110 #define StHit_hh 00111 00112 #include "StMeasuredPoint.h" 00113 #include "StEnumerations.h" 00114 #include "StContainers.h" 00115 00116 class StTrackNode; 00117 class StTrack; 00118 00119 class StHit : public StMeasuredPoint { 00120 public: 00121 StHit(); 00122 StHit(const StThreeVectorF& position, 00123 const StThreeVectorF& errors, 00124 unsigned int hardware, 00125 float charge, 00126 unsigned char trakRefCount = 0, 00127 UShort_t idTruth=0, UShort_t quality=0, UShort_t id =0); 00128 // StHit(const StHit&); use default 00129 // StHit& operator=(const StHit&); use default 00130 ~StHit(); 00131 00132 int operator==(const StHit&) const; 00133 int operator!=(const StHit&) const; 00134 00135 float charge() const; 00136 unsigned int trackReferenceCount() const; 00137 unsigned int flag() const; 00138 StThreeVectorF positionError() const; // overwrite inherited 00139 StMatrixF covariantMatrix() const; // overwrite inherited 00140 int usedInFit() const; 00141 int idTruth() const; 00142 int qaTruth() const { return mQuality; } 00143 int id() const; 00144 const StHit* nextHit() const; 00145 unsigned int hardwarePosition() const; 00146 00147 00148 void setCharge(float); 00149 void setFlag(UShort_t val) { mFlag = val; } 00150 void setFitFlag(unsigned char); 00151 void setTrackReferenceCount(unsigned char); 00152 void setHardwarePosition(unsigned int); 00153 void setPositionError(const StThreeVectorF&); 00154 void setId(int Id) {mId = Id;} 00155 void setIdTruth(Int_t idtru,Int_t qatru=0); 00156 void SetNextHit(StHit *next = 0) {mNextHit = next;} 00157 00158 virtual StDetectorId detector() const; 00159 virtual void Print(Option_t *option="") const; 00160 00161 protected: 00162 unsigned int bits(unsigned int, unsigned int) const; 00163 00164 UInt_t mHardwarePosition; 00165 StThreeVectorF mPositionError; 00166 Float_t mCharge; 00167 Int_t mId; 00168 UShort_t mIdTruth; // simulation track id 00169 UShort_t mQuality; // quality of this information (percentage of charge produced by mIdTruth) 00170 UChar_t mFitFlag; 00171 UChar_t mTrackRefCount; 00172 UShort_t mFlag; 00173 StHit* mNextHit; 00174 ClassDef(StHit,7) 00175 }; 00176 00177 inline unsigned int StHit::bits(unsigned int bit, unsigned int nbits) const 00178 { 00179 return (mHardwarePosition>>bit) & ~(~0UL<<nbits); 00180 } 00181 00182 inline unsigned int StHit::hardwarePosition() const {return mHardwarePosition;} 00183 inline int StHit::id() const {return mId;} 00184 inline const StHit* StHit::nextHit() const {return mNextHit;} 00185 00186 ostream& operator<<(ostream& os, StHit const & v); 00187 #endif
1.5.9