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