CGEM BOSS 6.6.5.h
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"
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
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*/
void bitDisplay(unsigned val)
Definition TMDCUtil.cxx:85
#define WireHitRightMask
Definition TMDCWireHit.h:49
#define WireHitLeft
Definition TMDCWireHit.h:21
#define WireHitAxial
Definition TMDCWireHit.h:30
#define WireHitRight
Definition TMDCWireHit.h:22
#define WireHitLeftMask
Definition TMDCWireHit.h:48
#define WireHitStereo
Definition TMDCWireHit.h:31
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 TMDCWireHitMC *const mc(void) const
returns a pointer to TMDCWireHitMC.
TMDCWireHit(TMDCWire *, MdcRec_wirhit *, float fudgeFactor)
Constructor.
A class to represent a wire in MDC.
Definition TMDCWire.h:55
bool axial(void) const
returns true if this wire is in an axial layer.
Definition TMDCWire.h:348
const TMDCWireHit *const hit(void) const
returns a pointer to a TMDCWireHit.
Definition TMDCWire.h:287
unsigned localId(void) const
returns local id in a wire layer.
Definition TMDCWire.h:213
unsigned layerId(void) const
returns layer id.
Definition TMDCWire.h:219
std::string name(void) const
returns name.
Definition TMDCWire.h:412
unsigned id(void) const
returns an id started from 0.
Definition TTrackHEP.h:122