/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcData/MdcData-00-01-27/MdcData/MdcHit.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: MdcHit.h,v 1.20 2010/05/24 11:41:12 zhangy Exp $
00004 //
00005 // Description:
00006 //      Class Header  for |MdcHit| 
00007 //      Fundamental Hit class for use by drift chamber fits and pattern
00008 //      recogition code
00009 //
00010 // Environment:
00011 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00012 //
00013 // Author List:
00014 //      S. Schaffner - Original
00015 //      A. Snyder - Modifications to use |MdcGeom| and to construct
00016 //                  from |MdcDigi|s
00017 //
00018 // Copyright Information:
00019 //      Copyright (C) 1996      SLAC
00020 // 
00021 // History:
00022 //      Migration for BESIII MDC
00023 //
00024 // 20080303 Zhang Yao -- Delete return of DetElemId
00025 //------------------------------------------------------------------------
00026 
00027 #ifndef MDCHIT_H
00028 #define MDCHIT_H
00029 #include "MdcGeom/Constants.h"
00030 #include "MdcRawEvent/MdcDigi.h"
00031 #include "MdcGeom/MdcDetector.h"
00032 #include "MdcGeom/MdcLayer.h"
00033 #include "MdcGeom/MdcSWire.h"
00034 #include "TrkBase/TrkFundHit.h"
00035 #include "TrkBase/TrkEnums.h"
00036 #include "Identifier/Identifier.h"
00037 #include "MdcCalibFunSvc/MdcCalibFunSvc.h"
00038 
00039 class Trajectory;
00040 
00041 extern const CLID& CLID_MdcHit;
00042 
00043 
00044 class MdcHit : public TrkFundHit {
00045 public:
00046 
00047   MdcHit(const MdcDigi*& digi, const MdcDetector*& det);
00048   MdcHit(const MdcHit&);
00049 
00050   virtual ~MdcHit();
00051 
00052   MdcHit& operator=(const MdcHit&);
00053   bool operator==(const MdcHit&) const;
00054 
00055   const MdcDigi*        digi ()         const { return _digiPtr;  }
00056   const MdcLayer*       layer()         const { return _layerPtr; }
00057   const MdcSWire*       wire ()         const { return _wirePtr;  }
00058   const MdcDetector*    geom ()         const { return _geomPtr;  }
00059   const MdcCalibFunSvc* calibSvc()      const { return m_mdcCalibFunSvc; }
00060   Identifier            mdcId()         const { return _id; }
00061   unsigned              layernumber()   const { return _layer; }
00062   unsigned              wirenumber()    const { return _wire; }
00063   unsigned              tdcIndex()      const { return _iTdc; }
00064   unsigned              adcIndex()      const { return _iAdc; }
00065   double                charge()        const { return _charge; } 
00066   double                rawTime()       const { return _rawTime; }
00067   double                driftTime(double tof, double z) const;
00068   double                driftDist(double, int, double, double, double) const;
00069   double                driftDist(double bunchTime, int ambig) const;  
00070   double                sigma(double, int, double, double, double) const;
00071   double                sigma(double driftdist, int ambig = 0) const;
00072   int                   whichView() const{ return _layerPtr->view(); } 
00073   const  Trajectory*    hitTraj() const;
00074   TrkEnums::TrkViewInfo whatView() const { return whichView()==0?TrkEnums::xyView:TrkEnums::bothView; }
00075   double                phi() const { return _phi;}           // phi at chamber center
00076   double                x()   const { return _rmid*_cosphi; } // x at chamber center
00077   double                y()   const { return _rmid*_sinphi; } // y at chamber center
00078   const double          phi(double z) const{return wire()->phiDC(z);}  // phi at z 
00079   double                x  (double z) const{return wire()->xWireDC(z);}// x at global z
00080   double                y  (double z) const{return wire()->yWireDC(z);}// y at global z
00081   double                rMid()        const { return _rmid; } // R at chamber center
00082   double                zlen()        const { return _zlen; } // chamber extent in z
00083   unsigned              status()      const { return _status;}// status
00084 
00085   void                  setCalibSvc(const MdcCalibFunSvc* calibSvc);
00086   void                  setCountPropTime(const bool count) { m_countPropTime = count;}
00087   void                  setCosmicFit(const bool cosmicfit) { m_cosmicFit = cosmicfit; }
00088   bool                  isCosmicFit() const { return m_cosmicFit; }
00089 
00090   void                  print(std::ostream &o) const;
00091   void                  printAll(std::ostream &o) const;
00092                                                                                 
00093 private:
00094 
00095   // Calculate crude (no track info) correction of time for flight 
00096   // delay (assumes tracks from origin); wire propagation assumes z=0;
00097   // return time in seconds(_rmid is in cm)
00098   double crudeTof() const { return  _rmid/Constants::c; }
00099 
00100   //hide the copy ctor and assignment op, at least until somebody needs them
00101   MdcHit();
00102 
00103   friend class MdcMakeHits;
00104 
00105   const MdcDigi*        _digiPtr;       // pointer to digi
00106   const MdcDetector*    _geomPtr;       // pointer to geometry
00107   const MdcLayer*       _layerPtr;      // pointer to layer  
00108   const MdcSWire*       _wirePtr;       // pointer to wire
00109   const MdcCalibFunSvc* m_mdcCalibFunSvc;//pointer to MdcCalibFunSvc
00110   Identifier            _id;            // Mdc Identifier 
00111   unsigned              _layer;         // layer number
00112   unsigned              _wire;          // wire number 
00113   unsigned              _iTdc;          // time channel
00114   unsigned              _iAdc;          // charge channel
00115   double                _rawTime;       // raw time, in NANO seconds
00116   double                _charge;        // charge 
00117   double                _rmid;          // radius of wire at mid chamber
00118   double                _zlen;          // wire length
00119   double                _phi;           // phi of wire
00120   double                _cosphi;        // cos(phi)
00121   double                _sinphi;        // sin(phi)
00122   unsigned              _status;        // status flag;
00123   double                _T0Walk;        // time of T0(from calib) and time walk
00124   static bool           m_cosmicFit;    // flag for csmc
00125   static bool           m_countPropTime;// flag if count propergation time              
00126 };
00127 extern std::ostream& operator<<(std::ostream &o,const MdcHit& aHit);
00128 
00129 typedef ObjectVector<MdcHit> MdcHitCol;
00130 
00131 #endif

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