BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcxReco/include/MdcxReco/MdcxHit.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcxHit.h,v 1.10 2009/12/16 08:59:13 zhangy Exp $
4//
5// Description:
6// Class Header for |MdcxHit|: hit that can calculate derivatives
7// and plot hits self specialized to the drift chamber
8//
9// Environment:
10// Software developed for the BaBar Detector at the SLAC B-Factory.
11//
12// Author List:
13// A. Snyder
14// Zhang Yao(zhangyao@ihep.ac.cn) Migration for BESIII
15//
16// Copyright Information:
17// Copyright (C) 1995 BEPCII
18//
19// History:
20// Migration for BESIII MDC
21//
22//------------------------------------------------------------------------
23
24#ifndef _MDCXHIT_
25#define _MDCXHIT_
26
27#include "MdcCalibFunSvc/IMdcCalibFunSvc.h"
28#include "MdcData/MdcHit.h"
29#include "MdcGeom/MdcDetector.h"
30#include "MdcGeom/MdcLayer.h"
31#include "MdcGeom/MdcSWire.h"
32#include <fstream>
33#include <iostream>
34#include <math.h>
35#include <vector>
36
37class MdcxHel;
38class MdcDigi;
39
40using namespace EventModel;
41
42class MdcxHit {
43 // A MDC hit that can calculate derivatives
44public:
45 // constructors
46 MdcxHit( const MdcDigi* pdcdatum, float c0 = 0, float cresol = .0180 );
47 MdcxHit( const MdcHit* pdchhit, float c0 = 0, float cresol = .0180 );
48
49 // destructor
50 virtual ~MdcxHit(){};
51 // private copy constructor and oprator
52private:
53 MdcxHit( const MdcxHit& );
54 MdcxHit& operator=( const MdcxHit& );
55 bool operator==( const MdcxHit& ) const;
56
57public:
58 static void setMdcCalibFunSvc( const IMdcCalibFunSvc* calibSvc );
59 static void setCountPropTime( bool countPropTime ); // yzhang for csmc
60 static void setMdcDetector( const MdcDetector* gm );
61
62 // accessors
63 inline const MdcDigi* getDigi() const { return _mdcDigi; }
64 inline const MdcHit* getMdcHit() const { return _mdcHit; }
65 inline int SuperLayer() const { return _superlayer; } // SuperLayer#
66 inline int WireNo() const { return _wirenumber; } // Wire#
67 inline int Layer() const { return _layernumber; } // layer#
68 inline float t() const { return _t; } // drift time
69 inline float x() const { return _x; } // x of wire
70 inline float y() const { return _y; } // y of wire
71 inline float xpos() const { return _xpos; }
72 inline float ypos() const { return _ypos; }
73 inline float xneg() const { return _xneg; }
74 inline float yneg() const { return _yneg; }
75 inline float wx() const { return _wx; }
76 inline float wy() const { return _wy; }
77 inline float wz() const { return _wz; }
78 inline float pw() const { return _pw; }
79 inline float phiMid() const { return _pw; } // yzhang add
80 inline float stereo() const { return _s; } // stereo angle of wire
81 inline float v() const { return _v; } // drift velocity
82 inline int type() const { return _type; } // flags |MdcxHit|
83
84 // workers
85 inline void SetConstErr( int i ) { _consterr = i; }
86 ///////////////////////////////////////////
87 float tcor( float zh = 0.0, float tof = 0.0, float tzero = 0.0 ) const;
88 float d( MdcxHel& hel ) const; // |drift dist| (changes hel's internal state)
89 float d( float zh = 0.0, float tof = 0.0, float tzero = 0.0, int wamb = 0,
90 float eang = 0.0 ) const; // |drift dist|
91 // float tcor(float tof) const;
92 // float d(int ambig = 0, double entranceAngle = 0) const;
93 // float d(MdcxHel& hel, int ambig = 0, double entranceAngle = 0) const;
94 ///////////////////////////
95
96 float e( float dd = 0.0 ) const; // drift error currently in use
97 float pull( MdcxHel& hel ) const; // Chisq contribution to fit
98 float residual( MdcxHel& hel ) const; // residual of this hit
99 std::vector<float> derivatives( MdcxHel& hel ) const; // Derivatives, etc.
100 void print( std::ostream& o, int i = 0 ) const; // print this hit
101 void printAll( std::ostream& o, int i = 0 ) const; // print this hit
102 inline void SetUsedOnHel( int i ) { usedonhel = i; }
103 inline int GetUsedOnHel() const { return usedonhel; }
104
105protected:
106 // functions
107 void process();
108
109 // data
110 unsigned _wirenumber;
111 unsigned _layernumber;
112 unsigned _superlayer;
113 float _t;
114 float _q;
115 unsigned _iTdc;
116 unsigned _iAdc;
117 float _T0Walk; // zoujh
118 float _x;
119 float _y;
120 float _r;
121 float _s;
122 float _L; // length of this layer
123 float _d;
124 float _v;
125 int _type; // yzhang add 2009-11-03
126 float _e;
127 float _xpos, _ypos, _xneg, _yneg;
128 float _p, _sp, _cp;
129 double _pw;
130 double _wx, _wy, _wz;
131 const MdcHit* _mdcHit;
132 const MdcDigi* _mdcDigi; // pointer to |MdcDigi| defining this hit
133 int _consterr;
134 int usedonhel;
135 float _c0; // accumulated global time offset; changes in t0 go here
136 float _cresol;
137
138private:
139 double getSigma( float driftDist, int ambig = 0, double entrAngle = 0, double dipAngle = 0,
140 double z = 0 ) const;
141 static const IMdcCalibFunSvc* m_mdcCalibFunSvc; // pointer to MdcCalibFunSvc
142 static const MdcDetector* m_gm; // pointer to MdcDetector
143 static bool m_countPropTime;
144}; // endof MdcxHit
145
146typedef ObjectVector<MdcxHit> MdcxHitCol;
147
148#endif
bool operator==(const double &x, const ICache::ID64 &y)
Definition cache.h:397
float d(MdcxHel &hel) const
float pull(MdcxHel &hel) const
void printAll(std::ostream &o, int i=0) const
float tcor(float zh=0.0, float tof=0.0, float tzero=0.0) const
std::vector< float > derivatives(MdcxHel &hel) const
void process()
float e(float dd=0.0) const
void print(std::ostream &o, int i=0) const
MdcxHit(const MdcHit *pdchhit, float c0=0, float cresol=.0180)
float residual(MdcxHel &hel) const
float d(float zh=0.0, float tof=0.0, float tzero=0.0, int wamb=0, float eang=0.0) const
MdcxHit(const MdcDigi *pdcdatum, float c0=0, float cresol=.0180)
static void setMdcDetector(const MdcDetector *gm)
static void setMdcCalibFunSvc(const IMdcCalibFunSvc *calibSvc)
static void setCountPropTime(bool countPropTime)