BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
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"
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
Definition: MdcxHit.h:145
Definition: MdcHit.h:44
float d(MdcxHel &hel) const
Definition: MdcxHit.cxx:160
float pull(MdcxHel &hel) const
Definition: MdcxHit.cxx:174
float _e
Definition: MdcxHit.h:126
const MdcDigi * getDigi() const
Definition: MdcxHit.h:63
float phiMid() const
Definition: MdcxHit.h:79
float _ypos
Definition: MdcxHit.h:127
unsigned _superlayer
Definition: MdcxHit.h:112
float _yneg
Definition: MdcxHit.h:127
void printAll(std::ostream &o, int i=0) const
Definition: MdcxHit.cxx:209
float stereo() const
Definition: MdcxHit.h:80
int Layer() const
Definition: MdcxHit.h:67
float wy() const
Definition: MdcxHit.h:76
float t() const
Definition: MdcxHit.h:68
double _wy
Definition: MdcxHit.h:130
float _y
Definition: MdcxHit.h:119
float pw() const
Definition: MdcxHit.h:78
double _pw
Definition: MdcxHit.h:129
void SetConstErr(int i)
Definition: MdcxHit.h:85
double _wx
Definition: MdcxHit.h:130
float _sp
Definition: MdcxHit.h:128
float _d
Definition: MdcxHit.h:123
float tcor(float zh=0.0, float tof=0.0, float tzero=0.0) const
Definition: MdcxHit.cxx:116
int usedonhel
Definition: MdcxHit.h:134
float _v
Definition: MdcxHit.h:124
std::vector< float > derivatives(MdcxHel &hel) const
Definition: MdcxHit.cxx:192
float _x
Definition: MdcxHit.h:118
float x() const
Definition: MdcxHit.h:69
void process()
Definition: MdcxHit.cxx:72
float e(float dd=0.0) const
Definition: MdcxHit.cxx:166
int _type
Definition: MdcxHit.h:125
float xneg() const
Definition: MdcxHit.h:73
int WireNo() const
Definition: MdcxHit.h:66
float y() const
Definition: MdcxHit.h:70
const MdcHit * _mdcHit
Definition: MdcxHit.h:131
float _p
Definition: MdcxHit.h:128
void print(std::ostream &o, int i=0) const
Definition: MdcxHit.cxx:205
unsigned _wirenumber
Definition: MdcxHit.h:110
float _c0
Definition: MdcxHit.h:135
int _consterr
Definition: MdcxHit.h:133
float _r
Definition: MdcxHit.h:120
float wx() const
Definition: MdcxHit.h:75
float _T0Walk
Definition: MdcxHit.h:117
float _L
Definition: MdcxHit.h:122
float _cresol
Definition: MdcxHit.h:136
static void setMdcDetector(const MdcDetector *gm)
Definition: MdcxHit.cxx:68
float residual(MdcxHel &hel) const
Definition: MdcxHit.cxx:182
float wz() const
Definition: MdcxHit.h:77
static void setMdcCalibFunSvc(const MdcCalibFunSvc *calibSvc)
Definition: MdcxHit.cxx:60
virtual ~MdcxHit()
Definition: MdcxHit.h:50
float _xpos
Definition: MdcxHit.h:127
int GetUsedOnHel() const
Definition: MdcxHit.h:103
int type() const
Definition: MdcxHit.h:82
double _wz
Definition: MdcxHit.h:130
float _cp
Definition: MdcxHit.h:128
float _xneg
Definition: MdcxHit.h:127
float yneg() const
Definition: MdcxHit.h:74
const MdcDigi * _mdcDigi
Definition: MdcxHit.h:132
float ypos() const
Definition: MdcxHit.h:72
int SuperLayer() const
Definition: MdcxHit.h:65
unsigned _layernumber
Definition: MdcxHit.h:111
float _s
Definition: MdcxHit.h:121
float _t
Definition: MdcxHit.h:113
const MdcHit * getMdcHit() const
Definition: MdcxHit.h:64
float _q
Definition: MdcxHit.h:114
unsigned _iTdc
Definition: MdcxHit.h:115
void SetUsedOnHel(int i)
Definition: MdcxHit.h:102
unsigned _iAdc
Definition: MdcxHit.h:116
float v() const
Definition: MdcxHit.h:81
float xpos() const
Definition: MdcxHit.h:71
static void setCountPropTime(bool countPropTime)
Definition: MdcxHit.cxx:64