BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcData/MdcData-00-01-27/MdcData/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"
36#include "Identifier/Identifier.h"
37#include "MdcCalibFunSvc/MdcCalibFunSvc.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
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
DOUBLE_PRECISION count[3]
const CLID & CLID_MdcHit
std::ostream & operator<<(std::ostream &o, const MdcHit &aHit)
const MdcDigi * digi() const
MdcHit(const MdcDigi *&digi, const MdcDetector *&det)
void setCalibSvc(const MdcCalibFunSvc *calibSvc)
void print(std::ostream &o) const
double sigma(double driftdist, int ambig=0) const
double driftDist(double bunchTime, int ambig) const
bool operator==(const MdcHit &) const
virtual ~MdcHit()
double driftTime(double tof, double z) const
double sigma(double, int, double, double, double) const
MdcHit & operator=(const MdcHit &)
const Trajectory * hitTraj() const
double driftDist(double, int, double, double, double) const
MdcHit(const MdcHit &)
void printAll(std::ostream &o) const