BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcData/include/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 "Identifier/Identifier.h"
30#include "MdcCalibFunSvc/IMdcCalibFunSvc.h"
31#include "MdcGeom/Constants.h"
32#include "MdcGeom/MdcDetector.h"
33#include "MdcGeom/MdcLayer.h"
34#include "MdcGeom/MdcSWire.h"
35#include "MdcRawEvent/MdcDigi.h"
36#include "TrkBase/TrkEnums.h"
37#include "TrkBase/TrkFundHit.h"
38
39class Trajectory;
40
41extern const CLID& CLID_MdcHit;
42
43class MdcHit : public TrkFundHit {
44public:
45 MdcHit( const MdcDigi*& digi, const MdcDetector*& det );
46 MdcHit( const MdcHit& );
47
48 virtual ~MdcHit();
49
51 bool operator==( const MdcHit& ) const;
52
53 const MdcDigi* digi() const { return _digiPtr; }
54 const MdcLayer* layer() const { return _layerPtr; }
55 const MdcSWire* wire() const { return _wirePtr; }
56 const MdcDetector* geom() const { return _geomPtr; }
57 const IMdcCalibFunSvc* calibSvc() const { return m_mdcCalibFunSvc; }
58 Identifier mdcId() const { return _id; }
59 unsigned layernumber() const { return _layer; }
60 unsigned wirenumber() const { return _wire; }
61 unsigned tdcIndex() const { return _iTdc; }
62 unsigned adcIndex() const { return _iAdc; }
63 double charge() const { return _charge; }
64 double rawTime() const { return _rawTime; }
65 double driftTime( double tof, double z ) const;
66 double driftDist( double, int, double, double, double ) const;
67 double driftDist( double bunchTime, int ambig ) const;
68 double sigma( double, int, double, double, double ) const;
69 double sigma( double driftdist, int ambig = 0 ) const;
70 int whichView() const { return _layerPtr->view(); }
71 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 // Calculate crude (no track info) correction of time for flight
95 // delay (assumes tracks from origin); wire propagation assumes z=0;
96 // return time in seconds(_rmid is in cm)
97 double crudeTof() const { return _rmid / Constants::c; }
98
99 // hide the copy ctor and assignment op, at least until somebody needs them
100 MdcHit();
101
102 friend class MdcMakeHits;
103
104 const MdcDigi* _digiPtr{ nullptr }; // pointer to digi
105 const MdcDetector* _geomPtr{ nullptr }; // pointer to geometry
106 const MdcLayer* _layerPtr{ nullptr }; // pointer to layer
107 const MdcSWire* _wirePtr{ nullptr }; // pointer to wire
108 const IMdcCalibFunSvc* m_mdcCalibFunSvc{ nullptr }; // pointer to MdcCalibFunSvc
109 Identifier _id; // Mdc Identifier
110 unsigned _layer{ 0 }; // layer number
111 unsigned _wire{ 0 }; // wire number
112 unsigned _iTdc{ 0 }; // time channel
113 unsigned _iAdc{ 0 }; // charge channel
114 double _rawTime{ 0.0 }; // raw time, in NANO seconds
115 double _charge{ 0.0 }; // charge
116 double _rmid{ 0.0 }; // radius of wire at mid chamber
117 double _zlen{ 0.0 }; // wire length
118 double _phi{ 0.0 }; // phi of wire
119 double _cosphi{ 0.0 }; // cos(phi)
120 double _sinphi{ 0.0 }; // sin(phi)
121 unsigned _status{ 0 }; // status flag;
122 double _T0Walk{ 0.0 }; // time of T0(from calib) and time walk
123 static bool m_cosmicFit; // flag for csmc
124 static bool m_countPropTime; // flag if count propergation time
125};
126extern std::ostream& operator<<( std::ostream& o, const MdcHit& aHit );
127
128typedef ObjectVector<MdcHit> MdcHitCol;
129
130#endif
DOUBLE_PRECISION count[3]
const CLID & CLID_MdcHit
std::ostream & operator<<(std::ostream &o, const MdcHit &aHit)
MdcHit(const MdcDigi *&digi, const MdcDetector *&det)
void print(std::ostream &o) const
double sigma(double driftdist, int ambig=0) const
double driftDist(double bunchTime, int ambig) const
const IMdcCalibFunSvc * calibSvc() 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 setCalibSvc(const IMdcCalibFunSvc *calibSvc)
void printAll(std::ostream &o) const