BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-13/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#ifndef ENABLE_BACKWARDS_COMPATIBILITY
17// backwards compatibility will be enabled ONLY in CLHEP 1.9
19#endif
20
21using namespace Event;
22//using CLHEP::HepGeom;
23
24class HoughHit{
25 public:
26 //construction and destruction
28 HoughHit(const MdcDigi* const digi);
29 HoughHit(const HoughHit& other);
30 HoughHit& operator=(const HoughHit& other);
31
32 //set truth info
33 void setTruthInfo(const MdcMcHit*& mcHit);
34 //set static number
35 static void setMdcCalibFunSvc(const MdcCalibFunSvc* calibSvc){_calibPtr = calibSvc;}
36 static void setMdcGeomSvc(MdcGeomSvc* geomSvc){_mdcGeomSvc = geomSvc;}
37 static void setBunchTime(double t0) {_bunchTime=t0;}
38
39
40 // CF transform
41 void conformalTrans(double x,double y,double r); //return x or y
42 double getConformal_u(double ,double , double);
43 double getConformal_v(double ,double , double);
44 double getConformal_r(double ,double , double);
45
46 //CF transform -> make circle
47 void makeCir(int n,double phi_begin,double phi_last ,double r);
48 CFCir getCir( int i) const {return vec_cfcir[i];}
49 static int _npart;
50
51
52 //get mdc
53 HoughHitType type() const {return _type;}
54 detectorType getDetectorType() const {return _detectorType;}
55 const MdcDigi* digi()const {return _digiPtr;}
56 double getBunchTime() const {return _bunchTime;}
57 HepPoint3D getMidPoint() const {return _midPoint;}
58 HepPoint3D getEastPoint() const {return _eastPoint;}
59 HepPoint3D getWestPoint() const {return _westPoint;}
60 double getMidX() const {return _midPoint.x();}
61 double getMidY() const {return _midPoint.y();}
62 int getLayerId() const {return _layer;}
63 int getWireId() const {return _wire;}
64 int getSlayerType()const {return _slayerType;}
65 const MdcLayer* layer() const { return _layerPtr; }
66 const MdcSWire* wire () const { return _wirePtr; }
67 double getCharge() const {return _charge;}
68 double getDriftTime() const {return _driftTime;}
69 double getDriftDist() const {return _driftDist;}
70
71 //get hough
72 double getU() const {return _u;}
73 double getV() const {return _v;}
74 double getR() const {return CF_drift;} //drift in CFS
75 double getDeltaD() const { return _deltad; } //l1l2-R+-r
76 double getFltLen() const { return _flightLength; } // R*dtheta
77
78
79 //calculate time and drift
80 double driftTime() const;
81 double driftTime(double tof, double z) const;
82 double calDriftDist(double, int, double, double, double) const;
83 double calDriftDist(double bunchTime, int ambig) const;
84 int slayerType(int layer);
85
86 //truth
87 double getXTruth() const {return _truthPoint.x();}
88 double getYTruth() const {return _truthPoint.y();}
89 double getZTruth() const {return _truthPoint.z();}
90 double getDriftDistTruth() const {return _truthDrift;}
91 int getIdTruth() const {return _truthId;}
92 int getLrTruth() const {return _truthlr;}
93 double getUTruth() const {return _truthU;}
94 double getVTruth() const {return _truthV;}
95 double getRTruth() const {return _truthR;}
96 HepPoint3D getPointTruth() const {return _truthPoint;}
97
98 //--------------------------------------------------------------------//
99
100 //set hough
101 void setDeltaD(double d) { _deltad=d; } //l1l2-R+-r
102 void setFltLen(double flt) {_flightLength= flt;} // R*dtheta
103
104 //calcu in MC
105 int getCirList() const {return _cirlist;}
106 int getStyle() const {return _style;}
107 void setCirList(int cir) {_cirlist=cir;}
108 void setStyle(int sty) {_style=sty;}
109
110 //print
111 void print() const;
112 void printAll() const;
113 void printTruth() const;
114
115 private:
116 double crudeTof() const { return _rmid/Constants::c; }
117
118 HoughHitType _type;
119 detectorType _detectorType;
120
121 static const MdcCalibFunSvc* _calibPtr; // pointer to MdcCalibFunSvc
122 static MdcGeomSvc* _mdcGeomSvc; // pointer to MdcGeomSvc
123 static double _bunchTime; // pointer to MdcGeomSvc
124
125 const MdcDetector* _det; // pointer to MdcDetector
126 const MdcDigi* _digiPtr; // pointer to digi
127 const MdcSWire* _wirePtr; // pointer to digi
128 const MdcLayer* _layerPtr; // pointer to digi
129 Identifier _id; // Mdc Identifier
130 unsigned _layer; // layer number
131 unsigned _wire; // wire number
132 double _rawTime; // raw time, in NANO seconds
133 double _driftTime; // drift time, in NANO seconds
134 double _driftDist; // drift dist, in NANO seconds
135 double _charge; // raw charge, in NANO seconds
136 int _slayerType;
137
138//position
139 HepPoint3D _midPoint;
140 HepPoint3D _eastPoint;
141 HepPoint3D _westPoint;
142 int _lr;
143 double _u;
144 double _v;
145
146 //truth
147 HepPoint3D _truthPoint;
148 double _truthDrift; // drift distance from truth
149 int _truthId;
150 int _truthlr;
151 double _truthU;
152 double _truthV;
153 double _truthR; //drift in CF
154
155 double _rmid;
156
157 // new method drift circle
158 double CF_drift;
159 vector<CFCir> vec_cfcir;
160
161 //calcu by houghspace
162 double _deltad;
163 double _flightLength;
164
165 //calcu in MC
166 int _cirlist;
167 int _style;
168
169};
170#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)
double driftTime() const
double driftTime(double tof, double z) const
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)
double getConformal_r(double, double, double)
HoughHit & operator=(const HoughHit &other)
double getConformal_u(double, double, double)