00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MDCHITONTRACK_H
00022 #define MDCHITONTRACK_H
00023
00024 #include "TrkBase/TrkHitOnTrk.h"
00025 #include "TrkBase/TrkEnums.h"
00026 #include "MdcGeom/Constants.h"
00027 #include <math.h>
00028 #include "CLHEP/Matrix/Vector.h"
00029 #include "CLHEP/Geometry/Point3D.h"
00030 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00031
00032 typedef HepGeom::Point3D<double> HepPoint3D;
00033 #endif
00034
00035 using CLHEP::Hep3Vector;
00036 class MdcHit;
00037 class MdcLayer;
00038 class Trajectory;
00039
00040 class MdcHitOnTrack : public TrkHitOnTrk {
00041
00042 public:
00043 MdcHitOnTrack(const TrkFundHit& fundHit, const MdcHit& baseHit,
00044 int ambig, double fittime);
00045 virtual ~MdcHitOnTrack();
00046
00047
00048
00049 double entranceAngleHit() const;
00050 double entranceAngle() const;
00051 double entranceAngle(const HepPoint3D pos, const Hep3Vector dir) const;
00052
00053
00054
00055
00056
00057
00058
00059 double dipAngle() const;
00060
00061
00062
00063
00064
00065
00066
00067 int ambig() const { return _ambig; }
00068 int wireAmbig() const;
00069
00070
00071 double fitTime() const { return _fitTime; }
00072
00073
00074
00075 double drift() const { return _ambig!=0 ? _drift[_ambig<0 ? 0:1]
00076 : (_drift[1]-_drift[0])*0.5; }
00077 double drift(double dca) const { return _drift[dca<0?0:1]; }
00078 double dcaToWire() const;
00079
00080 double rawTime() const;
00081
00082
00083 virtual const Trajectory* hitTraj() const;
00084 virtual const MdcHitOnTrack* mdcHitOnTrack() const;
00085 virtual bool timeResid(double& t,double& tErr) const;
00086 virtual bool timeAbsolute(double& t,double& tErr) const;
00087
00088
00089 virtual const MdcHit* mdcHit() const;
00090 virtual unsigned tdcIndex() const = 0;
00091 virtual unsigned status() const = 0;
00092
00093
00094 int wire() const ;
00095 const MdcLayer* layer() const ;
00096 int layernumber() const ;
00097 unsigned layerNumber() const;
00098 int whichView() const;
00099 double charge() const;
00100
00101 TrkEnums::TrkViewInfo whatView() const;
00102
00103
00104 void setAmbig(int a) { _ambig = a<0?-1:a>0?1:0; }
00105 void setT0(double t0);
00106
00107 protected:
00108
00109 MdcHitOnTrack(const TrkFundHit *baseHit, int ambig,
00110 double fittime, int layer, int wire);
00111 MdcHitOnTrack(const MdcHitOnTrack &hitToBeCopied, TrkRep *newRep,
00112 const TrkDifTraj* trkTraj,const MdcHit *hb=0);
00113
00114 bool isBeyondEndflange() const
00115 { return (hitLen() < _startLen || hitLen() > _endLen); }
00116
00117 bool updateAmbiguity(double dca);
00118
00119 virtual TrkErrCode updateMeasurement(const TrkDifTraj* traj, bool maintainAmbiguity);
00120
00121
00122
00123 const MdcHit* baseHit() const { return _dHit; }
00124 void changeBase(MdcHit* newBase);
00125
00126 private:
00127
00128
00129 void updateCorrections();
00130 double driftVelocity() const;
00131 bool driftCurrent() const { return ambig()*_drift[ambig()<0?0:1]>0; }
00132
00133
00134
00135 int _ambig;
00136
00137
00138
00139
00140 double _drift[2];
00141
00142 const Trajectory* _hitTraj;
00143 double _fitTime;
00144
00145 double _startLen;
00146 double _endLen;
00147 const MdcHit * _dHit;
00148
00149
00150
00151 MdcHitOnTrack(const MdcHitOnTrack&);
00152 MdcHitOnTrack& operator=(const MdcHitOnTrack&);
00153 };
00154
00155 #endif