CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-12/MdcHoughFinder/HoughHit.h
Go to the documentation of this file.
1#ifndef HOUGHHIT_H
2#define HOUGHHIT_H
3#include "MdcGeom/Constants.h"
4#include "MdcHoughFinder/HoughGlobal.h"
5#include "MdcHoughFinder/CFCir.h"
6#include "Identifier/Identifier.h"
7#include "Identifier/MdcID.h"
8#include "MdcCalibFunSvc/MdcCalibFunSvc.h"
9#include "MdcGeomSvc/MdcGeomSvc.h"
10#include "MdcGeom/MdcDetector.h"
11#include "CLHEP/Geometry/Point3D.h"
12#include "MdcRawEvent/MdcDigi.h"
13#include "McTruth/MdcMcHit.h"
14#include "MdcGeom/MdcLayer.h"
15#include "MdcGeom/MdcSWire.h"
16
17#include "CgemRecEvent/RecCgemCluster.h"
18#include "CgemGeomSvc/CgemGeomSvc.h"
19#include "McTruth/CgemMcHit.h"
20#include "TH2D.h"
21#ifndef ENABLE_BACKWARDS_COMPATIBILITY
22// backwards compatibility will be enabled ONLY in CLHEP 1.9
24#endif
25
26using namespace Event;
27//using CLHEP::HepGeom;
28
29class HoughHit{
30 public:
31 //construction and destruction
33 HoughHit(const MdcDigi* const digi);
34 HoughHit(const HoughHit& other);
35 HoughHit& operator=(const HoughHit& other);
36
37 //set truth info
38 void setTruthInfo(const MdcMcHit*& mcHit);
39 void setTruthInfo(const CgemMcHit* aMcHit); //set static number
40 //set static number
41 static void setMdcCalibFunSvc(const MdcCalibFunSvc* calibSvc){_calibPtr = calibSvc;}
42 static void setMdcGeomSvc(MdcGeomSvc* geomSvc){_mdcGeomSvc = geomSvc;}
43 static void setBunchTime(double t0) {_bunchTime=t0;}
44
45
46 // CF transform
47 void conformalTrans(double x,double y,double r); //return x or y
48 double getConformal_u(double ,double , double);
49 double getConformal_v(double ,double , double);
50 double getConformal_r(double ,double , double);
51
52 //CF transform -> make circle
53 void makeCir(int n,double phi_begin,double phi_last ,double r);
54 CFCir getCir( int i) const {return vec_cfcir[i];}
55 static int _npart;
56
57
58 //get mdc
59 HoughHitType type() const {return _type;}
60 detectorType getDetectorType() const {return _detectorType;}
61 const MdcDigi* digi()const {return _digiPtr;}
62 double getBunchTime() const {return _bunchTime;}
63 HepPoint3D getMidPoint() const {return _midPoint;}
64 HepPoint3D getEastPoint() const {return _eastPoint;}
65 HepPoint3D getWestPoint() const {return _westPoint;}
66 double getMidX() const {return _midPoint.x();}
67 double getMidY() const {return _midPoint.y();}
68 int getLayerId() const {return _layer;}
69 int getWireId() const {return _wire;}
70 int getSlayerType()const {return _slayerType;}
71 const MdcLayer* layer() const { return _layerPtr; }
72 const MdcSWire* wire () const { return _wirePtr; }
73 double getCharge() const {return _charge;}
74 double getDriftTime() const {return _driftTime;}
75 double getDriftDist() const {return _driftDist;}
76
77 //get hough
78 double getU() const {return _u;}
79 double getV() const {return _v;}
80 double getR() const {return CF_drift;} //drift in CFS
81 double getDeltaD() const { return _deltad; } //l1l2-R+-r
82 double getFltLen() const { return _flightLength; } // R*dtheta
83
84
85 //calculate time and drift
86 double driftTime() const;
87 double driftTime(double tof, double z) const;
88 double calDriftDist(double, int, double, double, double) const;
89 double calDriftDist(double bunchTime, int ambig) const;
90 int slayerType(int layer);
91
92 //truth
93 double getXTruth() const {return _truthPoint.x();}
94 double getYTruth() const {return _truthPoint.y();}
95 double getZTruth() const {return _truthPoint.z();}
96 double getDriftDistTruth() const {return _truthDrift;}
97 int getIdTruth() const {return _truthId;}
98 int getLrTruth() const {return _truthlr;}
99 double getUTruth() const {return _truthU;}
100 double getVTruth() const {return _truthV;}
101 double getRTruth() const {return _truthR;}
102 HepPoint3D getPointTruth() const {return _truthPoint;}
103
104 //--------------------------------------------------------------------//
105
106 //set hough
107 void setDeltaD(double d) { _deltad=d; } //l1l2-R+-r
108 void setFltLen(double flt) {_flightLength= flt;} // R*dtheta
109
110 //calcu in MC
111 int getCirList() const {return _cirlist;}
112 int getStyle() const {return _style;}
113 void setCirList(int cir) {_cirlist=cir;}
114 void setStyle(int sty) {_style=sty;}
115
116 //print
117 void print() const;
118 void printAll() const;
119 void printTruth() const;
120
121 //cgem
122 HoughHit(const RecCgemCluster* const cluster);
123 static void setCgemGeomSvc(CgemGeomSvc* geomSvc){_cgemGeomSvc = geomSvc;}
124 CgemGeomSvc* getCgemGeomSvc() const {return _cgemGeomSvc;}
125 const RecCgemCluster* getCluster() const {return _clusterPtr;}
126
127 int getTrkId() const {return _trkid;}
128 int getHitId() const {return _hitid;}
129 int getClusterId() const {return _clusterid;}
130 void setTrkId(int id) {_trkid=id;}
131 void setHitId(int id) {_hitid=id;}
132 void setClusterId(int id) {_clusterid=id;}
135 HepPoint3D getLeftPoint() const {return _leftPoint;}
136 HepPoint3D getRightPoint() const {return _rightPoint;}
137
138 TH2D* getHitMap(){return _hitMap;}
139 void buildMap(int x_bin, double x_min, double x_max, int y_bin, double y_min, double y_max, int nPoint, int charge);
140 void clearMap();
141 void setUsable(int u){_used = u;}
142 int getUsable(){return _used;}
143
144 private:
145 double crudeTof() const { return _rmid/Constants::c; }
146
147 HoughHitType _type;
148 detectorType _detectorType;
149
150 static const MdcCalibFunSvc* _calibPtr; // pointer to MdcCalibFunSvc
151 static MdcGeomSvc* _mdcGeomSvc; // pointer to MdcGeomSvc
152 static double _bunchTime; // pointer to MdcGeomSvc
153
154 const MdcDetector* _det; // pointer to MdcDetector
155 const MdcDigi* _digiPtr; // pointer to digi
156 const MdcSWire* _wirePtr; // pointer to digi
157 const MdcLayer* _layerPtr; // pointer to digi
158 Identifier _id; // Mdc Identifier
159 unsigned _layer; // layer number
160 unsigned _wire; // wire number for MDC,sheet number for CGEM
161 double _rawTime; // raw time, in NANO seconds
162 double _driftTime; // drift time, in NANO seconds
163 double _driftDist; // drift dist, in NANO seconds
164 double _charge; // raw charge, in NANO seconds
165 int _slayerType; // wire type for MDC, cluster type for CGEM
166
167//position
168 HepPoint3D _midPoint;
169 HepPoint3D _eastPoint;
170 HepPoint3D _westPoint;
171 HepPoint3D _leftPoint;
172 HepPoint3D _rightPoint;
173 int _lr;
174 double _u;
175 double _v;
176
177 //truth
178 HepPoint3D _truthPoint;
179 double _truthDrift; // drift distance from truth
180 int _truthId;
181 int _truthlr;
182 double _truthU;
183 double _truthV;
184 double _truthR; //drift in CF
185
186 double _rmid;
187
188 // new method drift circle
189 double CF_drift;
190 vector<CFCir> vec_cfcir;
191
192 //calcu by houghspace
193 double _deltad;
194 double _flightLength;
195
196 //calcu in MC
197 int _cirlist;//0:first circle fisrt half, 1:first circle second half, 2:second circle first half 3: second circle second half, 999: more than 2th circle
198 int _style;
199
200 //cgem
201 static CgemGeomSvc* _cgemGeomSvc;
202 const RecCgemCluster* _clusterPtr;
203
204 //id
205 int _trkid;
206 int _hitid;
207 int _clusterid;
208 TH2D* _hitMap;
209 int _used;
210
211};
212#endif
const Int_t n
void printTruth() const
double calDriftDist(double bunchTime, int ambig) const
HoughHit(const HoughHit &other)
void conformalTrans(double x, double y, double r)
void clearMap()
double driftTime() const
double driftTime(double tof, double z) const
HoughHit(const RecCgemCluster *const cluster)
void printAll() const
void print() const
void makeCir(int n, double phi_begin, double phi_last, double r)
void setTruthInfo(const MdcMcHit *&mcHit)
int slayerType(int layer)
double getConformal_v(double, double, double)
double calDriftDist(double, int, double, double, double) const
HoughHit(const MdcDigi *const digi)
static void setMdcCalibFunSvc(const MdcCalibFunSvc *calibSvc)
void buildMap(int x_bin, double x_min, double x_max, int y_bin, double y_min, double y_max, int nPoint, int charge)
double getConformal_r(double, double, double)
HoughHit & operator=(const HoughHit &other)
double getConformal_u(double, double, double)