CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
HoughHit Class Reference

#include <HoughHit.h>

Public Types

enum  HitType { CGEMHIT = 0 , MDCHIT = 1 , CGEMMCHIT = 2 , MDCMCHIT = 3 }
 
typedef std::pair< double, double > S_Z
 

Public Member Functions

 HoughHit ()
 
 HoughHit (const MdcDigi *mdcDigi, double bunchTime, int hitID)
 
 HoughHit (const RecCgemCluster *cgemCgemCluster, double bunchTime, int hitID)
 
 HoughHit (const MdcMcHit *mdcMcHit, double bunchTime, int hitID)
 
 HoughHit (const CgemMcHit *cgemMcHit, double bunchTime, int hitID)
 
 HoughHit (const HoughHit &other)
 
HoughHitoperator= (const HoughHit &other)
 
int getHitID () const
 
HitType getHitType () const
 
const RecCgemClustergetCgemCluster () const
 
const MdcDigigetDigi () const
 
const CgemMcHitgetCgemMcHit () const
 
const MdcMcHitgetMdcMcHit () const
 
int getLayer () const
 
int getWire () const
 
int getFlag () const
 
double getBunchTime () const
 
double getRawTime () const
 
double getDepositEnergy () const
 
HepPoint3D getHitPosition () const
 
HepPoint3D getWestPoint () const
 
HepPoint3D getEastPoint () const
 
double getDriftDist () const
 
double getResidual () const
 
vector< int > getTrkID () const
 
vector< HoughTrack * > getTrkPntVec ()
 
int getUse () const
 
vector< S_ZgetSZ () const
 
MdcGeomSvcgetMdcGeomSvc () const
 
MdcCalibFunSvcgetMdcCalibFunSvc () const
 
CgemGeomSvcgetCgemGeomSvc () const
 
CgemCalibFunSvcgetCgemCalibFunSvc () const
 
int getHalfCircle ()
 
HoughHitgetPairHit ()
 
void setHitID (int hitID)
 
void setHitType (HitType hitType)
 
void setCgemCluster (const RecCgemCluster *cgemCluster)
 
void setDigi (const MdcDigi *mdcDigi)
 
void setCgemMcHit (const CgemMcHit *cgemMcHit)
 
void setMdcMcHit (const MdcMcHit *mdcMcHit)
 
void setLayer (int layer)
 
void setWire (int wire)
 
void setFlag (int flag)
 
void setUse (int use)
 
void setBunchTime (double bunchTime)
 
void setRawTime (double rawTime)
 
void setDepositEnergy (double depositEnergy)
 
void setHitPosition (HepPoint3D point)
 
void setDriftDist (double driftDist)
 
void setResidual (double residual)
 
void setTrkID (vector< int > trkID)
 
void setSZ (vector< S_Z > sz)
 
void resetSZ ()
 
void addTrkID (int trkID)
 
void addSZ (S_Z sz)
 
void addTrkPnt (HoughTrack *aHTrk)
 
void rmTrkPnt (HoughTrack *aHTrk)
 
void clearTrkPnt ()
 
void dropTrkID (int trkID)
 
void addResid (double res)
 
vector< double > getVecResid ()
 
void setPairHit (HoughHit *pairHit)
 
void setHalfCircle (int halfCircle)
 
void addPosition (HepPoint3D position)
 
void print ()
 
double driftTime ()
 
double hitSigma ()
 
vector< HepPoint3D > & VHitPosition (HoughTrack *track)
 
double residual (HoughTrack *track)
 

 
void updateVHit (HoughTrack *track)
 
double residual (HoughTrack *track, HepPoint3D &positionOntrack, HepPoint3D &positionOnDetector)
 
int attach2NTrack ()
 
MdcHitgetMdcHit ()
 
void setMdcHit (MdcHit *mdcHit)
 

Static Public Member Functions

static void setMdcGeomSvc (MdcGeomSvc *mdcGeomSvc)
 
static void setMdcCalibFunSvc (MdcCalibFunSvc *mdcCalibFunSvc)
 
static void setCgemGeomSvc (CgemGeomSvc *cgemGeomSvc)
 
static void setCgemCalibFunSvc (CgemCalibFunSvc *cgemCalibFunSvc)
 
static void setMdcDetector (const MdcDetector *mdcDetector)
 

Detailed Description

Definition at line 24 of file HoughHit.h.

Member Typedef Documentation

◆ S_Z

typedef std::pair<double,double> HoughHit::S_Z

Definition at line 28 of file HoughHit.h.

Member Enumeration Documentation

◆ HitType

Enumerator
CGEMHIT 
MDCHIT 
CGEMMCHIT 
MDCMCHIT 

Definition at line 27 of file HoughHit.h.

27{CGEMHIT = 0, MDCHIT = 1, CGEMMCHIT = 2, MDCMCHIT = 3};
@ CGEMMCHIT
Definition: HoughHit.h:27
@ MDCMCHIT
Definition: HoughHit.h:27

Constructor & Destructor Documentation

◆ HoughHit() [1/6]

HoughHit::HoughHit ( )

Definition at line 20 of file HoughHit.cxx.

20 {
21 //m_det=Global::m_gm;
22 m_cgemCluster=NULL;
23 m_mdcDigi=NULL;
24 m_cgemMcHit=NULL;
25 m_mdcMcHit=NULL;
26 //m_hitMap = NULL;
27}

◆ HoughHit() [2/6]

HoughHit::HoughHit ( const MdcDigi mdcDigi,
double  bunchTime,
int  hitID 
)

Definition at line 29 of file HoughHit.cxx.

30{
31 m_hitID = hitID;
32 m_hitType = MDCHIT;
33 m_cgemCluster = NULL;
34 m_mdcDigi = mdcDigi;
35 m_cgemMcHit=NULL;
36 m_mdcMcHit=NULL;
37 m_layer = MdcID::layer(mdcDigi->identify());
38 m_wire = MdcID::wire(mdcDigi->identify());
39 m_flag = flag();
40 m_use = 0;
41 m_bunchTime = bunchTime;
42 m_rawTime = RawDataUtil::MdcTime(mdcDigi->getTimeChannel());
43 m_depositEnergy = mdcDigi->getChargeChannel();
44 const MdcGeoWire* wire = m_mdcGeomSvc->Wire(m_layer,m_wire);
45 m_hitPosition = (wire->Forward() + wire->Backward())/10/2;
46 m_westPoint = wire->Forward();
47 m_eastPoint = wire->Backward();
48 m_driftDist = driftDistance();
49 m_residual = 9999;
50 //m_hitMap = NULL;
51 //m_sLeft = 0;
52 //m_zLeft = 0;
53 //m_sRight = 0;
54 //m_zRight = 0;
55 m_trkID.clear();
56 m_sz.clear();
57 m_pairHit = NULL;
58 m_halfCircle = 0;
59 m_position.clear();
60 m_mdcHit = NULL;
61 //MdcHit mdcHit = *(new MdcHit(m_mdcDigi,m_mdcDetector));
62 //mdcHit.setCalibSvc(m_mdcCalibFunSvc);
63 //mdcHit.setCountPropTime(true);
64}
@ MDCHIT
Definition: HoughHit.h:27
HepPoint3D Forward(void) const
Definition: MdcGeoWire.h:129
HepPoint3D Backward(void) const
Definition: MdcGeoWire.h:128
const MdcGeoWire *const Wire(unsigned id)
Definition: MdcGeomSvc.cxx:770
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
static double MdcTime(int timeChannel)
Definition: RawDataUtil.h:8
virtual Identifier identify() const
Definition: RawData.cxx:15
unsigned int getChargeChannel() const
Definition: RawData.cxx:45
unsigned int getTimeChannel() const
Definition: RawData.cxx:40

◆ HoughHit() [3/6]

HoughHit::HoughHit ( const RecCgemCluster cgemCgemCluster,
double  bunchTime,
int  hitID 
)

Definition at line 66 of file HoughHit.cxx.

67{
68 m_hitID = hitID;
69 m_hitType = CGEMHIT;
70 m_cgemCluster = cgemCluster;
71 m_mdcDigi=NULL;
72 m_cgemMcHit=NULL;
73 m_mdcMcHit=NULL;
74 m_layer = cgemCluster->getlayerid();
75 m_wire = cgemCluster->getsheetid();
76 //m_wire = cgemCluster->getclusterid();
77 //m_wire = -1;
78 m_flag = cgemCluster->getflag();
79 m_use = 0;
80 m_bunchTime = bunchTime;
81 m_rawTime = 0; //FIXME
82 m_depositEnergy = cgemCluster->getenergydeposit(); //FIXME
83 m_hitPosition.setX((m_cgemGeomSvc->getCgemLayer(m_layer)->getMiddleROfGapD()/10.)*cos(cgemCluster->getrecphi()));
84 m_hitPosition.setY((m_cgemGeomSvc->getCgemLayer(m_layer)->getMiddleROfGapD()/10.)*sin(cgemCluster->getrecphi()));
85 m_hitPosition.setZ(cgemCluster->getRecZ()/10.);
86 m_westPoint = HepPoint3D(0,0,0);
87 m_eastPoint = HepPoint3D(0,0,0);
88 m_driftDist = 0;
89 m_residual = 9999;
90 //m_hitMap = NULL;
91 //m_sLeft = 0;
92 //m_zLeft = 0;
93 //m_sRight = 0;
94 //m_zRight = 0;
95 m_trkID.clear();
96 m_sz.clear();
97 m_pairHit = NULL;
98 m_halfCircle = 0;
99 m_position.clear();
100 m_mdcHit = NULL;
101}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
HepGeom::Point3D< double > HepPoint3D
Definition: Gam4pikp.cxx:37
double getMiddleROfGapD() const
Definition: CgemGeoLayer.h:105
CgemGeoLayer * getCgemLayer(int i) const
Definition: CgemGeomSvc.h:48
@ CGEMHIT
Definition: HoughHit.h:27

◆ HoughHit() [4/6]

HoughHit::HoughHit ( const MdcMcHit mdcMcHit,
double  bunchTime,
int  hitID 
)

Definition at line 103 of file HoughHit.cxx.

104{
105 m_hitID = hitID;
106 m_hitType = MDCMCHIT;
107 m_cgemCluster = NULL;
108 m_mdcDigi = NULL;
109 m_cgemMcHit = NULL;
110 m_mdcMcHit = mdcMcHit;
111 m_layer = MdcID::layer(mdcMcHit->identify());
112 m_wire = MdcID::wire(mdcMcHit->identify());
113 m_flag = flag();
114 m_use = mdcMcHit->getPositionFlag();
115 m_bunchTime = bunchTime;
116 m_rawTime = 0;
117 m_depositEnergy = mdcMcHit->getDepositEnergy();
118 m_hitPosition.setX(mdcMcHit->getPositionX()/10.);
119 m_hitPosition.setY(mdcMcHit->getPositionY()/10.);
120 m_hitPosition.setZ(mdcMcHit->getPositionZ()/10.);
121 m_westPoint = HepPoint3D(0,0,0);
122 m_eastPoint = HepPoint3D(0,0,0);
123 m_driftDist = mdcMcHit->getDriftDistance()/10.;
124 m_residual = 9999;
125 //m_hitMap = NULL;
126 //m_sLeft = 0;
127 //m_zLeft = 0;
128 //m_sRight = 0;
129 //m_zRight = 0;
130 m_trkID.push_back(mdcMcHit->getTrackIndex());
131 //cout<<m_layer<<" "<<mdcMcHit->getTrackIndex()<<endl;
132 m_sz.clear();
133 m_pairHit = NULL;
134 m_halfCircle = 0;
135 m_position.clear();
136 m_mdcHit = NULL;
137}
double getPositionZ() const
Definition: MdcMcHit.cxx:44
int getPositionFlag() const
Definition: MdcMcHit.cxx:59
double getDepositEnergy() const
Definition: MdcMcHit.cxx:54
unsigned int getTrackIndex() const
Definition: MdcMcHit.cxx:29
double getDriftDistance() const
Definition: MdcMcHit.cxx:49
double getPositionX() const
Definition: MdcMcHit.cxx:34
Identifier identify() const
Definition: MdcMcHit.cxx:24
double getPositionY() const
Definition: MdcMcHit.cxx:39

◆ HoughHit() [5/6]

HoughHit::HoughHit ( const CgemMcHit cgemMcHit,
double  bunchTime,
int  hitID 
)

Definition at line 139 of file HoughHit.cxx.

140{
141 m_hitID = hitID;
142 m_hitType = CGEMMCHIT;
143 m_cgemCluster = NULL;
144 m_mdcDigi = NULL;
145 m_cgemMcHit = cgemMcHit;
146 m_mdcMcHit = NULL;
147 m_layer = cgemMcHit->GetLayerID();
148 //m_wire = cgemMcHit->GetParentID();
149 //m_flag = cgemMcHit->GetPDGCode();
150 m_wire = -1;
151 m_flag = 2;
152 m_use = 0;
153 m_bunchTime = bunchTime;
154 m_rawTime = 0;
155 m_depositEnergy = 0;
156 m_hitPosition.setX((cgemMcHit->GetPositionXOfPrePoint()+cgemMcHit->GetPositionXOfPostPoint())/2/10.);
157 m_hitPosition.setY((cgemMcHit->GetPositionYOfPrePoint()+cgemMcHit->GetPositionYOfPostPoint())/2/10.);
158 m_hitPosition.setZ((cgemMcHit->GetPositionZOfPrePoint()+cgemMcHit->GetPositionZOfPostPoint())/2/10.);
159 m_westPoint = HepPoint3D(0,0,0);
160 m_eastPoint = HepPoint3D(0,0,0);
161 m_driftDist = 0;
162 m_residual = 9999;
163 //m_hitMap = NULL;
164 //m_sLeft = 0;
165 //m_zLeft = 0;
166 //m_sRight = 0;
167 //m_zRight = 0;
168 m_trkID.push_back(cgemMcHit->GetTrackID());
169 //cout<<m_layer<<" "<<cgemMcHit->GetTrackID()<<endl;
170 m_sz.clear();
171 m_pairHit = NULL;
172 m_halfCircle = 0;
173 m_position.clear();
174 m_mdcHit = NULL;
175}
double GetPositionXOfPostPoint() const
Definition: CgemMcHit.h:107
double GetPositionYOfPrePoint() const
Definition: CgemMcHit.h:105
double GetPositionZOfPrePoint() const
Definition: CgemMcHit.h:106
int GetTrackID() const
Definition: CgemMcHit.h:97
int GetLayerID() const
Definition: CgemMcHit.h:100
double GetPositionXOfPrePoint() const
Definition: CgemMcHit.h:104
double GetPositionZOfPostPoint() const
Definition: CgemMcHit.h:109
double GetPositionYOfPostPoint() const
Definition: CgemMcHit.h:108

◆ HoughHit() [6/6]

HoughHit::HoughHit ( const HoughHit other)

Definition at line 177 of file HoughHit.cxx.

177 :
178 m_hitID(other.m_hitID),
179 m_hitType(other.m_hitType),
180 m_cgemCluster(other.m_cgemCluster),
181 m_mdcDigi(other.m_mdcDigi),
182 m_cgemMcHit(other.m_cgemMcHit),
183 m_mdcMcHit(other.m_mdcMcHit),
184 m_layer(other.m_layer),
185 m_wire(other.m_wire),
186 m_flag(other.m_flag),
187 m_use(other.m_use),
188 m_bunchTime(other.m_bunchTime),
189 m_rawTime(other.m_rawTime),
190 m_depositEnergy(other.m_depositEnergy),
191 m_hitPosition(other.m_hitPosition),
192 m_westPoint(other.m_westPoint),
193 m_eastPoint(other.m_eastPoint),
194 m_driftDist(other.m_driftDist),
195 m_residual(other.m_residual),
196 //m_hitMap(other.m_hitMap),
197 //m_sLeft(other.m_sLeft),
198 //m_zLeft(other.m_zLeft),
199 //m_sRight(other.m_sRight),
200 //m_zRight(other.m_zRight),
201 m_trkID(other.m_trkID),
202 m_sz(other.m_sz),
203 m_pairHit(other.m_pairHit),
204 m_halfCircle(other.m_halfCircle),
205 m_position(other.m_position),
206 m_mdcHit(other.m_mdcHit)
207{}
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118

Member Function Documentation

◆ addPosition()

void HoughHit::addPosition ( HepPoint3D  position)
inline

Definition at line 118 of file HoughHit.h.

118{m_position.push_back(position);}

◆ addResid()

void HoughHit::addResid ( double  res)
inline

Definition at line 113 of file HoughHit.h.

113{m_vecResid.push_back(res);}

◆ addSZ()

void HoughHit::addSZ ( S_Z  sz)
inline

Definition at line 106 of file HoughHit.h.

106{m_sz.push_back(sz);}

Referenced by HoughTrack::calculateZ_S().

◆ addTrkID()

void HoughHit::addTrkID ( int  trkID)
inline

Definition at line 105 of file HoughHit.h.

105{m_trkID.push_back(trkID);}

◆ addTrkPnt()

void HoughHit::addTrkPnt ( HoughTrack aHTrk)
inline

Definition at line 107 of file HoughHit.h.

107{m_vecTrkPnt.push_back(aHTrk);}

◆ attach2NTrack()

int HoughHit::attach2NTrack ( )
inline

Definition at line 133 of file HoughHit.h.

133{return m_trkID.size();}

◆ clearTrkPnt()

void HoughHit::clearTrkPnt ( )
inline

Definition at line 109 of file HoughHit.h.

109{m_vecTrkPnt.clear();}

◆ driftTime()

double HoughHit::driftTime ( )

Definition at line 296 of file HoughHit.cxx.

297{
298 double ToF = 1.e9*sqrt(m_hitPosition.x()*m_hitPosition.x()+m_hitPosition.y()*m_hitPosition.y())/Constants::c;
299 double Tprop = m_mdcCalibFunSvc->getTprop(m_layer,m_hitPosition.z()*10.);
300 double Twalk = m_mdcCalibFunSvc->getTimeWalk(m_layer, m_depositEnergy);
301 double T0 = m_mdcCalibFunSvc->getT0(m_layer,m_wire);
302 double driftTime = m_rawTime - 1.e9*m_bunchTime - ToF - Tprop - Twalk -T0;
303 //cout<<m_rawTime - Twalk - T0 - ToF - Tprop<<endl;
304 //cout<<"("<<m_layer<<", "<<m_wire<<"): ";
305 //cout<<"bunchT = "<<1.e9*m_bunchTime<<" , rawT "<<m_rawTime<<" , Tof "<<ToF<<" , Tprop "<<Tprop<<" , T0walk "<<Twalk+T0<<" , driftT "<<driftTime<<" , rmid "<<sqrt(m_hitPosition.x()*m_hitPosition.x()+m_hitPosition.y()*m_hitPosition.y())<<" , z "<<m_hitPosition.z()*10.0<<endl;
306 //cout<<endl;
307 return driftTime;
308}
static const double c
Definition: Constants.h:43
double driftTime()
Definition: HoughHit.cxx:296
double getT0(int layid, int cellid) const
double getTprop(int lay, double z) const
double getTimeWalk(int layid, double Q) const

Referenced by driftTime(), and HoughFinder::makeHoughHitList().

◆ dropTrkID()

void HoughHit::dropTrkID ( int  trkID)

Definition at line 398 of file HoughHit.cxx.

399{
400 vector<int>::iterator it0 = m_trkID.begin();
401 vector<int>::iterator result = find(m_trkID.begin(),m_trkID.end(),trkID);
402 if(result!=m_trkID.end()) {
403 m_trkID.erase(result);
404 vector<double>::iterator itRes = m_vecResid.begin()+(result-it0);
405 if(itRes!=m_vecResid.end()) m_vecResid.erase(itRes);
406 }
407}

◆ getBunchTime()

double HoughHit::getBunchTime ( ) const
inline

Definition at line 48 of file HoughHit.h.

48{return m_bunchTime;}

◆ getCgemCalibFunSvc()

CgemCalibFunSvc * HoughHit::getCgemCalibFunSvc ( ) const
inline

Definition at line 68 of file HoughHit.h.

68{return m_cgemCalibFunSvc;}

Referenced by HoughTrack::fitCircle().

◆ getCgemCluster()

const RecCgemCluster * HoughHit::getCgemCluster ( ) const
inline

Definition at line 41 of file HoughHit.h.

41{return m_cgemCluster;}

Referenced by HoughTrack::calculateZ_S(), HoughTrack::fitCircle(), and HoughFinder::storeRecTracks().

◆ getCgemGeomSvc()

CgemGeomSvc * HoughHit::getCgemGeomSvc ( ) const
inline

Definition at line 67 of file HoughHit.h.

67{return m_cgemGeomSvc;}

Referenced by HoughTrack::fitCircle().

◆ getCgemMcHit()

const CgemMcHit * HoughHit::getCgemMcHit ( ) const
inline

Definition at line 43 of file HoughHit.h.

43{return m_cgemMcHit;}

Referenced by HoughFinder::getMcHitCol().

◆ getDepositEnergy()

double HoughHit::getDepositEnergy ( ) const
inline

Definition at line 50 of file HoughHit.h.

50{return m_depositEnergy;}

◆ getDigi()

const MdcDigi * HoughHit::getDigi ( ) const
inline

Definition at line 42 of file HoughHit.h.

42{return m_mdcDigi;}

Referenced by HoughTrack::fitCircle().

◆ getDriftDist()

double HoughHit::getDriftDist ( ) const
inline

Definition at line 54 of file HoughHit.h.

54{return m_driftDist;}

Referenced by HoughTrack::calculateZ_S(), HoughTrack::driftDistRes(), HoughFinder::fillHistogram(), residual(), and VHitPosition().

◆ getEastPoint()

HepPoint3D HoughHit::getEastPoint ( ) const
inline

Definition at line 53 of file HoughHit.h.

53{return m_eastPoint;}

◆ getFlag()

int HoughHit::getFlag ( ) const
inline

Definition at line 47 of file HoughHit.h.

47{return m_flag;}

Referenced by HoughTrack::calculateZ_S(), HoughFinder::fillHistogram(), HoughTrack::fitCircle(), and VHitPosition().

◆ getHalfCircle()

int HoughHit::getHalfCircle ( )
inline

Definition at line 70 of file HoughHit.h.

70{return m_halfCircle;}

Referenced by print().

◆ getHitID()

int HoughHit::getHitID ( ) const
inline

Definition at line 39 of file HoughHit.h.

39{return m_hitID;}

◆ getHitPosition()

◆ getHitType()

HitType HoughHit::getHitType ( ) const
inline

◆ getLayer()

◆ getMdcCalibFunSvc()

MdcCalibFunSvc * HoughHit::getMdcCalibFunSvc ( ) const
inline

Definition at line 66 of file HoughHit.h.

66{return m_mdcCalibFunSvc;}

Referenced by HoughTrack::fitCircle().

◆ getMdcGeomSvc()

MdcGeomSvc * HoughHit::getMdcGeomSvc ( ) const
inline

Definition at line 65 of file HoughHit.h.

65{return m_mdcGeomSvc;}

Referenced by HoughTrack::calculateZ_S(), and VHitPosition().

◆ getMdcHit()

MdcHit * HoughHit::getMdcHit ( )
inline

Definition at line 134 of file HoughHit.h.

134{return m_mdcHit;}

◆ getMdcMcHit()

const MdcMcHit * HoughHit::getMdcMcHit ( ) const
inline

Definition at line 44 of file HoughHit.h.

44{return m_mdcMcHit;}

Referenced by HoughFinder::getMcHitCol(), and print().

◆ getPairHit()

HoughHit * HoughHit::getPairHit ( )
inline

Definition at line 71 of file HoughHit.h.

71{return m_pairHit;}

Referenced by residual().

◆ getRawTime()

double HoughHit::getRawTime ( ) const
inline

Definition at line 49 of file HoughHit.h.

49{return m_rawTime;}

◆ getResidual()

double HoughHit::getResidual ( ) const
inline

Definition at line 55 of file HoughHit.h.

55{return m_residual;}

◆ getSZ()

vector< S_Z > HoughHit::getSZ ( ) const
inline

Definition at line 63 of file HoughHit.h.

63{return m_sz;}

Referenced by HoughFinder::fillHistogram().

◆ getTrkID()

vector< int > HoughHit::getTrkID ( ) const
inline

Definition at line 56 of file HoughHit.h.

56{return m_trkID;}

Referenced by print().

◆ getTrkPntVec()

vector< HoughTrack * > HoughHit::getTrkPntVec ( )
inline

Definition at line 57 of file HoughHit.h.

57{return m_vecTrkPnt;}

◆ getUse()

int HoughHit::getUse ( ) const
inline

Definition at line 58 of file HoughHit.h.

58{return m_use;}

◆ getVecResid()

vector< double > HoughHit::getVecResid ( )
inline

Definition at line 114 of file HoughHit.h.

114{return m_vecResid;}

◆ getWestPoint()

HepPoint3D HoughHit::getWestPoint ( ) const
inline

Definition at line 52 of file HoughHit.h.

52{return m_westPoint;}

◆ getWire()

int HoughHit::getWire ( ) const
inline

Definition at line 46 of file HoughHit.h.

46{return m_wire;}

Referenced by HoughTrack::calculateZ_S(), HoughFinder::getMcParticleCol(), and VHitPosition().

◆ hitSigma()

double HoughHit::hitSigma ( )

◆ operator=()

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

Definition at line 209 of file HoughHit.cxx.

210{
211 m_hitID = other.m_hitID;
212 m_hitType = other.m_hitType;
213 m_cgemCluster = other.m_cgemCluster;
214 m_mdcDigi = other.m_mdcDigi;
215 m_cgemMcHit = other.m_cgemMcHit;
216 m_mdcMcHit = other.m_mdcMcHit;
217 m_layer = other.m_layer;
218 m_wire = other.m_wire;
219 m_flag = other.m_flag;
220 m_use = other.m_use;
221 m_bunchTime = other.m_bunchTime;
222 m_rawTime = other.m_rawTime;
223 m_depositEnergy = other.m_depositEnergy;
224 m_hitPosition = other.m_hitPosition;
225 m_westPoint = other.m_westPoint;
226 m_eastPoint = other.m_eastPoint;
227 m_driftDist = other.m_driftDist;
228 m_residual = other.m_residual;
229 //m_hitMap = other.m_hitMap;
230 //m_sLeft = other.m_sLeft;
231 //m_zLeft = other.m_zLeft;
232 //m_sRight = other.m_sRight;
233 //m_zRight = other.m_zRight;
234 m_trkID = other.m_trkID;
235 m_sz = other.m_sz;
236 m_pairHit = other.m_pairHit;
237 m_halfCircle = other.m_halfCircle;
238 m_position = other.m_position;
239 m_mdcHit =other.m_mdcHit;
240}

◆ print()

void HoughHit::print ( )

Definition at line 327 of file HoughHit.cxx.

328{
329 string hitType;
330 switch(m_hitType){
331 case CGEMHIT : hitType = "CGEMHIT"; break;
332 case MDCHIT : hitType = "MDCHIT"; break;
333 case CGEMMCHIT : hitType = "CGEMMCHIT"; break;
334 case MDCMCHIT : hitType = "MDCMCHIT"; break;
335 default : hitType = "";
336 }
337 cout<<"ID:" <<setw(6)<<m_hitID;
338 cout<<"(" <<setw(2)<<m_layer;
339 cout<<"," <<setw(3)<<m_wire<<") ";
340 cout<<" flag:" <<setw(3)<<m_flag;
341 if(m_hitType==CGEMHIT) {cout<<" clusterId "<<m_cgemCluster->getclusterid()<<" pos: "<<m_hitPosition;}
342 if(m_hitType==CGEMHIT||m_hitType==MDCHIT){
343 if(m_pairHit!=NULL){
344 cout<<" half:"<<setw(2)<<m_pairHit->getHalfCircle();
345 cout<<" trkID:"<<setw(3)<<(m_pairHit->getTrkID())[0];
346 cout<<" McHit:("<<setw(10)<<m_pairHit->getHitPosition().x()<<", "<<setw(10)<<m_pairHit->getHitPosition().y()<<", "<<setw(10)<<m_pairHit->getHitPosition().z()<<") ";
347 if(m_hitType==MDCHIT){
348 cout<<" McLR:"<<setw(3)<<m_pairHit->getMdcMcHit()->getPositionFlag();
349 cout<<" drift:"<<setw(10)<<m_pairHit->getMdcMcHit()->getDriftDistance();
350 }
351 //if(m_hitType==MDCHIT)
352 //cout<<" trkID:"<<setw(3)<<m_pairHit->getMdcMcHit()->getTrackIndex();
353 }
354 }
355 if(m_hitType==CGEMMCHIT||m_hitType==MDCMCHIT){
356 cout<<" half:"<<setw(2)<<getHalfCircle();
357 cout<<" trkID:"<<setw(3)<<m_trkID[0];
358 cout<<" McHit:("<<setw(10)<<m_hitPosition.x()<<", "<<setw(10)<<m_hitPosition.y()<<", "<<setw(10)<<m_hitPosition.z()<<") ";
359 //if(m_hitType==MDCMCHIT)
360 //cout<<" trkID:"<<setw(3)<<m_mdcMcHit->getTrackIndex();
361 if(m_hitType==MDCMCHIT){
362 cout<<" McLR:"<<setw(3)<<m_mdcMcHit->getPositionFlag();
363 cout<<" drift:"<<setw(10)<<m_mdcMcHit->getDriftDistance();
364 }
365 }
366
367 //cout<<setw(7)<<"hitID:" <<setw(6)<<m_hitID
368 //<<setw(10)<<"hitType:" <<setw(10)<<hitType
369 //<<setw(8)<<"layer:" <<setw(4)<<m_layer
370 //<<setw(6)<<"wire:" <<setw(6)<<m_wire
371 //<<setw(10)<<"flag:" <<setw(10)<<m_flag
372 //<<setw(5)<<"use:" <<setw(3)<<m_use
373 //<<endl
374 //<<setw(12)<<"bunchTime:"<<setw(12)<<m_bunchTime
375 //<<setw(12)<<"rawTime:" <<setw(12)<<m_rawTime
376 //<<setw(12)<<"charge:" <<setw(12)<<m_depositEnergy
377 //<<setw(12)<<"driftTime:"<<setw(12)<<driftTime()
378 //<<setw(11)<<"driftDist:"<<setw(12)<<m_driftDist
379 //<<setw(12)<<"residual:" <<setw(12)<<m_residual
380 //<<endl
381 //<<setw(10)<<"sLeft:" <<setw(10)<<m_sLeft
382 //<<setw(10)<<"zLeft:" <<setw(10)<<m_zLeft
383 //<<setw(10)<<"sRight:" <<setw(10)<<m_sRight
384 //<<setw(10)<<"zRight:" <<setw(10)<<m_zRight
385 //<<endl
386 //<<endl
387 //cout<<m_trkID.size()<<" trkID:";
388 //for(int i=0;i<m_trkID.size();i++)cout<<setw(4)<<m_trkID[i]<<endl;
389 //;
390 //if(m_layer>3)cout<<"TrkID:"<<setw(4)<<getDigi()->getTrackIndex();
391 //cout<<endl;
392 //;
393 cout<<endl;
394}
int getHalfCircle()
Definition: HoughHit.h:70
vector< int > getTrkID() const
Definition: HoughHit.h:56
const MdcMcHit * getMdcMcHit() const
Definition: HoughHit.h:44
HepPoint3D getHitPosition() const
Definition: HoughHit.h:51
int getclusterid(void) const

Referenced by HoughFinder::getMcParticleCol(), and HoughTrack::printHot().

◆ resetSZ()

void HoughHit::resetSZ ( )
inline

Definition at line 97 of file HoughHit.h.

97{m_sz.clear();}

Referenced by HoughTrack::calculateZ_S(), and VHitPosition().

◆ residual() [1/2]

double HoughHit::residual ( HoughTrack track)

Definition at line 491 of file HoughHit.cxx.

492{
493 double residual(9999.);
494 if(m_flag==0){
495 HepPoint3D hitPoint = getHitPosition();
497 //HepPoint3D circleCenter = m_helix.center();
498 HepPoint3D circleCenter = track->center();
499 //double distance = circleCenter.perp(hitPoint);
500 double distance = (circleCenter-hitPoint).perp();
501 //double Rc = m_helix.radius();
502 double Rc = fabs(track->radius());
503 double driftDist(0);
504 //if(getHitType() == HoughHit::MDCMCHIT)driftDist = 0;
505 if(getHitType() == HoughHit::MDCHIT)driftDist = getDriftDist();
506 //residual = fabs(distance - Rc) - driftDist;
507 residual = driftDist-fabs(distance - Rc);
508 //cout<<"driftDist, distance, Rc = "<<driftDist<<", "<<distance<<", "<<Rc<<endl;
509 //double distance = (m_helix.center()).perp(hit.getHitPosition());
510 //res = fabs(distance - m_helix.radius()) - hit.getDriftDist();
512 double rCgem = hitPoint.perp();
513 //double phiTrkFlt = m_helix.IntersectCylinder(rCgem);
514 double phiTrkFlt = track->IntersectCylinder(rCgem);
515 phiTrkFlt = track->judgeHalf(this)*phiTrkFlt;
516 //HepPoint3D crossPoint = m_helix.x(phiTrkFlt);
517 HepPoint3D crossPoint = track->x(phiTrkFlt);
518 double phiCrossPoint = crossPoint.phi();
519 double phiMeasure = hitPoint.phi();
520 residual = phiMeasure - phiCrossPoint;
521 while(residual<-M_PI)residual += 2*M_PI;
522 while(residual> M_PI)residual -= 2*M_PI;
523 residual = rCgem*residual;
524 }
525 }else{
526 double zTruth = getPairHit()->getHitPosition().z();
527 double minRes(9999);
529 vector<HepPoint3D> position = VHitPosition(track);
530 for(vector<HepPoint3D>::iterator posIt = position.begin();posIt!=position.end();posIt++){
531 HepPoint3D point = *posIt;
532 double s = track->flightArc(point);
533 double zTrk = track->dz()+s*track->tanl();
534 double res = point.z() - zTrk;
535 //res = point.z() - zTruth;
536 if(fabs(res)<minRes){
537 minRes=fabs(res);
538 residual = res;
539 }
540 }
542 double s = track->flightArc(m_hitPosition);
543 double zTrk = track->dz()+s*track->tanl();
544 residual = m_hitPosition.z() - zTrk;
545 //residual = m_hitPosition.z() - zTruth;
546 }
547 }
548 return residual;
549}
XmlRpcServer s
Definition: HelloServer.cpp:11
#define M_PI
Definition: TConstant.h:4
const HepPoint3D & center(void) const
returns position of helix center(z = 0.);
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
double radius(void) const
returns radious of helix.
double residual(HoughTrack *track)
Definition: HoughHit.cxx:491
HoughHit * getPairHit()
Definition: HoughHit.h:71
double getDriftDist() const
Definition: HoughHit.h:54
HitType getHitType() const
Definition: HoughHit.h:40
vector< HepPoint3D > & VHitPosition(HoughTrack *track)
Definition: HoughHit.cxx:409
int judgeHalf(HoughHit *hit)
Definition: HoughTrack.cxx:596

Referenced by residual(), and setResidual().

◆ residual() [2/2]

double HoughHit::residual ( HoughTrack track,
HepPoint3D positionOntrack,
HepPoint3D positionOnDetector 
)

Definition at line 572 of file HoughHit.cxx.

573{
574 double residual(9999.);
575 HepPoint3D pivot(0,0,0);
576 track->pivot(pivot);
577 if(m_hitType==MDCHIT){
578 const MdcDetector* mdcDetector(m_mdcDetector);
579 MdcHit mdcHit(m_mdcDigi,mdcDetector);
580 const Trajectory* wire(mdcHit.hitTraj());
581
582 double d0 = -track->dr();
583 double phi0 = track->phi0()+M_PI/2;
584 double omega = track->kappa()/fabs(track->alpha());
585 double z0 = track->dz();
586 double tanl = track->tanl();
587
588 //HepVector a(5,0);
589 //a(1) = d0;
590 //a(2) = phi0;
591 //a(3) = omega;
592 //a(4) = z0;
593 //a(5) = tanl;
594 //HepSymMatrix Ea(5,0);
595 //const HepVector pvec(a);
596 //const HepSymMatrix pcov(Ea);
597 //const HepPoint3D refpoint(track->pivot());
598 //const HelixTraj trk(pvec, pcov, -99999., 99999., refpoint);
599
600 double hitWireLength = m_hitPosition.z()-m_westPoint.z();
601 const TrkExchangePar trkExchangePar(d0,phi0,omega,z0,tanl);
602 double trkFlightLength = track->flightLength(m_hitPosition);
603 const HelixTraj helixTraj(trkExchangePar);
604 TrkPoca trkPoca(helixTraj,trkFlightLength,*wire,hitWireLength);
605 trkFlightLength = trkPoca.flt1();
606 hitWireLength = trkPoca.flt2();
607 double doca = trkPoca.doca();
608 //double trkFlightArc = track->flightArc(m_hitPosition);
609 //const TrkCircleTraj circleTraj(trkExchangePar);
610 //TrkPoca trkPoca(circleTraj,trkFlightArc,*wire,hitWireLength);
611 //trkFlightArc = trkPoca.flt1();
612 //hitWireLength = trkPoca.flt2();
613 //double doca = trkPoca.doca();
614
615 Hep3Vector wireDirection, trackDirection;
616 //HepPoint3D hitOnWire, hitOntrack;
617 wire->getInfo(hitWireLength, positionOnDetector, wireDirection);
618 helixTraj.getInfo(trkFlightLength, positionOntrack, trackDirection);
619 residual = m_driftDist - fabs(doca);
620 //cout<<"("<<m_layer<<","<<m_wire<<") ";
621 //cout<<setw(12)<<m_driftDist
622 //<<setw(12)<<doca
623 //<<setw(12)<<residual
624 //<<endl;
625
626 //cout<<"("<<m_layer<<","<<m_wire<<") "
627 //<<setw(12)<<getPairHit()->getHitPosition().z()
628 //<<setw(12)<<positionOntrack.z()
629 //<<setw(12)<<positionOnDetector.z()
630 //<<setw(12)<<tanl/sqrt(1+tanl*tanl)*trkFlightLength+z0
631 //<<setw(12)<<tanl*(track->flightArc(m_hitPosition))+z0
632 //<<endl;
633 }
634 else if(m_hitType==CGEMHIT){
635 double rCgem = m_hitPosition.perp();
636 //double phiTrkFlt = m_helix.IntersectCylinder(rCgem);
637 double phiTrkFlt = track->IntersectCylinder(rCgem);
638 phiTrkFlt = track->judgeHalf(this)*phiTrkFlt;
639 //HepPoint3D crossPoint = m_helix.x(phiTrkFlt);
640 positionOntrack = track->x(phiTrkFlt);
641 positionOnDetector = track->x(phiTrkFlt);
642 if(m_flag==0){
643 double phiCrossPoint = positionOntrack.phi();
644 double phiMeasure = m_hitPosition.phi();
645 double dphi = phiMeasure - phiCrossPoint;
646 while(dphi<-M_PI)dphi += 2*M_PI;
647 while(dphi> M_PI)dphi -= 2*M_PI;
648 residual = rCgem*dphi;
649 }
650 else{
651 residual = (m_cgemCluster->getrecv() - m_cgemGeomSvc->getReadoutPlane(m_layer,m_wire)->getVFromPhiZ(positionOntrack.phi(),positionOntrack.z()*10.))/10.;
652 }
653 }
654 return residual;
655}
double getVFromPhiZ(double phi, double z, bool checkRange=true) const
CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const
Definition: CgemGeomSvc.h:140
double flightLength(HepPoint3D &hit) const
double dr(void) const
returns an element of parameters.
const HepPoint3D & pivot(void) const
returns pivot position.
Definition: MdcHit.h:44
double getrecv(void) const

◆ rmTrkPnt()

void HoughHit::rmTrkPnt ( HoughTrack aHTrk)
inline

Definition at line 108 of file HoughHit.h.

108{vector<HoughTrack*>::iterator result = find(m_vecTrkPnt.begin(), m_vecTrkPnt.end(), aHTrk); if(result!=m_vecTrkPnt.end()) m_vecTrkPnt.erase(result);}

◆ setBunchTime()

void HoughHit::setBunchTime ( double  bunchTime)
inline

Definition at line 83 of file HoughHit.h.

83{m_bunchTime = bunchTime;}

◆ setCgemCalibFunSvc()

static void HoughHit::setCgemCalibFunSvc ( CgemCalibFunSvc cgemCalibFunSvc)
inlinestatic

Definition at line 102 of file HoughHit.h.

102{m_cgemCalibFunSvc = cgemCalibFunSvc;}

Referenced by HoughFinder::initialize().

◆ setCgemCluster()

void HoughHit::setCgemCluster ( const RecCgemCluster cgemCluster)
inline

Definition at line 75 of file HoughHit.h.

75{m_cgemCluster = cgemCluster;}

Referenced by HoughFinder::getMcHitCol().

◆ setCgemGeomSvc()

static void HoughHit::setCgemGeomSvc ( CgemGeomSvc cgemGeomSvc)
inlinestatic

Definition at line 101 of file HoughHit.h.

101{m_cgemGeomSvc = cgemGeomSvc;}

Referenced by HoughFinder::initialize().

◆ setCgemMcHit()

void HoughHit::setCgemMcHit ( const CgemMcHit cgemMcHit)
inline

Definition at line 77 of file HoughHit.h.

77{m_cgemMcHit = cgemMcHit;}

◆ setDepositEnergy()

void HoughHit::setDepositEnergy ( double  depositEnergy)
inline

Definition at line 85 of file HoughHit.h.

85{m_depositEnergy = depositEnergy;}

◆ setDigi()

void HoughHit::setDigi ( const MdcDigi mdcDigi)
inline

Definition at line 76 of file HoughHit.h.

76{m_mdcDigi = mdcDigi;}

Referenced by HoughFinder::getMcHitCol().

◆ setDriftDist()

void HoughHit::setDriftDist ( double  driftDist)
inline

Definition at line 89 of file HoughHit.h.

89{m_driftDist = driftDist;}

◆ setFlag()

void HoughHit::setFlag ( int  flag)
inline

Definition at line 81 of file HoughHit.h.

81{m_flag = flag;}

Referenced by HoughFinder::getMcHitCol().

◆ setHalfCircle()

void HoughHit::setHalfCircle ( int  halfCircle)
inline

Definition at line 117 of file HoughHit.h.

117{m_halfCircle = halfCircle;}

◆ setHitID()

void HoughHit::setHitID ( int  hitID)
inline

Definition at line 73 of file HoughHit.h.

73{m_hitID = hitID;}

◆ setHitPosition()

void HoughHit::setHitPosition ( HepPoint3D  point)
inline

Definition at line 86 of file HoughHit.h.

86{m_hitPosition = point;}

◆ setHitType()

void HoughHit::setHitType ( HitType  hitType)
inline

Definition at line 74 of file HoughHit.h.

74{m_hitType = hitType;}

◆ setLayer()

void HoughHit::setLayer ( int  layer)
inline

Definition at line 79 of file HoughHit.h.

79{m_layer = layer;}

◆ setMdcCalibFunSvc()

static void HoughHit::setMdcCalibFunSvc ( MdcCalibFunSvc mdcCalibFunSvc)
inlinestatic

Definition at line 100 of file HoughHit.h.

100{m_mdcCalibFunSvc = mdcCalibFunSvc;}

Referenced by HoughFinder::initialize().

◆ setMdcDetector()

static void HoughHit::setMdcDetector ( const MdcDetector mdcDetector)
inlinestatic

Definition at line 103 of file HoughHit.h.

103{m_mdcDetector = mdcDetector;}

Referenced by HoughFinder::initialize().

◆ setMdcGeomSvc()

static void HoughHit::setMdcGeomSvc ( MdcGeomSvc mdcGeomSvc)
inlinestatic

Definition at line 99 of file HoughHit.h.

99{m_mdcGeomSvc = mdcGeomSvc;}

Referenced by HoughFinder::initialize().

◆ setMdcHit()

void HoughHit::setMdcHit ( MdcHit mdcHit)
inline

Definition at line 135 of file HoughHit.h.

135{m_mdcHit = mdcHit;}

Referenced by HoughFinder::makeHoughHitList().

◆ setMdcMcHit()

void HoughHit::setMdcMcHit ( const MdcMcHit mdcMcHit)
inline

Definition at line 78 of file HoughHit.h.

78{m_mdcMcHit = mdcMcHit;}

◆ setPairHit()

void HoughHit::setPairHit ( HoughHit pairHit)
inline

Definition at line 116 of file HoughHit.h.

116{m_pairHit = pairHit;}

Referenced by HoughFinder::getMcHitCol().

◆ setRawTime()

void HoughHit::setRawTime ( double  rawTime)
inline

Definition at line 84 of file HoughHit.h.

84{m_rawTime = rawTime;}

◆ setResidual()

void HoughHit::setResidual ( double  residual)
inline

Definition at line 90 of file HoughHit.h.

90{m_residual = residual;}

Referenced by HoughTrack::driftDistRes().

◆ setSZ()

void HoughHit::setSZ ( vector< S_Z sz)
inline

Definition at line 96 of file HoughHit.h.

96{m_sz.clear();m_sz = sz;}

◆ setTrkID()

void HoughHit::setTrkID ( vector< int >  trkID)
inline

Definition at line 91 of file HoughHit.h.

91{m_trkID.clear();m_trkID = trkID;}

◆ setUse()

void HoughHit::setUse ( int  use)
inline

Definition at line 82 of file HoughHit.h.

82{m_use = use;}

◆ setWire()

void HoughHit::setWire ( int  wire)
inline

Definition at line 80 of file HoughHit.h.

80{m_wire = wire;}

Referenced by HoughFinder::getMcHitCol().

◆ updateVHit()

void HoughHit::updateVHit ( HoughTrack track)

Definition at line 551 of file HoughHit.cxx.

552{
553 if(m_flag!=0&&m_hitType==HoughHit::MDCHIT){
554 double minRes(9999);
555 HepPoint3D hitPoint(m_hitPosition);
556 vector<HepPoint3D> position = VHitPosition(track);
557 for(vector<HepPoint3D>::iterator posIt = position.begin();posIt!=position.end();posIt++){
558 HepPoint3D point = *posIt;
559 double s = track->flightArc(point);
560 double zTrk = track->dz()+s*track->tanl();
561 double res = point.z() - zTrk;
562 if(fabs(res)<minRes){
563 minRes=fabs(res);
564 hitPoint = point;
565 }
566 }
567 m_hitPosition = hitPoint;
568 m_driftDist = driftDistance();
569 }
570}

◆ VHitPosition()

vector< HepPoint3D > & HoughHit::VHitPosition ( HoughTrack track)

Definition at line 409 of file HoughHit.cxx.

410{
411 if(getFlag()==0)return m_position;
412 m_position.clear();
413 //if(getPairHit()==NULL)return m_position;
414 //if(getPairHit()->getHalfCircle()!=1)return m_position;
415 double z(0);
416 double xc = track->center().x();
417 double yc = track->center().y();
418 double rTrack = track->radius();// signed FIXME
420 resetSZ();
421 double drift = getDriftDist();
422 const MdcGeoWire* wire = getMdcGeomSvc()->Wire(getLayer(),getWire());
423 HepPoint3D westPoint = wire->Forward();
424 HepPoint3D eastPoint = wire->Backward();
425 double xEast = eastPoint.x()/10.0;
426 double xWest = westPoint.x()/10.0;
427 double yEast = eastPoint.y()/10.0;
428 double yWest = westPoint.y()/10.0;
429 double zEast = eastPoint.z()/10.0;
430 double zWest = westPoint.z()/10.0;
431 //cout<<"wast:x,y,z: "<<xWest<<", "<<yWest<<", "<<zWest<<endl;
432 //cout<<"east:x,y,z: "<<xEast<<", "<<yEast<<", "<<zEast<<endl;
433 //cout<<"Xc, Yc, Rc: "<<xc<<", "<<yc<<", "<<rTrack<<endl;
434 double west2east = sqrt((xEast-xWest)*(xEast-xWest)+(yEast-yWest)*(yEast-yWest));
435
436 double slope = (yEast-yWest)/(xEast-xWest);
437 double intercept = (yWest-slope*xWest+yEast-slope*xEast)/2;
438 double a = 1+slope*slope;
439 double b = -2*(xc+slope*yc-slope*intercept);
440 double c1 = xc*xc+(yc-intercept)*(yc-intercept)-(rTrack+drift)*(rTrack+drift);
441 double c2 = xc*xc+(yc-intercept)*(yc-intercept)-(rTrack-drift)*(rTrack-drift);
442 //double c1 = intercept*(2*yc-intercept)+drift*(drift+rTrack);
443 //double c2 = intercept*(2*yc-intercept)+drift*(drift-rTrack);
444 double delta1 = (b*b-4*a*c1);
445 double delta2 = (b*b-4*a*c2);
446 //cout<<"a,b,c1,c2: "<<a<<", "<<b<<", "<<c1<<", "<<c2<<endl;
447 //cout<<"delta: "<<delta1<<", "<<delta2<<endl;
448 if(delta1>=0){
449 double x1 = (-b+sqrt(delta1))/(2*a);
450 double x2 = (-b-sqrt(delta1))/(2*a);
451 double y1 = slope*x1+intercept;
452 double y2 = slope*x2+intercept;
453 if((x1-xWest)*(x1-xEast)<0){
454 double l = sqrt((x1-xWest)*(x1-xWest)+(y1-yWest)*(y1-yWest));
455 z = zWest + l/west2east*fabs((zEast-zWest));
456 HepPoint3D position(x1,y1,z);
457 m_position.push_back(position);
458 }
459 if((x2-xWest)*(x2-xEast)<0){
460 double l = sqrt((x2-xWest)*(x2-xWest)+(y2-yWest)*(y2-yWest));
461 z = zWest + l/west2east*fabs((zEast-zWest));
462 HepPoint3D position(x2,y2,z);
463 m_position.push_back(position);
464 }
465 }
466
467 if( delta2>=0){
468 double x1 = (-b+sqrt(delta2))/(2*a);
469 double x2 = (-b-sqrt(delta2))/(2*a);
470 double y1 = slope*x1+intercept;
471 double y2 = slope*x2+intercept;
472 if((x1-xWest)*(x1-xEast)<0){
473 double l = sqrt((x1-xWest)*(x1-xWest)+(y1-yWest)*(y1-yWest));
474 z = zWest + l/west2east*fabs((zEast-zWest));
475 HepPoint3D position(x1,y1,z);
476 m_position.push_back(position);
477 }
478 if((x2-xWest)*(x2-xEast)<0){
479 //double l = zWest + sqrt((x2-xWest)*(x2-xWest)+(y2-yWest)*(y2-yWest));
480 //z = l/west2east*fabs((zEast-zWest));
481 double l = sqrt((x2-xWest)*(x2-xWest)+(y2-yWest)*(y2-yWest));
482 z = zWest + l/west2east*fabs((zEast-zWest));
483 HepPoint3D position(x2,y2,z);
484 m_position.push_back(position);
485 }
486 }
487 }
488 return m_position;
489}
MdcGeomSvc * getMdcGeomSvc() const
Definition: HoughHit.h:65
int getFlag() const
Definition: HoughHit.h:47
int getLayer() const
Definition: HoughHit.h:45
int getWire() const
Definition: HoughHit.h:46
void resetSZ()
Definition: HoughHit.h:97
TCanvas * c1
Definition: tau_mode.c:75

Referenced by residual(), and updateVHit().


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