BOSS 7.0.3
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 : [email protected]
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/TMDCUtil.h"
16#include "TrkReco/TMDCWire.h"
17#include "TrkReco/TMDCWireHit.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}
62
63void
64TMDCWireHit::dump(const std::string & msg, const std::string & pre) const {
65 std::cout << pre;
66 std::cout << _wire->name();
67 if (msg.find("state") != std::string::npos || msg.find("detail") != std::string::npos) {
68 std::cout << ",state ";
69 bitDisplay(_state);
70 if (track()) std::cout << ",trk ";
71 }
72 if (msg.find("drift") != std::string::npos || msg.find("detail") != std::string::npos) {
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 std::cout << ",hep ";
81 if (mc()) {
82 if (mc()->hep()) std::cout << mc()->hep()->id();
83 else std::cout << "0";
84 }
85 else {
86 std::cout << "0";
87 }
88 }
89 std::cout << std::endl;
90}
91
93TMDCWireHit::position(unsigned lr) const {
94 const HepPoint3D myHepZHat(0.0, 0.0, 1.0);
95 //...Left...
96 if (lr == WireHitLeft) {
97 return _xyPosition
98 - _drift[WireHitLeft] * myHepZHat.cross(_xyPosition.unit());
99 }
100
101 //...Right case...
102 else {
103 return _xyPosition
104 + _drift[WireHitRight] * myHepZHat.cross(_xyPosition.unit());
105 }
106}
107
108
109/*
110double
111TMDCWireHit::DriftTime(double tof,double z) const {
112 double tprop = 0.;
113 double _vprop = (_layer<8) ? Constants::vpropInner : Constants::vpropOuter;
114 if (0 == _layer%2){
115 tprop = (0.5*_zlen + z)/_vprop; //odd
116 }else{
117 tprop = (0.5*_zlen - z)/_vprop; //even
118 }
119 double driftT;
120 driftT = fabs(_rawTime - _T0Walk -1.e9*tof - tprop);
121
122 //std::cout<< "lay "<<_layer<<" cell "<<_wire<<" zhit "<<z<<" tprop "<<tprop << std::endl;
123 return driftT;
124}
125*/
double w
void bitDisplay(unsigned)
Definition: TMDCUtil.cxx:85
const TTrackHEP *const hep(void) const
returns a pointer to a GEN_HEPEVT.
HepPoint3D position(unsigned) const
returns left position. z is always zero.
Definition: TMDCWireHit.cxx:93
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TMDCWireHit.cxx:64
virtual ~TMDCWireHit()
Destructor.
Definition: TMDCWireHit.cxx:60
const TTrack *const track(void) const
assigns a pointer to a TTrack.
const TMDCWireHitMC *const mc(void) const
returns a pointer to TMDCWireHitMC.
TMDCWireHit(TMDCWire *, MdcRec_wirhit *, float fudgeFactor)
Constructor.
Definition: TMDCWireHit.cxx:44
A class to represent a wire in MDC.
unsigned localId(void) const
returns local id in a wire layer.
unsigned layerId(void) const
returns layer id.
std::string name(void) const
returns name.
unsigned id(void) const
returns an id started from 0.