/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/TrkReco/TrkReco-00-08-59-patch4-slc6tag/src/TMDCWireHit.cxx

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // $Id: TMDCWireHit.cxx,v 1.7 2010/03/31 09:58:59 liucy Exp $
00003 //-----------------------------------------------------------------------------
00004 // Filename : TMDCWireHit.cc
00005 // Section  : Tracking MDC
00006 // Owner    : Yoshi Iwasaki
00007 // Email    : yoshihito.iwasaki@kek.jp
00008 //-----------------------------------------------------------------------------
00009 // Description : A class to represent a wire hit in MDC.
00010 //               See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
00011 //-----------------------------------------------------------------------------
00012 
00013 #define TMDCWireHit_INLINE_DEFINE_HERE
00014 
00015 #include "TrkReco/TMDCUtil.h"
00016 #include "TrkReco/TMDCWire.h"
00017 #include "TrkReco/TMDCWireHit.h"
00018 #include "TrkReco/TMDCWireHitMC.h"
00019 #include "TrkReco/TTrackHEP.h"
00020 
00021 //#include "panther/panther.h"
00022 //#include MDC_H
00023 #include "MdcTables/MdcTables.h"
00024 
00025 /*
00026 // inline to here --
00027 const TTrack * const
00028 TMDCWireHit::track(void) const {
00029     return _track;
00030 }
00031  
00032 const TTrack * const
00033 TMDCWireHit::track(const TTrack * a) {
00034     return _track = a;
00035 }
00036  
00037 const TTrack * const
00038 TMDCWireHit::track(const TTrack * a) const {
00039     return _track = a;
00040 }
00041 // end -- zsl
00042 */
00043 
00044 TMDCWireHit::TMDCWireHit(TMDCWire * w, MdcRec_wirhit * r, float fudgeFactor)
00045 : _wire(w),
00046   _xyPosition(w->xyPosition()),
00047   _r(r),
00048   _state(r->stat),
00049   _track(0),
00050   _mc(0) {
00051     w->hit(this);
00052     _drift[0] = r->ddl;
00053     _drift[1] = r->ddr;
00054     _driftError[0] = r->erddl * fudgeFactor;
00055     _driftError[1] = r->erddr * fudgeFactor;
00056     if (w->axial()) _state |= WireHitAxial;
00057     else            _state |= WireHitStereo;
00058 }
00059 
00060 TMDCWireHit::~TMDCWireHit() {
00061 }
00062 
00063 void
00064 TMDCWireHit::dump(const std::string & msg, const std::string & pre) const {
00065     std::cout << pre;
00066     std::cout << _wire->name();
00067     if (msg.find("state") != std::string::npos || msg.find("detail") != std::string::npos) {
00068         std::cout << ",state ";
00069         bitDisplay(_state);
00070         if (track()) std::cout << ",trk ";
00071     }
00072     if (msg.find("drift") != std::string::npos || msg.find("detail") != std::string::npos) {
00073         if (_state & WireHitLeftMask) std::cout << ", L";
00074         if (_state & WireHitRightMask) std::cout << ", R";
00075         std::cout<<" layer "<<_wire->layerId()<<" cell "<<_wire->localId();
00076         std::cout << ",dl " << _drift[0] << "+-" << _driftError[0];
00077         std::cout << ",dr " << _drift[1] << "+-" << _driftError[1];
00078     }
00079     if (msg.find("mc") != std::string::npos || msg.find("detail") != std::string::npos) {
00080         std::cout << ",hep ";
00081         if (mc()) {
00082             if (mc()->hep()) std::cout << mc()->hep()->id();
00083             else std::cout << "0";
00084         }
00085         else {
00086             std::cout << "0";
00087         }
00088     }
00089     std::cout << std::endl;
00090 }
00091 
00092 HepPoint3D
00093 TMDCWireHit::position(unsigned lr) const {
00094     const HepPoint3D myHepZHat(0.0, 0.0, 1.0);
00095     //...Left...
00096     if (lr == WireHitLeft) {
00097         return _xyPosition
00098             - _drift[WireHitLeft] *  myHepZHat.cross(_xyPosition.unit());
00099     }
00100 
00101     //...Right case...
00102     else {
00103         return _xyPosition
00104             + _drift[WireHitRight] * myHepZHat.cross(_xyPosition.unit());
00105     }
00106 }
00107 
00108 
00109 /*
00110 double
00111 TMDCWireHit::DriftTime(double tof,double z) const {
00112     double tprop = 0.;
00113     double _vprop = (_layer<8) ? Constants::vpropInner : Constants::vpropOuter;
00114     if (0 == _layer%2){
00115       tprop = (0.5*_zlen + z)/_vprop; //odd
00116     }else{
00117       tprop = (0.5*_zlen - z)/_vprop; //even
00118     }
00119     double driftT;
00120     driftT = fabs(_rawTime - _T0Walk -1.e9*tof - tprop);
00121 
00122     //std::cout<< "lay "<<_layer<<" cell "<<_wire<<" zhit "<<z<<" tprop "<<tprop << std::endl;
00123     return driftT;
00124 }
00125 */

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