BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TMDCWireHit.cxx
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TMDCWireHit.cxx,v 1.7 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : TMDCWireHit.cc
5// Section : Tracking MDC
6// Owner : Yoshi Iwasaki
7// Email : yoshihito.iwasaki@kek.jp
8//-----------------------------------------------------------------------------
9// Description : A class to represent a wire hit in MDC.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#define TMDCWireHit_INLINE_DEFINE_HERE
14
15#include "TrkReco/TMDCWireHit.h"
16#include "TrkReco/TMDCUtil.h"
17#include "TrkReco/TMDCWire.h"
18#include "TrkReco/TMDCWireHitMC.h"
19#include "TrkReco/TTrackHEP.h"
20
21// #include "panther/panther.h"
22// #include MDC_H
23#include "MdcTables/MdcTables.h"
24
25/*
26// inline to here --
27const TTrack * const
28TMDCWireHit::track(void) const {
29 return _track;
30}
31
32const TTrack * const
33TMDCWireHit::track(const TTrack * a) {
34 return _track = a;
35}
36
37const TTrack * const
38TMDCWireHit::track(const TTrack * a) const {
39 return _track = a;
40}
41// end -- zsl
42*/
43
45 : _wire( w )
46 , _xyPosition( w->xyPosition() )
47 , _r( r )
48 , _state( r->stat )
49 , _track( 0 )
50 , _mc( 0 ) {
51 w->hit( this );
52 _drift[0] = r->ddl;
53 _drift[1] = r->ddr;
54 _driftError[0] = r->erddl * fudgeFactor;
55 _driftError[1] = r->erddr * fudgeFactor;
56 if ( w->axial() ) _state |= WireHitAxial;
57 else _state |= WireHitStereo;
58}
59
61
62void TMDCWireHit::dump( const std::string& msg, const std::string& pre ) const {
63 std::cout << pre;
64 std::cout << _wire->name();
65 if ( msg.find( "state" ) != std::string::npos || msg.find( "detail" ) != std::string::npos )
66 {
67 std::cout << ",state ";
68 bitDisplay( _state );
69 if ( track() ) std::cout << ",trk ";
70 }
71 if ( msg.find( "drift" ) != std::string::npos || msg.find( "detail" ) != std::string::npos )
72 {
73 if ( _state & WireHitLeftMask ) std::cout << ", L";
74 if ( _state & WireHitRightMask ) std::cout << ", R";
75 std::cout << " layer " << _wire->layerId() << " cell " << _wire->localId();
76 std::cout << ",dl " << _drift[0] << "+-" << _driftError[0];
77 std::cout << ",dr " << _drift[1] << "+-" << _driftError[1];
78 }
79 if ( msg.find( "mc" ) != std::string::npos || msg.find( "detail" ) != std::string::npos )
80 {
81 std::cout << ",hep ";
82 if ( mc() )
83 {
84 if ( mc()->hep() ) std::cout << mc()->hep()->id();
85 else std::cout << "0";
86 }
87 else { std::cout << "0"; }
88 }
89 std::cout << std::endl;
90}
91
92HepPoint3D TMDCWireHit::position( unsigned lr ) const {
93 const HepPoint3D myHepZHat( 0.0, 0.0, 1.0 );
94 //...Left...
95 if ( lr == WireHitLeft )
96 { return _xyPosition - _drift[WireHitLeft] * myHepZHat.cross( _xyPosition.unit() ); }
97
98 //...Right case...
99 else { return _xyPosition + _drift[WireHitRight] * myHepZHat.cross( _xyPosition.unit() ); }
100}
101
102/*
103double
104TMDCWireHit::DriftTime(double tof,double z) const {
105 double tprop = 0.;
106 double _vprop = (_layer<8) ? Constants::vpropInner : Constants::vpropOuter;
107 if (0 == _layer%2){
108 tprop = (0.5*_zlen + z)/_vprop; //odd
109 }else{
110 tprop = (0.5*_zlen - z)/_vprop; //even
111 }
112 double driftT;
113 driftT = fabs(_rawTime - _T0Walk -1.e9*tof - tprop);
114
115 //std::cout<< "lay "<<_layer<<" cell "<<_wire<<" zhit "<<z<<" tprop "<<tprop << std::endl;
116 return driftT;
117}
118*/
double w
void bitDisplay(unsigned)
Definition TMDCUtil.cxx:82
HepGeom::Point3D< double > HepPoint3D
const TTrackHEP *const hep(void) const
returns a pointer to a GEN_HEPEVT.
HepPoint3D position(unsigned) const
returns left position. z is always zero.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
virtual ~TMDCWireHit()
Destructor.
const TTrack *const track(void) const
assigns a pointer to a TTrack.
const HepPoint3D & xyPosition(void) const
returns drift time
const TMDCWireHitMC *const mc(void) const
returns a pointer to TMDCWireHitMC.
TMDCWireHit(TMDCWire *, MdcRec_wirhit *, float fudgeFactor)
Constructor.
unsigned id(void) const
returns an id started from 0.