/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcxReco/MdcxReco-00-01-59/MdcxReco/MdcxHit.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: MdcxHit.h,v 1.10 2009/12/16 08:59:13 zhangy Exp $
00004 //
00005 // Description:
00006 //      Class Header for |MdcxHit|: hit that can calculate derivatives
00007 //      and plot hits self specialized to the drift chamber
00008 //
00009 // Environment:
00010 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00011 //
00012 // Author List:
00013 //      A. Snyder
00014 //      Zhang Yao(zhangyao@ihep.ac.cn) Migration for BESIII
00015 //
00016 // Copyright Information:
00017 //      Copyright (C) 1995      BEPCII
00018 // 
00019 // History:
00020 //      Migration for BESIII MDC
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   // A MDC hit that can calculate derivatives
00044 public:
00045   //constructors
00046   MdcxHit(const MdcDigi *pdcdatum, float c0=0,  float cresol=.0180);
00047   MdcxHit(const MdcHit  *pdchhit,  float c0=0,  float cresol=.0180);
00048   
00049   //destructor
00050   virtual ~MdcxHit() { };
00051   //private copy constructor and oprator
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); //yzhang for csmc
00060   static void setMdcDetector(const MdcDetector* gm);
00061     
00062   //accessors
00063   inline const MdcDigi* getDigi()const {return _mdcDigi;}
00064   inline const MdcHit* getMdcHit()const {return _mdcHit;}
00065   inline int SuperLayer()const {return _superlayer;} //SuperLayer#
00066   inline int WireNo()const {return _wirenumber;} // Wire#
00067   inline int Layer()const {return _layernumber;}// layer#
00068   inline float t()const {return _t;} // drift time
00069   inline float x()const {return _x;} // x of wire
00070   inline float y()const {return _y;} // y of wire
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;} //yzhang add
00080   inline float stereo()const {return _s;} // stereo angle of wire
00081   inline float v()const {return _v;} // drift velocity
00082   inline int type()const {return _type;} // flags |MdcxHit|
00083   
00084   //workers
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; // |drift dist| (changes hel's internal state)
00089   float d(float zh=0.0, float tof=0.0, float tzero=0.0,
00090           int wamb=0, float eang=0.0)const; // |drift dist|
00091   //float tcor(float tof) const;
00092   //float d(int ambig = 0, double entranceAngle = 0) const;
00093   //float d(MdcxHel& hel, int ambig = 0, double entranceAngle = 0) const;
00095 
00096   float e(float dd = 0.0) const;  //drift error currently in use
00097   float pull(MdcxHel& hel)const;//Chisq contribution to fit
00098   float residual(MdcxHel &hel)const;    //residual of this hit
00099   std::vector<float> derivatives(MdcxHel& hel)const; //Derivatives, etc.
00100   void print(std::ostream &o,int i=0)const;     //print this hit
00101   void printAll(std::ostream &o,int i=0)const;  //print this hit
00102   inline void SetUsedOnHel(int i) {usedonhel=i;}
00103   inline int  GetUsedOnHel()const {return usedonhel;}
00104 
00105 protected:
00106   //functions
00107   void process();
00108 
00109   //data
00110   unsigned _wirenumber;
00111   unsigned _layernumber;
00112   unsigned _superlayer;
00113   float _t;
00114   float _q;         
00115   unsigned _iTdc;
00116   unsigned _iAdc;   
00117   float _T0Walk;    //zoujh
00118   float _x;
00119   float _y;
00120   float _r;
00121   float _s;
00122   float _L;//length of this layer
00123   float _d;
00124   float _v;
00125   int   _type;//yzhang add 2009-11-03  
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; //pointer to |MdcDigi| defining this hit
00133   int _consterr; 
00134   int usedonhel;
00135   float _c0; //accumulated global time offset; changes in t0 go here
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;  //pointer to MdcCalibFunSvc
00141   static const MdcDetector* m_gm;  //pointer to MdcDetector
00142   static bool m_countPropTime;   
00143 };//endof MdcxHit
00144 
00145 typedef ObjectVector<MdcxHit> MdcxHitCol;
00146 
00147 #endif

Generated on Tue Nov 29 23:13:36 2016 for BOSS_7.0.2 by  doxygen 1.4.7