BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/MdcxReco/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([email protected]) 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 <math.h>
28#include <iostream>
29#include <fstream>
30#include <vector>
31#include "MdcGeom/MdcLayer.h"
32#include "MdcGeom/MdcSWire.h"
33#include "MdcData/MdcHit.h"
34#include "MdcCalibFunSvc/MdcCalibFunSvc.h"
35#include "MdcGeom/MdcDetector.h"
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 MdcCalibFunSvc* 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,
90 int wamb=0, 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;
128 float _p,_sp,_cp;
129 double _pw;
130 double _wx,_wy,_wz;
132 const MdcDigi *_mdcDigi; //pointer to |MdcDigi| defining this hit
135 float _c0; //accumulated global time offset; changes in t0 go here
136 float _cresol;
137private:
138 double getSigma(float driftDist, int ambig = 0, double entrAngle = 0,
139 double dipAngle = 0, double z = 0) const;
140 static const MdcCalibFunSvc* m_mdcCalibFunSvc; //pointer to MdcCalibFunSvc
141 static const MdcDetector* m_gm; //pointer to MdcDetector
142 static bool m_countPropTime;
143};//endof MdcxHit
144
145typedef ObjectVector<MdcxHit> MdcxHitCol;
146
147#endif
ObjectVector< MdcxHit > MdcxHitCol
float d(MdcxHel &hel) const
Definition: MdcxHit.cxx:160
float pull(MdcxHel &hel) const
Definition: MdcxHit.cxx:174
void printAll(std::ostream &o, int i=0) const
float tcor(float zh=0.0, float tof=0.0, float tzero=0.0) const
Definition: MdcxHit.cxx:116
std::vector< float > derivatives(MdcxHel &hel) const
Definition: MdcxHit.cxx:192
void process()
Definition: MdcxHit.cxx:72
float e(float dd=0.0) const
Definition: MdcxHit.cxx:166
void print(std::ostream &o, int i=0) const
static void setMdcDetector(const MdcDetector *gm)
Definition: MdcxHit.cxx:68
float residual(MdcxHel &hel) const
Definition: MdcxHit.cxx:182
static void setMdcCalibFunSvc(const MdcCalibFunSvc *calibSvc)
Definition: MdcxHit.cxx:60
static void setCountPropTime(bool countPropTime)
Definition: MdcxHit.cxx:64