BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
HoughHit Class Reference

#include <HoughHit.h>

+ Inheritance diagram for HoughHit:

Public Member Functions

 HoughHit ()
 
 HoughHit (const MdcDigi *const digi)
 
 HoughHit (const HoughHit &other)
 
HoughHitoperator= (const HoughHit &other)
 
void setTruthInfo (const MdcMcHit *&mcHit)
 
void conformalTrans (double x, double y, double r)
 
double getConformal_u (double, double, double)
 
double getConformal_v (double, double, double)
 
double getConformal_r (double, double, double)
 
void makeCir (int n, double phi_begin, double phi_last, double r)
 
CFCir getCir (int i) const
 
HoughHitType type () const
 
detectorType getDetectorType () const
 
const MdcDigidigi () const
 
double getBunchTime () const
 
HepPoint3D getMidPoint () const
 
HepPoint3D getEastPoint () const
 
HepPoint3D getWestPoint () const
 
double getMidX () const
 
double getMidY () const
 
int getLayerId () const
 
int getWireId () const
 
int getSlayerType () const
 
const MdcLayerlayer () const
 
const MdcSWirewire () const
 
double getCharge () const
 
double getDriftTime () const
 
double getDriftDist () const
 
double getU () const
 
double getV () const
 
double getR () const
 
double getDeltaD () const
 
double getFltLen () const
 
double driftTime () const
 
double driftTime (double tof, double z) const
 
double calDriftDist (double, int, double, double, double) const
 
double calDriftDist (double bunchTime, int ambig) const
 
int slayerType (int layer)
 
double getXTruth () const
 
double getYTruth () const
 
double getZTruth () const
 
double getDriftDistTruth () const
 
int getIdTruth () const
 
int getLrTruth () const
 
double getUTruth () const
 
double getVTruth () const
 
double getRTruth () const
 
HepPoint3D getPointTruth () const
 
void setDeltaD (double d)
 
void setFltLen (double flt)
 
int getCirList () const
 
int getStyle () const
 
void setCirList (int cir)
 
void setStyle (int sty)
 
void print () const
 
void printAll () const
 
void printTruth () const
 

Static Public Member Functions

static void setMdcCalibFunSvc (const MdcCalibFunSvc *calibSvc)
 
static void setMdcGeomSvc (MdcGeomSvc *geomSvc)
 
static void setBunchTime (double t0)
 

Static Public Attributes

static int _npart =360
 

Detailed Description

Definition at line 24 of file HoughHit.h.

Constructor & Destructor Documentation

◆ HoughHit() [1/3]

HoughHit::HoughHit ( )

Definition at line 19 of file HoughHit.cxx.

19 {
20 _det=Global::m_gm;
21 _digiPtr=NULL;
22 _layerPtr=NULL;
23 _wirePtr=NULL;
24}
#define NULL
const MdcDetector * m_gm
Definition: HoughGlobal.cxx:3

◆ HoughHit() [2/3]

HoughHit::HoughHit ( const MdcDigi *const  digi)

Definition at line 25 of file HoughHit.cxx.

25 {
26 _det= Global::m_gm;
27 _digiPtr=aDigi;
28 _id = aDigi->identify();
29 _layer = MdcID::layer(_id);
30 _wire = MdcID::wire(_id);
31 _layerPtr = _det->Layer(_id);
32 _wirePtr = _det->Wire(_id);
33 _rawTime = RawDataUtil::MdcTime(_digiPtr->getTimeChannel());
34 _charge = _digiPtr->getChargeChannel();
35 _driftTime = driftTime();
36 _driftDist = calDriftDist(_bunchTime,0);
37 _slayerType=slayerType(_layer);
38 _lr = 0;
39 _rmid = _wirePtr->rMid();
40
41 assert(_mdcGeomSvc!=NULL);
42 const MdcGeoWire* wire = _mdcGeomSvc->Wire(_layer,_wire);
43 assert(wire!=NULL);
44 HepPoint3D eastP = wire->Backward()/10.;
45 HepPoint3D westP = wire->Forward()/10.;
46 _eastPoint = eastP;
47 _westPoint = westP;
48 _midPoint = (eastP+westP)/2.;
49
50 _type = MIDPOINT;
51 conformalTrans( _midPoint.x(), _midPoint.y(),_driftDist);
52}
@ MIDPOINT
Definition: HoughGlobal.h:25
void conformalTrans(double x, double y, double r)
Definition: HoughHit.cxx:129
double driftTime() const
Definition: HoughHit.cxx:145
int slayerType(int layer)
Definition: HoughHit.cxx:198
double calDriftDist(double, int, double, double, double) const
Definition: HoughHit.cxx:167
const MdcSWire * wire() const
Definition: HoughHit.h:66
const MdcLayer * Layer(unsigned id) const
Definition: MdcDetector.h:33
const MdcSWire * Wire(unsigned id) const
Definition: MdcDetector.h:28
const MdcGeoWire *const Wire(unsigned id)
Definition: MdcGeomSvc.cxx:768
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
Definition: MdcID.cxx:49
static int wire(const Identifier &id)
Definition: MdcID.cxx:54
double rMid(void) const
Definition: MdcSWire.h:50
static double MdcTime(int timeChannel)
Definition: RawDataUtil.h:8
unsigned int getChargeChannel() const
Definition: RawData.cxx:45
unsigned int getTimeChannel() const
Definition: RawData.cxx:40

◆ HoughHit() [3/3]

HoughHit::HoughHit ( const HoughHit other)

Definition at line 54 of file HoughHit.cxx.

54 :
55 _digiPtr(other._digiPtr),
56 _det(other._det),
57 _layerPtr(other._layerPtr), _wirePtr(other._wirePtr), _id(other._id),
58 _layer(other._layer), _wire(other._wire),
59 _rawTime(other._rawTime), _charge(other._charge),
60 _eastPoint(other._eastPoint),_westPoint(other._westPoint),_midPoint(other._midPoint),
61 _u(other._u),_v(other._v),
62 _type(other._type),_detectorType(other._detectorType),
63 _rmid(other._rmid), _slayerType(other._slayerType),
64 _cirlist(other._cirlist),_style(other._style),
65 _driftTime(other._driftTime), _driftDist(other._driftDist),
66 CF_drift(other.CF_drift),
67 vec_cfcir(other.vec_cfcir),
68 //truth
69 _truthU(other._truthU),
70 _truthV(other._truthV),
71 _truthR(other._truthR),
72 _truthlr(other._truthlr),
73 _truthPoint(other._truthPoint),
74 _truthDrift(other._truthDrift),
75 _deltad(other._deltad),
76 _flightLength(other._flightLength)
77 { }

Member Function Documentation

◆ calDriftDist() [1/2]

double HoughHit::calDriftDist ( double  bunchTime,
int  ambig 
) const

Definition at line 161 of file HoughHit.cxx.

161 {
162
163 // double crudeTof = 0; //FIXME
164 return calDriftDist(bunchTime+crudeTof(), ambig, 0., 0., 0. );
165}

◆ calDriftDist() [2/2]

double HoughHit::calDriftDist ( double  tof,
int  ambig,
double  entranceAngle,
double  ,
double  z 
) const

Definition at line 167 of file HoughHit.cxx.

167 {
168
169 double driftD;
170 //drift time ns, layer id begin with 0, entrance angle rads,
171 //lr ambig: wire ambig 1,-1,0 -> Calib 0,1,2
172 int lrCalib=2;
173 if (ambig==1) lrCalib = 0;
174 else if (ambig==-1) lrCalib = 1;
175
176 // tof in s, driftDist in cm, dirftTime in ns
177 if (fabs(z)>150. || fabs(driftTime(tof,z))>1500.){
178 return 9999.;
179 }
180 driftD = 0.1 * _calibPtr->driftTimeToDist(driftTime(tof,z),_layer,_wire,lrCalib,entranceAngle);//to cm
181 //std::cout<<"driftDist "<<"("<<_layer <<","<<_wire <<") dd "<<driftD<<" dt "<<driftTime(tof,z) <<" lr "<<lrCalib <<" eAng "<<entranceAngle <<" tof "<<tof*1.e9<<" z "<<z <<" t0walk "<<_T0Walk<<" rawT "<<_rawTime <<" tprop "<< _rawTime - driftTime(tof,z)- _T0Walk-1.e9*tof<<std::endl;
182
183 if (abs(driftD)<0.00001) driftD = 0.00001;
184 return driftD;
185}
double driftTimeToDist(double drifttime, int layid, int cellid, int lr, double entrance=0.0) const

Referenced by calDriftDist(), and HoughHit().

◆ conformalTrans()

void HoughHit::conformalTrans ( double  x,
double  y,
double  r 
)

Definition at line 129 of file HoughHit.cxx.

129 {
130 _u = 2*x/(x*x+y*y-r*r);
131 _v = 2*y/(x*x+y*y-r*r);
132 CF_drift = 2*r/(x*x+y*y-r*r);
133}
Double_t x[10]
double y[1000]

Referenced by HoughHit().

◆ digi()

const MdcDigi * HoughHit::digi ( ) const
inline

Definition at line 55 of file HoughHit.h.

55{return _digiPtr;}

Referenced by HoughTrack::cald_layer(), printAll(), and HoughHitList::remove().

◆ driftTime() [1/2]

double HoughHit::driftTime ( ) const

Definition at line 145 of file HoughHit.cxx.

145 {
146 double tprop = _calibPtr->getTprop(_layer,0);
147 double T0Walk = _calibPtr->getT0(_layer,_wire) + _calibPtr->getTimeWalk(_layer, _charge);
148 //tof in ns, driftTime in ns, _T0Walk in ns
149 double driftT = _rawTime - T0Walk - 1.e9*_bunchTime- tprop;
150 return driftT;
151}
double getT0(int layid, int cellid) const
double getTprop(int lay, double z) const
double getTimeWalk(int layid, double Q) const

Referenced by HoughHitList::addMdcDigiList(), calDriftDist(), HoughTrack::find_pair_hit(), HoughTrack::find_stereo_hit(), and HoughHit().

◆ driftTime() [2/2]

double HoughHit::driftTime ( double  tof,
double  z 
) const

Definition at line 152 of file HoughHit.cxx.

152 {
153 double tprop = _calibPtr->getTprop(_layer,z*10.);
154 double T0Walk = _calibPtr->getT0(_layer,_wire) + _calibPtr->getTimeWalk(_layer, _charge);
155 //tof in ns, driftTime in ns, _T0Walk in ns
156 double driftT = _rawTime - T0Walk - 1.e9*tof - tprop;
157
158 return driftT;
159}

◆ getBunchTime()

double HoughHit::getBunchTime ( ) const
inline

Definition at line 56 of file HoughHit.h.

56{return _bunchTime;}

◆ getCharge()

double HoughHit::getCharge ( ) const
inline

Definition at line 67 of file HoughHit.h.

67{return _charge;}

◆ getCir()

CFCir HoughHit::getCir ( int  i) const
inline

Definition at line 48 of file HoughHit.h.

48{return vec_cfcir[i];}

◆ getCirList()

int HoughHit::getCirList ( ) const
inline

Definition at line 105 of file HoughHit.h.

105{return _cirlist;}

Referenced by HoughTrack::cald_layer(), and HoughMap::select_slant().

◆ getConformal_r()

double HoughHit::getConformal_r ( double  x,
double  y,
double  r 
)

Definition at line 141 of file HoughHit.cxx.

141 {
142 return 2*r/(x*x+y*y-r*r);
143}

Referenced by setTruthInfo().

◆ getConformal_u()

double HoughHit::getConformal_u ( double  x,
double  y,
double  r 
)

Definition at line 135 of file HoughHit.cxx.

135 {
136 return 2*x/(x*x+y*y-r*r);
137}

Referenced by setTruthInfo().

◆ getConformal_v()

double HoughHit::getConformal_v ( double  x,
double  y,
double  r 
)

Definition at line 138 of file HoughHit.cxx.

138 {
139 return 2*x/(x*x+y*y-r*r);
140}

Referenced by setTruthInfo().

◆ getDeltaD()

double HoughHit::getDeltaD ( ) const
inline

Definition at line 75 of file HoughHit.h.

75{ return _deltad; } //l1l2-R+-r

◆ getDetectorType()

detectorType HoughHit::getDetectorType ( ) const
inline

Definition at line 54 of file HoughHit.h.

54{return _detectorType;}

◆ getDriftDist()

double HoughHit::getDriftDist ( ) const
inline

Definition at line 69 of file HoughHit.h.

69{return _driftDist;}

Referenced by HoughStereo::cald(), HoughTrack::cald_layer(), and HoughPeak::collectHits().

◆ getDriftDistTruth()

double HoughHit::getDriftDistTruth ( ) const
inline

Definition at line 90 of file HoughHit.h.

90{return _truthDrift;}

◆ getDriftTime()

double HoughHit::getDriftTime ( ) const
inline

Definition at line 68 of file HoughHit.h.

68{return _driftTime;}

◆ getEastPoint()

HepPoint3D HoughHit::getEastPoint ( ) const
inline

Definition at line 58 of file HoughHit.h.

58{return _eastPoint;}

Referenced by HoughStereo::cald().

◆ getFltLen()

double HoughHit::getFltLen ( ) const
inline

Definition at line 76 of file HoughHit.h.

76{ return _flightLength; } // R*dtheta

◆ getIdTruth()

int HoughHit::getIdTruth ( ) const
inline

Definition at line 91 of file HoughHit.h.

91{return _truthId;}

◆ getLayerId()

int HoughHit::getLayerId ( ) const
inline

◆ getLrTruth()

int HoughHit::getLrTruth ( ) const
inline

Definition at line 92 of file HoughHit.h.

92{return _truthlr;}

◆ getMidPoint()

HepPoint3D HoughHit::getMidPoint ( ) const
inline

Definition at line 57 of file HoughHit.h.

57{return _midPoint;}

◆ getMidX()

double HoughHit::getMidX ( ) const
inline

Definition at line 60 of file HoughHit.h.

60{return _midPoint.x();}

Referenced by HoughTrack::cald_layer(), and HoughPeak::collectHits().

◆ getMidY()

double HoughHit::getMidY ( ) const
inline

Definition at line 61 of file HoughHit.h.

61{return _midPoint.y();}

Referenced by HoughTrack::cald_layer(), and HoughPeak::collectHits().

◆ getPointTruth()

HepPoint3D HoughHit::getPointTruth ( ) const
inline

Definition at line 96 of file HoughHit.h.

96{return _truthPoint;}

◆ getR()

double HoughHit::getR ( ) const
inline

Definition at line 74 of file HoughHit.h.

74{return CF_drift;} //drift in CFS

◆ getRTruth()

double HoughHit::getRTruth ( ) const
inline

Definition at line 95 of file HoughHit.h.

95{return _truthR;}

◆ getSlayerType()

int HoughHit::getSlayerType ( ) const
inline

◆ getStyle()

int HoughHit::getStyle ( ) const
inline

Definition at line 106 of file HoughHit.h.

106{return _style;}

Referenced by HoughTrack::cald_layer(), HoughStereo::print(), and HoughMap::select_slant().

◆ getU()

double HoughHit::getU ( ) const
inline

Definition at line 72 of file HoughHit.h.

72{return _u;}

Referenced by HoughMap::select_slant().

◆ getUTruth()

double HoughHit::getUTruth ( ) const
inline

Definition at line 93 of file HoughHit.h.

93{return _truthU;}

Referenced by HoughTrack::cald_layer().

◆ getV()

double HoughHit::getV ( ) const
inline

Definition at line 73 of file HoughHit.h.

73{return _v;}

Referenced by HoughMap::select_slant().

◆ getVTruth()

double HoughHit::getVTruth ( ) const
inline

Definition at line 94 of file HoughHit.h.

94{return _truthV;}

Referenced by HoughTrack::cald_layer().

◆ getWestPoint()

HepPoint3D HoughHit::getWestPoint ( ) const
inline

Definition at line 59 of file HoughHit.h.

59{return _westPoint;}

Referenced by HoughStereo::cald().

◆ getWireId()

int HoughHit::getWireId ( ) const
inline

Definition at line 63 of file HoughHit.h.

63{return _wire;}

Referenced by HoughTrack::find_pair_hit(), HoughTrack::find_stereo_hit(), HoughStereo::print(), and small_layer().

◆ getXTruth()

double HoughHit::getXTruth ( ) const
inline

Definition at line 87 of file HoughHit.h.

87{return _truthPoint.x();}

◆ getYTruth()

double HoughHit::getYTruth ( ) const
inline

Definition at line 88 of file HoughHit.h.

88{return _truthPoint.y();}

◆ getZTruth()

double HoughHit::getZTruth ( ) const
inline

Definition at line 89 of file HoughHit.h.

89{return _truthPoint.z();}

◆ layer()

const MdcLayer * HoughHit::layer ( ) const
inline

Definition at line 65 of file HoughHit.h.

65{ return _layerPtr; }

Referenced by slayerType().

◆ makeCir()

void HoughHit::makeCir ( int  n,
double  phi_begin,
double  phi_last,
double  r 
)

Definition at line 210 of file HoughHit.cxx.

210 {
211 vec_cfcir.clear();
212 vector<CFCir>().swap(vec_cfcir);
213 for(int i =0; i<n; i++){
214 double phi_slice = (phi_last-phi_begin)/n;
215 double phi = phi_begin + (1/2.+i)*phi_slice;
216 double x = _u + r*cos(phi);
217 double y = _v + r*sin(phi);
218 vec_cfcir.push_back( CFCir(x,y,phi,n,_u,_v,r) );
219 }
220}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
const Int_t n
Definition: CFCir.h:3

◆ operator=()

HoughHit & HoughHit::operator= ( const HoughHit other)

Definition at line 79 of file HoughHit.cxx.

79 {
80 _digiPtr=(other._digiPtr);
81 _det=(other._det);
82 _layerPtr=(other._layerPtr); _wirePtr=(other._wirePtr); _id=(other._id);
83 _layer=(other._layer); _wire=(other._wire);
84 _rawTime=(other._rawTime); _charge=(other._charge);
85 _eastPoint=(other._eastPoint);_westPoint=(other._westPoint);_midPoint=(other._midPoint);
86 _u=(other._u);_v=(other._v);
87 _type=(other._type);_detectorType=(other._detectorType);
88 _rmid=(other._rmid); _slayerType=(other._slayerType);
89 _cirlist=(other._cirlist);_style=(other._style);
90 _driftTime=(other._driftTime); _driftDist=(other._driftDist);
91 CF_drift = (other.CF_drift);
92 vec_cfcir = (other.vec_cfcir);
93 //truth
94 _truthU= (other._truthU);
95 _truthV= (other._truthV);
96 _truthR= (other._truthR);
97 _truthlr= (other._truthlr);
98 _truthDrift= (other._truthDrift);
99 _truthPoint= (other._truthPoint);
100 _deltad= (other._deltad);
101 _flightLength= (other._flightLength);
102}

Referenced by HoughRecHit::operator=().

◆ print()

void HoughHit::print ( ) const

Definition at line 187 of file HoughHit.cxx.

187 {
188 std::cout<<"("<<_layer<<","<<_wire<<") "<<std::endl;
189}

◆ printAll()

void HoughHit::printAll ( ) const

Definition at line 191 of file HoughHit.cxx.

191 {
192 std::cout<<"("<<_layer<<","<<_wire<<") id "<<this->digi()->getTrackIndex()<<" xyz "<<_midPoint<<endl;
193}
const MdcDigi * digi() const
Definition: HoughHit.h:55
int getTrackIndex() const
Definition: RawData.cxx:50

◆ printTruth()

void HoughHit::printTruth ( ) const

Definition at line 194 of file HoughHit.cxx.

194 {
195 std::cout<<"("<<_layer<<","<<_wire<<") truth "<<_truthId<<" xyz "<<_truthPoint<<" uv "<<_truthU<<","<<_truthV<<") "<<" cir list "<<_cirlist<<" ambig "<<_truthlr<<std::endl;
196}

◆ setBunchTime()

static void HoughHit::setBunchTime ( double  t0)
inlinestatic

Definition at line 37 of file HoughHit.h.

37{_bunchTime=t0;}

Referenced by MdcHoughFinder::execute(), and MdcHoughFinder::initialize().

◆ setCirList()

void HoughHit::setCirList ( int  cir)
inline

Definition at line 107 of file HoughHit.h.

107{_cirlist=cir;}

◆ setDeltaD()

void HoughHit::setDeltaD ( double  d)
inline

Definition at line 101 of file HoughHit.h.

101{ _deltad=d; } //l1l2-R+-r

Referenced by HoughTrack::cald_layer().

◆ setFltLen()

void HoughHit::setFltLen ( double  flt)
inline

Definition at line 102 of file HoughHit.h.

102{_flightLength= flt;} // R*dtheta

Referenced by HoughTrack::cald_layer().

◆ setMdcCalibFunSvc()

static void HoughHit::setMdcCalibFunSvc ( const MdcCalibFunSvc calibSvc)
inlinestatic

Definition at line 35 of file HoughHit.h.

35{_calibPtr = calibSvc;}

Referenced by MdcHoughFinder::initialize().

◆ setMdcGeomSvc()

static void HoughHit::setMdcGeomSvc ( MdcGeomSvc geomSvc)
inlinestatic

Definition at line 36 of file HoughHit.h.

36{_mdcGeomSvc = geomSvc;}

Referenced by MdcHoughFinder::initialize().

◆ setStyle()

void HoughHit::setStyle ( int  sty)
inline

Definition at line 108 of file HoughHit.h.

108{_style=sty;}

◆ setTruthInfo()

void HoughHit::setTruthInfo ( const MdcMcHit *&  mcHit)

Definition at line 104 of file HoughHit.cxx.

104 {
105 if(!aMcHit) return;
106 _truthDrift = aMcHit->getDriftDistance()/10.;//mm to cm
107 _truthPoint.setX(aMcHit->getPositionX()/10.);//mm to cm
108 _truthPoint.setY(aMcHit->getPositionY()/10.);
109 _truthPoint.setZ(aMcHit->getPositionZ()/10.);
110
111 int mcLR = aMcHit->getPositionFlag();
112// if (mcLR == 0) mcLR = -1;//FIXME
113// for truth reserve from digi
114 if (mcLR == 1) mcLR = -1;//
115 if (mcLR == 0) mcLR = 1;//
116 _truthId = aMcHit->getTrackIndex();
117 _truthlr = mcLR;
118
119//fix
120 _truthU = getConformal_u( _truthPoint.x(), _truthPoint.y(), _truthDrift );
121 _truthV = getConformal_v( _truthPoint.y(), _truthPoint.x(), _truthDrift );
122 _truthR = getConformal_r( _truthPoint.x(), _truthPoint.y(), _truthDrift );
123
124 //std::cout<<__FILE__<<" "<<_layer<<","<<_wire<<" "<<_truthId<<" truth "<<_truthPoint<<" truthU "<<_truthU<<std::endl;
125
126 _type = DIGIWITHTRUTH;
127}
@ DIGIWITHTRUTH
Definition: HoughGlobal.h:24
double getConformal_v(double, double, double)
Definition: HoughHit.cxx:138
double getConformal_r(double, double, double)
Definition: HoughHit.cxx:141
double getConformal_u(double, double, double)
Definition: HoughHit.cxx:135

◆ slayerType()

int HoughHit::slayerType ( int  layer)

Definition at line 198 of file HoughHit.cxx.

198 {
199 //get nominal shift cell of this layer
200 double nomShift= _mdcGeomSvc->Layer(layer)->nomShift();
201
202 if(nomShift>0) return 1;
203 else if(nomShift<0) return -1;
204 else return 0;
205
206 return -999;
207}
const MdcLayer * layer() const
Definition: HoughHit.h:65
double nomShift(void) const
Definition: MdcGeoLayer.h:169
const MdcGeoLayer *const Layer(unsigned id)
Definition: MdcGeomSvc.cxx:784

Referenced by HoughHit().

◆ type()

HoughHitType HoughHit::type ( ) const
inline

Definition at line 53 of file HoughHit.h.

53{return _type;}

◆ wire()

const MdcSWire * HoughHit::wire ( ) const
inline

Definition at line 66 of file HoughHit.h.

66{ return _wirePtr; }

Referenced by HoughHit().

Member Data Documentation

◆ _npart

int HoughHit::_npart =360
static

Definition at line 49 of file HoughHit.h.

Referenced by MdcHoughFinder::initialize().


The documentation for this class was generated from the following files: