00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _MDCXHIT_
00025 #define _MDCXHIT_
00026
00027 #include <math.h>
00028 #include <iostream>
00029 #include <fstream>
00030 #include <vector>
00031 #include "MdcGeom/MdcLayer.h"
00032 #include "MdcGeom/MdcSWire.h"
00033 #include "MdcData/MdcHit.h"
00034 #include "MdcCalibFunSvc/MdcCalibFunSvc.h"
00035 #include "MdcGeom/MdcDetector.h"
00036
00037 class MdcxHel;
00038 class MdcDigi;
00039
00040 using namespace EventModel;
00041
00042 class MdcxHit {
00043
00044 public:
00045
00046 MdcxHit(const MdcDigi *pdcdatum, float c0=0, float cresol=.0180);
00047 MdcxHit(const MdcHit *pdchhit, float c0=0, float cresol=.0180);
00048
00049
00050 virtual ~MdcxHit() { };
00051
00052 private:
00053 MdcxHit(const MdcxHit&);
00054 MdcxHit& operator=(const MdcxHit&);
00055 bool operator==(const MdcxHit&) const;
00056
00057 public:
00058 static void setMdcCalibFunSvc(const MdcCalibFunSvc* calibSvc);
00059 static void setCountPropTime(bool countPropTime);
00060 static void setMdcDetector(const MdcDetector* gm);
00061
00062
00063 inline const MdcDigi* getDigi()const {return _mdcDigi;}
00064 inline const MdcHit* getMdcHit()const {return _mdcHit;}
00065 inline int SuperLayer()const {return _superlayer;}
00066 inline int WireNo()const {return _wirenumber;}
00067 inline int Layer()const {return _layernumber;}
00068 inline float t()const {return _t;}
00069 inline float x()const {return _x;}
00070 inline float y()const {return _y;}
00071 inline float xpos()const {return _xpos;}
00072 inline float ypos()const {return _ypos;}
00073 inline float xneg()const {return _xneg;}
00074 inline float yneg()const {return _yneg;}
00075 inline float wx()const {return _wx;}
00076 inline float wy()const {return _wy;}
00077 inline float wz()const {return _wz;}
00078 inline float pw()const {return _pw;}
00079 inline float phiMid()const {return _pw;}
00080 inline float stereo()const {return _s;}
00081 inline float v()const {return _v;}
00082 inline int type()const {return _type;}
00083
00084
00085 inline void SetConstErr(int i) {_consterr = i;}
00087 float tcor(float zh=0.0, float tof=0.0, float tzero=0.0)const;
00088 float d(MdcxHel& hel)const;
00089 float d(float zh=0.0, float tof=0.0, float tzero=0.0,
00090 int wamb=0, float eang=0.0)const;
00091
00092
00093
00095
00096 float e(float dd = 0.0) const;
00097 float pull(MdcxHel& hel)const;
00098 float residual(MdcxHel &hel)const;
00099 std::vector<float> derivatives(MdcxHel& hel)const;
00100 void print(std::ostream &o,int i=0)const;
00101 void printAll(std::ostream &o,int i=0)const;
00102 inline void SetUsedOnHel(int i) {usedonhel=i;}
00103 inline int GetUsedOnHel()const {return usedonhel;}
00104
00105 protected:
00106
00107 void process();
00108
00109
00110 unsigned _wirenumber;
00111 unsigned _layernumber;
00112 unsigned _superlayer;
00113 float _t;
00114 float _q;
00115 unsigned _iTdc;
00116 unsigned _iAdc;
00117 float _T0Walk;
00118 float _x;
00119 float _y;
00120 float _r;
00121 float _s;
00122 float _L;
00123 float _d;
00124 float _v;
00125 int _type;
00126 float _e;
00127 float _xpos,_ypos,_xneg,_yneg;
00128 float _p,_sp,_cp;
00129 double _pw;
00130 double _wx,_wy,_wz;
00131 const MdcHit* _mdcHit;
00132 const MdcDigi *_mdcDigi;
00133 int _consterr;
00134 int usedonhel;
00135 float _c0;
00136 float _cresol;
00137 private:
00138 double getSigma(float driftDist, int ambig = 0, double entrAngle = 0,
00139 double dipAngle = 0, double z = 0) const;
00140 static const MdcCalibFunSvc* m_mdcCalibFunSvc;
00141 static const MdcDetector* m_gm;
00142 static bool m_countPropTime;
00143 };
00144
00145 typedef ObjectVector<MdcxHit> MdcxHitCol;
00146
00147 #endif