CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
HoughTrack Class Reference

#include <HoughTrack.h>

+ Inheritance diagram for HoughTrack:

Public Member Functions

 HoughTrack (int charge, double angle, double rho, double dAngle, double dRho, int trkID)
 
 HoughTrack (int charge, const HepPoint3D &position, const Hep3Vector &momentum, int trkID)
 
 HoughTrack (HepPoint3D &pivot, HepVector &a, int trkID)
 
 HoughTrack (const HoughTrack &other)
 

 
HoughTrackoperator= (const HoughTrack &other)
 
 HoughTrack ()
 
void setTrkID (int trkID)
 
void setFlag (int flag)
 
void setCharge (int charge)
 
void setAngle (double angle)
 
void setRho (double rho)
 
void setDAngle (double dAngle)
 
void setDRho (double dRho)
 
void setDTanl (double dTanl)
 
void setDDz (double dDz)
 
void setChi2 (double chi2)
 
void setDz (double dz)
 
void setTanl (double tanl)
 
int getTrkID () const
 
int getCharge () const
 
int getFlag () const
 
double getAngle () const
 
double getRho () const
 
double getDAngle () const
 
double getDRho () const
 
double getDTanl () const
 
double getDDz () const
 
double getChi2 () const
 
int getCircleFitStat () const
 
TrkRecoTrkgetTrkRecoTrk ()
 
double getDr () const
 
double getPhi0 () const
 
double getKappa () const
 
double getDz () const
 
double getTanl () const
 
int findXHot (vector< HoughHit * > &hitList, int charge)
 
void sortHot (vector< HoughHit * > &hotList)
 
vector< HoughHit * > getVecHitPnt ()
 
void addHitPnt (HoughHit *aHitPnt)
 
void dropHitPnt (HoughHit *aHitPnt)
 
void dropVHitPnt (HoughHit *aHitPnt)
 
int getNHitsShared ()
 
void dropRedundentCgemXHits ()
 
void dropRedundentCgemVHits ()
 
int getNhitFirstHalf ()
 
int getNhitSecondHalf ()
 
int getNhitUnusedFirstHalf ()
 
int getNhitUnusedSecondHalf ()
 
void resetNhitHalf ()
 
double driftDistRes (HoughHit *hit)
 
int judgeHalf (HoughHit *hit)
 
int judgeCharge (HoughHit *hit)
 
int judgeCharge (double xHit, double yHit)
 
TrkErrCode fitCircle (const MdcDetector *mdcDetector, TrkContextEv *trkContextEv, double bunchT0)
 
int calculateZ_S (HoughHit *hit)
 
void updateHelix ()
 
void update (double angle, double rho)
 
void updateCirclePar (double dr, double phi0, double kappa)
 
void markUsedHot (vector< HoughHit * > &hitPntList, int use=1)
 
void markUsedHot (int use=1)
 
void print ()
 
void printHot ()
 
void clearHits ()
 
bool isAGoodCircle ()
 
int getNTried ()
 
void releaseSelHits ()
 
vector< double > getVecHitRes ()
 
vector< HoughHit * > getVecStereoHitPnt ()
 
void addVecStereoHitPnt (HoughHit *aHitPnt)
 
vector< double > getVecStereoHitRes ()
 
TrkErrCode fitHelix (const MdcDetector *mdcDetector, const BField *bField, double bunchT0, vector< HoughHit * > &hot, int Layer)
 
TrkErrCode fitHelix (const MdcDetector *mdcDetector, TrkContextEv *trkContextEv, double bunchT0, vector< MdcHit * > &mdcHitCol, vector< HoughHit * > &hot)
 
int findVHot (vector< HoughHit * > &hitList, int charge, int maxLayer)
 
vector< HoughHit * > getHotList (int type=2)
 
HoughTrackgetMcTrack () const
 
void setMcTrack (HoughTrack *mcTrack)
 
void clearMemory ()
 
 HoughTrack ()
 
 ~HoughTrack ()
 
 HoughTrack (const HoughTrack &other)
 
 HoughTrack (const HoughPeak &centerPeak, std::vector< const HoughHit * > trackHitList, double, double, int)
 
TrkRecoTrkgetTrk () const
 
TrkRecoTrkgetTrk2D () const
 
vector< MdcHit * > & getVecForClean3D ()
 
HoughPeak getCenterPeak () const
 
Hough2D get2D () const
 
Hough3D get3D () const
 
recHitCol & getHoughHitList ()
 
void setCharge (int charge)
 
int getCharge () const
 
double getPt_least () const
 
double getPt2D () const
 
double getPt3D () const
 
double getP () const
 
double getPz () const
 
double getRho () const
 
double getTheta () const
 
double getD0 () const
 
double getOmega () const
 
double getPhi0 () const
 
double getTanl () const
 
double getZ0 () const
 
double getTanl_zs () const
 
double getZ0_zs () const
 
int getHitNum (int) const
 
int getHitNumA (int) const
 
int getHitNumS (int) const
 
int getNfit2D () const
 
int getNfit3D () const
 
int getStat2D () const
 
int getStat3D () const
 
double getCirR () const
 
double getCirX () const
 
double getCirY () const
 
double getChi2_3D () const
 
double getChi2_2D () const
 
double getNfit () const
 
void setHoughHitList (vector< HoughHit > vec_hit)
 
void printRecHit () const
 
void printHoughTrack ()
 
void print ()
 
void sortHit ()
 
void fit (double bunchtime)
 
int calzs ()
 
void fitzs ()
 
int judgeTrack ()
 
int find_stereo_hit ()
 
int find_pair_hit ()
 
int cutNoise_inner ()
 
int cut_axial_inner ()
 
HoughTrackoperator= (const HoughTrack &other)
 
HoughTrackadd (const HoughTrack &other)
 
int fit2D (double bunchtime)
 
int fit3D ()
 
int fit3D_inner ()
 
int trackCharge2D ()
 
int trackCharge3D ()
 
void outerHit ()
 
void cald_layer ()
 
double getMapRho () const
 
double getMapTheta () const
 
double getPro () const
 
void Leastfit (vector< double >, vector< double >, double &, double &)
 
void setMdcHit (const vector< MdcHit * > *mdchit)
 
void setMcPar (std::map< int, const HepVector > mcTkPars)
 
double getbunchTime ()
 
void setbunchTime (double t)
 
int getTrkid ()
 
int fitLeast ()
 
double intersect_cylinder (double r_cylinder, double r_center, double phi_center, int charge)
 
double intersect_cylinder (int charge, double x_center, double y_center, double r_cylinder)
 
 HoughTrack (int charge, double angle, double rho, double dAngle, double dRho, int trkID)
 
 HoughTrack (int charge, const HepPoint3D &position, const Hep3Vector &momentum, int trkID)
 
 HoughTrack (HepPoint3D &pivot, HepVector &a, int trkID)
 
 HoughTrack (const HoughTrack &other)
 
HoughTrackoperator= (const HoughTrack &other)
 
 HoughTrack ()
 
void setTrkID (int trkID)
 
void setFlag (int flag)
 
void setCharge (int charge)
 
void setAngle (double angle)
 
void setRho (double rho)
 
void setDAngle (double dAngle)
 
void setDRho (double dRho)
 
void setDTanl (double dTanl)
 
void setDDz (double dDz)
 
void setChi2 (double chi2)
 
void setDz (double dz)
 
void setTanl (double tanl)
 
int getTrkID () const
 
int getCharge () const
 
int getFlag () const
 
double getAngle () const
 
double getRho () const
 
double getDAngle () const
 
double getDRho () const
 
double getDTanl () const
 
double getDDz () const
 
double getChi2 () const
 
int getCircleFitStat () const
 
TrkRecoTrkgetTrkRecoTrk ()
 
double getDr () const
 
double getPhi0 () const
 
double getKappa () const
 
double getDz () const
 
double getTanl () const
 
int findXHot (vector< HoughHit * > &hitList, int charge)
 
void sortHot (vector< HoughHit * > &hotList)
 
vector< HoughHit * > getVecHitPnt ()
 
void addHitPnt (HoughHit *aHitPnt)
 
void dropHitPnt (HoughHit *aHitPnt)
 
void dropVHitPnt (HoughHit *aHitPnt)
 
int getNHitsShared ()
 
void dropRedundentCgemXHits ()
 
void dropRedundentCgemVHits ()
 
int getNhitFirstHalf ()
 
int getNhitSecondHalf ()
 
int getNhitUnusedFirstHalf ()
 
int getNhitUnusedSecondHalf ()
 
void resetNhitHalf ()
 
double driftDistRes (HoughHit *hit)
 
int judgeHalf (HoughHit *hit)
 
int judgeCharge (HoughHit *hit)
 
int judgeCharge (double xHit, double yHit)
 
TrkErrCode fitCircle (const MdcDetector *mdcDetector, TrkContextEv *trkContextEv, double bunchT0)
 
int calculateZ_S (HoughHit *hit)
 
void updateHelix ()
 
void update (double angle, double rho)
 
void updateCirclePar (double dr, double phi0, double kappa)
 
void markUsedHot (vector< HoughHit * > &hitPntList, int use=1)
 
void markUsedHot (int use=1)
 
void print ()
 
void printHot ()
 
void clearHits ()
 
bool isAGoodCircle ()
 
int getNTried ()
 
void releaseSelHits ()
 
vector< double > getVecHitRes ()
 
vector< HoughHit * > getVecStereoHitPnt ()
 
void addVecStereoHitPnt (HoughHit *aHitPnt)
 
vector< double > getVecStereoHitRes ()
 
TrkErrCode fitHelix (const MdcDetector *mdcDetector, const BField *bField, double bunchT0, vector< HoughHit * > &hot, int Layer)
 
TrkErrCode fitHelix (const MdcDetector *mdcDetector, TrkContextEv *trkContextEv, double bunchT0, vector< MdcHit * > &mdcHitCol, vector< HoughHit * > &hot)
 
int findVHot (vector< HoughHit * > &hitList, int charge, int maxLayer)
 
vector< HoughHit * > getHotList (int type=2)
 
HoughTrackgetMcTrack () const
 
void setMcTrack (HoughTrack *mcTrack)
 
void clearMemory ()
 
 HoughTrack ()
 
 ~HoughTrack ()
 
 HoughTrack (const HoughTrack &other)
 
 HoughTrack (const HoughPeak &centerPeak, std::vector< const HoughHit * > trackHitList, double, double, int)
 
TrkRecoTrkgetTrk () const
 
TrkRecoTrkgetTrk2D () const
 
vector< MdcHit * > & getVecForClean3D ()
 
HoughPeak getCenterPeak () const
 
Hough2D get2D () const
 
Hough3D get3D () const
 
recHitCol & getHoughHitList ()
 
void setCharge (int charge)
 
int getCharge () const
 
double getPt_least () const
 
double getPt2D () const
 
double getPt3D () const
 
double getP () const
 
double getPz () const
 
double getRho () const
 
double getTheta () const
 
double getD0 () const
 
double getOmega () const
 
double getPhi0 () const
 
double getTanl () const
 
double getZ0 () const
 
double getTanl_zs () const
 
double getZ0_zs () const
 
int getHitNum (int) const
 
int getHitNumA (int) const
 
int getHitNumS (int) const
 
int getNfit2D () const
 
int getNfit3D () const
 
int getStat2D () const
 
int getStat3D () const
 
double getCirR () const
 
double getCirX () const
 
double getCirY () const
 
double getChi2_3D () const
 
double getChi2_2D () const
 
double getNfit () const
 
void setHoughHitList (vector< HoughHit > vec_hit)
 
void printRecHit () const
 
void printHoughTrack ()
 
void print ()
 
void sortHit ()
 
void fit (double bunchtime)
 
int calzs ()
 
void fitzs ()
 
int judgeTrack ()
 
int find_stereo_hit ()
 
int find_pair_hit ()
 
int cutNoise_inner ()
 
int cut_axial_inner ()
 
HoughTrackoperator= (const HoughTrack &other)
 
HoughTrackadd (const HoughTrack &other)
 
int fit2D (double bunchtime)
 
int fit3D ()
 
int fit3D_inner ()
 
int trackCharge2D ()
 
int trackCharge3D ()
 
void outerHit ()
 
void cald_layer ()
 
double getMapRho () const
 
double getMapTheta () const
 
double getPro () const
 
void Leastfit (vector< double >, vector< double >, double &, double &)
 
void setMdcHit (const vector< MdcHit * > *mdchit)
 
void setMcPar (std::map< int, const HepVector > mcTkPars)
 
double getbunchTime ()
 
void setbunchTime (double t)
 
int getTrkid ()
 
int fitLeast ()
 
double intersect_cylinder (double r_cylinder, double r_center, double phi_center, int charge)
 
double intersect_cylinder (int charge, double x_center, double y_center, double r_cylinder)
 
- Public Member Functions inherited from Helix
 Helix ()
 
 Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 
 Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 
 Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
 
 Helix (const Helix &i)
 
virtual ~Helix ()
 Destructor.
 
const HepPoint3Dcenter (void) const
 returns position of helix center(z = 0.);
 
const HepPoint3Dpivot (void) const
 returns pivot position.
 
double radius (void) const
 returns radious of helix.
 
HepPoint3D x (double dPhi=0.) const
 returns position after rotating angle dPhi in phi direction.
 
double * x (double dPhi, double p[3]) const
 
HepPoint3D x (double dPhi, HepSymMatrix &Ex) const
 returns position and convariance matrix(Ex) after rotation.
 
Hep3Vector direction (double dPhi=0.) const
 returns direction vector after rotating angle dPhi in phi direction.
 
Hep3Vector momentum (double dPhi=0.) const
 returns momentum vector after rotating angle dPhi in phi direction.
 
Hep3Vector momentum (double dPhi, HepSymMatrix &Em) const
 returns momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass, HepSymMatrix &Em) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass, HepPoint3D &x, HepSymMatrix &Emx) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
double dr (void) const
 returns an element of parameters.
 
double phi0 (void) const
 
double kappa (void) const
 
double dz (void) const
 
double tanl (void) const
 
double curv (void) const
 
double sinPhi0 (void) const
 
double cosPhi0 (void) const
 
double alpha (void) const
 
const HepVector & a (void) const
 returns helix parameters.
 
const HepSymMatrix & Ea (void) const
 returns error matrix.
 
double pt (void) const
 
double cosTheta (void) const
 
const HepVector & a (const HepVector &newA)
 sets helix parameters.
 
const HepSymMatrix & Ea (const HepSymMatrix &newdA)
 sets helix paramters and error matrix.
 
const HepPoint3Dpivot (const HepPoint3D &newPivot)
 sets pivot position.
 
void set (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 sets helix pivot position, parameters, and error matrix.
 
void ignoreErrorMatrix (void)
 unsets error matrix. Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.
 
double bFieldZ (double)
 sets/returns z componet of the magnetic field.
 
double bFieldZ (void) const
 
Helixoperator= (const Helix &)
 Copy operator.
 
HepMatrix delApDelA (const HepVector &ap) const
 
HepMatrix delXDelA (double phi) const
 
HepMatrix delMDelA (double phi) const
 
HepMatrix del4MDelA (double phi, double mass) const
 
HepMatrix del4MXDelA (double phi, double mass) const
 
double IntersectCylinder (double r) const
 
double flightArc (HepPoint3D &hit) const
 
double flightArc (double r) const
 
double flightLength (HepPoint3D &hit) const
 
double dPhi (HepPoint3D &hit) const
 
 Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 
 Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 
 Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
 
virtual ~Helix ()
 Destructor.
 
const HepPoint3Dcenter (void) const
 returns position of helix center(z = 0.);
 
const HepPoint3Dpivot (void) const
 returns pivot position.
 
double radius (void) const
 returns radious of helix.
 
HepPoint3D x (double dPhi=0.) const
 returns position after rotating angle dPhi in phi direction.
 
double * x (double dPhi, double p[3]) const
 
HepPoint3D x (double dPhi, HepSymMatrix &Ex) const
 returns position and convariance matrix(Ex) after rotation.
 
Hep3Vector direction (double dPhi=0.) const
 returns direction vector after rotating angle dPhi in phi direction.
 
Hep3Vector momentum (double dPhi=0.) const
 returns momentum vector after rotating angle dPhi in phi direction.
 
Hep3Vector momentum (double dPhi, HepSymMatrix &Em) const
 returns momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass, HepSymMatrix &Em) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass, HepPoint3D &x, HepSymMatrix &Emx) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
double dr (void) const
 returns an element of parameters.
 
double phi0 (void) const
 
double kappa (void) const
 
double dz (void) const
 
double tanl (void) const
 
double curv (void) const
 
double sinPhi0 (void) const
 
double cosPhi0 (void) const
 
double alpha (void) const
 
const HepVector & a (void) const
 returns helix parameters.
 
const HepSymMatrix & Ea (void) const
 returns error matrix.
 
double pt (void) const
 
double cosTheta (void) const
 
const HepVector & a (const HepVector &newA)
 sets helix parameters.
 
const HepSymMatrix & Ea (const HepSymMatrix &newdA)
 sets helix paramters and error matrix.
 
const HepPoint3Dpivot (const HepPoint3D &newPivot)
 sets pivot position.
 
void set (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 sets helix pivot position, parameters, and error matrix.
 
void ignoreErrorMatrix (void)
 unsets error matrix. Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.
 
double bFieldZ (double)
 sets/returns z componet of the magnetic field.
 
double bFieldZ (void) const
 
Helixoperator= (const Helix &)
 Copy operator.
 
HepMatrix delApDelA (const HepVector &ap) const
 
HepMatrix delXDelA (double phi) const
 
HepMatrix delMDelA (double phi) const
 
HepMatrix del4MDelA (double phi, double mass) const
 
HepMatrix del4MXDelA (double phi, double mass) const
 
double IntersectCylinder (double r) const
 
 Helix ()
 
 Helix (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Constructor with pivot, helix parameter a, and its error matrix.
 
 Helix (const HepPoint3D &pivot, const HepVector &a)
 Constructor without error matrix.
 
 Helix (const HepPoint3D &position, const Hep3Vector &momentum, double charge)
 Constructor with position, momentum, and charge.
 
 Helix (const Helix &i)
 
virtual ~Helix ()
 Destructor.
 
const HepPoint3Dcenter (void) const
 returns position of helix center(z = 0.);
 
const HepPoint3Dpivot (void) const
 returns pivot position.
 
double radius (void) const
 returns radious of helix.
 
HepPoint3D x (double dPhi=0.) const
 returns position after rotating angle dPhi in phi direction.
 
double * x (double dPhi, double p[3]) const
 
HepPoint3D x (double dPhi, HepSymMatrix &Ex) const
 returns position and convariance matrix(Ex) after rotation.
 
Hep3Vector direction (double dPhi=0.) const
 returns direction vector after rotating angle dPhi in phi direction.
 
Hep3Vector momentum (double dPhi=0.) const
 returns momentum vector after rotating angle dPhi in phi direction.
 
Hep3Vector momentum (double dPhi, HepSymMatrix &Em) const
 returns momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass, HepSymMatrix &Em) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass, HepPoint3D &x, HepSymMatrix &Emx) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
double dr (void) const
 returns an element of parameters.
 
double phi0 (void) const
 
double kappa (void) const
 
double dz (void) const
 
double tanl (void) const
 
double curv (void) const
 
double sinPhi0 (void) const
 
double cosPhi0 (void) const
 
double alpha (void) const
 
const HepVector & a (void) const
 returns helix parameters.
 
const HepSymMatrix & Ea (void) const
 returns error matrix.
 
double pt (void) const
 
double cosTheta (void) const
 
const HepVector & a (const HepVector &newA)
 sets helix parameters.
 
const HepSymMatrix & Ea (const HepSymMatrix &newdA)
 sets helix paramters and error matrix.
 
const HepPoint3Dpivot (const HepPoint3D &newPivot)
 sets pivot position.
 
void set (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 sets helix pivot position, parameters, and error matrix.
 
void ignoreErrorMatrix (void)
 unsets error matrix. Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.
 
double bFieldZ (double)
 sets/returns z componet of the magnetic field.
 
double bFieldZ (void) const
 
Helixoperator= (const Helix &)
 Copy operator.
 
HepMatrix delApDelA (const HepVector &ap) const
 
HepMatrix delXDelA (double phi) const
 
HepMatrix delMDelA (double phi) const
 
HepMatrix del4MDelA (double phi, double mass) const
 
HepMatrix del4MXDelA (double phi, double mass) const
 
double IntersectCylinder (double r) const
 
double flightArc (HepPoint3D &hit) const
 
double flightArc (double r) const
 
double flightLength (HepPoint3D &hit) const
 
double dPhi (HepPoint3D &hit) const
 

Public Attributes

std::map< int, const HepVector > g_tkParTruth
 

Static Public Attributes

static int m_clearTrack =1
 
static int m_useCgemInGlobalFit =3
 
static TGraph * m_cut [2][43] = {NULL}
 
static bool m_debug =0
 
static bool m_globalfit =0
 
- Static Public Attributes inherited from Helix
static const double ConstantAlpha = 333.564095
 Constant alpha for uniform field.
 

Additional Inherited Members

- Protected Attributes inherited from Helix
IMagneticFieldSvcm_pmgnIMF
 
double m_bField
 
double m_alpha
 

Detailed Description

Constructor & Destructor Documentation

◆ HoughTrack() [1/16]

HoughTrack::HoughTrack ( int  charge,
double  angle,
double  rho,
double  dAngle,
double  dRho,
int  trkID 
)

Definition at line 19 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

19 :Helix()
20{
21 bFieldZ(-bFieldZ());
22
23 m_trkID = trkID;
24 m_charge = (charge>0)?1:-1;
25 m_angle = angle;
26 m_rho = rho;
27 m_flag = 0;
28 m_dAngle = dAngle;
29 m_dRho = dRho;
30 m_dTanl = 0;
31 m_dDz = 0;
32 m_chi2 = 0;
33 m_circleFitStat = 0;
34
35 m_dr = 0;
36 m_phi0 = (rho>0)? angle:angle+M_PI;
37 m_phi0 = (m_charge<0)? m_phi0:m_phi0+M_PI;
38 if(m_phi0>2*M_PI)m_phi0-=2*M_PI;
39 if(m_phi0<0) m_phi0+=2*M_PI;
40 m_kappa = fabs(m_alpha*rho)*m_charge;
41 m_dz = 0.0;
42 m_tanl = 0.0;
43
44 HepPoint3D pivot(0,0,0);
45 HepVector a(5,0);
46 HepSymMatrix Ea(5,0);
47 a(2) = m_phi0;
48 a(3) = m_kappa;
49 set(pivot,a,Ea);
50
51 //Helix helix(pivot,a); helix.bFieldZ(-helix.bFieldZ());
52 //KalmanFit::Helix helix(pivot,a);
53 //m_helix = helix;
54 //m_hot.clear();
55 m_trkRecoTrk = NULL;
56
57 m_vecHitPnt.clear();
58 m_vecHitResidual.clear();
59 m_vecHitChi2.clear();
60
61 //m_dr = m_helix.dr();
62 //m_phi0 = m_helix.phi0();
63 //m_kappa = m_helix.kappa();
64 //m_dz = m_helix.dz();
65 //m_tanl = m_helix.tanl();
66
67 m_unused=0;
68 m_untried=0;
69 m_mcTrack = NULL;
70 m_cgemHitVector.clear();
71}
#define M_PI
Definition: TConstant.h:4
void set(const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
sets helix pivot position, parameters, and error matrix.
const HepSymMatrix & Ea(void) const
returns error matrix.
const HepVector & a(void) const
returns helix parameters.
const HepPoint3D & pivot(void) const
returns pivot position.

◆ HoughTrack() [2/16]

HoughTrack::HoughTrack ( int  charge,
const HepPoint3D position,
const Hep3Vector &  momentum,
int  trkID 
)

Definition at line 73 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

73 :Helix(position,momentum,charge)
74//HoughTrack::HoughTrack(int charge, HepPoint3D& position, Hep3Vector& momentum, int trkID)
75{
76 bFieldZ(-bFieldZ());
77 //Helix helix(position, momentum, charge); helix.bFieldZ(-helix.bFieldZ());
78 //m_helix = helix;
79 m_trkID = trkID;
80 m_charge = charge;
81 //m_angle = m_helix.center().phi();
82 //m_rho = 1./m_helix.radius();
83 m_angle = center().phi();
84 m_rho = 1./radius();
85 m_flag = 0;
86 if(m_angle<0)m_angle=+2*M_PI;
87 m_circleFitStat = 0;
88
89 //m_dr = m_helix.dr();
90 //m_phi0 = m_helix.phi0();
91 //m_kappa = m_helix.kappa();
92 //m_dz = m_helix.dz();
93 //m_tanl = m_helix.tanl();
94 m_dr = dr();
95 m_phi0 = phi0();
96 m_kappa = kappa();
97 m_dz = dz();
98 m_tanl = tanl();
99
100 //m_hot.clear();
101 m_trkRecoTrk = NULL;
102
103 m_vecHitPnt.clear();
104 m_vecHitResidual.clear();
105 m_vecHitChi2.clear();
106
107 m_dAngle = 0;
108 m_dRho = 0;
109 m_dTanl = 0;
110 m_dDz = 0;
111 m_chi2 = 0;
112 m_mcTrack = NULL;
113 m_cgemHitVector.clear();
114}
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
const HepPoint3D & center(void) const
returns position of helix center(z = 0.);
double radius(void) const
returns radious of helix.
double dr(void) const
returns an element of parameters.

◆ HoughTrack() [3/16]

HoughTrack::HoughTrack ( HepPoint3D pivot,
HepVector &  a,
int  trkID 
)

Definition at line 116 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

116 :Helix(pivot,a)
117{
118 bFieldZ(-bFieldZ());
119 //Helix helix(pivot,a); helix.bFieldZ(-helix.bFieldZ());
120 //m_helix = helix;
121 m_trkID = trkID;
122 //m_charge = (m_helix.kappa()>0)? 1:-1;;
123 //m_angle = m_helix.center().phi();
124 //m_rho = 1./m_helix.radius();
125 m_charge = (kappa()>0)? 1:-1;;
126 m_angle = center().phi();
127 m_rho = 1./radius();
128 m_flag = 0;
129 m_circleFitStat = 0;
130 if(m_angle<0)m_angle=+2*M_PI;
131
132 //m_dr = m_helix.dr();
133 //m_phi0 = m_helix.phi0();
134 //m_kappa = m_helix.kappa();
135 //m_dz = m_helix.dz();
136 //m_tanl = m_helix.tanl();
137 m_dr = dr();
138 m_phi0 = phi0();
139 m_kappa = kappa();
140 m_dz = dz();
141 m_tanl = tanl();
142
143 //m_hot.clear();
144 m_trkRecoTrk = NULL;
145
146 m_vecHitPnt.clear();
147 m_vecHitResidual.clear();
148 m_vecHitChi2.clear();
149
150 m_dAngle = 0;
151 m_dRho = 0;
152 m_dTanl = 0;
153 m_dDz = 0;
154 m_chi2 = 0;
155 m_mcTrack = NULL;
156 m_cgemHitVector.clear();
157}

◆ HoughTrack() [4/16]

HoughTrack::HoughTrack ( const HoughTrack other)

Definition at line 222 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

222 :
223 Helix(other),
224 m_trkID(other.m_trkID),
225 m_charge(other.m_charge),
226 m_angle(other.m_angle),
227 m_rho(other.m_rho),
228 m_flag(other.m_flag),
229
230 m_dAngle(other.m_dAngle),
231 m_dRho(other.m_dRho),
232 m_dTanl(other.m_dTanl),
233 m_dDz(other.m_dTanl),
234
235 m_dr(other.m_dr),
236 m_phi0(other.m_phi0),
237 m_kappa(other.m_kappa),
238 m_dz(other.m_dz),
239 m_tanl(other.m_tanl),
240
241 m_chi2(other.m_chi2),
242 m_trkRecoTrk(other.m_trkRecoTrk),
243
244 m_circleFitStat(other.m_circleFitStat),
245 m_vecHitPnt(other.m_vecHitPnt),
246 m_vecHitResidual(other.m_vecHitResidual),
247 m_vecHitChi2(other.m_vecHitChi2),
248 m_vecStereoHitPnt(other.m_vecStereoHitPnt),
249 m_vecStereoHitRes(other.m_vecStereoHitRes),
250 m_mcTrack(other.m_mcTrack),
251 m_cgemHitVector(other.m_cgemHitVector)
252{}
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118

◆ HoughTrack() [5/16]

HoughTrack::HoughTrack ( )

Definition at line 187 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

188{
189 m_trkID = -1;
190 m_charge = 0;
191 m_angle = 0;
192 m_rho = 1e-6;
193 m_flag = 0;
194 HepVector a(5,0);
195 HepPoint3D pivot(0,0,0);
196 bFieldZ(-bFieldZ());
197 m_circleFitStat = 0;
198
199 m_dr = dr();
200 m_phi0 = phi0();
201 m_kappa = kappa();
202 m_dz = dz();
203 m_tanl = tanl();
204
205 //m_hot.clear();
206 m_trkRecoTrk = NULL;
207
208 m_vecHitPnt.clear();
209 m_vecHitResidual.clear();
210 m_vecHitChi2.clear();
211
212 m_dAngle = 0;
213 m_dRho = 0;
214 m_dTanl = 0;
215 m_dDz = 0;
216 m_chi2 = 0;
217 m_mcTrack = NULL;
218 m_cgemHitVector.clear();
219}

◆ HoughTrack() [6/16]

HoughTrack::HoughTrack ( )

◆ ~HoughTrack() [1/2]

HoughTrack::~HoughTrack ( )

Definition at line 19 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

19 {
20}

◆ HoughTrack() [7/16]

HoughTrack::HoughTrack ( const HoughTrack other)

◆ HoughTrack() [8/16]

HoughTrack::HoughTrack ( const HoughPeak centerPeak,
std::vector< const HoughHit * >  trackHitList,
double  rho,
double  theta,
int  trackId 
)

Definition at line 151 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

151 {
152 _centerPeak=centerPeak;
153 _recHitVec.clear();
154 _stat2D=0;
155 _stat3D=0;
156 _tanl=-999;
157 _z0=-999;
158 _ptLeast=-999;
159 _pt2D=-999;
160 _pt3D=-999;
161 _p=-999;
162 _d0=-999;
163 _omega=-999;
164 _phi0=-999;
165 _z0=-999;
166 _tanl=-999;
167 _chi2_aver=-999;
168 _nfit=-999;
169 p_trk=NULL;
170 p_trk2D=NULL;
171 _charge=0; //undeter mine
172 _maprho=rho;
173 _maptheta=theta;
174 _trkid = trackId;
175 //if(_recHitVec.size()!= 0 ){
176 // cout<<" Mind trackhitlist size !=0 "<<endl;
177 // for(int i =0;i<_recHitVec.size();i++){
178 // delete _recHitVec[i];
179 // _recHitVec[i]=NULL;
180 // }
181 // _recHitVec.clear();
182 //}
183 int t_size = trackHitList.size();
184 for(int i =0;i<t_size;i++){
185 HoughRecHit p_hit ( *(trackHitList[i]),0.,0.,1);
186 p_hit.setPtr2D(&_Hough2D);
187 p_hit.setflag(0);
188 _recHitVec.push_back(p_hit);
189 }
190}

◆ HoughTrack() [9/16]

HoughTrack::HoughTrack ( int  charge,
double  angle,
double  rho,
double  dAngle,
double  dRho,
int  trkID 
)

◆ HoughTrack() [10/16]

HoughTrack::HoughTrack ( int  charge,
const HepPoint3D position,
const Hep3Vector &  momentum,
int  trkID 
)

◆ HoughTrack() [11/16]

HoughTrack::HoughTrack ( HepPoint3D pivot,
HepVector &  a,
int  trkID 
)

◆ HoughTrack() [12/16]

HoughTrack::HoughTrack ( const HoughTrack other)

◆ HoughTrack() [13/16]

HoughTrack::HoughTrack ( )

◆ HoughTrack() [14/16]

HoughTrack::HoughTrack ( )

◆ ~HoughTrack() [2/2]

HoughTrack::~HoughTrack ( )

◆ HoughTrack() [15/16]

HoughTrack::HoughTrack ( const HoughTrack other)

◆ HoughTrack() [16/16]

HoughTrack::HoughTrack ( const HoughPeak centerPeak,
std::vector< const HoughHit * >  trackHitList,
double  ,
double  ,
int   
)

Member Function Documentation

◆ add() [1/2]

HoughTrack & HoughTrack::add ( const HoughTrack other)

◆ add() [2/2]

HoughTrack & HoughTrack::add ( const HoughTrack other)

◆ addHitPnt() [1/2]

void HoughTrack::addHitPnt ( HoughHit aHitPnt)
inline

Definition at line 83 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

83{m_vecHitPnt.push_back(aHitPnt);};// llwang 2018-12-26

Referenced by HoughFinder::getMcParticleCol().

◆ addHitPnt() [2/2]

void HoughTrack::addHitPnt ( HoughHit aHitPnt)
inline

Definition at line 83 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

83{m_vecHitPnt.push_back(aHitPnt);};// llwang 2018-12-26

◆ addVecStereoHitPnt() [1/2]

void HoughTrack::addVecStereoHitPnt ( HoughHit aHitPnt)
inline

Definition at line 126 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

126{m_vecStereoHitPnt.push_back(aHitPnt);};

Referenced by HoughFinder::getMcParticleCol().

◆ addVecStereoHitPnt() [2/2]

void HoughTrack::addVecStereoHitPnt ( HoughHit aHitPnt)
inline

Definition at line 126 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

126{m_vecStereoHitPnt.push_back(aHitPnt);};

◆ calculateZ_S() [1/2]

int HoughTrack::calculateZ_S ( HoughHit hit)

Definition at line 768 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

769{
770 int nTangency(0);
771 if(hit->getFlag()==0)return nTangency;
772 //if(hit->getPairHit()==NULL)return nTangency;
773 //if(hit->getPairHit()->getHalfCircle()!=1)return nTangency;
774 double s(0),z(0);
775 double xc = center().x();
776 double yc = center().y();
777 double rTrack = radius();// signed FIXME
778 if(hit->getHitType()==HoughHit::CGEMHIT){
779 if(hit->getFlag()!=2)return nTangency;
780 //for(HitVector_Iterator hitIt = m_hot.begin(); hitIt != m_hot.end();hitIt++){
781 for(vector<HoughHit*>::iterator hotIt = m_vecHitPnt.begin(); hotIt != m_vecHitPnt.end(); hotIt++){
782 if((*hotIt)->getFlag()!=0)continue;
783 if((*hotIt)->getHitType()==HoughHit::MDCHIT)continue;
784 if((*hotIt)->getCgemCluster()->getclusterid() == hit->getCgemCluster()->getclusterflagb()){
785 HepPoint3D point = hit->getHitPosition();
786 s = flightArc(point);
787 z = point.z();
788 // double rHit = point.perp();
789 // s = flightArc(rHit);
790 // z = getZfrom ... // FIXME
791 pair<double,double> sz(s,z);
792 hit->addSZ(sz);
793 nTangency++;
794 //double s = flightArc(hit->getHitPosition());
795 }
796 }
797 }else{
798 hit->resetSZ();
799 double drift = hit->getDriftDist();
800 const MdcGeoWire* wire = hit->getMdcGeomSvc()->Wire(hit->getLayer(),hit->getWire());
801 HepPoint3D westPoint = wire->Forward();
802 HepPoint3D eastPoint = wire->Backward();
803 double xEast = eastPoint.x()/10.0;
804 double xWest = westPoint.x()/10.0;
805 double yEast = eastPoint.y()/10.0;
806 double yWest = westPoint.y()/10.0;
807 double zEast = eastPoint.z()/10.0;
808 double zWest = westPoint.z()/10.0;
809 //cout<<"wast:x,y,z: "<<xWest<<", "<<yWest<<", "<<zWest<<endl;
810 //cout<<"east:x,y,z: "<<xEast<<", "<<yEast<<", "<<zEast<<endl;
811 //cout<<"Xc, Yc, Rc: "<<xc<<", "<<yc<<", "<<rTrack<<endl;
812 double west2east = sqrt((xEast-xWest)*(xEast-xWest)+(yEast-yWest)*(yEast-yWest));
813
814 double slope = (yEast-yWest)/(xEast-xWest);
815 double intercept = (yWest-slope*xWest+yEast-slope*xEast)/2;
816 double a = 1+slope*slope;
817 double b = -2*(xc+slope*yc-slope*intercept);
818 double c1 = xc*xc+(yc-intercept)*(yc-intercept)-(rTrack+drift)*(rTrack+drift);
819 double c2 = xc*xc+(yc-intercept)*(yc-intercept)-(rTrack-drift)*(rTrack-drift);
820 //double c1 = intercept*(2*yc-intercept)+drift*(drift+rTrack);
821 //double c2 = intercept*(2*yc-intercept)+drift*(drift-rTrack);
822 double delta1 = (b*b-4*a*c1);
823 double delta2 = (b*b-4*a*c2);
824 //cout<<"a,b,c1,c2: "<<a<<", "<<b<<", "<<c1<<", "<<c2<<endl;
825 //cout<<"delta: "<<delta1<<", "<<delta2<<endl;
826 if(delta1>=0){
827 double x1 = (-b+sqrt(delta1))/(2*a);
828 double x2 = (-b-sqrt(delta1))/(2*a);
829 double y1 = slope*x1+intercept;
830 double y2 = slope*x2+intercept;
831 if((x1-xWest)*(x1-xEast)<0){
832 HepPoint3D point(x1,y1,0);
833 s = flightArc(point);
834 //s = flightArc(hit->getHitPosition());
835 double l = sqrt((x1-xWest)*(x1-xWest)+(y1-yWest)*(y1-yWest));
836 z = zWest + l/west2east*fabs((zEast-zWest));
837 pair<double,double> sz(s,z);
838 hit->addSZ(sz);
839 nTangency++;
840 HepPoint3D position(x1,y1,z);
841 //hit->addPosition(position);
842 //cout<<"hit outside track, bigger root, x,y,z,s: "<<x1<<", "<<y1<<", "<<z<<", "<<s<<endl;
843 }
844 if((x2-xWest)*(x2-xEast)<0){
845 HepPoint3D point(x2,y2,0);
846 s = flightArc(point);
847 //s = flightArc(hit->getHitPosition());
848 double l = sqrt((x2-xWest)*(x2-xWest)+(y2-yWest)*(y2-yWest));
849 z = zWest + l/west2east*fabs((zEast-zWest));
850 pair<double,double> sz(s,z);
851 hit->addSZ(sz);
852 nTangency++;
853 HepPoint3D position(x2,y2,z);
854 //cout<<"hit outside track, small root, x,y,z,s: "<<x2<<", "<<y2<<", "<<z<<", "<<s<<endl;
855 //hit->addPosition(position);
856 }
857 }
858
859 if( delta2>=0){
860 double x1 = (-b+sqrt(delta2))/(2*a);
861 double x2 = (-b-sqrt(delta2))/(2*a);
862 double y1 = slope*x1+intercept;
863 double y2 = slope*x2+intercept;
864 if((x1-xWest)*(x1-xEast)<0){
865 HepPoint3D point(x1,y1,0);
866 s = flightArc(point);
867 //s = flightArc(hit->getHitPosition());
868 double l = sqrt((x1-xWest)*(x1-xWest)+(y1-yWest)*(y1-yWest));
869 z = zWest + l/west2east*fabs((zEast-zWest));
870 pair<double,double> sz(s,z);
871 hit->addSZ(sz);
872 nTangency++;
873 HepPoint3D position(x1,y1,z);
874 //cout<<"hit outside track, bigger root, x,y,z,s: "<<x1<<", "<<y1<<", "<<z<<", "<<s<<endl;
875 //hit->addPosition(position);
876 }
877 if((x2-xWest)*(x2-xEast)<0){
878 HepPoint3D point(x2,y2,0);
879 s = flightArc(point);
880 //s = flightArc(hit->getHitPosition());
881 //double l = zWest + sqrt((x2-xWest)*(x2-xWest)+(y2-yWest)*(y2-yWest));
882 //z = l/west2east*fabs((zEast-zWest));
883 double l = sqrt((x2-xWest)*(x2-xWest)+(y2-yWest)*(y2-yWest));
884 z = zWest + l/west2east*fabs((zEast-zWest));
885 pair<double,double> sz(s,z);
886 hit->addSZ(sz);
887 nTangency++;
888 HepPoint3D position(x2,y2,z);
889 //cout<<"hit outside track, small root, x,y,z,s: "<<x2<<", "<<y2<<", "<<z<<", "<<s<<endl;
890 //hit->addPosition(position);
891 }
892 }
893 }
894 return nTangency;
895}
XmlRpcServer s
Definition: HelloServer.cpp:11
const RecCgemCluster * getCgemCluster() const
const MdcGeoWire *const Wire(unsigned id)
Definition: MdcGeomSvc.cxx:770
TCanvas * c1
Definition: tau_mode.c:75

Referenced by HoughFinder::fillHistogram(), and findVHot().

◆ calculateZ_S() [2/2]

int HoughTrack::calculateZ_S ( HoughHit hit)

◆ cald_layer() [1/2]

void HoughTrack::cald_layer ( )

Definition at line 940 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

940 {
941 /*
942 //in truth
943 double k,b,theta,rho,x_cross,y_cross;
944 vector<double> vtemp,utemp;
945 std::vector<HoughRecHit>::iterator iter = _recHitVec.begin();
946 for(int iHit=0;iter!= _recHitVec.end(); iter++,iHit++){
947 const HoughRecHit h = (*iter);
948 // if( h.getCirList()!=0 ) continue;
949 if ( h.digi()->getTrackIndex()>=0 && h.getStyle()==0&& h.getSlayerType()==0 && h.getCirList()==0 && utemp.size()<10) // ??use 2nd half
950 {
951 utemp.push_back(h.getUTruth());
952 vtemp.push_back(h.getVTruth());
953 }
954 }
955 Leastfit(utemp,vtemp,k,b);
956 //calcu truth
957 //k,b from truth
958 x_cross = -b/(k+1/k);
959 y_cross = b/(1+k*k);
960 rho=sqrt(x_cross*x_cross+y_cross*y_cross);
961 theta=atan2(y_cross,x_cross);
962 //
963 */
964 //cout<<"track center position "<<_centerX<<" "<<_centerY<<endl;
965 std::vector<HoughRecHit>::iterator iter0= _recHitVec.begin();
966 for(; iter0!= _recHitVec.end(); iter0++){
967 HoughRecHit *hit = &(*iter0);
968 if( hit->getSlayerType()!=0 ) continue;
969 //if(hit->getDetectorType() == CGEM)continue;
970 // if( hit->getCirList()!=0 ) continue; // use in learn distribute
971 //double cirr_hit = hit->getDriftDistTruth();
972 int layer = hit->getLayerId();
973 int wire = hit->getWireId();
974 double cirx_hit = hit->getMidX();
975 double ciry_hit = hit->getMidY();
976 double cirr_hit = hit->getDriftDist();
977 //if( _charge == 1 && (cirx_track*ciry_hit - ciry_track*cirx_hit>=0) ) continue; // suppose charge -1 FIXME
978 //if( _charge ==-1 && (cirx_track*ciry_hit - ciry_track*cirx_hit<=0) ) continue; // suppose charge -1 FIXME
979 double deltaD ;
980 if(hit->getDetectorType() == MDC){
981 double l1l2 = sqrt( (cirx_hit-_centerX)*(cirx_hit-_centerX)+(ciry_hit-_centerY)*(ciry_hit-_centerY) );
982 if( l1l2>_centerR ) deltaD = l1l2-_centerR-cirr_hit;
983 if( l1l2<=_centerR ) deltaD = l1l2-_centerR+cirr_hit;
984 }else if(hit->getDetectorType() == CGEM){
985 double r_cgem = hit->getCgemGeomSvc()->getCgemLayer(layer)->getMiddleROfGapD()/10.;
986 double phi_cross = intersect_cylinder(_charge,_centerX,_centerY,r_cgem);
987 double phih_cluster = hit->getCluster()->getrecphi();
988 double dphi = phih_cluster - phi_cross;
989 if(dphi>M_PI)dphi-=2*M_PI;
990 if(dphi<-1*M_PI)dphi+=2*M_PI;
991 deltaD = r_cgem*dphi;
992 }
993 hit->setDeltaD(deltaD);
994 //cout<<layer<<" "<<deltaD<<endl;
995 //cout<<l1l2<<" "<<hit->getDisToCir()<<endl;
996
997
998 //cal flight length
999 /*
1000 double theta_temp;
1001 double l_temp;
1002 if(_centerX==0||cirx_hit-_centerX==0){
1003 theta_temp=0;
1004 }
1005 else{
1006 theta_temp=M_PI-atan2(ciry_hit-_centerY,cirx_hit-_centerX)+atan2(_centerY,_centerX);
1007 if(theta_temp>2*M_PI){
1008 theta_temp=theta_temp-2*M_PI;
1009 }
1010 if(theta_temp<0){
1011 theta_temp=theta_temp+2*M_PI;
1012 }
1013 }
1014 //cout<<" charge "<<_charge <<" "<<theta_temp<<endl;
1015 if(_charge==-1) {
1016 l_temp=_centerR*theta_temp;
1017 }
1018 if(_charge==1) {
1019 theta_temp=2*M_PI-theta_temp;
1020 l_temp=_centerR*(theta_temp);
1021 }
1022 // cout<<"("<<hit->getLayerId()<<","<<hit->getWireId()<<") "<<l_temp<<endl;
1023 hit->setFltLen(l_temp);
1024 */
1025 // cout<<"int map deltaD: ("<<hit->getLayerId()<<","<<hit->getWireId()<<")"<< hit->getDeltaD()<<endl;
1026 }
1027}
double intersect_cylinder(double r_cylinder, double r_center, double phi_center, int charge)

Referenced by fit2D().

◆ cald_layer() [2/2]

void HoughTrack::cald_layer ( )

◆ calzs() [1/2]

int HoughTrack::calzs ( )

Definition at line 607 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

607 {
608 int n_zs=0;
609 for( int i =0; i<_recHitVec.size(); i++){
610 if ( _recHitVec[i].getSlayerType() ==0 || _recHitVec[i].getflag()!=0 ) continue;
611 if ( _recHitVec[i].getDetectorType()==MDC){
612 // if ( _recHitVec[i].getLayerId()>=8) continue;
613 HoughStereo zs( _bunchTime, &_Hough2D, &(_recHitVec[i]) );
614 // cout<<"("<<_recHitVec[i].getLayerId()<<","<<_recHitVec[i].getWireId()<<") stat "<<stat<<" style "<<_recHitVec[i].getStyle() <<endl;
615 // cout<<endl;
616
617 //zs.setAmb(-1); //right
618 //int stat_left = zs.cald();
619
620 //zs.setAmb(1); //left
621 //int stat_right= zs.cald();
622 //if( stat_left==-1 && stat_right==-1 ) _recHitVec[i].setflag(-999);
623
624 int stat= zs.cald();
625 _recHitVec[i].setnsol(stat);
626 if( stat==0 ) _recHitVec[i].setflag(-999);
627
628 zs.setRecHit();
629 _recHitVec[i].setAmb(-999); // check
630 //cout<<__FILE__<<" ("<<_recHitVec[i].getLayerId()<<", "<<_recHitVec[i].getWireId()<<") "<<_recHitVec[i].getflag()<<" "<<stat<<endl;
631 //if( _recHitVec[i].getLayerId()<8 ) n_zs++;
632 n_zs++;
633 if(m_debug>0) zs.print();
634 //zs.print();
635 }else if( _recHitVec[i].getDetectorType()==CGEM){
636 double z=(_recHitVec[i].getCluster())->getRecZ()/10.;
637 std::pair<double,double> theta_l = calcuArcTrack(_recHitVec[i]);
638 double l=theta_l.second;
639 _recHitVec[i].setzAmb( 0 , z);
640 _recHitVec[i].setsAmb( 0 , l);
641 _recHitVec[i].setzAmb( 1 , z);
642 _recHitVec[i].setsAmb( 1 , l);
643 _recHitVec[i]. setzPos(z);
644 _recHitVec[i]. setsPos(l);
645 HepPoint3D leftPoint(_recHitVec[i].getMidX(),_recHitVec[i].getMidY(),z);
646 HepPoint3D rightPoint(_recHitVec[i].getMidX(),_recHitVec[i].getMidY(),z);
647 _recHitVec[i].setLeftPoint(leftPoint);
648 _recHitVec[i].setRightPoint(rightPoint);
649 n_zs++;
650 }
651 }
652 // int naddStero = cutNoise_inner();
653 //return naddStero;
654 return n_zs;
655}

Referenced by fit3D(), and fit3D_inner().

◆ calzs() [2/2]

int HoughTrack::calzs ( )

◆ clearHits() [1/2]

void HoughTrack::clearHits ( )

Definition at line 1173 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1174{
1175 //m_hot.clear();
1176 m_vecHitPnt.clear();
1177 m_vecHitResidual.clear();
1178 m_vecHitChi2.clear();
1179 m_map_lay_d.clear();
1180 m_map_lay_hit.clear();
1181 m_setLayer.clear();
1182 m_unused=0;
1183 m_untried=0;
1184 m_nHitFirstHalf=0;
1185 m_nHitSecondHalf=0;
1186 m_nHitUnused_FirstHalf=0;
1187 m_nHitUnused_SecondHalf=0;
1188
1189
1190}

◆ clearHits() [2/2]

void HoughTrack::clearHits ( )

◆ clearMemory() [1/2]

void HoughTrack::clearMemory ( )

Definition at line 2538 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

2539{
2540 for(vector<CgemHitOnTrack*>::iterator iter = m_cgemHitVector.begin(); iter != m_cgemHitVector.end(); iter++){
2541 delete *iter;
2542 }
2543 if(m_clearTrack)delete m_trkRecoTrk;
2544}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

◆ clearMemory() [2/2]

void HoughTrack::clearMemory ( )

◆ cut_axial_inner() [1/2]

int HoughTrack::cut_axial_inner ( )

◆ cut_axial_inner() [2/2]

int HoughTrack::cut_axial_inner ( )

◆ cutNoise_inner() [1/2]

int HoughTrack::cutNoise_inner ( )

◆ cutNoise_inner() [2/2]

int HoughTrack::cutNoise_inner ( )

◆ driftDistRes() [1/2]

double HoughTrack::driftDistRes ( HoughHit hit)

Definition at line 632 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

633{
634 double residual(9999.);
635 HepPoint3D hitPoint = hit->getHitPosition();
636 if(hit->getHitType() == HoughHit::MDCHIT || hit->getHitType() == HoughHit::MDCMCHIT){
637 //HepPoint3D circleCenter = m_helix.center();
638 HepPoint3D circleCenter = center();
639 //double distance = circleCenter.perp(hitPoint);
640 double distance = (circleCenter-hitPoint).perp();
641 //hit->print();
642 //cout<<distance<<endl
643 //<<sqrt((circleCenter-hitPoint).x()*(circleCenter-hitPoint).x()+(circleCenter-hitPoint).y()*(circleCenter-hitPoint).y())<<endl
644 //<<sqrt((circleCenter.x()-hitPoint.x())*(circleCenter.x()-hitPoint.x())+(circleCenter.y()-hitPoint.y())*(circleCenter.y()-hitPoint.y()))<<endl;
645 //double Rc = m_helix.radius();
646 double Rc = fabs(radius());
647 double driftDist(0);
648 //if(hit->getHitType() == HoughHit::MDCMCHIT)driftDist = 0;
649 if(hit->getHitType() == HoughHit::MDCHIT)driftDist = hit->getDriftDist();
650 //residual = fabs(distance - Rc) - driftDist;
651 residual = driftDist-fabs(distance - Rc);
652 //cout<<"driftDist, distance, Rc = "<<driftDist<<", "<<distance<<", "<<Rc<<endl;
653 //double distance = (m_helix.center()).perp(hit->getHitPosition());
654 //res = fabs(distance - m_helix.radius()) - hit->getDriftDist();
655 }else if(hit->getHitType() == HoughHit::CGEMHIT || hit->getHitType() == HoughHit::CGEMMCHIT){
656 double rCgem = hitPoint.perp();
657 //double phiTrkFlt = m_helix.IntersectCylinder(rCgem);
658 double phiTrkFlt = IntersectCylinder(rCgem);
659 phiTrkFlt=judgeHalf(hit)*phiTrkFlt;
660 //HepPoint3D crossPoint = m_helix.x(phiTrkFlt);
661 HepPoint3D crossPoint = x(phiTrkFlt);
662 double phiCrossPoint = crossPoint.phi();
663 double phiMeasure = hitPoint.phi();
664 residual = phiMeasure - phiCrossPoint;
665 while(residual<-M_PI)residual += 2*M_PI;
666 while(residual> M_PI)residual -= 2*M_PI;
667 residual = rCgem*residual;
668 }
669 hit->setResidual(residual);
670 return residual;
671}
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.

Referenced by findXHot().

◆ driftDistRes() [2/2]

double HoughTrack::driftDistRes ( HoughHit hit)

◆ dropHitPnt() [1/2]

void HoughTrack::dropHitPnt ( HoughHit aHitPnt)

Definition at line 1834 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1835{
1836 vector<HoughHit*>::iterator it0 = m_vecHitPnt.begin();
1837 vector<HoughHit*>::iterator result = find(m_vecHitPnt.begin(), m_vecHitPnt.end(), aHitPnt);
1838 if(result!=m_vecHitPnt.end()) {
1839 //cout<<"remove hit "<<(*result)->getHitID();
1840 m_vecHitPnt.erase(result);
1841 vector<double>::iterator itRes = m_vecHitResidual.begin()+(result-it0);
1842 if(itRes!=m_vecHitResidual.end()) {
1843 //cout<<" with residual "<<*itRes<<" from trk "<<getTrkID()<<endl;
1844 m_vecHitResidual.erase(itRes);
1845 }
1846 }
1847}

Referenced by dropRedundentCgemXHits().

◆ dropHitPnt() [2/2]

void HoughTrack::dropHitPnt ( HoughHit aHitPnt)

◆ dropRedundentCgemVHits() [1/2]

void HoughTrack::dropRedundentCgemVHits ( )

Definition at line 1918 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1919{
1920 //cout<<"begin HoughTrack::dropRedundentCgemXHits"<<endl;
1921 vector<HoughHit*> hitPnt_cgem[3];
1922 HoughHit* hitPnt_cgem_resMin[3]={NULL, NULL, NULL};
1923 double res_cgem_min[3]={999., 999., 999.};
1924 vector<HoughHit*>::iterator iter = m_vecStereoHitPnt.begin();
1925 for(; iter!=m_vecStereoHitPnt.end(); iter++)
1926 {
1927 int iLayer = (*iter)->getLayer();
1928 if(iLayer<3) {
1929 hitPnt_cgem[iLayer].push_back(*iter);
1930 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
1931 double res = (*iter)->residual(this, positionOntrack, positionOnDetector);
1932 if(fabs(res)<fabs(res_cgem_min[iLayer])) {
1933 res_cgem_min[iLayer] = res;
1934 hitPnt_cgem_resMin[iLayer] = *iter;
1935 }
1936 }
1937 }
1938 for(int iLayer=0; iLayer<3; iLayer++)
1939 {
1940 int nHits = hitPnt_cgem[iLayer].size();
1941 if(nHits>1)
1942 {
1943 HoughHit* hitToKeep = hitPnt_cgem_resMin[iLayer];
1944 for(int iHit=0; iHit<nHits; iHit++)
1945 {
1946 HoughHit* aHoughHit = hitPnt_cgem[iLayer][iHit];
1947 if(aHoughHit==hitToKeep) continue;
1948 dropVHitPnt(aHoughHit);
1949 }
1950 }
1951 }
1952 //cout<<"end HoughTrack::dropRedundentCgemXHits"<<endl;
1953}

◆ dropRedundentCgemVHits() [2/2]

void HoughTrack::dropRedundentCgemVHits ( )

◆ dropRedundentCgemXHits() [1/2]

void HoughTrack::dropRedundentCgemXHits ( )

Definition at line 1859 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1860{
1861 //cout<<"begin HoughTrack::dropRedundentCgemXHits"<<endl;
1862 vector<HoughHit*> hitPnt_cgem[3];
1863 HoughHit* hitPnt_cgem_keep[3]={NULL, NULL, NULL};
1864 double res_cgem_keep[3]={999., 999., 999.};
1865 HoughHit* hitPnt_cgem_resMin[3]={NULL, NULL, NULL};
1866 double res_cgem_min[3]={999., 999., 999.};
1867 vector<HoughHit*>::iterator iter0 = m_vecHitPnt.begin();
1868 vector<HoughHit*>::iterator iter = m_vecHitPnt.begin();
1869 vector<double>::iterator itRes = m_vecHitResidual.begin();
1870 for(; iter!=m_vecHitPnt.end(); iter++)
1871 {
1872 int iLayer = (*iter)->getLayer();
1873 if(iLayer<3) {
1874 hitPnt_cgem[iLayer].push_back(*iter);
1875 int idx = iter-iter0;
1876 double res = m_vecHitResidual[idx];
1877 vector<double> vecRes = (*iter)->getVecResid();
1878 int nTrk = vecRes.size();
1879 if(nTrk==1&&fabs(res)<fabs(res_cgem_keep[iLayer])) {
1880 res_cgem_keep[iLayer] = res;
1881 hitPnt_cgem_keep[iLayer] = *iter;
1882 }
1883 if(fabs(res)<fabs(res_cgem_min[iLayer])) {
1884 res_cgem_min[iLayer] = res;
1885 hitPnt_cgem_resMin[iLayer] = *iter;
1886 }
1887 }
1888 }
1889 for(int iLayer=0; iLayer<3; iLayer++)
1890 {
1891 int nHits = hitPnt_cgem[iLayer].size();
1892 if(nHits>1)
1893 {
1894 HoughHit* hitToKeep;
1895 if(hitPnt_cgem_keep[iLayer]!=NULL) hitToKeep = hitPnt_cgem_keep[iLayer];
1896 else hitToKeep = hitPnt_cgem_resMin[iLayer];
1897 //cout<<"HoughTrack::dropRedundentCgemXHits: "<<endl;
1898 //cout<<" keep hit "<<hitToKeep->getHitID()
1899 //<<", layer "<<hitToKeep->getLayer()
1900 //<<" at ("<<hitToKeep->getHitPosition().x()
1901 //<<", "<<hitToKeep->getHitPosition().y()<<")"<<endl;
1902 for(int iHit=0; iHit<nHits; iHit++)
1903 {
1904 HoughHit* aHoughHit = hitPnt_cgem[iLayer][iHit];
1905 if(aHoughHit==hitToKeep) continue;
1906 //cout<<" remove hit "<<aHoughHit->getHitID()
1907 //<<", layer "<<aHoughHit->getLayer()
1908 //<<" at ("<<aHoughHit->getHitPosition().x()
1909 //<<", "<<aHoughHit->getHitPosition().y()<<")"<<endl;
1910 dropHitPnt(aHoughHit);
1911 //aHoughHit->dropTrkID(m_trkID);
1912 }
1913 }
1914 }
1915 //cout<<"end HoughTrack::dropRedundentCgemXHits"<<endl;
1916}

◆ dropRedundentCgemXHits() [2/2]

void HoughTrack::dropRedundentCgemXHits ( )

◆ dropVHitPnt() [1/2]

void HoughTrack::dropVHitPnt ( HoughHit aHitPnt)

Definition at line 1849 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1850{
1851 vector<HoughHit*>::iterator it0 = m_vecStereoHitPnt.begin();
1852 vector<HoughHit*>::iterator result = find(m_vecStereoHitPnt.begin(), m_vecStereoHitPnt.end(), aHitPnt);
1853 if(result!=m_vecStereoHitPnt.end()) {
1854 //cout<<"remove hit "<<(*result)->getHitID();
1855 m_vecStereoHitPnt.erase(result);
1856 }
1857}

Referenced by dropRedundentCgemVHits().

◆ dropVHitPnt() [2/2]

void HoughTrack::dropVHitPnt ( HoughHit aHitPnt)

◆ find_pair_hit() [1/2]

int HoughTrack::find_pair_hit ( )

Definition at line 1061 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

1061 {
1062 int nster1=0;
1063 int nster2=0;
1064 int nster3=0;
1065 int naxial1=0;
1066 int naxial2=0;
1067 int naxial3=0;
1068 for(int ihit=0;ihit<_houghList.size();ihit++){
1069 const HoughHit hit= _houghList[ihit];
1070 if ( hit.getDetectorType() == CGEM) continue;
1071 if ( hit.driftTime(_bunchTime,0)>1000 ) continue;
1072 if ( hit.getLayerId()>=24 ) continue;
1073 HoughRecHit p_hit( hit,0,0,1);
1074 p_hit.setPtr2D(&_Hough2D);
1075 std::pair<double,double> theta_l = calcuArcTrack( p_hit );
1076 double dist=calcuDistToTrack( p_hit );
1077 double distToCir=calcuDistToCir( p_hit );
1078 int flag = judge_half( p_hit );
1079 int layer = p_hit.getLayerId();
1080 int wire= p_hit.getWireId();
1081 int slayer= p_hit.getSlayerType();
1082 double disCut;
1083 if( slayer == 0 ) disCut = 6;
1084 else {
1085 if(layer<8) disCut=6;
1086 else disCut=6;
1087 }
1088 if( m_debug >0 )cout<<"("<<layer<<","<<wire<<") "<<" pair dist flag "<<dist<<" "<< flag<<endl;
1089 if( fabs(dist) < disCut ) {
1090 if( flag !=1 ) continue; //find hit in the 2nd half
1091 if ( layer<4) nster1++;
1092 else if ( layer<8) nster2++;
1093 else if ( layer<12) naxial1++;
1094 else if ( layer<16) naxial2++;
1095 else if ( layer<20) naxial3++;
1096 else nster3++;
1097 }
1098 }
1099 if(m_debug >0){
1100 cout <<"naxial_1 "<<naxial1<<endl;
1101 cout <<"naxial_2 "<<naxial2<<endl;
1102 cout <<"naxial_3 "<<naxial3<<endl;
1103 cout <<"stereo_1 "<<nster1<<endl;
1104 cout <<"stereo_2 "<<nster2<<endl;
1105 cout <<"stereo_3 "<<nster3<<endl;
1106 }
1107 //if (nster1>=2 && nster2>=2 && nster3>=2 && naxial1>=2 && naxial2>=2 && naxial3>=2 ) return 1;
1108 if ( nster1>=2 && nster3>=2 && naxial1>=2 && naxial2>=2 && naxial3>=2 ) return 1;
1109 else return 0;
1110}

Referenced by MdcHoughFinder::execute().

◆ find_pair_hit() [2/2]

int HoughTrack::find_pair_hit ( )

◆ find_stereo_hit() [1/2]

int HoughTrack::find_stereo_hit ( )

Definition at line 777 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

777 {
778 vector<HoughRecHit> vec_rec; // store hit temp
779 int naddStero=0;
780 for(int ihit=0;ihit<_houghList.size();ihit++){
781 const HoughHit hit= _houghList[ihit];
782 if ( hit.getDetectorType() == CGEM) continue;
783 if ( hit.getSlayerType()==0 ) continue;
784 if ( hit.driftTime(_bunchTime,0)>800 ) continue;
785 HoughRecHit p_hit( hit,0,0,1);
786 p_hit.setPtr2D(&_Hough2D);
787 std::pair<double,double> theta_l = calcuArcTrack( p_hit );
788 double dist=calcuDistToTrack( p_hit );
789 double distToCir=calcuDistToCir( p_hit );
790 int flag = judge_half( p_hit );
791 int layer = p_hit.getLayerId();
792 int wire= p_hit.getWireId();
793 double disCut;
794 if(layer<8) disCut=4;
795 else disCut=6;
796 // double dist=sqrt( pow( (xhit-x_cir),2)+pow( (yhit-y_cir),2) )-r_cir;
797 // cout<<"find stereo hit dist?("<<layer<<" ,"<<wire<<" ) "<<dist<<endl;
798 if( m_debug >0 )cout<<"("<<layer<<","<<wire<<") "<<" rec hit dist theta "<<dist<<" "<< theta_l.first<<endl;
799 //cout<<__FILE__<<" ("<<layer<<","<<wire<<") "<<flag<<" rec hit dist theta "<<dist<<" "<< theta_l.first<<endl;
800 if( fabs(dist) < disCut ) {
801 p_hit.setDisToTrack(dist);
802 p_hit.setDisToCir(distToCir);
803 p_hit.setRet(theta_l);
804 p_hit.setflag(flag);
805 // if( p_hit.getflag()==0 ) vec_rec.push_back(p_hit);
806 // vec_rec.push_back(p_hit);
807 if( p_hit.getflag()!=0 ) continue;
808 _recHitVec.push_back(p_hit);
809 naddStero++;
810 }
811 }
812 return naddStero;
813}

Referenced by MdcHoughFinder::execute().

◆ find_stereo_hit() [2/2]

int HoughTrack::find_stereo_hit ( )

◆ findVHot() [1/2]

int HoughTrack::findVHot ( vector< HoughHit * > &  hitList,
int  charge,
int  maxLayer 
)

Definition at line 1969 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1970{
1971 bool printFlag(false);
1972 int nHot(0);
1973 m_vecStereoHitPnt.clear();
1974 for(vector<HoughHit*>::iterator hitIt = hitList.begin(); hitIt != hitList.end(); hitIt++){
1975 /*
1976 if(0 == flag){
1977 if((*hitIt)->getFlag() != 0) continue;
1978 if(judgeCharge(*hitIt)*charge<0) continue;// charge requirement
1979 //if((*hitIt)->getPairHit()==NULL)continue;//FIXME
1980 //if((*hitIt)->getPairHit()->getHalfCircle()!=1)continue;//FIXME
1981 double cut1, cut2;
1982 int iLayer = (*hitIt)->getLayer();
1983 int used = (*hitIt)->getUse();
1984 XhitCutWindow(m_rho, iLayer, charge, cut1, cut2);
1985 double res = driftDistRes(*hitIt);
1986 map<int,double>::iterator it_map;
1987 it_map=m_map_lay_d.find(iLayer);
1988 if(it_map==m_map_lay_d.end()||fabs(res)<fabs(it_map->second))
1989 {
1990 m_map_lay_d[iLayer]=res;
1991 m_map_lay_hit[iLayer]=(*hitIt);
1992 }
1993 if(res>cut1&&res<cut2)
1994 {
1995 //cout<<" selected!";
1996 //if(iLayer>3)
1997 m_vecHitPnt.push_back(*hitIt);
1998 m_vecHitResidual.push_back(res);
1999 //m_hot.push_back((*(*hitIt)));
2000 m_chi2 =+ res*res;
2001 m_setLayer.insert(iLayer);
2002 if(used==0) m_untried++;
2003 if(used==0||used==-1) m_unused++;
2004 if(judgeHalf(*hitIt)>0) {
2005 m_nHitFirstHalf++;
2006 if(used<=0) m_nHitUnused_FirstHalf++;
2007 }
2008 else {
2009 m_nHitSecondHalf++;
2010 if(used<=0) m_nHitUnused_SecondHalf++;
2011 }
2012 nHot++;
2013 }// within window
2014 //cout<<endl;
2015 }// X-view
2016 //*/
2017 //else {
2018 int layer = (*hitIt)->getLayer();
2019 int wire = (*hitIt)->getWire();
2020 if((*hitIt)->getFlag() == 0) continue;
2021 if((*hitIt)->getHitType()==HoughHit::CGEMHIT){
2022 if(calculateZ_S(*hitIt)==0){
2023 continue;
2024 }
2025 }
2026 //if((*hitIt)->getPairHit()==NULL)continue;//FIXME
2027 //if((*hitIt)->getPairHit()->getHalfCircle()>1)continue;//FIXME
2028 double Pt = fabs(pt());
2029 double cut[2] = {0};
2030 if(layer<3){
2031 if(m_cut[0][layer+3]!=NULL)cut[0]=m_cut[0][layer+3]->Eval(Pt);
2032 if(m_cut[1][layer+3]!=NULL)cut[1]=m_cut[1][layer+3]->Eval(Pt);
2033 }else{
2034 if(m_cut[0][layer]!=NULL)cut[0]=m_cut[0][layer]->Eval(Pt);
2035 if(m_cut[1][layer]!=NULL)cut[1]=m_cut[1][layer]->Eval(Pt);
2036 }
2037 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
2038 double res = (*hitIt)->residual(this, positionOntrack, positionOnDetector);
2039 if(judgeCharge(positionOntrack.x(),positionOntrack.y())*charge<0) continue;// charge requirement
2040 bool isNewHot(true);
2041 for(vector<HoughHit*>::iterator hotIt = m_vecStereoHitPnt.begin(); hotIt != m_vecStereoHitPnt.end(); hotIt++){
2042 if((*hitIt)->getHitID() == (*hotIt)->getHitID()){
2043 isNewHot = false;
2044 break;
2045 }
2046 }
2047 if(!isNewHot){
2048 //cout<<" OK!";
2049 //cout<<endl;
2050 continue;
2051 }
2052 if(printFlag)(*hitIt)->print();
2053 if(printFlag)cout<<"res:"<<setw(12)<<res;
2054 if(printFlag)cout<<" win: "<<setw(5)<<cut[0]<<" ~ "<<setw(5)<<cut[1];
2055 double ext(1);
2056 if(ext*cut[0]<res&&res<ext*cut[1]){
2057 if((*hitIt)->getLayer()>=maxLayer)continue;
2058 m_vecStereoHitPnt.push_back(*hitIt);
2059 if(printFlag)cout<<" selected!";
2060 nHot++;
2061 /*
2062 if(maxLayer<20){
2063 if((*hitIt)->getLayer()>=maxLayer)continue;
2064 //HepPoint3D szz(minS,zTrk,zHit);
2065 //(*hitIt)->setHitPosition(szz);
2066 m_vecStereoHitPnt.push_back(*hitIt);
2067 //m_vecStereoHitRes.push_back(minRes);
2068 nHot++;
2069 //cout<<" OK!";
2070 //(*hitIt)->print();
2071 }
2072 else{
2073 //if((*hitIt)->getLayer()!=maxLayer)continue;
2074 if((*hitIt)->getLayer()>=maxLayer)continue;
2075 //HepPoint3D szz(minS,zTrk,zHit);
2076 //(*hitIt)->setHitPosition(szz);
2077 m_vecStereoHitPnt.push_back(*hitIt);
2078 //m_vecStereoHitRes.push_back(minRes);
2079 nHot++;
2080 //cout<<" OK!";
2081 //(*hitIt)->print();
2082 }
2083 //*/
2084 }
2085 if(printFlag)cout<<endl;
2086 //if(layer<3)cout<<endl;
2087 //}// V-view
2088 }// loop hits
2089 return nHot;
2090}
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared cut
Definition: KarFin.h:27

◆ findVHot() [2/2]

int HoughTrack::findVHot ( vector< HoughHit * > &  hitList,
int  charge,
int  maxLayer 
)

◆ findXHot() [1/2]

int HoughTrack::findXHot ( vector< HoughHit * > &  hitList,
int  charge 
)

Definition at line 479 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

480{
481
482 bool printFlag(false);
483 int nHot(0);
484 for(vector<HoughHit*>::iterator hitIt = hitList.begin(); hitIt != hitList.end(); hitIt++){
485 //cout<<judgeCharge(*(*hitIt))*charge<<" ";
486 //if(0 == flag){
487 if((*hitIt)->getFlag() != 0) continue;
488 if(judgeCharge(*hitIt)*charge<0) continue;// charge requirement
489 //if((*hitIt)->getPairHit()==NULL)continue;//FIXME
490 //if((*hitIt)->getPairHit()->getHalfCircle()>1)continue;//FIXME
491 if(printFlag)(*hitIt)->print();
492 //double cut = 999.0;//FIXME
493 //double cut1, cut2;
494 double cut[2] = {0};
495 int iLayer = (*hitIt)->getLayer();
496 int used = (*hitIt)->getUse();
497 XhitCutWindow(m_rho, iLayer, charge, cut[0], cut[1]);
498 double res = driftDistRes(*hitIt);
499 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
500 double res2 = (*hitIt)->residual(this, positionOntrack, positionOnDetector);
501 //if(fabs(res)<cut)
502 //cout<<"("<<(*hitIt)->getLayer()<<", "<<(*hitIt)->getWire()<<") ";
503 if(printFlag)cout<<"res:"<<setw(12)<<res;
504 //cout<<setw(12)<<res2;
505 if(printFlag)cout<<" win: "<<setw(5)<<cut[0]<<" ~ "<<setw(5)<<cut[1];
506 //cout<<endl;
507 map<int,double>::iterator it_map;
508 it_map=m_map_lay_d.find(iLayer);
509 if(it_map==m_map_lay_d.end()||fabs(res)<fabs(it_map->second))
510 {
511 m_map_lay_d[iLayer]=res;
512 m_map_lay_hit[iLayer]=(*hitIt);
513 }
514 if(res>cut[0]&&res<cut[1])
515 {
516 if(printFlag)cout<<" selected!";
517 //if(iLayer>3)
518 m_vecHitPnt.push_back((*hitIt));
519 m_vecHitResidual.push_back(res);
520 //m_hot.push_back((*(*hitIt)));
521 m_chi2 =+ res*res;
522 m_setLayer.insert(iLayer);
523 if(used==0) m_untried++;
524 if(used==0||used==-1) m_unused++;
525 if(judgeHalf(*hitIt)>0) {
526 m_nHitFirstHalf++;
527 if(used<=0) m_nHitUnused_FirstHalf++;
528 }
529 else {
530 m_nHitSecondHalf++;
531 if(used<=0) m_nHitUnused_SecondHalf++;
532 }
533 nHot++;
534 }// within window
535 if(printFlag)cout<<endl;
536 //}// X-view
537 /*
538 else {
539 if((*hitIt)->getFlag() == 0) continue;
540 //if((*hitIt)->getPairHit()==NULL)continue;//FIXME
541 //if((*hitIt)->getPairHit()->getHalfCircle()!=1)continue;//FIXME
542 int layer = (*hitIt)->getLayer();
543 int wire = (*hitIt)->getWire();
544 double Pt = fabs(pt());
545 double cut[2] = {0};
546 if(layer<3){
547 if(m_cut[0][layer+3]!=NULL)cut[0]=m_cut[0][layer+3]->Eval(Pt);
548 if(m_cut[1][layer+3]!=NULL)cut[1]=m_cut[1][layer+3]->Eval(Pt);
549 }else{
550 if(m_cut[0][layer]!=NULL)cut[0]=m_cut[0][layer]->Eval(Pt);
551 if(m_cut[1][layer]!=NULL)cut[1]=m_cut[1][layer]->Eval(Pt);
552 }
553 //cout<<"("<<setw(2)<<layer<<","<<setw(3)<<wire<<") ";
554 //cout<<"("<<setw(12)<<cut[0]<<" , "<<setw(13)<<cut[1]<<") ";
555 //cout<<Pt<<endl;
556 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
557 double res = (*hitIt)->residual(this, positionOntrack, positionOnDetector);
558 bool isNewHot(true);
559 for(vector<HoughHit*>::iterator hotIt = m_vecStereoHitPnt.begin(); hotIt != m_vecStereoHitPnt.end(); hotIt++){
560 if((*hitIt)->getHitID() == (*hotIt)->getHitID()){
561 isNewHot = false;
562 break;
563 }
564 }
565 if(!isNewHot){
566 //cout<<" OK!";
567 //cout<<endl;
568 continue;
569 }
570 if(cut[0]<res&&res<cut[1]){
571 //HepPoint3D szz(minS,zTrk,zHit);
572 //(*hitIt)->setHitPosition(szz);
573 m_vecStereoHitPnt.push_back((*hitIt));
574 //m_vecStereoHitRes.push_back(minRes);
575 //m_hot.push_back(*(*hitIt));
576 nHot++;
577 //cout<<" OK!";
578 //(*hitIt)->print();
579 }
580 }// V-view
581 //*/
582 }// loop hits
583
584 m_maxGap=0;
585 m_nGap=XGapSize(m_setLayer,m_maxGap);
586 return nHot;
587}

◆ findXHot() [2/2]

int HoughTrack::findXHot ( vector< HoughHit * > &  hitList,
int  charge 
)

◆ fit() [1/2]

void HoughTrack::fit ( double  bunchtime)

◆ fit() [2/2]

void HoughTrack::fit ( double  bunchtime)

◆ fit2D() [1/2]

int HoughTrack::fit2D ( double  bunchtime)

Definition at line 198 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

198 {
199 sortHit();
200 // cout<<"in fit2d"<<endl;
201 _bunchTime=bunchtime;
202 _stat2D = fitLeast();
203 cald_layer();
204 // outerHit();
205 if(m_globalfit)_stat2D = fit_global2D(_recHitVec);
206 else _stat2D =1;
207 //_stat2D =1;
208 //printRecHit();
209 //collectAxialHit();
210 //_Hough2D.print();
211 //cald_layer();
212 return _stat2D;
213}

Referenced by MdcHoughFinder::execute().

◆ fit2D() [2/2]

int HoughTrack::fit2D ( double  bunchtime)

◆ fit3D() [1/2]

int HoughTrack::fit3D ( )

Definition at line 311 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

311 {
312 sortHit();
313 // cout<<"in fit3d"<<endl;
314 int nhit_zs = calzs();
315 if( nhit_zs >=3 ) fitzs();
316 else {
317 cout<<" not enough ster hit in zs fit"<<endl;
318 _tanl=0.;_z0=0.;
319 }
320 outerHit();
321 if(m_debug>0) { cout<< " before 3d fit "<<endl; this->printRecHit();}
322 if(m_globalfit)_stat3D = fit_global3D(0);
323 else _stat3D =1;
324 return _stat3D;
325}

Referenced by MdcHoughFinder::execute().

◆ fit3D() [2/2]

int HoughTrack::fit3D ( )

◆ fit3D_inner() [1/2]

int HoughTrack::fit3D_inner ( )

Definition at line 327 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

327 { //for multi turn track
328 sortHit();
329 int nhit_zs = calzs();
330 cutMultiCirHit();
331 if( nhit_zs >=3 ) fitzs();
332 else {
333 // cout<<" not enough ster hit in zs fit"<<endl;
334 _tanl=0.;_z0=0.;
335 }
336 cutMultiCirHit_after_zs();
337 outerHit();
338 if(m_debug>0) { cout<< " before 3d fit "<<endl; this->printRecHit();}
339 if(m_globalfit)_stat3D = fit_global3D(0);
340 else _stat3D =1;
341 return _stat3D;
342}

Referenced by MdcHoughFinder::execute().

◆ fit3D_inner() [2/2]

int HoughTrack::fit3D_inner ( )

◆ fitCircle() [1/2]

TrkErrCode HoughTrack::fitCircle ( const MdcDetector mdcDetector,
TrkContextEv trkContextEv,
double  bunchT0 
)

Definition at line 2146 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

2147{
2148 m_circleFitStat=0;
2149 double d0 = -m_dr;
2150 double phi0 = m_phi0+M_PI/2;
2151 while(phi0>M_PI)phi0-=2*M_PI;
2152 while(phi0<-M_PI)phi0+=2*M_PI;
2153 double omega = m_kappa/fabs(alpha());
2154 //double z0 = m_dz;
2155 //double tanl = m_tanl;
2156 double z0 = 0;
2157 double tanl = 0;
2158 //cout<<"hough params:"<<endl;
2159 //cout
2160 //<<setw(15)<<d0
2161 //<<setw(15)<<phi0
2162 //<<setw(15)<<omega
2163 //;
2164 //cout<<endl;
2165 TrkExchangePar circleTrk(d0,phi0,omega,z0,tanl);
2166 TrkCircleMaker circlefactory;
2167 double chisum =0.;
2168 TrkRecoTrk* trkRecoTrk = circlefactory.makeTrack(circleTrk, chisum, *trkContextEv, bunchT0);
2169 bool permitFlips = true;
2170 bool lPickHits = true;
2171 circlefactory.setFlipAndDrop(*trkRecoTrk, permitFlips, lPickHits);
2172 TrkHitList* trkHitList = trkRecoTrk->hits();
2173
2174 //---convert hits
2175 vector<MdcHit*> mdcHitVector;
2176 mdcHitVector.clear();
2177 vector<CgemHitOnTrack*> cgemHitVector;
2178 cgemHitVector.clear();
2179
2180 for(vector<HoughHit*>::iterator iter = m_vecHitPnt.begin(); iter != m_vecHitPnt.end(); iter++){
2181 HoughHit* hitIt = (*iter);
2182 if(hitIt->getFlag()!=0)continue;
2183 //hitIt->print();
2184 if(hitIt->getHitType()==HoughHit::MDCHIT || hitIt->getHitType()==HoughHit::MDCMCHIT){
2185 const MdcDigi* mdcDigi = hitIt->getDigi();
2186 MdcHit *mdcHit = new MdcHit(mdcDigi,mdcDetector);
2187 mdcHitVector.push_back(mdcHit);
2188 mdcHit->setCalibSvc(hitIt->getMdcCalibFunSvc());
2189 mdcHit->setCountPropTime(true);
2190 //if(mdcHit->driftDist(m_bunchT0,0)>ddCut)continue;//FIXME
2191 int newAmbig = 0;
2192 MdcRecoHitOnTrack mdcRecoHitOnTrack(*mdcHit, newAmbig, bunchT0*1.e9);
2193 MdcHitOnTrack* mdcHitOnTrack = &mdcRecoHitOnTrack;
2194 HepPoint3D midPoint = hitIt->getHitPosition();
2195 double fltLength = flightLength(midPoint);
2196 //double fltLength = flightLength(hitIt->getHitPosition());
2197 mdcHitOnTrack->setFltLen(fltLength);
2198 trkHitList->appendHot(mdcHitOnTrack);
2199 }else if(hitIt->getHitType()==HoughHit::CGEMHIT || hitIt->getHitType()==HoughHit::CGEMMCHIT){
2200 if(m_useCgemInGlobalFit<1)continue;
2201 CgemHitOnTrack* cgemHitOnTrack = new CgemHitOnTrack(*(hitIt->getCgemCluster()),bunchT0*1.e9);
2202 cgemHitVector.push_back(cgemHitOnTrack);
2203 cgemHitOnTrack->setCgemGeomSvc(hitIt->getCgemGeomSvc());
2204 cgemHitOnTrack->setCgemCalibFunSvc(hitIt->getCgemCalibFunSvc());
2205 trkHitList->appendHot(cgemHitOnTrack);
2206 }
2207 }
2208 //---fitting
2209 TrkHitList* qhits = trkRecoTrk->hits();
2210 //cout<<"num of qhits to fit = "<<qhits->nHit()<<endl;
2211 //cout<<"before TrkHitList->fit()"<<endl;
2212 TrkErrCode err=qhits->fit();
2213 //cout<<"after TrkHitList->fit()"<<endl;
2214
2215 if(err.success()){
2216 //cout<<" circle fits well "<<endl;
2217 m_circleFitStat=1;
2218 const TrkFit* fitResult = trkRecoTrk->fitResult();
2219 TrkExchangePar par = fitResult->helix(0.);
2220 //if(fabs(m_kappa-par.omega()*fabs(alpha()))/fabs(m_kappa)>0.3)cout<<"fit divergent"<<endl;
2221 m_dr = -par.d0();
2222 m_phi0 = par.phi0()-M_PI/2;
2223 m_kappa = par.omega()*fabs(alpha());
2224 m_dz = par.z0();
2225 m_tanl = par.tanDip();
2226
2227 //cout<<"phi0 = "<<m_phi0<<endl;
2228 while(m_phi0>2.*M_PI) m_phi0-=2.*M_PI;
2229 while(m_phi0<0.) m_phi0+=2.*M_PI;
2230 //cout<<"phi0 = "<<m_phi0<<endl;
2231 //HepVector hepVector(5,0);
2232 //hepVector(1) = m_dr;
2233 //hepVector(2) = m_phi0;
2234 //hepVector(3) = m_kappa;
2235 //hepVector(4) = m_dz;
2236 //hepVector(5) = m_tanl;
2237 //a(hepVector);
2238 updateHelix();
2239 //cout<<"update Helix"<<endl;
2240
2241 //m_trkRecoTrk = trkRecoTrk;
2242 m_chi2 = fitResult->chisq();
2243 //cout<<"chi2 obtained "<<endl;
2244 //cout<<"fitting params:"<<endl;
2245 //cout
2246 //<<setw(15)<<par.d0()
2247 //<<setw(15)<<par.phi0()
2248 //<<setw(15)<<par.omega()
2249 //;
2250 //cout<<endl;
2251 }
2252 for(vector<MdcHit*>::iterator iter = mdcHitVector.begin(); iter != mdcHitVector.end(); iter++){
2253 delete *iter;
2254 }
2255 for(vector<CgemHitOnTrack*>::iterator iter = cgemHitVector.begin(); iter != cgemHitVector.end(); iter++){
2256 delete *iter;
2257 }
2258 if(m_clearTrack)delete trkRecoTrk;
2259 return err;
2260}
double flightLength(HepPoint3D &hit) const
void setCalibSvc(const MdcCalibFunSvc *calibSvc)
Definition: MdcHit.cxx:136
void setCountPropTime(const bool count)
virtual double chisq() const =0
virtual TrkExchangePar helix(double fltL) const =0
TrkErrCode fit()
Definition: TrkHitList.cxx:59
TrkHitOnTrk * appendHot(const TrkHitOnTrk *theHot)
Definition: TrkHitList.cxx:91
const TrkFit * fitResult() const
Definition: TrkRecoTrk.cxx:387
bool setFlipAndDrop(TrkRecoTrk &, bool allowFlips, bool allowDrops) const
TrkRecoTrk * makeTrack(const TrkExchangePar &helix, const double chi2, const TrkContext &, double trackT0) const

◆ fitCircle() [2/2]

TrkErrCode HoughTrack::fitCircle ( const MdcDetector mdcDetector,
TrkContextEv trkContextEv,
double  bunchT0 
)

◆ fitHelix() [1/4]

TrkErrCode HoughTrack::fitHelix ( const MdcDetector mdcDetector,
const BField bField,
double  bunchT0,
vector< HoughHit * > &  hot,
int  Layer 
)

Definition at line 2403 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

2404{
2405 int nHot(0);
2406 double d0 = -m_dr;
2407 double phi0 = m_phi0+M_PI/2;
2408 double omega = m_kappa/fabs(alpha());
2409 double z0 = m_dz;
2410 double tanl = m_tanl;
2411 while(phi0>M_PI)phi0-=2*M_PI;
2412 while(phi0<-M_PI)phi0+=2*M_PI;
2413
2414 TrkExchangePar helixTrk(d0,phi0,omega,z0,tanl);
2415 TrkHelixMaker helixfactory;
2416 double chisum =0.;
2417 long idnum(0);
2418 TrkRecoTrk* trkRecoTrk = helixfactory.makeTrack(helixTrk, chisum, bfield, bunchT0);
2419 bool permitFlips = true;
2420 bool lPickHits = true;
2421 helixfactory.setFlipAndDrop(*trkRecoTrk, permitFlips, lPickHits);
2422 TrkHitList* trkHitList = trkRecoTrk->hits();
2423
2424 //--- convert hits
2425 //cout<<maxLayer<<endl;
2426 vector<MdcHit*> mdcHitVector;
2427 mdcHitVector.clear();
2428 vector<CgemHitOnTrack*> cgemHitVector;
2429 cgemHitVector.clear();
2430
2431 for(vector<HoughHit*>::iterator hitIt = hot.begin(); hitIt != hot.end();hitIt++){
2432 //(*hitIt)->print();
2433 //cout<<endl;
2434 if((*hitIt)->getHitType()==HoughHit::MDCHIT /*|| (*hitIt)->getHitType()==HoughHit::MDCMCHIT*/){
2435 if((*hitIt)->getFlag()!=0&&(*hitIt)->getLayer()>maxLayer)continue;
2436 bool sameHit(false);
2437 const TrkHitList* aList = trkRecoTrk->hits();
2438 for (TrkHitList::hot_iterator hot = aList->begin();hot!=aList->end();hot++){
2439 if(typeid(*hot)==typeid(MdcRecoHitOnTrack) || typeid(*hot)==typeid(MdcHitOnTrack)){
2440 const MdcRecoHitOnTrack* recoHot = dynamic_cast<const MdcRecoHitOnTrack*> (&(*hot));
2441 int layerId = recoHot->mdcHit()->layernumber();
2442 int wireId = recoHot->mdcHit()->wirenumber();
2443 if((*hitIt)->getLayer()==layerId && (*hitIt)->getWire()==wireId)sameHit = true;
2444 }
2445 }
2446 if(sameHit)continue;
2447
2448 const MdcDigi* mdcDigi = (*hitIt)->getDigi();
2449 MdcHit *mdcHit = new MdcHit(mdcDigi,mdcDetector);
2450 mdcHitVector.push_back(mdcHit);
2451
2452 mdcHit->setCalibSvc((*hitIt)->getMdcCalibFunSvc());
2453 mdcHit->setCountPropTime(true);
2454 int newAmbig = 0;
2455 MdcRecoHitOnTrack mdcRecoHitOnTrack(*mdcHit, newAmbig, bunchT0*1.e9);
2456 MdcHitOnTrack* mdcHitOnTrack = &mdcRecoHitOnTrack;
2457 HepPoint3D midPoint = (*hitIt)->getHitPosition();
2458 //double fltLength = flightLength(midPoint);
2459 double fltLength = flightArc(midPoint);
2460 //double fltLength = flightLength((*hitIt)->getHitPosition());
2461 mdcHitOnTrack->setFltLen(fltLength);
2462 trkHitList->appendHot(mdcHitOnTrack);
2463 nHot++;
2464 }else if((*hitIt)->getHitType()==HoughHit::CGEMHIT/* || (*hitIt)->getHitType()==HoughHit::CGEMMCHIT*/){
2465 if(m_useCgemInGlobalFit<3)continue;
2466 bool sameHit(false);
2467 const TrkHitList* aList = trkRecoTrk->hits();
2468 for (TrkHitList::hot_iterator hot = aList->begin();hot!=aList->end();hot++){
2469 if(typeid(*hot)==typeid(CgemHitOnTrack)){
2470 const CgemHitOnTrack* recoHot = dynamic_cast<const CgemHitOnTrack*> (&(*hot));
2471 const RecCgemCluster* recCgemCluster = recoHot->baseHit();
2472 int clusterid = recCgemCluster->getclusterid();
2473 if((*hitIt)->getCgemCluster()->getclusterid()==clusterid)sameHit = true;
2474 }
2475 }
2476 if(sameHit)continue;
2477
2478 CgemHitOnTrack* cgemHitOnTrack = new CgemHitOnTrack(*((*hitIt)->getCgemCluster()),bunchT0*1.e9);
2479 cgemHitVector.push_back(cgemHitOnTrack);
2480 if((*hitIt)->getFlag()==0)continue;
2481 cgemHitOnTrack->setCgemGeomSvc((*hitIt)->getCgemGeomSvc());
2482 cgemHitOnTrack->setCgemCalibFunSvc((*hitIt)->getCgemCalibFunSvc());
2483 trkHitList->appendHot(cgemHitOnTrack);
2484 nHot++;
2485 }
2486 }
2487 //cout<<trkHitList->nHit()<<endl;
2488 //---fitting
2489 TrkHitList* qhits = trkRecoTrk->hits();
2490 TrkErrCode err=qhits->fit();
2491 //err.print(std::cout);cout<<endl;cout<<endl;
2492
2493 //const TrkHitList* aList = trkRecoTrk->hits();
2494 //for (TrkHitList::hot_iterator hot = aList->begin();hot!=aList->end();hot++){
2495 //if(typeid(*hot)==typeid(MdcRecoHitOnTrack) || typeid(*hot)==typeid(MdcHitOnTrack)){
2496 //const MdcRecoHitOnTrack* recoHot;
2497 //recoHot = dynamic_cast<const MdcRecoHitOnTrack*> (&(*hot));
2498 //int layerId = recoHot->mdcHit()->layernumber();
2499 //int wireId = recoHot->mdcHit()->wirenumber();
2500 //double res=999.,rese=999.;
2501 //if (recoHot->resid(res,rese,false)){
2502 //}else{}
2503 //std::cout<<"("<<layerId<<","<<wireId<<") res:"<<res<<std::endl;
2504 //}
2505 //else if(typeid(*hot)==typeid(CgemHitOnTrack)){
2506 //const CgemHitOnTrack* recoHot = dynamic_cast<const CgemHitOnTrack*> (&(*hot));
2507 //const RecCgemCluster* recCgemCluster = recoHot->baseHit();
2508 //int clusterid = recCgemCluster->getclusterid();
2509 //cout<<"clusterid:"<< recCgemCluster->getclusterid()<<" layer:"<<recCgemCluster->getlayerid()<<endl;
2510 //}
2511 //}
2512
2513 if(err.success()){
2514 const TrkFit* fitResult = trkRecoTrk->fitResult();
2515 TrkExchangePar par = fitResult->helix(0.);
2516 m_dr = -par.d0();
2517 m_phi0 = par.phi0()-M_PI/2;
2518 m_kappa = par.omega()*fabs(alpha());
2519 m_dz = par.z0();
2520 m_tanl = par.tanDip();
2521 while(m_phi0>2*M_PI)m_phi0-=2*M_PI;
2522 while(m_phi0<0)m_phi0+=2*M_PI;
2523 updateHelix();
2524
2525 m_chi2 = fitResult->chisq();
2526 }
2527 for(vector<MdcHit*>::iterator iter = mdcHitVector.begin(); iter != mdcHitVector.end(); iter++){
2528 delete *iter;
2529 }
2530 for(vector<CgemHitOnTrack*>::iterator iter = cgemHitVector.begin(); iter != cgemHitVector.end(); iter++){
2531 delete *iter;
2532 }
2533 if(m_clearTrack)delete trkRecoTrk;
2534 //cout<<"getId():"<<trkRecoTrk->id()<<endl;
2535 return err;
2536}
const MdcHit * mdcHit() const

◆ fitHelix() [2/4]

TrkErrCode HoughTrack::fitHelix ( const MdcDetector mdcDetector,
const BField bField,
double  bunchT0,
vector< HoughHit * > &  hot,
int  Layer 
)

◆ fitHelix() [3/4]

TrkErrCode HoughTrack::fitHelix ( const MdcDetector mdcDetector,
TrkContextEv trkContextEv,
double  bunchT0,
vector< MdcHit * > &  mdcHitCol,
vector< HoughHit * > &  hot 
)

Definition at line 2262 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

2263{
2264 int nHot(0);
2265 double d0 = -m_dr;
2266 double phi0 = m_phi0+M_PI/2;
2267 double omega = m_kappa/fabs(alpha());
2268 double z0 = m_dz;
2269 double tanl = m_tanl;
2270 while(phi0>M_PI)phi0-=2*M_PI;
2271 while(phi0<-M_PI)phi0+=2*M_PI;
2272
2273 TrkExchangePar helixTrk(d0,phi0,omega,z0,tanl);
2274 TrkHelixMaker helixfactory;
2275 double chisum =0.;
2276 m_trkRecoTrk = helixfactory.makeTrack(helixTrk, chisum, *trkContextEv, bunchT0);
2277 bool permitFlips = true;
2278 bool lPickHits = true;
2279 helixfactory.setFlipAndDrop(*m_trkRecoTrk, permitFlips, lPickHits);
2280 TrkHitList* trkHitList = m_trkRecoTrk->hits();
2281
2282 //--- convert hits
2283 //cout<<maxLayer<<endl;
2284 for(vector<HoughHit*>::iterator hitIt = hot.begin(); hitIt != hot.end();hitIt++){
2285 //(*hitIt)->print();
2286 //cout<<endl;
2287 if((*hitIt)->getHitType()==HoughHit::MDCHIT /*|| (*hitIt)->getHitType()==HoughHit::MDCMCHIT*/){
2288 bool sameHit(false);
2289 const TrkHitList* aList = m_trkRecoTrk->hits();
2290 for (TrkHitList::hot_iterator hot = aList->begin();hot!=aList->end();hot++){
2291 if(typeid(*hot)==typeid(MdcRecoHitOnTrack) || typeid(*hot)==typeid(MdcHitOnTrack)){
2292 const MdcRecoHitOnTrack* recoHot = dynamic_cast<const MdcRecoHitOnTrack*> (&(*hot));
2293 int layerId = recoHot->mdcHit()->layernumber();
2294 int wireId = recoHot->mdcHit()->wirenumber();
2295 if((*hitIt)->getLayer()==layerId && (*hitIt)->getWire()==wireId)sameHit = true;
2296 }
2297 }
2298 if(sameHit)continue;
2299
2300 //const MdcDigi* mdcDigi = (*hitIt)->getDigi();
2301 //MdcHit *mdcHit = new MdcHit(mdcDigi,mdcDetector);
2302 MdcHit *mdcHit;
2303 vector<MdcHit*>::iterator imdcHit = mdcHitCol.begin();
2304 for(;imdcHit != mdcHitCol.end();imdcHit++){
2305 if((*imdcHit)->mdcId() == (*hitIt)->getDigi()->identify()){
2306 mdcHit = *imdcHit;
2307 break;
2308 }
2309 }
2310
2311 mdcHit->setCalibSvc((*hitIt)->getMdcCalibFunSvc());
2312 mdcHit->setCountPropTime(true);
2313 int newAmbig = 0;
2314 MdcRecoHitOnTrack mdcRecoHitOnTrack(*mdcHit, newAmbig, bunchT0*1.e9);
2315 MdcHitOnTrack* mdcHitOnTrack = &mdcRecoHitOnTrack;
2316 HepPoint3D midPoint = (*hitIt)->getHitPosition();
2317 //double fltLength = flightLength(midPoint);
2318 double fltLength = flightArc(midPoint);
2319 //double fltLength = flightLength((*hitIt)->getHitPosition());
2320 mdcHitOnTrack->setFltLen(fltLength);
2321 trkHitList->appendHot(mdcHitOnTrack);
2322 nHot++;
2323 }else if((*hitIt)->getHitType()==HoughHit::CGEMHIT/* || (*hitIt)->getHitType()==HoughHit::CGEMMCHIT*/){
2324 if(m_useCgemInGlobalFit<2)continue;
2325 bool sameHit(false);
2326 const TrkHitList* aList = m_trkRecoTrk->hits();
2327 for (TrkHitList::hot_iterator hot = aList->begin();hot!=aList->end();hot++){
2328 if(typeid(*hot)==typeid(CgemHitOnTrack)){
2329 const CgemHitOnTrack* recoHot = dynamic_cast<const CgemHitOnTrack*> (&(*hot));
2330 const RecCgemCluster* recCgemCluster = recoHot->baseHit();
2331 int clusterid = recCgemCluster->getclusterid();
2332 if((*hitIt)->getCgemCluster()->getclusterid()==clusterid)sameHit = true;
2333 }
2334 }
2335 if(sameHit)continue;
2336
2337 CgemHitOnTrack* cgemHitOnTrack = new CgemHitOnTrack(*((*hitIt)->getCgemCluster()),bunchT0*1.e9);
2338 m_cgemHitVector.push_back(cgemHitOnTrack);
2339 if((*hitIt)->getFlag()==0)continue;
2340 cgemHitOnTrack->setCgemGeomSvc((*hitIt)->getCgemGeomSvc());
2341 cgemHitOnTrack->setCgemCalibFunSvc((*hitIt)->getCgemCalibFunSvc());
2342 trkHitList->appendHot(cgemHitOnTrack);
2343 nHot++;
2344 }
2345 }
2346 //cout<<trkHitList->nHit()<<endl;
2347 //---fitting
2348 TrkHitList* qhits = m_trkRecoTrk->hits();
2349 TrkErrCode err=qhits->fit();
2350 //err.print(std::cout);
2351 //cout<<endl;
2352 //cout<<endl;
2353
2354 //const TrkHitList* aList = m_trkRecoTrk->hits();
2355 //for (TrkHitList::hot_iterator hot = aList->begin();hot!=aList->end();hot++){
2356 //if(typeid(*hot)==typeid(MdcRecoHitOnTrack) || typeid(*hot)==typeid(MdcHitOnTrack)){
2357 //const MdcRecoHitOnTrack* recoHot;
2358 //recoHot = dynamic_cast<const MdcRecoHitOnTrack*> (&(*hot));
2359 //int layerId = recoHot->mdcHit()->layernumber();
2360 //int wireId = recoHot->mdcHit()->wirenumber();
2361 //double res=999.,rese=999.;
2362 //if (recoHot->resid(res,rese,false)){
2363 //}else{}
2364 //std::cout<<"("<<layerId<<","<<wireId<<") res:"<<res<<std::endl;
2365 //}
2366 //else if(typeid(*hot)==typeid(CgemHitOnTrack)){
2367 //const CgemHitOnTrack* recoHot = dynamic_cast<const CgemHitOnTrack*> (&(*hot));
2368 //const RecCgemCluster* recCgemCluster = recoHot->baseHit();
2369 //int clusterid = recCgemCluster->getclusterid();
2370 //cout<<"clusterid:"<< recCgemCluster->getclusterid()<<" layer:"<<recCgemCluster->getlayerid()<<endl;
2371 //}
2372 //}
2373
2374 if(err.success()){
2375 const TrkFit* fitResult = m_trkRecoTrk->fitResult();
2376 TrkExchangePar par = fitResult->helix(0.);
2377 m_dr = -par.d0();
2378 m_phi0 = par.phi0()-M_PI/2;
2379 m_kappa = par.omega()*fabs(alpha());
2380 m_dz = par.z0();
2381 m_tanl = par.tanDip();
2382 while(m_phi0>2*M_PI)m_phi0-=2*M_PI;
2383 while(m_phi0<0)m_phi0+=2*M_PI;
2384 //HepVector hepVector(5,0);
2385 //a(hepVector);
2386 updateHelix();
2387
2388 m_chi2 = fitResult->chisq();
2389 //cout<<"fitting params:"<<endl;
2390 //cout
2391 //<<setw(15)<<par.d0()
2392 //<<setw(15)<<par.phi0()
2393 //<<setw(15)<<par.omega()
2394 //<<setw(15)<<par.z0()
2395 //<<setw(15)<<par.tanDip()
2396 //;
2397 //cout<<endl;
2398 }
2399 //cout<<"getId()="<<m_trkRecoTrk->id()<<endl;
2400 return err;
2401}
TrkFundHit::hot_iterator begin() const

◆ fitHelix() [4/4]

TrkErrCode HoughTrack::fitHelix ( const MdcDetector mdcDetector,
TrkContextEv trkContextEv,
double  bunchT0,
vector< MdcHit * > &  mdcHitCol,
vector< HoughHit * > &  hot 
)

◆ fitLeast() [1/2]

int HoughTrack::fitLeast ( )

Definition at line 371 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

371 {
372 _Hough2D=Hough2D(_recHitVec,_bunchTime);
373 double circleR = fabs(1./(_maprho));
374 double circleX = (1./_maprho)*cos(_maptheta);
375 double circleY = (1./_maprho)*sin(_maptheta);
376 double d0 = sqrt( circleX*circleX + circleY*circleY )-circleR;
377 double phi0 = atan2(circleY,circleX)+M_PI/2.;
378 double omega = 1/circleR;
379 if(_charge==-1){
380 //d0=d0;
381 d0=-d0;
382 omega=-1.*fabs(omega);
383 }
384 if(_charge==1){
385 //d0=-d0;
386 d0=d0;
387 omega=1.*fabs(omega);
388 phi0=phi0-M_PI;
389 }
390 _Hough2D.setCharge(_charge);
391 _Hough2D.setCirX( circleX);
392 _Hough2D.setCirY( circleY );
393 _Hough2D.setCirR( circleR );
394 _Hough2D.setD0( d0 );
395 _Hough2D.setPhi0( phi0 );
396 _Hough2D.setOmega( omega );
397 _Hough2D.setPt( circleR/333.567 );
398
399 //fill HoughTrack
400 _centerX=_Hough2D.getCirX();
401 _centerY=_Hough2D.getCirY();
402 _centerR=_Hough2D.getCirR();
403 //_pt=_Hough2D.getPt();
404 _pt2D=_Hough2D.getPt();
405 _d0=_Hough2D.getD0();
406 _omega=_Hough2D.getOmega();
407 _phi0=_Hough2D.getPhi0();
408 hitOnTrack();
409 if(m_debug>0) {cout<<" after least 2d "<<endl; printRecHit();}
410 return 1;
411
412}
double sin(const BesAngle a)
double cos(const BesAngle a)

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

◆ fitLeast() [2/2]

int HoughTrack::fitLeast ( )

◆ fitzs() [1/2]

void HoughTrack::fitzs ( )

Definition at line 656 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

656 {
657 //for( int i =0; i<_recHitVec.size(); i++)cout<<__FILE__<<" ("<<_recHitVec[i].getLayerId()<<", "<<_recHitVec[i].getWireId()<<") "<<_recHitVec[i].getflag()<<endl;
658 HoughZsFit zsfit(&_recHitVec);
659 //for( int i =0; i<_recHitVec.size(); i++)cout<<__FILE__<<" ("<<_recHitVec[i].getLayerId()<<", "<<_recHitVec[i].getWireId()<<") "<<_recHitVec[i].getflag()<<endl;
660 _tanl=zsfit.getTanl();
661 _z0=zsfit.getZ0();
662 _tanl_zs=zsfit.getTanl();
663 _z0_zs=zsfit.getZ0();
664 t_pro_correct = zsfit.getPro();
665 if(m_debug>0) printRecHit();
666}

Referenced by fit3D(), and fit3D_inner().

◆ fitzs() [2/2]

void HoughTrack::fitzs ( )

◆ get2D() [1/2]

Hough2D HoughTrack::get2D ( ) const
inline

Definition at line 27 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

27{ return _Hough2D;}

◆ get2D() [2/2]

Hough2D HoughTrack::get2D ( ) const
inline

◆ get3D() [1/2]

Hough3D HoughTrack::get3D ( ) const
inline

Definition at line 28 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

28{ return _Hough3D;}

◆ get3D() [2/2]

Hough3D HoughTrack::get3D ( ) const
inline

◆ getAngle() [1/2]

double HoughTrack::getAngle ( ) const
inline

Definition at line 51 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

51{return m_angle;}

◆ getAngle() [2/2]

double HoughTrack::getAngle ( ) const
inline

◆ getbunchTime() [1/2]

double HoughTrack::getbunchTime ( )
inline

Definition at line 96 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

96{return _bunchTime;}

◆ getbunchTime() [2/2]

double HoughTrack::getbunchTime ( )
inline

◆ getCenterPeak() [1/2]

HoughPeak HoughTrack::getCenterPeak ( ) const
inline

Definition at line 26 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

26{ return _centerPeak;}

◆ getCenterPeak() [2/2]

HoughPeak HoughTrack::getCenterPeak ( ) const
inline

Definition at line 26 of file Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-12/MdcHoughFinder/HoughTrack.h.

26{ return _centerPeak;}

◆ getCharge() [1/4]

int HoughTrack::getCharge ( ) const
inline

Definition at line 49 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

49{return m_charge;}

Referenced by HoughFinder::fillHistogram().

◆ getCharge() [2/4]

int HoughTrack::getCharge ( ) const
inline

Definition at line 32 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

32{return _charge;}

◆ getCharge() [3/4]

int HoughTrack::getCharge ( ) const
inline

◆ getCharge() [4/4]

int HoughTrack::getCharge ( ) const
inline

◆ getChi2() [1/2]

double HoughTrack::getChi2 ( ) const
inline

Definition at line 57 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

57{return m_chi2;}

◆ getChi2() [2/2]

double HoughTrack::getChi2 ( ) const
inline

◆ getChi2_2D() [1/2]

double HoughTrack::getChi2_2D ( ) const
inline

Definition at line 60 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

60{return _chi2_aver2D;}

◆ getChi2_2D() [2/2]

double HoughTrack::getChi2_2D ( ) const
inline

Definition at line 60 of file Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-12/MdcHoughFinder/HoughTrack.h.

60{return _chi2_aver2D;}

◆ getChi2_3D() [1/2]

double HoughTrack::getChi2_3D ( ) const
inline

Definition at line 59 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

59{return _chi2_aver;}

◆ getChi2_3D() [2/2]

double HoughTrack::getChi2_3D ( ) const
inline

◆ getCircleFitStat() [1/2]

int HoughTrack::getCircleFitStat ( ) const
inline

Definition at line 58 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

58{return m_circleFitStat;};

◆ getCircleFitStat() [2/2]

int HoughTrack::getCircleFitStat ( ) const
inline

Definition at line 58 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

58{return m_circleFitStat;};

◆ getCirR() [1/2]

double HoughTrack::getCirR ( ) const
inline

Definition at line 56 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

56{return _centerR;}

◆ getCirR() [2/2]

double HoughTrack::getCirR ( ) const
inline

◆ getCirX() [1/2]

double HoughTrack::getCirX ( ) const
inline

Definition at line 57 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

57{return _centerX;}

◆ getCirX() [2/2]

double HoughTrack::getCirX ( ) const
inline

◆ getCirY() [1/2]

double HoughTrack::getCirY ( ) const
inline

Definition at line 58 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

58{return _centerY;}

◆ getCirY() [2/2]

double HoughTrack::getCirY ( ) const
inline

◆ getD0() [1/2]

double HoughTrack::getD0 ( ) const
inline

Definition at line 40 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

40{return _d0;}

◆ getD0() [2/2]

double HoughTrack::getD0 ( ) const
inline

◆ getDAngle() [1/2]

double HoughTrack::getDAngle ( ) const
inline

Definition at line 53 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

53{return m_dAngle;}

◆ getDAngle() [2/2]

double HoughTrack::getDAngle ( ) const
inline

◆ getDDz() [1/2]

double HoughTrack::getDDz ( ) const
inline

Definition at line 56 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

56{return m_dDz;}

◆ getDDz() [2/2]

double HoughTrack::getDDz ( ) const
inline

◆ getDr() [1/2]

double HoughTrack::getDr ( ) const
inline

Definition at line 62 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

62{return m_dr;}

◆ getDr() [2/2]

double HoughTrack::getDr ( ) const
inline

◆ getDRho() [1/2]

double HoughTrack::getDRho ( ) const
inline

Definition at line 54 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

54{return m_dRho;}

◆ getDRho() [2/2]

double HoughTrack::getDRho ( ) const
inline

◆ getDTanl() [1/2]

double HoughTrack::getDTanl ( ) const
inline

Definition at line 55 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

55{return m_dTanl;}

◆ getDTanl() [2/2]

double HoughTrack::getDTanl ( ) const
inline

◆ getDz() [1/2]

double HoughTrack::getDz ( ) const
inline

Definition at line 65 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

65{return m_dz;}

◆ getDz() [2/2]

double HoughTrack::getDz ( ) const
inline

◆ getFlag() [1/2]

int HoughTrack::getFlag ( ) const
inline

Definition at line 50 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

50{return m_flag;}

◆ getFlag() [2/2]

int HoughTrack::getFlag ( ) const
inline

◆ getHitNum() [1/2]

int HoughTrack::getHitNum ( int  select) const

Definition at line 668 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

668 {
669 int size=_recHitVec.size();
670 int n0,n1,n2,n3,n4,n5,n6;
671 n0=n1=n2=n3=n4=n5=n6=0;
672 for(int i=0;i<size;i++){
673 int cir= _recHitVec[i].getCirList();
674 int style= _recHitVec[i].getStyle();
675 n0++;
676 if( style == 1 ) n1++;
677 if( style == 2 ) n2++;
678 if(_recHitVec[i].getDetectorType()==MDC){
679 int index = _recHitVec[i].digi()->getTrackIndex();
680 if( index < 0 ) n3++;
681 if( index >=0 && cir<=1 && style==0) n4++;
682 if( index <0 || cir>1 ) n5++;
683 if( index >=0 && cir==0 && style==0) n6++;
684 }
685 }
686 if( select == 0 ) return n0;
687 if( select == 1 ) return n1;
688 if( select == 2 ) return n2;
689 if( select == 3 ) return n3;
690 if( select == 4 ) return n4;
691 if( select == 5 ) return n5;
692 if( select == 6 ) return n6;
693}
int n2
Definition: SD0Tag.cxx:55
int n1
Definition: SD0Tag.cxx:54

◆ getHitNum() [2/2]

int HoughTrack::getHitNum ( int  ) const

◆ getHitNumA() [1/2]

int HoughTrack::getHitNumA ( int  select) const

Definition at line 694 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

694 {
695 int size=_recHitVec.size();
696 int n0,n1,n2,n3,n4,n5,n6;
697 n0=n1=n2=n3=n4=n5=n6=0;
698 for(int i=0;i<size;i++){
699 int cir= _recHitVec[i].getCirList();
700 int type = _recHitVec[i].getSlayerType();
701 int style= _recHitVec[i].getStyle();
702 if( type ==0 ) n0++;
703 if( type==0 && style == 1 ) n1++;
704 if( type==0 && style == 2 ) n2++;
705 if(_recHitVec[i].getDetectorType()==MDC){
706 int index = _recHitVec[i].digi()->getTrackIndex();
707 if( type==0 && index < 0 ) n3++;
708 if( type==0 && index >=0 && cir<=1 && style==0 ) n4++;
709 if( type==0 && (index <0 || cir>1) ) n5++;
710 if( type==0 && index >=0 && cir==0 && style==0 ) n6++;
711 }
712 }
713 if( select == 0 ) return n0;
714 if( select == 1 ) return n1;
715 if( select == 2 ) return n2;
716 if( select == 3 ) return n3;
717 if( select == 4 ) return n4;
718 if( select == 5 ) return n5;
719 if( select == 6 ) return n6;
720}

◆ getHitNumA() [2/2]

int HoughTrack::getHitNumA ( int  ) const

◆ getHitNumS() [1/2]

int HoughTrack::getHitNumS ( int  select) const

Definition at line 721 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

721 {
722 int size=_recHitVec.size();
723 int n0,n1,n2,n3,n4,n5,n6;
724 n0=n1=n2=n3=n4=n5=n6=0;
725 for(int i=0;i<size;i++){
726 int cir= _recHitVec[i].getCirList();
727 int type = _recHitVec[i].getSlayerType();
728 int style= _recHitVec[i].getStyle();
729 if( type !=0 ) n0++;
730 if( type!=0 && style == 1 ) n1++;
731 if( type!=0 && style == 2 ) n2++;
732 if(_recHitVec[i].getDetectorType()==MDC){
733 int index = _recHitVec[i].digi()->getTrackIndex();
734 if( type!=0 && index < 0 ) n3++;
735 if( type!=0 && index >=0 && cir<=1 && style==0) n4++;
736 if( type!=0 && (index <0 || cir>1) ) n5++;
737 if( type!=0 && index >=0 && cir==0 && style==0) n6++;
738 }
739 }
740 if( select == 0 ) return n0;
741 if( select == 1 ) return n1;
742 if( select == 2 ) return n2;
743 if( select == 3 ) return n3;
744 if( select == 4 ) return n4;
745 if( select == 5 ) return n5;
746 if( select == 6 ) return n6;
747}

◆ getHitNumS() [2/2]

int HoughTrack::getHitNumS ( int  ) const

◆ getHotList() [1/2]

vector< HoughHit * > HoughTrack::getHotList ( int  type = 2)

Definition at line 2096 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

2097{
2098 vector<HoughHit*> hotList;
2099 vector<HoughHit*> axialHot = getVecHitPnt();
2100 vector<HoughHit*> stereoHot = getVecStereoHitPnt();
2101
2102 for(vector<HoughHit*>::iterator hotIt = axialHot.begin(); hotIt != axialHot.end(); hotIt++){
2103 if(type==1)continue;
2104 if(type==2&&(**hotIt).getHitType()==HoughHit::CGEMHIT)continue;
2105 hotList.push_back(*hotIt);
2106 }
2107 for(vector<HoughHit*>::iterator hotIt = stereoHot.begin(); hotIt != stereoHot.end(); hotIt++){
2108 if(type>0)hotList.push_back(*hotIt);
2109 }
2110/*
2111 // --- CGEM XV cluster
2112 for(vector<HoughHit*>::iterator hotIt = stereoHot.begin(); hotIt != stereoHot.end(); hotIt++){
2113 if((**hotIt).getLayer()<3)hotList.push_back(*hotIt);
2114 //cout<<(**hotIt).getHitID()<<" "<<(**hotIt).getLayer()<<endl;
2115 }
2116
2117 // --- MDC hits, layer 9-20
2118 for(vector<HoughHit*>::iterator hotIt = axialHot.begin(); hotIt != axialHot.end(); hotIt++){
2119 //if(m_fitFlag==1&&(**hotIt).getLayer()<3)hot.push_back(**hotIt);
2120 if((**hotIt).getLayer()>3&&(**hotIt).getLayer()<20)hotList.push_back(*hotIt);
2121 //cout<<(**hotIt).getHitID()<<" "<<(**hotIt).getLayer()<<endl;
2122 }
2123
2124 // --- MDC hits, layer 21-36
2125 for(vector<HoughHit*>::iterator hotIt = stereoHot.begin(); hotIt != stereoHot.end(); hotIt++){
2126 if((**hotIt).getLayer()>=20&&(**hotIt).getLayer()<36)hotList.push_back(*hotIt);
2127 //int layer = (*hotIt)->getLayer();
2128 //int wire = (*hotIt)->getWire();
2129 //cout<<"("<<setw(2)<<layer<<","<<setw(3)<<wire<<") ";
2130 //cout<<(**hotIt).residual(&(*trkIT));
2131 //cout<<endl;
2132 //cout<<(**hotIt).getHitID()<<" "<<(**hotIt).getLayer()<<endl;
2133 }
2134
2135 // --- MDC hits, layer 37-43
2136 for(vector<HoughHit*>::iterator hotIt = axialHot.begin(); hotIt != axialHot.end(); hotIt++){
2137 if((**hotIt).getLayer()>=36)hotList.push_back(*hotIt);
2138 //cout<<(**hotIt).getHitID()<<" "<<(**hotIt).getLayer()<<endl;
2139 }
2140//*/
2141 sortHot(hotList);
2142 return hotList;
2143 //cout<<"nHot: "<<hot.size()<<endl;
2144}
void sortHot(vector< HoughHit * > &hotList)

Referenced by moreHot(), print(), and printHot().

◆ getHotList() [2/2]

vector< HoughHit * > HoughTrack::getHotList ( int  type = 2)

◆ getHoughHitList() [1/2]

recHitCol & HoughTrack::getHoughHitList ( )
inline

Definition at line 29 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

29{ return _recHitVec; }

◆ getHoughHitList() [2/2]

recHitCol & HoughTrack::getHoughHitList ( )
inline

Definition at line 29 of file Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-12/MdcHoughFinder/HoughTrack.h.

29{ return _recHitVec; }

◆ getKappa() [1/2]

double HoughTrack::getKappa ( ) const
inline

Definition at line 64 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

64{return m_kappa;}

◆ getKappa() [2/2]

double HoughTrack::getKappa ( ) const
inline

◆ getMapRho() [1/2]

double HoughTrack::getMapRho ( ) const
inline

Definition at line 89 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

89{return _maprho;}

◆ getMapRho() [2/2]

double HoughTrack::getMapRho ( ) const
inline

◆ getMapTheta() [1/2]

double HoughTrack::getMapTheta ( ) const
inline

Definition at line 90 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

90{return _maptheta;}

◆ getMapTheta() [2/2]

double HoughTrack::getMapTheta ( ) const
inline

◆ getMcTrack() [1/2]

HoughTrack * HoughTrack::getMcTrack ( ) const
inline

Definition at line 132 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

132{return m_mcTrack;}

◆ getMcTrack() [2/2]

HoughTrack * HoughTrack::getMcTrack ( ) const
inline

Definition at line 132 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

132{return m_mcTrack;}

◆ getNfit() [1/2]

double HoughTrack::getNfit ( ) const
inline

Definition at line 61 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

61{return _nfit;}

◆ getNfit() [2/2]

double HoughTrack::getNfit ( ) const
inline

◆ getNfit2D() [1/2]

int HoughTrack::getNfit2D ( ) const
inline

◆ getNfit2D() [2/2]

int HoughTrack::getNfit2D ( ) const
inline

◆ getNfit3D() [1/2]

int HoughTrack::getNfit3D ( ) const
inline

◆ getNfit3D() [2/2]

int HoughTrack::getNfit3D ( ) const
inline

◆ getNhitFirstHalf() [1/2]

int HoughTrack::getNhitFirstHalf ( )
inline

Definition at line 91 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

91{return m_nHitFirstHalf;};

◆ getNhitFirstHalf() [2/2]

int HoughTrack::getNhitFirstHalf ( )
inline

Definition at line 91 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

91{return m_nHitFirstHalf;};

◆ getNhitSecondHalf() [1/2]

int HoughTrack::getNhitSecondHalf ( )
inline

Definition at line 92 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

92{return m_nHitSecondHalf;};

◆ getNhitSecondHalf() [2/2]

int HoughTrack::getNhitSecondHalf ( )
inline

Definition at line 92 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

92{return m_nHitSecondHalf;};

◆ getNHitsShared() [1/2]

int HoughTrack::getNHitsShared ( )

Definition at line 1956 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1957{
1958 int nShared = 0;
1959 vector<HoughHit*>::iterator iter = m_vecHitPnt.begin();
1960 for(; iter!=m_vecHitPnt.end(); iter++)
1961 {
1962 vector<double> vecRes = (*iter)->getVecResid();
1963 int nTrk = vecRes.size();
1964 if(nTrk>1) nShared++;
1965 }
1966 return nShared;
1967}

◆ getNHitsShared() [2/2]

int HoughTrack::getNHitsShared ( )

◆ getNhitUnusedFirstHalf() [1/2]

int HoughTrack::getNhitUnusedFirstHalf ( )
inline

Definition at line 93 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

93{return m_nHitUnused_FirstHalf;};

◆ getNhitUnusedFirstHalf() [2/2]

int HoughTrack::getNhitUnusedFirstHalf ( )
inline

Definition at line 93 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

93{return m_nHitUnused_FirstHalf;};

◆ getNhitUnusedSecondHalf() [1/2]

int HoughTrack::getNhitUnusedSecondHalf ( )
inline

Definition at line 94 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

94{return m_nHitUnused_SecondHalf;};

◆ getNhitUnusedSecondHalf() [2/2]

int HoughTrack::getNhitUnusedSecondHalf ( )
inline

Definition at line 94 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

94{return m_nHitUnused_SecondHalf;};

◆ getNTried() [1/2]

int HoughTrack::getNTried ( )
inline

Definition at line 120 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

120{return m_untried;};// llwang 2018-12-23

◆ getNTried() [2/2]

int HoughTrack::getNTried ( )
inline

Definition at line 120 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

120{return m_untried;};// llwang 2018-12-23

◆ getOmega() [1/2]

double HoughTrack::getOmega ( ) const
inline

Definition at line 41 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

41{return _omega;}

◆ getOmega() [2/2]

double HoughTrack::getOmega ( ) const
inline

◆ getP() [1/2]

double HoughTrack::getP ( ) const
inline

Definition at line 36 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

36{return _p;}

◆ getP() [2/2]

double HoughTrack::getP ( ) const
inline

◆ getPhi0() [1/4]

double HoughTrack::getPhi0 ( ) const
inline

Definition at line 63 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

63{return m_phi0;}

◆ getPhi0() [2/4]

double HoughTrack::getPhi0 ( ) const
inline

Definition at line 42 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

42{return _phi0;}

◆ getPhi0() [3/4]

double HoughTrack::getPhi0 ( ) const
inline

◆ getPhi0() [4/4]

double HoughTrack::getPhi0 ( ) const
inline

◆ getPro() [1/2]

double HoughTrack::getPro ( ) const
inline

Definition at line 91 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

91{return t_pro_correct;}

◆ getPro() [2/2]

double HoughTrack::getPro ( ) const
inline

Definition at line 91 of file Reconstruction/MdcHoughFinder/MdcHoughFinder-00-00-12/MdcHoughFinder/HoughTrack.h.

91{return t_pro_correct;}

◆ getPt2D() [1/2]

double HoughTrack::getPt2D ( ) const
inline

Definition at line 34 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

34{return _pt2D;}

◆ getPt2D() [2/2]

double HoughTrack::getPt2D ( ) const
inline

◆ getPt3D() [1/2]

double HoughTrack::getPt3D ( ) const
inline

Definition at line 35 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

35{return _pt3D;}

Referenced by more_pt().

◆ getPt3D() [2/2]

double HoughTrack::getPt3D ( ) const
inline

◆ getPt_least() [1/2]

double HoughTrack::getPt_least ( ) const
inline

Definition at line 33 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

33{return _ptLeast;}

◆ getPt_least() [2/2]

double HoughTrack::getPt_least ( ) const
inline

◆ getPz() [1/2]

double HoughTrack::getPz ( ) const
inline

Definition at line 37 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

37{return _pz;}

◆ getPz() [2/2]

double HoughTrack::getPz ( ) const
inline

◆ getRho() [1/4]

double HoughTrack::getRho ( ) const
inline

Definition at line 52 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

52{return m_rho;}

◆ getRho() [2/4]

double HoughTrack::getRho ( ) const
inline

◆ getRho() [3/4]

double HoughTrack::getRho ( ) const
inline

◆ getRho() [4/4]

double HoughTrack::getRho ( ) const
inline

◆ getStat2D() [1/2]

int HoughTrack::getStat2D ( ) const
inline

Definition at line 53 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

53{return _stat2D;}

◆ getStat2D() [2/2]

int HoughTrack::getStat2D ( ) const
inline

◆ getStat3D() [1/2]

int HoughTrack::getStat3D ( ) const
inline

Definition at line 54 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

54{return _stat3D;}

◆ getStat3D() [2/2]

int HoughTrack::getStat3D ( ) const
inline

◆ getTanl() [1/4]

double HoughTrack::getTanl ( ) const
inline

Definition at line 66 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

66{return m_tanl;}

◆ getTanl() [2/4]

double HoughTrack::getTanl ( ) const
inline

Definition at line 43 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

43{return _tanl;}

◆ getTanl() [3/4]

double HoughTrack::getTanl ( ) const
inline

◆ getTanl() [4/4]

double HoughTrack::getTanl ( ) const
inline

◆ getTanl_zs() [1/2]

double HoughTrack::getTanl_zs ( ) const
inline

Definition at line 45 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

45{return _tanl_zs;}

◆ getTanl_zs() [2/2]

double HoughTrack::getTanl_zs ( ) const
inline

◆ getTheta() [1/2]

double HoughTrack::getTheta ( ) const
inline

◆ getTheta() [2/2]

double HoughTrack::getTheta ( ) const
inline

◆ getTrk() [1/2]

TrkRecoTrk * HoughTrack::getTrk ( ) const
inline

Definition at line 22 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

22{return p_trk;}

◆ getTrk() [2/2]

TrkRecoTrk * HoughTrack::getTrk ( ) const
inline

◆ getTrk2D() [1/2]

TrkRecoTrk * HoughTrack::getTrk2D ( ) const
inline

Definition at line 23 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

23{return p_trk2D;}

◆ getTrk2D() [2/2]

TrkRecoTrk * HoughTrack::getTrk2D ( ) const
inline

◆ getTrkid() [1/2]

int HoughTrack::getTrkid ( )
inline

Definition at line 98 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

98{return _trkid;}

◆ getTrkid() [2/2]

int HoughTrack::getTrkid ( )
inline

◆ getTrkID() [1/2]

int HoughTrack::getTrkID ( ) const
inline

Definition at line 48 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

48{return m_trkID;}

Referenced by HoughFinder::getMcParticleCol(), and markUsedHot().

◆ getTrkID() [2/2]

int HoughTrack::getTrkID ( ) const
inline

◆ getTrkRecoTrk() [1/2]

TrkRecoTrk * HoughTrack::getTrkRecoTrk ( )
inline

Definition at line 61 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

61{return m_trkRecoTrk;}

◆ getTrkRecoTrk() [2/2]

TrkRecoTrk * HoughTrack::getTrkRecoTrk ( )
inline

Definition at line 61 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

61{return m_trkRecoTrk;}

◆ getVecForClean3D() [1/2]

vector< MdcHit * > & HoughTrack::getVecForClean3D ( )
inline

◆ getVecForClean3D() [2/2]

vector< MdcHit * > & HoughTrack::getVecForClean3D ( )
inline

◆ getVecHitPnt() [1/2]

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

Definition at line 82 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

82{return m_vecHitPnt;}; // llwang 2018-12-26

Referenced by getHotList(), and print().

◆ getVecHitPnt() [2/2]

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

Definition at line 82 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

82{return m_vecHitPnt;}; // llwang 2018-12-26

◆ getVecHitRes() [1/2]

vector< double > HoughTrack::getVecHitRes ( )
inline

Definition at line 124 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

124{return m_vecHitResidual;}

◆ getVecHitRes() [2/2]

vector< double > HoughTrack::getVecHitRes ( )
inline

Definition at line 124 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

124{return m_vecHitResidual;}

◆ getVecStereoHitPnt() [1/2]

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

Definition at line 125 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

125{return m_vecStereoHitPnt;}; // llwang 2018-12-26

Referenced by getHotList(), and print().

◆ getVecStereoHitPnt() [2/2]

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

Definition at line 125 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

125{return m_vecStereoHitPnt;}; // llwang 2018-12-26

◆ getVecStereoHitRes() [1/2]

vector< double > HoughTrack::getVecStereoHitRes ( )
inline

Definition at line 127 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

127{return m_vecStereoHitRes;}

◆ getVecStereoHitRes() [2/2]

vector< double > HoughTrack::getVecStereoHitRes ( )
inline

Definition at line 127 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

127{return m_vecStereoHitRes;}

◆ getZ0() [1/2]

double HoughTrack::getZ0 ( ) const
inline

Definition at line 44 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

44{return _z0;}

◆ getZ0() [2/2]

double HoughTrack::getZ0 ( ) const
inline

◆ getZ0_zs() [1/2]

double HoughTrack::getZ0_zs ( ) const
inline

Definition at line 46 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

46{return _z0_zs;}

◆ getZ0_zs() [2/2]

double HoughTrack::getZ0_zs ( ) const
inline

◆ intersect_cylinder() [1/4]

double HoughTrack::intersect_cylinder ( double  r_cylinder,
double  r_center,
double  phi_center,
int  charge 
)

Definition at line 1030 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

1031{
1032 double phi;
1033 if(charge==0)return 9999;
1034 while(phi_center<0) phi_center += 2*M_PI;
1035 while(phi_center>2*M_PI) phi_center -= 2*M_PI;
1036 if(r_center<r_cylinder/2) return -9999;
1037 double dphi = acos( r_cylinder/(2*r_center) );
1038 if(charge<0) phi = phi_center + dphi;
1039 else phi = phi_center - dphi;
1040 while(phi<0) phi += 2*M_PI;
1041 while(phi>2*M_PI) phi -= 2*M_PI;
1042 return phi;
1043}

Referenced by cald_layer().

◆ intersect_cylinder() [2/4]

double HoughTrack::intersect_cylinder ( double  r_cylinder,
double  r_center,
double  phi_center,
int  charge 
)

◆ intersect_cylinder() [3/4]

double HoughTrack::intersect_cylinder ( int  charge,
double  x_center,
double  y_center,
double  r_cylinder 
)

Definition at line 1044 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

1045{
1046 double phi;
1047 double phi_center = atan2(y_center,x_center);
1048 double r_center = sqrt(x_center*x_center+y_center*y_center);
1049 if(charge==0)return 9999;
1050 while(phi_center<0) phi_center += 2*M_PI;
1051 while(phi_center>2*M_PI) phi_center -= 2*M_PI;
1052 if(r_center<r_cylinder/2) return -9999;
1053 double dphi = acos( r_cylinder/(2*r_center) );
1054 if(charge<0) phi = phi_center + dphi;
1055 else phi = phi_center - dphi;
1056 while(phi<0) phi += 2*M_PI;
1057 while(phi>2*M_PI) phi -= 2*M_PI;
1058 return phi;
1059}

◆ intersect_cylinder() [4/4]

double HoughTrack::intersect_cylinder ( int  charge,
double  x_center,
double  y_center,
double  r_cylinder 
)

◆ isAGoodCircle() [1/2]

bool HoughTrack::isAGoodCircle ( )

Definition at line 1487 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1488{
1489 int NtotLayer = m_setLayer.size();
1490
1491 std::set<int>::iterator it = m_setLayer.begin();
1492 int lastLayer = *it;
1493 // check N_CGEM_layer, N_ODC1_nearStereo, N_ODC2_nearStereo
1494 int nCgemLayer(0), N_ODC1_nearStereo(0), N_ODC2_nearStereo(0);
1495 for(; it!=m_setLayer.end(); it++)
1496 {
1497 if((*it)<3) nCgemLayer++;
1498 else if((*it)>=16&&(*it)<=19) N_ODC1_nearStereo++;
1499 else if((*it)>=36&&(*it)<=39) N_ODC2_nearStereo++;
1500 }
1501 bool enoughVHits;
1502 //enoughVHits = nCgemLayer==3 ;
1503 enoughVHits = nCgemLayer>=2
1504 || (nCgemLayer>0 && (N_ODC1_nearStereo>=2 || N_ODC2_nearStereo>=2))
1505 || (N_ODC1_nearStereo>=2 && N_ODC2_nearStereo>=2 && NtotLayer>=8) ;
1506 //if(!enoughVHits) cout<<"not enough V hits, ";
1507
1508 // gap fraction
1509 double r_gap = 1.0*m_nGap/(m_nGap+NtotLayer);
1510 bool smallGap = r_gap<0.3;
1511 //if(!smallGap) cout<<"gap too large 30%, "<<endl;
1512
1513 // check conditions
1514 bool good = true;
1515 good=good && m_unused>=3;
1516 good=good && m_untried>=3;
1517 good=good && (nCgemLayer==3||NtotLayer>3);
1518 good=good && enoughVHits;
1519 good=good && smallGap;
1520 //good=good && m_maxGap<4;
1521 return good;
1522
1523}

◆ isAGoodCircle() [2/2]

bool HoughTrack::isAGoodCircle ( )

◆ judgeCharge() [1/4]

int HoughTrack::judgeCharge ( double  xHit,
double  yHit 
)

Definition at line 618 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

619{
620 //xHit = hit->getHitPosition().x();
621 //yHit = hit->getHitPosition().y();
622 //double xCenter = m_helix.center().x();
623 //double yCenter = m_helix.center().y();
624 double xCenter = center().x();
625 double yCenter = center().y();
626 double leftOrRight = xHit*yCenter - xCenter*yHit;
627 if(leftOrRight>0) return 1;
628 else return -1;
629}

◆ judgeCharge() [2/4]

int HoughTrack::judgeCharge ( double  xHit,
double  yHit 
)

◆ judgeCharge() [3/4]

int HoughTrack::judgeCharge ( HoughHit hit)

Definition at line 605 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

606{
607 double xHit = hit->getHitPosition().x();
608 double yHit = hit->getHitPosition().y();
609 //double xCenter = m_helix.center().x();
610 //double yCenter = m_helix.center().y();
611 double xCenter = center().x();
612 double yCenter = center().y();
613 double leftOrRight = xHit*yCenter - xCenter*yHit;
614 if(leftOrRight>0) return 1;
615 else return -1;
616}

Referenced by findVHot(), and findXHot().

◆ judgeCharge() [4/4]

int HoughTrack::judgeCharge ( HoughHit hit)

◆ judgeHalf() [1/2]

int HoughTrack::judgeHalf ( HoughHit hit)

Definition at line 592 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

593{
594 double xHit = hit->getHitPosition().x();
595 double yHit = hit->getHitPosition().y();
596 //double xCenter = m_helix.center().x();
597 //double yCenter = m_helix.center().y();
598 double xCenter = center().x();
599 double yCenter = center().y();
600 if(xHit*yCenter > xCenter*yHit)return m_charge;
601 else if(xHit*yCenter < xCenter*yHit)return -m_charge;
602 else return 0;
603}

Referenced by driftDistRes(), HoughFinder::fillHistogram(), findXHot(), HoughFinder::getMcParticleCol(), and HoughHit::residual().

◆ judgeHalf() [2/2]

int HoughTrack::judgeHalf ( HoughHit hit)

◆ judgeTrack() [1/2]

int HoughTrack::judgeTrack ( )

Definition at line 749 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

749 {
750 // hit number test
751 int axialHit=0;
752 // int stereoHit=0;
753 // int innerHit=0;
754 vector<int> vec_layer;
755 for( int i =0;i<_recHitVec.size();i++){
756 int layer = _recHitVec[i].getLayerId();
757 int slant= _recHitVec[i].getSlayerType();
758 if( 0==slant ) axialHit++;
759 // if( 0!=slant ) stereoHit++;
760 // if( layer<8 ) innerHit++;
761 }
762 // if ( axialHit <5 || stereoHit <3 || innerHit ==0 ) return 0;
763 if ( axialHit <5 ) return 0;
764 else return 1;
765 // // continues hit test
766 // bool continues=false;
767 // for(int i =0;i<vec_layer.size();i++){
768 // int layer = vec_layer[i];
769 // vector<int>::iterator iter = find( vec_layer.begin(),vec_layer.end(),layer+1 );
770 // if( iter != vec_layer.end() ){
771 // vector<int>::iterator iter2 = find( vec_layer.begin(),vec_layer.end(),layer-1 );
772 // if( iter2 != vec_layer.end() ) continues = true;
773 // }
774 // }
775}

◆ judgeTrack() [2/2]

int HoughTrack::judgeTrack ( )

◆ Leastfit() [1/2]

void HoughTrack::Leastfit ( vector< double >  ,
vector< double >  ,
double &  ,
double &   
)

◆ Leastfit() [2/2]

void HoughTrack::Leastfit ( vector< double >  ,
vector< double >  ,
double &  ,
double &   
)

◆ markUsedHot() [1/4]

void HoughTrack::markUsedHot ( int  use = 1)

Definition at line 1464 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1465{
1466 vector<double>::iterator it0_res = m_vecHitResidual.begin();
1467 vector<HoughHit*>::iterator iter0 = m_vecHitPnt.begin();
1468 vector<HoughHit*>::iterator iter = m_vecHitPnt.begin();
1469 for(; iter!=m_vecHitPnt.end(); iter++)
1470 {
1471 int useOld = (*iter)->getUse();
1472 if(use==-1&&useOld>0) continue;
1473 (*iter)->setUse(use);
1474 if(use==1) {
1475 //cout<<"HoughTrack::markUsedHot(use) add trk ID "<<getTrkID()<<endl;
1476 //(*iter)->addTrkPnt(this);
1477 (*iter)->addTrkID(getTrkID());
1478 vector<double>::iterator it_res = it0_res+(iter-iter0);
1479 //cout<<"add residual "<<*it_res<<endl;
1480 (*iter)->addResid(*it_res);
1481 //vector<double> vecRes = (*iter)->getVecResid();
1482 //cout<<"VecResid.size = "<<vecRes.size()<<endl;
1483 }
1484 }
1485}

◆ markUsedHot() [2/4]

void HoughTrack::markUsedHot ( int  use = 1)

◆ markUsedHot() [3/4]

void HoughTrack::markUsedHot ( vector< HoughHit * > &  hitPntList,
int  use = 1 
)

Definition at line 1447 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1448{
1449 vector<HoughHit*>::iterator iter = hitPntList.begin();
1450 for(; iter!=hitPntList.end(); iter++)
1451 {
1452 int useOld = (*iter)->getUse();
1453 if(use==-1&&useOld>0) continue;
1454 (*iter)->setUse(use);
1455
1456 if(use==1) {
1457 //cout<<"HoughTrack::markUsedHot add trk ID "<<getTrkID()<<endl;
1458 //(*iter)->addTrkPnt(this);
1459 (*iter)->addTrkID(getTrkID());
1460 }
1461 }
1462}

◆ markUsedHot() [4/4]

void HoughTrack::markUsedHot ( vector< HoughHit * > &  hitPntList,
int  use = 1 
)

◆ operator=() [1/4]

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

Definition at line 254 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

255{
256 if (this == & other) return * this;
257
258 Helix::operator=(other);
259 m_trkID = other.m_trkID;
260 m_charge = other.m_charge;
261 m_angle = other.m_angle;
262 m_rho = other.m_rho;
263 m_flag = other.m_flag;
264
265 m_dAngle = other.m_dAngle;
266 m_dRho = other.m_dRho;
267 m_dTanl = other.m_dTanl;
268 m_dDz = other.m_dTanl;
269
270 m_dr = other.m_dr;
271 m_phi0 = other.m_phi0;
272 m_kappa = other.m_kappa;
273 m_dz = other.m_dz;
274 m_tanl = other.m_tanl;
275
276 m_chi2 = other.m_chi2;
277 m_trkRecoTrk = other.m_trkRecoTrk;
278
279 m_circleFitStat=other.m_circleFitStat;
280 m_vecHitPnt = other.m_vecHitPnt;
281 m_vecHitResidual = other.m_vecHitResidual;
282 m_vecHitChi2 = other.m_vecHitChi2;
283
284 m_vecStereoHitPnt = other.m_vecStereoHitPnt;
285 m_vecStereoHitRes = other.m_vecStereoHitRes;
286 m_mcTrack = other.m_mcTrack;
287 m_cgemHitVector = other.m_cgemHitVector;
288 return * this;
289}
Helix & operator=(const Helix &)
Copy operator.

◆ operator=() [2/4]

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

◆ operator=() [3/4]

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

◆ operator=() [4/4]

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

◆ outerHit() [1/2]

void HoughTrack::outerHit ( )

Definition at line 218 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

218 {
219 vector<int> vec_layer_num[43];
220 for(int ilay=0;ilay<43;ilay++){
221 for(int ihit=0;ihit<_recHitVec.size();ihit++){
222 if(_recHitVec[ihit].getDetectorType()==CGEM)continue;
223 if( _recHitVec[ihit].getLayerId()==ilay && _recHitVec[ihit].getflag()==0 ) {
224 vec_layer_num[ilay].push_back( _recHitVec[ihit].getWireId() );
225 }
226 }
227 std::sort( vec_layer_num[ilay].begin(),vec_layer_num[ilay].end(),less_layer);
228 //for(int j=0;j<vec_layer_num[ilay].size();j++) cout<<"("<<ilay<<","<<vec_layer_num[ilay][j]<<")"<<endl;
229 if( vec_layer_num[ilay].size() < 4 ) continue;
230 for(int j=0;j<vec_layer_num[ilay].size();j++) {
231 // if( (vec_layer_num[ilay][j]+1 == vec_layer_num[ilay][j+1]) && (vec_layer_num[ilay][j+1]+1 == vec_layer_num[ilay][j+2]) && (vec_layer_num[ilay][j+2]+1 == vec_layer_num[ilay][j+3]) ) {
232 for(int jhit=0;jhit<_recHitVec.size();jhit++) {
233 if(_recHitVec[jhit].getDetectorType()==CGEM)continue;
234 if( (ilay==_recHitVec[jhit].getLayerId()) && (vec_layer_num[ilay][j]==_recHitVec[jhit].getWireId() ) ) {_recHitVec[jhit].setflag(-1);}
235 }
236 //}
237 }
238 }
239}
bool less_layer(const int &a, const int &b)

Referenced by fit3D(), and fit3D_inner().

◆ outerHit() [2/2]

void HoughTrack::outerHit ( )

◆ print() [1/4]

void HoughTrack::print ( )

Definition at line 956 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

957{
958 cout
959 <<setw(12)<<"trkID:" <<setw(15)<<m_trkID
960 <<setw(12)<<"flag:" <<setw(15)<<m_flag
961 //<<setw(12)<<"q:" <<setw(15)<<m_charge
962 <<setw(12)<<"pt:" <<setw(15)<<pt()
963 <<setw(12)<<"angle:" <<setw(15)<<m_angle
964 <<setw(12)<<"rho:" <<setw(15)<<m_rho
965 <<endl
966 <<setw(12)<<"dr:" <<setw(15)<<dr()
967 <<setw(12)<<"phi0:" <<setw(15)<<phi0()
968 <<setw(12)<<"kappa:" <<setw(15)<<kappa()
969 <<setw(12)<<"dz:" <<setw(15)<<dz()
970 <<setw(12)<<"tanl:" <<setw(15)<<tanl()
971 <<endl
972 //<<setw(12)<<"dr:" <<setw(15)<<m_dr
973 //<<setw(12)<<"phi0:" <<setw(15)<<m_phi0
974 //<<setw(12)<<"kappa:" <<setw(15)<<m_kappa
975 //<<setw(12)<<"dz:" <<setw(15)<<m_dz
976 //<<setw(12)<<"tanl:" <<setw(15)<<m_tanl
977 //<<endl
978 //<<setw(12)<<"dAngle:" <<setw(15)<<m_dAngle
979 //<<setw(12)<<"dRho:" <<setw(15)<<m_dRho
980 //<<setw(12)<<"dTanl:" <<setw(15)<<m_dTanl
981 //<<setw(12)<<"dDz:" <<setw(15)<<m_dDz
982 //<<setw(12)<<"chi2:" <<setw(15)<<m_chi2
983 //<<setw(12)<<":"<<setw(15)<<
984 //<<setw(12)<<":"<<setw(15)<<
985 //<<setw(12)<<":"<<setw(15)<<
986 ;
987 int nHot = getHotList().size();
988 int nAxialHot = 0;
989 int nStereoHot = 0;
990 int nXCluster = 0;
991 int nXVCluster = 0;
992 vector<HoughHit*> hotList;
993 vector<HoughHit*> axialHot = getVecHitPnt();
994 vector<HoughHit*> stereoHot = getVecStereoHitPnt();
995 for(vector<HoughHit*>::iterator hotIt = axialHot.begin(); hotIt != axialHot.end(); hotIt++){
996 if((**hotIt).getHitType()==HoughHit::CGEMHIT)nXCluster++;
997 if((**hotIt).getHitType()==HoughHit::MDCHIT)nAxialHot++;
998 }
999 for(vector<HoughHit*>::iterator hotIt = stereoHot.begin(); hotIt != stereoHot.end(); hotIt++){
1000 if((**hotIt).getHitType()==HoughHit::CGEMHIT)nXVCluster++;
1001 if((**hotIt).getHitType()==HoughHit::MDCHIT)nStereoHot++;
1002 }
1003 cout
1004 <<setw(12)<<"nHot:" <<setw(15)<<nHot
1005 <<setw(12)<<"nAxialHot0:" <<setw(15)<<nAxialHot
1006 <<setw(12)<<"nStereoHot0:" <<setw(15)<<nStereoHot
1007 <<setw(12)<<"nXCluster0:" <<setw(15)<<nXCluster
1008 <<setw(12)<<"nXVCluster0:" <<setw(15)<<nXVCluster
1009 <<endl;
1010 //cout<<endl;
1011}
vector< HoughHit * > getHotList(int type=2)

Referenced by HoughFinder::getMcParticleCol().

◆ print() [2/4]

void HoughTrack::print ( )

◆ print() [3/4]

void HoughTrack::print ( )

◆ print() [4/4]

void HoughTrack::print ( )

◆ printHot() [1/2]

void HoughTrack::printHot ( )

Definition at line 1013 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1014{
1015 vector<HoughHit*> hitList = getHotList();
1016 //vector<HoughHit*> hitList = getVecStereoHitPnt();
1017 for(vector<HoughHit*>::iterator hotIt = hitList.begin(); hotIt != hitList.end();hotIt++){
1018 HoughHit* hitIt = *hotIt;
1019 hitIt->print();
1020 //if(hitIt->getLayer()>3)continue;
1021 //cout<<hitIt->getHitID();
1022 //cout<<" ("<<hitIt->getLayer()<<", "<<hitIt->getWire()<<") "<<hitIt->getFlag();
1023 //if(hitIt->getHitType()==HoughHit::CGEMMCHIT||hitIt->getHitType()==HoughHit::MDCMCHIT)cout<<" halfCircle:"<<hitIt->getHalfCircle();
1024 //else if(hitIt->getPairHit()!=NULL)cout<<" halfCircle:"<<hitIt->getPairHit()->getHalfCircle();
1025 //HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
1026 //double res = hitIt->residual(this, positionOntrack, positionOnDetector);
1027 //cout<<" res:"<<setw(10)<<res<<" ";
1028 //cout<<endl;
1029 }
1030 cout<<endl;
1031 /*
1032 for(vector<HoughHit*>::iterator hitIt = hitList.begin(); hitIt != hitList.end();hitIt++){
1033 cout<<setw(4)<<(*hitIt)->getHitID();
1034 cout<<"("<<setw(2)<<(*hitIt)->getLayer()<<","<<setw(3)<<(*hitIt)->getWire()<<") ";
1035 cout<<"("<<setw( 9)<<(*hitIt)->getHitPosition().x()<<","<<setw( 9)<<(*hitIt)->getHitPosition().y()<<","<<setw( 9)<<(*hitIt)->getHitPosition().z()<<") ";
1036 cout<<"flag:"<<setw(3)<<(*hitIt)->getFlag();
1037 cout<<"use:"<<setw(3)<<(*hitIt)->getUse();
1038 if((*hitIt)->getHitType()==HoughHit::CGEMMCHIT||(*hitIt)->getHitType()==HoughHit::MDCMCHIT){
1039 vector<int> trkID = (*hitIt)->getTrkID();
1040 cout<<"TrkID:"<<setw(4)<<trkID[0];
1041 }
1042 if((*hitIt)->getHitType()==HoughHit::CGEMHIT){
1043 if((*hitIt)->getPairHit()!=NULL)cout<<"TrkID:"<<setw(3)<<((*hitIt)->getPairHit()->getTrkID())[0];
1044 cout<<"res:"<<setw(10)<<(*hitIt)->residual(this)<<" ";
1045 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
1046 double res = (*hitIt)->residual(this, positionOntrack, positionOnDetector);
1047 cout<<"res:"<<setw(10)<<res<<" ";
1048 //cout<<"["<<setw(4)<<(*hitIt)->getCgemCluster()->getclusterflagb()<<", "<<setw(4)<<(*hitIt)->getCgemCluster()->getclusterflage()<<"] ";
1049 }
1050 if((*hitIt)->getHitType()==HoughHit::MDCHIT){
1051 cout<<"TrkID:"<<setw(3)<<(*hitIt)->getDigi()->getTrackIndex();
1052 cout<<"res:"<<setw(10)<<(*hitIt)->residual(this)<<" ";
1053 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
1054 double res = (*hitIt)->residual(this, positionOntrack, positionOnDetector);
1055 cout<<"res:"<<setw(10)<<res<<" ";
1056 //cout<<(*hitIt)->getDigi()->identify()<<" ";
1057 //cout<<"("<<(*hitIt)->getPairHit()->getLayer()<<", "<<(*hitIt)->getPairHit()->getWire()<<") ";
1058 //if((*hitIt)->getPairHit()!=NULL)cout<<(*hitIt)->getDriftDist()<<" "<<(*hitIt)->getPairHit()->getDriftDist()<<" "<<(*hitIt)->getDriftDist()-(*hitIt)->getPairHit()->getDriftDist()<<endl;
1059 }
1060 if((*hitIt)->getPairHit()!=NULL){
1061 cout<<setw(4)<<(*hitIt)->getPairHit()->getHitID();
1062 //if((*hitIt)->driftTime()>1500.)cout<<(*hitIt)->getDriftDist()<<" "<<(*hitIt)->getPairHit()->getDriftDist();
1063 }
1064 //HepPoint3D hitPoint = (*hitIt)->getHitPosition();
1065 //cout<<flightLength(hitPoint);
1066 //else cout<<"NULL";
1067 cout<<endl;
1068 }
1069
1070 //vector<HoughHit*> hitList = getVecHitPnt();
1071 hitList = getVecStereoHitPnt();
1072 for(vector<HoughHit*>::iterator hitIt = hitList.begin(); hitIt != hitList.end();hitIt++){
1073 cout<<setw(4)<<(*hitIt)->getHitID();
1074 cout<<"("<<setw(2)<<(*hitIt)->getLayer()<<","<<setw(3)<<(*hitIt)->getWire()<<") ";
1075 cout<<"("<<setw( 9)<<(*hitIt)->getHitPosition().x()<<","<<setw( 9)<<(*hitIt)->getHitPosition().y()<<","<<setw( 9)<<(*hitIt)->getHitPosition().z()<<") ";
1076 cout<<"flag:"<<setw(3)<<(*hitIt)->getFlag();
1077 cout<<"use:"<<setw(3)<<(*hitIt)->getUse();
1078 if((*hitIt)->getHitType()==HoughHit::CGEMMCHIT||(*hitIt)->getHitType()==HoughHit::MDCMCHIT){
1079 vector<int> trkID = (*hitIt)->getTrkID();
1080 cout<<"TrkID:"<<setw(4)<<trkID[0];
1081 }
1082 if((*hitIt)->getHitType()==HoughHit::CGEMHIT){
1083 if((*hitIt)->getPairHit()!=NULL)cout<<"TrkID:"<<setw(3)<<((*hitIt)->getPairHit()->getTrkID())[0];
1084 cout<<"res:"<<setw(10)<<(*hitIt)->residual(this)<<" ";
1085 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
1086 double res = (*hitIt)->residual(this, positionOntrack, positionOnDetector);
1087 cout<<"res:"<<setw(10)<<res<<" ";
1088 //cout<<"["<<setw(4)<<(*hitIt)->getCgemCluster()->getclusterflagb()<<", "<<setw(4)<<(*hitIt)->getCgemCluster()->getclusterflage()<<"] ";
1089 }
1090 if((*hitIt)->getHitType()==HoughHit::MDCHIT){
1091 cout<<"TrkID:"<<setw(3)<<(*hitIt)->getDigi()->getTrackIndex();
1092 cout<<"res:"<<setw(10)<<(*hitIt)->residual(this)<<" ";
1093 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
1094 double res = (*hitIt)->residual(this, positionOntrack, positionOnDetector);
1095 cout<<"res:"<<setw(10)<<res<<" ";
1096 //cout<<(*hitIt)->getDigi()->identify()<<" ";
1097 //cout<<"("<<(*hitIt)->getPairHit()->getLayer()<<", "<<(*hitIt)->getPairHit()->getWire()<<") ";
1098 //if((*hitIt)->getPairHit()!=NULL)cout<<(*hitIt)->getDriftDist()<<" "<<(*hitIt)->getPairHit()->getDriftDist()<<" "<<(*hitIt)->getDriftDist()-(*hitIt)->getPairHit()->getDriftDist()<<endl;
1099 }
1100 if((*hitIt)->getPairHit()!=NULL){
1101 cout<<setw(4)<<(*hitIt)->getPairHit()->getHitID();
1102 //if((*hitIt)->driftTime()>1500.)cout<<(*hitIt)->getDriftDist()<<" "<<(*hitIt)->getPairHit()->getDriftDist();
1103 }
1104 //HepPoint3D hitPoint = (*hitIt)->getHitPosition();
1105 //cout<<flightLength(hitPoint);
1106 //else cout<<"NULL";
1107 cout<<endl;
1108 }
1109 //*/
1110}

◆ printHot() [2/2]

void HoughTrack::printHot ( )

◆ printHoughTrack() [1/2]

void HoughTrack::printHoughTrack ( )

Definition at line 1137 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

1138{
1139 cout<<".........................................print HoughTrack "<<_trkid<<"............................................."<<endl;
1140 //cout<<"q d0 phi0 omega d0 tanl: "<<_charge<<" "<<_d0<<" "<<_phi0<<" "<<_omega<<" "<<_tanl<<" "<<_z0<<endl;
1141 //cout<<"q pt Xc Yc R:"<<_charge<<" "<<_ptLeast<<" "<<_centerX<<" "<<_centerY<<" "<<_centerR<<endl;
1142 cout<<"(Xc, Yc, R):"<<"("<<_centerX<<", "<<_centerY<<", "<<_centerR<<") (theta,rho):"<<"("<<_centerPeak.getTheta()<<", "<<_centerPeak.getRho()<<")"<<" ,pt_2D: "<<_pt2D*_charge<<" pt_3D: "<<_pt3D*_charge<<endl;
1143 cout<<endl;
1144}

Referenced by MdcHoughFinder::execute().

◆ printHoughTrack() [2/2]

void HoughTrack::printHoughTrack ( )

◆ printRecHit() [1/2]

void HoughTrack::printRecHit ( ) const

Definition at line 1145 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

1145 {
1146 cout<<"print rec hit"<<endl;
1147 double rho = _centerPeak.getRho();
1148 double theta= _centerPeak.getTheta();
1149 int size=_recHitVec.size();
1150 for(int i=0;i<size;i++){
1151 int layer= _recHitVec[i].getLayerId();
1152 int wire = _recHitVec[i].getWireId();
1153 int slant= _recHitVec[i].getSlayerType();
1154 int flag= _recHitVec[i].getflag();
1155 int style= _recHitVec[i].getStyle();
1156 int cirlist= _recHitVec[i].getCirList();
1157 if( slant ==0 ) std::cout<<"axial hit ("<<layer<<","<<wire<<") "<<_recHitVec[i].getDisToTrack()<<" "<<_recHitVec[i].getDisToCir()<<" "<<flag<<" "<<style<<" "<<cirlist<<std::endl;
1158 }
1159 for(int i=0;i<size;i++){
1160 int layer= _recHitVec[i].getLayerId();
1161 int wire = _recHitVec[i].getWireId();
1162 int slant= _recHitVec[i].getSlayerType();
1163 int flag= _recHitVec[i].getflag();
1164 int style= _recHitVec[i].getStyle();
1165 int cirlist= _recHitVec[i].getCirList();
1166 if( slant !=0 ) std::cout<<"stereo hit ("<<layer<<","<<wire<<") "<<_recHitVec[i].getDisToTrack()<<" "<<flag<<" "<<style<<" "<<cirlist<<std::endl;
1167 }
1168}

Referenced by fit3D(), fit3D_inner(), fitLeast(), and fitzs().

◆ printRecHit() [2/2]

void HoughTrack::printRecHit ( ) const

◆ releaseSelHits() [1/2]

void HoughTrack::releaseSelHits ( )

Definition at line 1825 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

1826{
1827 vector<HoughHit*>::iterator it = m_vecHitPnt.begin();
1828 for(; it!=m_vecHitPnt.end(); it++)
1829 {
1830 (*it)->dropTrkID(m_trkID);// erase trk id and residual from the Hough hit
1831 }
1832}

◆ releaseSelHits() [2/2]

void HoughTrack::releaseSelHits ( )

◆ resetNhitHalf() [1/2]

void HoughTrack::resetNhitHalf ( )
inline

Definition at line 95 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

95{m_nHitFirstHalf=0; m_nHitSecondHalf=0; m_nHitUnused_FirstHalf=0; m_nHitUnused_SecondHalf=0;};

◆ resetNhitHalf() [2/2]

void HoughTrack::resetNhitHalf ( )
inline

Definition at line 95 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

95{m_nHitFirstHalf=0; m_nHitSecondHalf=0; m_nHitUnused_FirstHalf=0; m_nHitUnused_SecondHalf=0;};

◆ setAngle() [1/2]

void HoughTrack::setAngle ( double  angle)
inline

Definition at line 36 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

36{m_angle = angle;}

◆ setAngle() [2/2]

void HoughTrack::setAngle ( double  angle)
inline

◆ setbunchTime() [1/2]

void HoughTrack::setbunchTime ( double  t)
inline

Definition at line 97 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

97{_bunchTime = t;}
int t()
Definition: t.c:1

Referenced by MdcHoughFinder::execute().

◆ setbunchTime() [2/2]

void HoughTrack::setbunchTime ( double  t)
inline

◆ setCharge() [1/4]

void HoughTrack::setCharge ( int  charge)
inline

Definition at line 35 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

35{m_charge = charge;}

Referenced by MdcHoughFinder::execute().

◆ setCharge() [2/4]

void HoughTrack::setCharge ( int  charge)
inline

Definition at line 31 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

31{_charge=charge;}

◆ setCharge() [3/4]

void HoughTrack::setCharge ( int  charge)
inline

Definition at line 35 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

35{m_charge = charge;}

◆ setCharge() [4/4]

void HoughTrack::setCharge ( int  charge)
inline

◆ setChi2() [1/2]

void HoughTrack::setChi2 ( double  chi2)
inline

Definition at line 42 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

42{m_chi2 = chi2;}

◆ setChi2() [2/2]

void HoughTrack::setChi2 ( double  chi2)
inline

◆ setDAngle() [1/2]

void HoughTrack::setDAngle ( double  dAngle)
inline

Definition at line 38 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

38{m_dAngle = dAngle;}

◆ setDAngle() [2/2]

void HoughTrack::setDAngle ( double  dAngle)
inline

Definition at line 38 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

38{m_dAngle = dAngle;}

◆ setDDz() [1/2]

void HoughTrack::setDDz ( double  dDz)
inline

Definition at line 41 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

41{m_dDz = dDz;}

◆ setDDz() [2/2]

void HoughTrack::setDDz ( double  dDz)
inline

◆ setDRho() [1/2]

void HoughTrack::setDRho ( double  dRho)
inline

Definition at line 39 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

39{m_dRho = dRho;}

◆ setDRho() [2/2]

void HoughTrack::setDRho ( double  dRho)
inline

◆ setDTanl() [1/2]

void HoughTrack::setDTanl ( double  dTanl)
inline

Definition at line 40 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

40{m_dTanl = dTanl;}

◆ setDTanl() [2/2]

void HoughTrack::setDTanl ( double  dTanl)
inline

◆ setDz() [1/2]

void HoughTrack::setDz ( double  dz)
inline

Definition at line 45 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

45{m_dz = dz;}

◆ setDz() [2/2]

void HoughTrack::setDz ( double  dz)
inline

◆ setFlag() [1/2]

void HoughTrack::setFlag ( int  flag)
inline

Definition at line 34 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

34{m_flag = flag;}

◆ setFlag() [2/2]

void HoughTrack::setFlag ( int  flag)
inline

◆ setHoughHitList() [1/2]

void HoughTrack::setHoughHitList ( vector< HoughHit vec_hit)
inline

Definition at line 63 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

63{_houghList=vec_hit;}

Referenced by MdcHoughFinder::execute().

◆ setHoughHitList() [2/2]

void HoughTrack::setHoughHitList ( vector< HoughHit vec_hit)
inline

◆ setMcPar() [1/2]

void HoughTrack::setMcPar ( std::map< int, const HepVector >  mcTkPars)
inline

◆ setMcPar() [2/2]

void HoughTrack::setMcPar ( std::map< int, const HepVector >  mcTkPars)
inline

◆ setMcTrack() [1/2]

void HoughTrack::setMcTrack ( HoughTrack mcTrack)
inline

Definition at line 133 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

133{m_mcTrack = mcTrack;}

◆ setMcTrack() [2/2]

void HoughTrack::setMcTrack ( HoughTrack mcTrack)
inline

Definition at line 133 of file Reconstruction/HoughTransAlg/HoughTransAlg-00-00-14/HoughTransAlg/HoughTrack.h.

133{m_mcTrack = mcTrack;}

◆ setMdcHit() [1/2]

void HoughTrack::setMdcHit ( const vector< MdcHit * > *  mdchit)
inline

Definition at line 93 of file InstallArea/include/MdcHoughFinder/MdcHoughFinder/HoughTrack.h.

93{vec_mdcHit= mdchit;}

Referenced by MdcHoughFinder::execute().

◆ setMdcHit() [2/2]

void HoughTrack::setMdcHit ( const vector< MdcHit * > *  mdchit)
inline

◆ setRho() [1/2]

void HoughTrack::setRho ( double  rho)
inline

Definition at line 37 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

37{m_rho = rho;}

◆ setRho() [2/2]

void HoughTrack::setRho ( double  rho)
inline

◆ setTanl() [1/2]

void HoughTrack::setTanl ( double  tanl)
inline

Definition at line 46 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

46{m_tanl = tanl;}

◆ setTanl() [2/2]

void HoughTrack::setTanl ( double  tanl)
inline

◆ setTrkID() [1/2]

void HoughTrack::setTrkID ( int  trkID)
inline

Definition at line 33 of file InstallArea/include/HoughTransAlg/HoughTransAlg/HoughTrack.h.

33{m_trkID = trkID;}

◆ setTrkID() [2/2]

void HoughTrack::setTrkID ( int  trkID)
inline

◆ sortHit() [1/2]

void HoughTrack::sortHit ( )

Definition at line 195 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

195 {
196 std::sort (_recHitVec.begin(),_recHitVec.end(),digi_in_track);
197}
bool digi_in_track(const HoughRecHit &hita, const HoughRecHit &hitb)

Referenced by fit2D(), fit3D(), and fit3D_inner().

◆ sortHit() [2/2]

void HoughTrack::sortHit ( )

◆ sortHot() [1/2]

void HoughTrack::sortHot ( vector< HoughHit * > &  hotList)

Definition at line 912 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

913{
914 std::sort(hotList.begin(),hotList.end(),sortByLayer);
915}
bool sortByLayer(HoughHit *hit1, HoughHit *hit2)

Referenced by getHotList().

◆ sortHot() [2/2]

void HoughTrack::sortHot ( vector< HoughHit * > &  hotList)

◆ trackCharge2D() [1/2]

int HoughTrack::trackCharge2D ( )

Definition at line 877 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

877 {
878 int n_neg(0);
879 int n_pos(0);
880 for(int ihit=0;ihit<_recHitVec.size();ihit++){
881 if(_recHitVec[ihit].getSlayerType()!=0 ) continue;
882 double xhit =_recHitVec[ihit].getMidX();
883 double yhit =_recHitVec[ihit].getMidY();
884 double x_cir=_Hough2D.getCirX();
885 double y_cir=_Hough2D.getCirY();
886 double r_cir=_Hough2D.getCirR();
887 if( (x_cir*yhit - y_cir*xhit >=0) ) n_neg++;
888 if( (x_cir*yhit - y_cir*xhit <=0) ) n_pos++;
889 }
890 if( m_debug >0 ) cout<<" in track charge 2d "<<n_neg<<" "<<n_pos<<endl;
891 if( (_charge==-1&&n_neg<3) || (_charge==1&&n_pos<3) ) return 0;
892 else if( _charge ==0 ) cout<<" wrong ! in track charge 2D not set charge "<<endl;
893 else return 1;
894}

Referenced by MdcHoughFinder::execute().

◆ trackCharge2D() [2/2]

int HoughTrack::trackCharge2D ( )

◆ trackCharge3D() [1/2]

int HoughTrack::trackCharge3D ( )

Definition at line 896 of file MdcHoughFinder/MdcHoughFinder-00-00-12/src/HoughTrack.cxx.

896 {
897 int n_neg(0);
898 int n_pos(0);
899 for(int ihit=0;ihit<_recHitVec.size();ihit++){
900 if(_recHitVec[ihit].getSlayerType()==0 ) continue;
901 if(_recHitVec[ihit].getflag()!=0)continue;
902 //if(_recHitVec[ihit].getLayerId()>7 ) continue;
903 double xhit =_recHitVec[ihit].getMidX();
904 double yhit =_recHitVec[ihit].getMidY();
905 double x_cir=_Hough2D.getCirX();
906 double y_cir=_Hough2D.getCirY();
907 double r_cir=_Hough2D.getCirR();
908 if( (x_cir*yhit - y_cir*xhit >=0) ) n_neg++;
909 if( (x_cir*yhit - y_cir*xhit <=0) ) n_pos++;
910 }
911 if( m_debug >0 ) cout<<" in track charge 3d "<<n_neg<<" "<<n_pos<<endl;
912 if( (_charge==-1&&n_neg<2) || (_charge==1&&n_pos<2) ) return 0;
913 else if( _charge ==0 ) cout<<" wrong ! in track charge 3D not set charge "<<endl;
914 else return 1;
915}

Referenced by MdcHoughFinder::execute().

◆ trackCharge3D() [2/2]

int HoughTrack::trackCharge3D ( )

◆ update() [1/2]

void HoughTrack::update ( double  angle,
double  rho 
)

Definition at line 929 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

930{
931 m_angle = angle;
932 m_rho = rho;
933 m_phi0 = (rho>0)? angle:angle+M_PI;
934 m_phi0 = (m_charge<0)? m_phi0:m_phi0+M_PI;
935 if(m_phi0>2*M_PI)m_phi0-=2*M_PI;
936 if(m_phi0<0) m_phi0+=2*M_PI;
937 m_kappa = fabs(m_alpha*rho)*m_charge;
938 HepPoint3D pivot(0,0,0);
939 HepVector a(5,0);
940 HepSymMatrix Ea(5,0);
941 a(2) = m_phi0;
942 a(3) = m_kappa;
943 set(pivot,a,Ea);
944}

◆ update() [2/2]

void HoughTrack::update ( double  angle,
double  rho 
)

◆ updateCirclePar() [1/2]

void HoughTrack::updateCirclePar ( double  dr,
double  phi0,
double  kappa 
)

Definition at line 947 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

948{
949 m_dr = dr;
950 m_phi0=phi0;
951 m_kappa=kappa;
952 updateHelix();
953
954}

◆ updateCirclePar() [2/2]

void HoughTrack::updateCirclePar ( double  dr,
double  phi0,
double  kappa 
)

◆ updateHelix() [1/2]

void HoughTrack::updateHelix ( )

Definition at line 917 of file HoughTransAlg/HoughTransAlg-00-00-14/src/HoughTrack.cxx.

918{
919 pivot(HepPoint3D(0,0,0));
920 HepVector hepVector(5,0);
921 hepVector(1) = m_dr;
922 hepVector(2) = m_phi0;
923 hepVector(3) = m_kappa;
924 hepVector(4) = m_dz;
925 hepVector(5) = m_tanl;
926 a(hepVector);
927}
HepGeom::Point3D< double > HepPoint3D
Definition: Gam4pikp.cxx:37

Referenced by fitCircle(), fitHelix(), and updateCirclePar().

◆ updateHelix() [2/2]

void HoughTrack::updateHelix ( )

Member Data Documentation

◆ g_tkParTruth

std::map< int, const HepVector > HoughTrack::g_tkParTruth

◆ m_clearTrack

int HoughTrack::m_clearTrack =1
static

◆ m_cut

TGraph * HoughTrack::m_cut = {NULL}
static

◆ m_debug

◆ m_globalfit

bool HoughTrack::m_globalfit =0
static

◆ m_useCgemInGlobalFit

int HoughTrack::m_useCgemInGlobalFit =3
static

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