BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
HoughHit.h
Go to the documentation of this file.
1#ifndef HOUGHHIT_H
2#define HOUGHHIT_H
3#include "MdcGeom/Constants.h"
7#include "Identifier/MdcID.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
25 public:
26 //construction and destruction
27 HoughHit();
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
HoughHitType
Definition: HoughGlobal.h:23
detectorType
Definition: HoughGlobal.h:18
HepGeom::Point3D< double > HepPoint3D
Definition: HoughHit.h:18
Definition: CFCir.h:3
static const double c
Definition: Constants.h:43
double getR() const
Definition: HoughHit.h:74
HoughHit()
Definition: HoughHit.cxx:19
double getV() const
Definition: HoughHit.h:73
static void setMdcGeomSvc(MdcGeomSvc *geomSvc)
Definition: HoughHit.h:36
void printTruth() const
Definition: HoughHit.cxx:194
double getDeltaD() const
Definition: HoughHit.h:75
const MdcDigi * digi() const
Definition: HoughHit.h:55
double getUTruth() const
Definition: HoughHit.h:93
int getIdTruth() const
Definition: HoughHit.h:91
CFCir getCir(int i) const
Definition: HoughHit.h:48
int getCirList() const
Definition: HoughHit.h:105
void conformalTrans(double x, double y, double r)
Definition: HoughHit.cxx:129
void setFltLen(double flt)
Definition: HoughHit.h:102
double getFltLen() const
Definition: HoughHit.h:76
int getSlayerType() const
Definition: HoughHit.h:64
double driftTime() const
Definition: HoughHit.cxx:145
double getZTruth() const
Definition: HoughHit.h:89
static void setBunchTime(double t0)
Definition: HoughHit.h:37
double getDriftDist() const
Definition: HoughHit.h:69
HepPoint3D getWestPoint() const
Definition: HoughHit.h:59
double getMidY() const
Definition: HoughHit.h:61
static int _npart
Definition: HoughHit.h:49
void setDeltaD(double d)
Definition: HoughHit.h:101
double getU() const
Definition: HoughHit.h:72
double getXTruth() const
Definition: HoughHit.h:87
const MdcLayer * layer() const
Definition: HoughHit.h:65
int getLrTruth() const
Definition: HoughHit.h:92
HepPoint3D getEastPoint() const
Definition: HoughHit.h:58
void printAll() const
Definition: HoughHit.cxx:191
double getMidX() const
Definition: HoughHit.h:60
HepPoint3D getPointTruth() const
Definition: HoughHit.h:96
void print() const
Definition: HoughHit.cxx:187
double getRTruth() const
Definition: HoughHit.h:95
double getCharge() const
Definition: HoughHit.h:67
int getStyle() const
Definition: HoughHit.h:106
void makeCir(int n, double phi_begin, double phi_last, double r)
Definition: HoughHit.cxx:210
detectorType getDetectorType() const
Definition: HoughHit.h:54
void setTruthInfo(const MdcMcHit *&mcHit)
Definition: HoughHit.cxx:104
int slayerType(int layer)
Definition: HoughHit.cxx:198
double getConformal_v(double, double, double)
Definition: HoughHit.cxx:138
double calDriftDist(double, int, double, double, double) const
Definition: HoughHit.cxx:167
HoughHitType type() const
Definition: HoughHit.h:53
double getDriftDistTruth() const
Definition: HoughHit.h:90
static void setMdcCalibFunSvc(const MdcCalibFunSvc *calibSvc)
Definition: HoughHit.h:35
HepPoint3D getMidPoint() const
Definition: HoughHit.h:57
double getDriftTime() const
Definition: HoughHit.h:68
int getLayerId() const
Definition: HoughHit.h:62
double getVTruth() const
Definition: HoughHit.h:94
void setCirList(int cir)
Definition: HoughHit.h:107
void setStyle(int sty)
Definition: HoughHit.h:108
int getWireId() const
Definition: HoughHit.h:63
double getBunchTime() const
Definition: HoughHit.h:56
double getYTruth() const
Definition: HoughHit.h:88
double getConformal_r(double, double, double)
Definition: HoughHit.cxx:141
const MdcSWire * wire() const
Definition: HoughHit.h:66
HoughHit & operator=(const HoughHit &other)
Definition: HoughHit.cxx:79
double getConformal_u(double, double, double)
Definition: HoughHit.cxx:135
double y[1000]
Definition: Event.h:21