CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
HoughHit.h
Go to the documentation of this file.
1#ifndef HOUGHHIT2_H
2#define HOUGHHIT2_H
3
4
7#include "McTruth/MdcMcHit.h"
8#include "McTruth/CgemMcHit.h"
9#include "CLHEP/Geometry/Point3D.h"
10#include "MdcData/MdcHit.h"
11
16#include <vector>
18#include "MdcGeom/MdcDetector.h"
19
20class HoughTrack;
21
22using namespace Event;
23
25{
26 public:
27 enum HitType{CGEMHIT = 0, MDCHIT = 1, CGEMMCHIT = 2, MDCMCHIT = 3};
28 typedef std::pair<double,double> S_Z;
29
30 HoughHit();
31 HoughHit(const MdcDigi* mdcDigi, double bunchTime, int hitID);
32 HoughHit(const RecCgemCluster* cgemCgemCluster, double bunchTime, int hitID);
33 HoughHit(const MdcMcHit* mdcMcHit, double bunchTime, int hitID);
34 HoughHit(const CgemMcHit* cgemMcHit, double bunchTime, int hitID);
35 HoughHit(const HoughHit& other);
36 HoughHit& operator=(const HoughHit& other);
37 //~HoughHit();
38
39 int getHitID() const {return m_hitID;}
40 HitType getHitType() const {return m_hitType;}
41 const RecCgemCluster* getCgemCluster() const {return m_cgemCluster;}
42 const MdcDigi* getDigi() const {return m_mdcDigi;}
43 const CgemMcHit* getCgemMcHit()const{return m_cgemMcHit;}
44 const MdcMcHit* getMdcMcHit()const{return m_mdcMcHit;}
45 int getLayer() const {return m_layer;}
46 int getWire() const {return m_wire;}
47 int getFlag() const {return m_flag;}
48 double getBunchTime() const {return m_bunchTime;}
49 double getRawTime() const {return m_rawTime;}
50 double getDepositEnergy() const {return m_depositEnergy;}
51 HepPoint3D getHitPosition() const {return m_hitPosition;}
52 HepPoint3D getWestPoint() const {return m_westPoint;}
53 HepPoint3D getEastPoint() const {return m_eastPoint;}
54 double getDriftDist() const {return m_driftDist;}
55 double getResidual() const {return m_residual;}
56 vector<int> getTrkID() const {return m_trkID;}
57 vector<HoughTrack*> getTrkPntVec() {return m_vecTrkPnt;}
58 int getUse() const {return m_use;}
59 //int getSLeft() const {return m_sLeft;}
60 //int getZLeft() const {return m_zLeft;}
61 //int getSRight() const {return m_sRight;}
62 //int getZRight() const {return m_zRight;}
63 vector<S_Z> getSZ() const {return m_sz;}
64
65 MdcGeomSvc* getMdcGeomSvc() const {return m_mdcGeomSvc;}
66 MdcCalibFunSvc* getMdcCalibFunSvc() const {return m_mdcCalibFunSvc;}
67 CgemGeomSvc* getCgemGeomSvc() const {return m_cgemGeomSvc;}
68 CgemCalibFunSvc* getCgemCalibFunSvc() const {return m_cgemCalibFunSvc;}
69
70 int getHalfCircle(){return m_halfCircle;}
71 HoughHit* getPairHit(){return m_pairHit;}
72
73 void setHitID(int hitID) {m_hitID = hitID;}
74 void setHitType(HitType hitType){m_hitType = hitType;}
75 void setCgemCluster(const RecCgemCluster* cgemCluster){m_cgemCluster = cgemCluster;}
76 void setDigi(const MdcDigi* mdcDigi){m_mdcDigi = mdcDigi;}
77 void setCgemMcHit(const CgemMcHit* cgemMcHit){m_cgemMcHit = cgemMcHit;}
78 void setMdcMcHit(const MdcMcHit* mdcMcHit){m_mdcMcHit = mdcMcHit;}
79 void setLayer(int layer){m_layer = layer;}
80 void setWire(int wire){m_wire = wire;}
81 void setFlag(int flag){m_flag = flag;}
82 void setUse(int use) {m_use = use;}
83 void setBunchTime(double bunchTime){m_bunchTime = bunchTime;}
84 void setRawTime(double rawTime){m_rawTime = rawTime;}
85 void setDepositEnergy(double depositEnergy){m_depositEnergy = depositEnergy;}
86 void setHitPosition(HepPoint3D point){m_hitPosition = point;}
87 //void setWestPoint(HepPoint3D point){m_westPoint = point;}
88 //void setEastPoint(HepPoint3D point){m_eastPoint = point;}
89 void setDriftDist(double driftDist){m_driftDist = driftDist;}
90 void setResidual(double residual) {m_residual = residual;}
91 void setTrkID(vector<int> trkID) {m_trkID.clear();m_trkID = trkID;}
92 //void setSLeft(double s) {m_sLeft = s;}
93 //void setZLeft(double z) {m_zLeft = z;}
94 //void setSRight(double s) {m_sRight = s;}
95 //void setZRight(double z) {m_zRight = z;}
96 void setSZ(vector<S_Z> sz) {m_sz.clear();m_sz = sz;}
97 void resetSZ() {m_sz.clear();}
98
99 static void setMdcGeomSvc(MdcGeomSvc* mdcGeomSvc) {m_mdcGeomSvc = mdcGeomSvc;}
100 static void setMdcCalibFunSvc(MdcCalibFunSvc* mdcCalibFunSvc) {m_mdcCalibFunSvc = mdcCalibFunSvc;}
101 static void setCgemGeomSvc(CgemGeomSvc* cgemGeomSvc) {m_cgemGeomSvc = cgemGeomSvc;}
102 static void setCgemCalibFunSvc(CgemCalibFunSvc* cgemCalibFunSvc) {m_cgemCalibFunSvc = cgemCalibFunSvc;}
103 static void setMdcDetector(const MdcDetector* mdcDetector) {m_mdcDetector = mdcDetector;}
104
105 void addTrkID(int trkID) {m_trkID.push_back(trkID);}
106 void addSZ(S_Z sz) {m_sz.push_back(sz);}
107 void addTrkPnt(HoughTrack* aHTrk) {m_vecTrkPnt.push_back(aHTrk);}
108 void rmTrkPnt(HoughTrack* aHTrk) {vector<HoughTrack*>::iterator result = find(m_vecTrkPnt.begin(), m_vecTrkPnt.end(), aHTrk); if(result!=m_vecTrkPnt.end()) m_vecTrkPnt.erase(result);}
109 void clearTrkPnt() {m_vecTrkPnt.clear();}
110 void dropTrkID(int trkID); // remove trk ID and its residual
111 //{vector<int>::iterator result = find(m_trkID.begin(),m_trkID.end(),trkID); if(result!=m_trkID.end()) m_trkID.erase(result);}
112
113 void addResid(double res) {m_vecResid.push_back(res);}
114 vector<double> getVecResid() {return m_vecResid;}
115
116 void setPairHit(HoughHit* pairHit){m_pairHit = pairHit;}
117 void setHalfCircle(int halfCircle){m_halfCircle = halfCircle;}
118 void addPosition(HepPoint3D position){m_position.push_back(position);}
119
120 //void buildMap(int x_bin, double x_min, double x_max, int y_bin, double y_min, double y_max, int nPoint, int charge);
121 //void clearMap();
122 void print();
123 double driftTime();
124 double hitSigma();
125 vector<HepPoint3D>& VHitPosition(HoughTrack* track);
126 double residual(HoughTrack* track);
127 void updateVHit(HoughTrack* track);
128 //double flightArc(HoughTrack* track);
129 //double flightLength(HoughTrack* track);
130 //double dPhi(HoughTrack* track);
131 //double doca(HoughTrack* track);
132 double residual(HoughTrack* track, HepPoint3D& positionOntrack, HepPoint3D& positionOnDetector);
133 int attach2NTrack(){return m_trkID.size();}
134 MdcHit* getMdcHit(){return m_mdcHit;}
135 void setMdcHit(MdcHit* mdcHit){m_mdcHit = mdcHit;}
136
137 private:
138 int flag();
139 double driftDistance();
140
141 private:
142 unsigned int m_hitID;
143 HitType m_hitType;
144 const RecCgemCluster* m_cgemCluster;
145 const MdcDigi* m_mdcDigi;
146 const CgemMcHit* m_cgemMcHit;
147 const MdcMcHit* m_mdcMcHit;
148 unsigned m_layer;
149 unsigned m_wire;
150 int m_flag;// 0, -1, +1 for wires of DC; 0, 1, 2 for CGEM clusters
151 int m_use;
152 double m_bunchTime;
153 double m_rawTime;
154 double m_depositEnergy;
155 HepPoint3D m_hitPosition;
156 HepPoint3D m_westPoint;
157 HepPoint3D m_eastPoint;
158 double m_driftDist;
159
160 double m_residual;
161 vector<int> m_trkID;
162 vector<double> m_vecResid;
163 vector<S_Z> m_sz;
164 vector<HoughTrack*> m_vecTrkPnt;
165 vector<HepPoint3D> m_position;
166
167 int m_halfCircle;
168 HoughHit* m_pairHit;
169 MdcHit* m_mdcHit;
170
171 //double m_sLeft;
172 //double m_zLeft;
173 //double m_sRight;
174 //double m_zRight;
175
176 static MdcGeomSvc* m_mdcGeomSvc;
177 static MdcCalibFunSvc* m_mdcCalibFunSvc;
178 static CgemGeomSvc* m_cgemGeomSvc;
179 static CgemCalibFunSvc* m_cgemCalibFunSvc;
180 const static MdcDetector* m_mdcDetector;
181};
182
183typedef vector<HoughHit>::iterator HitVector_Iterator;
184
185#endif
vector< HoughHit >::iterator HitVector_Iterator
Definition: HoughHit.h:183
void setCgemCluster(const RecCgemCluster *cgemCluster)
Definition: HoughHit.h:75
double getDepositEnergy() const
Definition: HoughHit.h:50
vector< S_Z > getSZ() const
Definition: HoughHit.h:63
void setHitID(int hitID)
Definition: HoughHit.h:73
HoughHit()
Definition: HoughHit.cxx:20
void setDepositEnergy(double depositEnergy)
Definition: HoughHit.h:85
double getRawTime() const
Definition: HoughHit.h:49
int getHalfCircle()
Definition: HoughHit.h:70
MdcGeomSvc * getMdcGeomSvc() const
Definition: HoughHit.h:65
double residual(HoughTrack *track)
Definition: HoughHit.cxx:491
double hitSigma()
const MdcDigi * getDigi() const
Definition: HoughHit.h:42
void dropTrkID(int trkID)
Definition: HoughHit.cxx:398
HoughHit * getPairHit()
Definition: HoughHit.h:71
void addTrkID(int trkID)
Definition: HoughHit.h:105
void setUse(int use)
Definition: HoughHit.h:82
void setHalfCircle(int halfCircle)
Definition: HoughHit.h:117
static void setMdcGeomSvc(MdcGeomSvc *mdcGeomSvc)
Definition: HoughHit.h:99
const RecCgemCluster * getCgemCluster() const
Definition: HoughHit.h:41
double getDriftDist() const
Definition: HoughHit.h:54
vector< int > getTrkID() const
Definition: HoughHit.h:56
HepPoint3D getWestPoint() const
Definition: HoughHit.h:52
int getHitID() const
Definition: HoughHit.h:39
void setMdcHit(MdcHit *mdcHit)
Definition: HoughHit.h:135
MdcCalibFunSvc * getMdcCalibFunSvc() const
Definition: HoughHit.h:66
HepPoint3D getEastPoint() const
Definition: HoughHit.h:53
void setDigi(const MdcDigi *mdcDigi)
Definition: HoughHit.h:76
const MdcMcHit * getMdcMcHit() const
Definition: HoughHit.h:44
void setDriftDist(double driftDist)
Definition: HoughHit.h:89
void addSZ(S_Z sz)
Definition: HoughHit.h:106
HepPoint3D getHitPosition() const
Definition: HoughHit.h:51
HitType getHitType() const
Definition: HoughHit.h:40
CgemGeomSvc * getCgemGeomSvc() const
Definition: HoughHit.h:67
void addTrkPnt(HoughTrack *aHTrk)
Definition: HoughHit.h:107
const CgemMcHit * getCgemMcHit() const
Definition: HoughHit.h:43
void rmTrkPnt(HoughTrack *aHTrk)
Definition: HoughHit.h:108
void addResid(double res)
Definition: HoughHit.h:113
void setTrkID(vector< int > trkID)
Definition: HoughHit.h:91
void setPairHit(HoughHit *pairHit)
Definition: HoughHit.h:116
void setLayer(int layer)
Definition: HoughHit.h:79
static void setMdcCalibFunSvc(MdcCalibFunSvc *mdcCalibFunSvc)
Definition: HoughHit.h:100
void clearTrkPnt()
Definition: HoughHit.h:109
int attach2NTrack()
Definition: HoughHit.h:133
int getFlag() const
Definition: HoughHit.h:47
void print()
Definition: HoughHit.cxx:327
CgemCalibFunSvc * getCgemCalibFunSvc() const
Definition: HoughHit.h:68
vector< double > getVecResid()
Definition: HoughHit.h:114
void setHitType(HitType hitType)
Definition: HoughHit.h:74
void addPosition(HepPoint3D position)
Definition: HoughHit.h:118
double driftTime()
Definition: HoughHit.cxx:296
MdcHit * getMdcHit()
Definition: HoughHit.h:134
void updateVHit(HoughTrack *track)
Definition: HoughHit.cxx:551
vector< HepPoint3D > & VHitPosition(HoughTrack *track)
Definition: HoughHit.cxx:409
void setHitPosition(HepPoint3D point)
Definition: HoughHit.h:86
vector< HoughTrack * > getTrkPntVec()
Definition: HoughHit.h:57
static void setCgemCalibFunSvc(CgemCalibFunSvc *cgemCalibFunSvc)
Definition: HoughHit.h:102
void setWire(int wire)
Definition: HoughHit.h:80
int getLayer() const
Definition: HoughHit.h:45
int getUse() const
Definition: HoughHit.h:58
void setFlag(int flag)
Definition: HoughHit.h:81
void setRawTime(double rawTime)
Definition: HoughHit.h:84
static void setCgemGeomSvc(CgemGeomSvc *cgemGeomSvc)
Definition: HoughHit.h:101
static void setMdcDetector(const MdcDetector *mdcDetector)
Definition: HoughHit.h:103
int getWire() const
Definition: HoughHit.h:46
void setMdcMcHit(const MdcMcHit *mdcMcHit)
Definition: HoughHit.h:78
void resetSZ()
Definition: HoughHit.h:97
double getResidual() const
Definition: HoughHit.h:55
void setCgemMcHit(const CgemMcHit *cgemMcHit)
Definition: HoughHit.h:77
void setBunchTime(double bunchTime)
Definition: HoughHit.h:83
void setSZ(vector< S_Z > sz)
Definition: HoughHit.h:96
double getBunchTime() const
Definition: HoughHit.h:48
@ CGEMMCHIT
Definition: HoughHit.h:27
@ MDCMCHIT
Definition: HoughHit.h:27
HoughHit & operator=(const HoughHit &other)
Definition: HoughHit.cxx:209
std::pair< double, double > S_Z
Definition: HoughHit.h:28
void setResidual(double residual)
Definition: HoughHit.h:90
Definition: MdcHit.h:44
Definition: Event.h:21