BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcHit.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcHit.h,v 1.20 2010/05/24 11:41:12 zhangy Exp $
4//
5// Description:
6// Class Header for |MdcHit|
7// Fundamental Hit class for use by drift chamber fits and pattern
8// recogition code
9//
10// Environment:
11// Software developed for the BaBar Detector at the SLAC B-Factory.
12//
13// Author List:
14// S. Schaffner - Original
15// A. Snyder - Modifications to use |MdcGeom| and to construct
16// from |MdcDigi|s
17//
18// Copyright Information:
19// Copyright (C) 1996 SLAC
20//
21// History:
22// Migration for BESIII MDC
23//
24// 20080303 Zhang Yao -- Delete return of DetElemId
25//------------------------------------------------------------------------
26
27#ifndef MDCHIT_H
28#define MDCHIT_H
29#include "MdcGeom/Constants.h"
30#include "MdcRawEvent/MdcDigi.h"
31#include "MdcGeom/MdcDetector.h"
32#include "MdcGeom/MdcLayer.h"
33#include "MdcGeom/MdcSWire.h"
34#include "TrkBase/TrkFundHit.h"
35#include "TrkBase/TrkEnums.h"
38
39class Trajectory;
40
41extern const CLID& CLID_MdcHit;
42
43
44class MdcHit : public TrkFundHit {
45public:
46
47 MdcHit(const MdcDigi*& digi, const MdcDetector*& det);
48 MdcHit(const MdcHit&);
49
50 virtual ~MdcHit();
51
52 MdcHit& operator=(const MdcHit&);
53 bool operator==(const MdcHit&) const;
54
55 const MdcDigi* digi () const { return _digiPtr; }
56 const MdcLayer* layer() const { return _layerPtr; }
57 const MdcSWire* wire () const { return _wirePtr; }
58 const MdcDetector* geom () const { return _geomPtr; }
59 const MdcCalibFunSvc* calibSvc() const { return m_mdcCalibFunSvc; }
60 Identifier mdcId() const { return _id; }
61 unsigned layernumber() const { return _layer; }
62 unsigned wirenumber() const { return _wire; }
63 unsigned tdcIndex() const { return _iTdc; }
64 unsigned adcIndex() const { return _iAdc; }
65 double charge() const { return _charge; }
66 double rawTime() const { return _rawTime; }
67 double driftTime(double tof, double z) const;
68 double driftDist(double, int, double, double, double) const;
69 double driftDist(double bunchTime, int ambig) const;
70 double sigma(double, int, double, double, double) const;
71 double sigma(double driftdist, int ambig = 0) const;
72 int whichView() const{ return _layerPtr->view(); }
73 const Trajectory* hitTraj() const;
75 double phi() const { return _phi;} // phi at chamber center
76 double x() const { return _rmid*_cosphi; } // x at chamber center
77 double y() const { return _rmid*_sinphi; } // y at chamber center
78 const double phi(double z) const{return wire()->phiDC(z);} // phi at z
79 double x (double z) const{return wire()->xWireDC(z);}// x at global z
80 double y (double z) const{return wire()->yWireDC(z);}// y at global z
81 double rMid() const { return _rmid; } // R at chamber center
82 double zlen() const { return _zlen; } // chamber extent in z
83 unsigned status() const { return _status;}// status
84
86 void setCountPropTime(const bool count) { m_countPropTime = count;}
87 void setCosmicFit(const bool cosmicfit) { m_cosmicFit = cosmicfit; }
88 bool isCosmicFit() const { return m_cosmicFit; }
89
90 void print(std::ostream &o) const;
91 void printAll(std::ostream &o) const;
92
93private:
94
95 // Calculate crude (no track info) correction of time for flight
96 // delay (assumes tracks from origin); wire propagation assumes z=0;
97 // return time in seconds(_rmid is in cm)
98 double crudeTof() const { return _rmid/Constants::c; }
99
100 //hide the copy ctor and assignment op, at least until somebody needs them
101 MdcHit();
102
103 friend class MdcMakeHits;
104
105 const MdcDigi* _digiPtr; // pointer to digi
106 const MdcDetector* _geomPtr; // pointer to geometry
107 const MdcLayer* _layerPtr; // pointer to layer
108 const MdcSWire* _wirePtr; // pointer to wire
109 const MdcCalibFunSvc* m_mdcCalibFunSvc;//pointer to MdcCalibFunSvc
110 Identifier _id; // Mdc Identifier
111 unsigned _layer; // layer number
112 unsigned _wire; // wire number
113 unsigned _iTdc; // time channel
114 unsigned _iAdc; // charge channel
115 double _rawTime; // raw time, in NANO seconds
116 double _charge; // charge
117 double _rmid; // radius of wire at mid chamber
118 double _zlen; // wire length
119 double _phi; // phi of wire
120 double _cosphi; // cos(phi)
121 double _sinphi; // sin(phi)
122 unsigned _status; // status flag;
123 double _T0Walk; // time of T0(from calib) and time walk
124 static bool m_cosmicFit; // flag for csmc
125 static bool m_countPropTime;// flag if count propergation time
126};
127extern std::ostream& operator<<(std::ostream &o,const MdcHit& aHit);
128
129typedef ObjectVector<MdcHit> MdcHitCol;
130
131#endif
TTree * sigma
DOUBLE_PRECISION count[3]
const CLID & CLID_MdcHit
ObjectVector< MdcHit > MdcHitCol
Definition: MdcHit.h:129
std::ostream & operator<<(std::ostream &o, const MdcHit &aHit)
static const double c
Definition: Constants.h:43
Definition: MdcHit.h:44
const MdcDigi * digi() const
Definition: MdcHit.h:55
bool isCosmicFit() const
Definition: MdcHit.h:88
void setCalibSvc(const MdcCalibFunSvc *calibSvc)
Definition: MdcHit.cxx:136
double x(double z) const
Definition: MdcHit.h:79
double rMid() const
Definition: MdcHit.h:81
unsigned layernumber() const
Definition: MdcHit.h:61
unsigned wirenumber() const
Definition: MdcHit.h:62
void setCosmicFit(const bool cosmicfit)
Definition: MdcHit.h:87
void print(std::ostream &o) const
Definition: MdcHit.cxx:121
const MdcDetector * geom() const
Definition: MdcHit.h:58
unsigned status() const
Definition: MdcHit.h:83
double x() const
Definition: MdcHit.h:76
virtual ~MdcHit()
Definition: MdcHit.cxx:102
double rawTime() const
Definition: MdcHit.h:66
int whichView() const
Definition: MdcHit.h:72
unsigned adcIndex() const
Definition: MdcHit.h:64
TrkEnums::TrkViewInfo whatView() const
Definition: MdcHit.h:74
bool operator==(const MdcHit &) const
Definition: MdcHit.cxx:116
double phi() const
Definition: MdcHit.h:75
double charge() const
Definition: MdcHit.h:65
const MdcCalibFunSvc * calibSvc() const
Definition: MdcHit.h:59
double driftTime(double tof, double z) const
Definition: MdcHit.cxx:142
double y() const
Definition: MdcHit.h:77
MdcHit & operator=(const MdcHit &)
Definition: MdcHit.cxx:74
Identifier mdcId() const
Definition: MdcHit.h:60
const double phi(double z) const
Definition: MdcHit.h:78
double y(double z) const
Definition: MdcHit.h:80
const Trajectory * hitTraj() const
Definition: MdcHit.cxx:231
double zlen() const
Definition: MdcHit.h:82
void setCountPropTime(const bool count)
Definition: MdcHit.h:86
double driftDist(double, int, double, double, double) const
Definition: MdcHit.cxx:156
const MdcLayer * layer() const
Definition: MdcHit.h:56
const MdcSWire * wire() const
Definition: MdcHit.h:57
unsigned tdcIndex() const
Definition: MdcHit.h:63
void printAll(std::ostream &o) const
Definition: MdcHit.cxx:126
int view(void) const
Definition: MdcLayer.h:28
double yWireDC(double z) const
Definition: MdcSWire.h:62
double xWireDC(double z) const
Definition: MdcSWire.h:61
double phiDC(double z) const
Definition: MdcSWire.h:60
TrkViewInfo
Definition: TrkEnums.h:22
@ xyView
Definition: TrkEnums.h:22
@ bothView
Definition: TrkEnums.h:22