BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
HoughTrack Class Reference

#include <HoughTrack.h>

Public Member Functions

 HoughTrack ()
 
 ~HoughTrack ()
 
 HoughTrack (const HoughTrack &other)
 
 HoughTrack (const HoughPeak &centerPeak, std::vector< const HoughHit * > trackHitList, double, double)
 
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 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)
 

Static Public Attributes

static bool m_debug =0
 

Detailed Description

Definition at line 14 of file HoughTrack.h.

Constructor & Destructor Documentation

◆ HoughTrack() [1/3]

HoughTrack::HoughTrack ( )

Definition at line 12 of file HoughTrack.cxx.

12 {
13 p_trk=NULL;
14 p_trk2D=NULL;
15}
#define NULL

◆ ~HoughTrack()

HoughTrack::~HoughTrack ( )

Definition at line 16 of file HoughTrack.cxx.

16 {
17}

◆ HoughTrack() [2/3]

HoughTrack::HoughTrack ( const HoughTrack & other)

Definition at line 71 of file HoughTrack.cxx.

71 :
72 _dist(other._dist),
73 _charge(other._charge),
74 _ptLeast(other._ptLeast),
75 _pt2D(other._pt2D),
76 _pt3D(other._pt3D),
77 _pz(other._pz),
78 _p(other._p),
79
80 _d0(other._d0),
81 _omega(other._omega),
82 _phi0(other._phi0),
83 _z0(other._z0),
84 _tanl(other._tanl),
85 _z0_zs(other._z0_zs),
86 _tanl_zs(other._tanl_zs),
87
88 _centerPeak(other._centerPeak),
89 _Hough2D(other._Hough2D),
90 _Hough3D(other._Hough3D),
91 _bunchTime(other._bunchTime),
92 _centerX(other._centerX),
93 _centerY(other._centerY),
94 _centerR(other._centerR),
95 _chi2_aver(other._chi2_aver),
96 _nfit(other._nfit),
97 _chi2_aver2D(other._chi2_aver2D),
98 _nfit2D(other._nfit2D),
99 _stat2D(other._stat2D),
100 _stat3D(other._stat3D),
101 _recHitVec(other._recHitVec),
102 p_trk(other.p_trk),
103 p_trk2D(other.p_trk2D),
104 _maprho(other._maprho),
105 _maptheta(other._maptheta),
106 t_pro_correct(other.t_pro_correct),
107 _houghList(other._houghList),
108 vec_mdcHit ( other.vec_mdcHit)
109{
110 // _recHitVec.clear();
111 //if(_recHitVec.size() != 0 ){
112 // //cout<<"clear first "<<endl;
113 // for(int i =0;i<_recHitVec.size();i++){
114 // delete _recHitVec[i];
115 // _recHitVec[i]=NULL;
116 // }
117 // _recHitVec.clear();
118 //}
119 //for(int i =0;i<other._recHitVec.size();i++){
120 // //const HoughHit* p_hit= new HoughHit( *(other._recHitVec[i]));
121 // HoughRecHit p_hit ( (trackHitList[i])->digi(),0.,0. );
122 // _recHitVec.push_back(p_hit);
123 //}
124}
Index other(Index i, Index j)

◆ HoughTrack() [3/3]

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

Definition at line 144 of file HoughTrack.cxx.

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

Member Function Documentation

◆ add()

HoughTrack & HoughTrack::add ( const HoughTrack & other)

Definition at line 126 of file HoughTrack.cxx.

127{
128 for(int i =0;i<other._recHitVec.size();i++){
129 int same=0;
130 for(int j =0;j<_recHitVec.size();j++){
131 if( _recHitVec[j].digi() == other._recHitVec[i].digi() ) { same=1;}
132 }
133 if( same==0 ) {
134 //const HoughHit* p_hit= new HoughHit( *(other._recHitVec[i]));
135 //HoughRecHit p_hit ( (other._recHitVec[i]).digi(),0.,1);
136 HoughRecHit p_hit ( (other._recHitVec[i]));
137 _recHitVec.push_back(p_hit);
138 }
139 //cout<<" after copy: "<<i<<" new: "<<p_hit<<" old: "<<other._recHitVec[i]<<endl;
140 }
141 return *this;
142}

◆ cald_layer()

void HoughTrack::cald_layer ( )

Definition at line 879 of file HoughTrack.cxx.

879 {
880 //in truth
881 double k,b,theta,rho,x_cross,y_cross;
882 vector<double> vtemp,utemp;
883 std::vector<HoughRecHit>::iterator iter = _recHitVec.begin();
884 for(int iHit=0;iter!= _recHitVec.end(); iter++,iHit++){
885 const HoughRecHit h = (*iter);
886 // if( h.getCirList()!=0 ) continue;
887 if ( h.digi()->getTrackIndex()>=0 && h.getStyle()==0&& h.getSlayerType()==0 && h.getCirList()==0 && utemp.size()<10) // ??use 2nd half
888 {
889 utemp.push_back(h.getUTruth());
890 vtemp.push_back(h.getVTruth());
891 }
892 }
893 Leastfit(utemp,vtemp,k,b);
894 //calcu truth
895 //k,b from truth
896 x_cross = -b/(k+1/k);
897 y_cross = b/(1+k*k);
898 rho=sqrt(x_cross*x_cross+y_cross*y_cross);
899 theta=atan2(y_cross,x_cross);
900 //
901 //cout<<"track center position "<<_centerX<<" "<<_centerY<<endl;
902 std::vector<HoughRecHit>::iterator iter0= _recHitVec.begin();
903 for(; iter0!= _recHitVec.end(); iter0++){
904 HoughRecHit *hit = &(*iter0);
905 if( hit->getSlayerType()!=0 ) continue;
906 // if( hit->getCirList()!=0 ) continue; // use in learn distribute
907 //double cirr_hit = hit->getDriftDistTruth();
908 double cirx_hit = hit->getMidX();
909 double ciry_hit = hit->getMidY();
910 double cirr_hit = hit->getDriftDist();
911 double l1l2 = sqrt( (cirx_hit-_centerX)*(cirx_hit-_centerX)+(ciry_hit-_centerY)*(ciry_hit-_centerY) );
912 double deltaD ;
913 if( l1l2>_centerR ) deltaD = l1l2-_centerR-cirr_hit;
914 if( l1l2<=_centerR ) deltaD = l1l2-_centerR+cirr_hit;
915 hit->setDeltaD(deltaD);
916 //cal flight length
917
918 double theta_temp;
919 double l_temp;
920 if(_centerX==0||cirx_hit-_centerX==0){
921 theta_temp=0;
922 }
923 else{
924 theta_temp=M_PI-atan2(ciry_hit-_centerY,cirx_hit-_centerX)+atan2(_centerY,_centerX);
925 if(theta_temp>2*M_PI){
926 theta_temp=theta_temp-2*M_PI;
927 }
928 if(theta_temp<0){
929 theta_temp=theta_temp+2*M_PI;
930 }
931 }
932 //cout<<" charge "<<_charge <<" "<<theta_temp<<endl;
933 if(_charge==-1) {
934 l_temp=_centerR*theta_temp;
935 }
936 if(_charge==1) {
937 theta_temp=2*M_PI-theta_temp;
938 l_temp=_centerR*(theta_temp);
939 }
940 // cout<<"("<<hit->getLayerId()<<","<<hit->getWireId()<<") "<<l_temp<<endl;
941 hit->setFltLen(l_temp);
942
943 // cout<<"int map deltaD: ("<<hit->getLayerId()<<","<<hit->getWireId()<<")"<< hit->getDeltaD()<<endl;
944 }
945}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
#define M_PI
Definition TConstant.h:4
const MdcDigi * digi() const
Definition HoughHit.h:55
double getUTruth() const
Definition HoughHit.h:93
int getCirList() const
Definition HoughHit.h:105
void setFltLen(double flt)
Definition HoughHit.h:102
int getSlayerType() const
Definition HoughHit.h:64
double getDriftDist() const
Definition HoughHit.h:69
double getMidY() const
Definition HoughHit.h:61
void setDeltaD(double d)
Definition HoughHit.h:101
double getMidX() const
Definition HoughHit.h:60
int getStyle() const
Definition HoughHit.h:106
double getVTruth() const
Definition HoughHit.h:94
void Leastfit(vector< double >, vector< double >, double &, double &)
int getTrackIndex() const
Definition RawData.cxx:50
const double b
Definition slope.cxx:9

◆ calzs()

int HoughTrack::calzs ( )

Definition at line 554 of file HoughTrack.cxx.

554 {
555 int n_zs=0;
556 for( int i =0; i<_recHitVec.size(); i++){
557 if ( _recHitVec[i].getSlayerType() ==0 || _recHitVec[i].getflag()!=0 ) continue;
558 // if ( _recHitVec[i].getLayerId()>=8) continue;
559 HoughStereo zs( _bunchTime, &_Hough2D, &(_recHitVec[i]) );
560 // cout<<"("<<_recHitVec[i].getLayerId()<<","<<_recHitVec[i].getWireId()<<") stat "<<stat<<" style "<<_recHitVec[i].getStyle() <<endl;
561 // cout<<endl;
562
563 //zs.setAmb(-1); //right
564 //int stat_left = zs.cald();
565
566 //zs.setAmb(1); //left
567 //int stat_right= zs.cald();
568 //if( stat_left==-1 && stat_right==-1 ) _recHitVec[i].setflag(-999);
569
570 int stat= zs.cald();
571 _recHitVec[i].setnsol(stat);
572 if( stat==0 ) _recHitVec[i].setflag(-999);
573
574 zs.setRecHit();
575 _recHitVec[i].setAmb(-999); // check
576
577 if( _recHitVec[i].getLayerId()<8 ) n_zs++;
578 if(m_debug>0) zs.print();
579 }
580 // int naddStero = cutNoise_inner();
581 //return naddStero;
582 return n_zs;
583}
static bool m_debug
Definition HoughTrack.h:76

Referenced by fit3D(), and fit3D_inner().

◆ cut_axial_inner()

int HoughTrack::cut_axial_inner ( )

Definition at line 733 of file HoughTrack.cxx.

733 {
734 for( int ilay=0;ilay<43;ilay++){
735 //if( (ilay<7&&ilay<20) || ilay>35 ) continue;
736 if ((ilay>=0&&ilay<=7)||(ilay>=20&&ilay<=35)) continue;
737 // for( int ilay=0;ilay<8;ilay++)
738 double disToCir=9999;
739 int max=-999;
740 int count=0;
741 int count_cut=0;
742 for( int ihit=0;ihit<_recHitVec.size();ihit++){
743 if( _recHitVec[ihit].getLayerId()==ilay && _recHitVec[ihit].getflag()==0 ) {
744 count++;
745 if( (fabs(_recHitVec[ihit].getDisToCir())<disToCir) ) {
746 disToCir= fabs(_recHitVec[ihit].getDisToCir()); max=ihit;
747 count_cut=1;
748 }
749 }
750 }
751 if( m_debug >0 ) cout<<"ilay count count_cut "<<ilay<<" "<<count<<" "<<count_cut<<endl;
752 if( count_cut !=0 && count>1 ) _recHitVec[max].setflag(-999);
753 if( m_debug >0 && count_cut!=0 && count>1) cout<<"delete ("<<_recHitVec[max].getLayerId()<<","<<_recHitVec[max].getWireId()<<")"<<endl;
754 }
755 int size_of_axial;
756 for( int ihit=0;ihit<_recHitVec.size();ihit++){
757 if(_recHitVec[ihit].getSlayerType()==0 && _recHitVec[ihit].getflag()==0 ) size_of_axial++;
758 }
759 return size_of_axial;
760}
DOUBLE_PRECISION count[3]

◆ cutNoise_inner()

int HoughTrack::cutNoise_inner ( )

Definition at line 762 of file HoughTrack.cxx.

762 {
763 // for( int ilay=0;ilay<43;ilay++)
764 // if( (ilay>7&&ilay<20) || ilay>35 ) continue;
765 for( int ilay=0;ilay<8;ilay++){
766 double z_0=0;
767 double z_1=0;
768 int min=-999;
769 int count=0;
770 int count_cut=0;
771 // cout<<" size "<<_recHitVec.size()<<endl;
772 for( int ihit=0;ihit<_recHitVec.size();ihit++){
773 if( _recHitVec[ihit].getLayerId()==ilay && _recHitVec[ihit].getflag()==0) {
774 count++;
775 if( ((fabs(_recHitVec[ihit].getzAmb(0))>z_0) && (fabs(_recHitVec[ihit].getzAmb(1)) > z_1)) ) {
776 if( z_0!=0 && z_1!=0 ) count_cut++;
777 z_0= fabs(_recHitVec[ihit].getzAmb(0));z_1= fabs(_recHitVec[ihit].getzAmb(1)) ; min=ihit;
778 }
779 else if( ((fabs(_recHitVec[ihit].getzAmb(0))<z_0) && (fabs(_recHitVec[ihit].getzAmb(1)) < z_1)) ) {
780 count_cut++;
781 }
782 }
783 }
784 if( m_debug >0 ) cout<<"ilay count count_cut "<<ilay<<" "<<count<<" "<<count_cut<<endl;
785 if( count_cut>0 && count>1 ) _recHitVec[min].setflag(-999);
786 if( m_debug >0 && count_cut>0 && count>1) cout<<"delete ("<<_recHitVec[min].getLayerId()<<","<<_recHitVec[min].getWireId()<<")"<<endl;
787 }
788 int size_of_stereo;
789 for( int ihit=0;ihit<_recHitVec.size();ihit++){
790 if(_recHitVec[ihit].getSlayerType()!=0 && _recHitVec[ihit].getflag()==0 ) size_of_stereo++;
791 }
792 return size_of_stereo;
793}

◆ find_pair_hit()

int HoughTrack::find_pair_hit ( )

Definition at line 946 of file HoughTrack.cxx.

946 {
947 int nster1=0;
948 int nster2=0;
949 int nster3=0;
950 int naxial1=0;
951 int naxial2=0;
952 int naxial3=0;
953 for(int ihit=0;ihit<_houghList.size();ihit++){
954 const HoughHit hit= _houghList[ihit];
955 if ( hit.driftTime(_bunchTime,0)>1000 ) continue;
956 if ( hit.getLayerId()>=24 ) continue;
957 HoughRecHit p_hit ( hit,0,0,1);
958 p_hit.setPtr2D(&_Hough2D);
959 std::pair<double,double> theta_l = calcuArcTrack( p_hit );
960 double dist=calcuDistToTrack( p_hit );
961 double distToCir=calcuDistToCir( p_hit );
962 int flag = judge_half( p_hit );
963 int layer = p_hit.getLayerId();
964 int wire= p_hit.getWireId();
965 int slayer= p_hit.getSlayerType();
966 double disCut;
967 if( slayer == 0 ) disCut = 6;
968 else {
969 if(layer<8) disCut=6;
970 else disCut=6;
971 }
972 if( m_debug >0 )cout<<"("<<layer<<","<<wire<<") "<<" pair dist flag "<<dist<<" "<< flag<<endl;
973 if( fabs(dist) < disCut ) {
974 if( flag !=1 ) continue; //find hit in the 2nd half
975 if ( layer<4) nster1++;
976 else if ( layer<8) nster2++;
977 else if ( layer<12) naxial1++;
978 else if ( layer<16) naxial2++;
979 else if ( layer<20) naxial3++;
980 else nster3++;
981 }
982 }
983 if(m_debug >0){
984 cout <<"naxial_1 "<<naxial1<<endl;
985 cout <<"naxial_2 "<<naxial2<<endl;
986 cout <<"naxial_3 "<<naxial3<<endl;
987 cout <<"stereo_1 "<<nster1<<endl;
988 cout <<"stereo_2 "<<nster2<<endl;
989 cout <<"stereo_3 "<<nster3<<endl;
990 }
991 if (nster1>=2 && nster2>=2 && nster3>=2 && naxial1>=2 && naxial2>=2 && naxial3>=2 ) return 1;
992 else return 0;
993}
double driftTime() const
Definition HoughHit.cxx:145
int getLayerId() const
Definition HoughHit.h:62

Referenced by MdcHoughFinder::execute().

◆ find_stereo_hit()

int HoughTrack::find_stereo_hit ( )

Definition at line 697 of file HoughTrack.cxx.

697 {
698 vector<HoughRecHit> vec_rec; // store hit temp
699 int naddStero=0;
700 for(int ihit=0;ihit<_houghList.size();ihit++){
701 const HoughHit hit= _houghList[ihit];
702 if ( hit.getSlayerType()==0 ) continue;
703 if ( hit.driftTime(_bunchTime,0)>800 ) continue;
704 HoughRecHit p_hit ( hit,0,0,1);
705 p_hit.setPtr2D(&_Hough2D);
706 std::pair<double,double> theta_l = calcuArcTrack( p_hit );
707 double dist=calcuDistToTrack( p_hit );
708 double distToCir=calcuDistToCir( p_hit );
709 int flag = judge_half( p_hit );
710 int layer = p_hit.getLayerId();
711 int wire= p_hit.getWireId();
712 double disCut;
713 if(layer<8) disCut=4;
714 else disCut=6;
715 // double dist=sqrt( pow( (xhit-x_cir),2)+pow( (yhit-y_cir),2) )-r_cir;
716 // cout<<"find stereo hit dist?("<<layer<<" ,"<<wire<<" ) "<<dist<<endl;
717 if( m_debug >0 )cout<<"("<<layer<<","<<wire<<") "<<" rec hit dist theta "<<dist<<" "<< theta_l.first<<endl;
718 if( fabs(dist) < disCut ) {
719 p_hit.setDisToTrack(dist);
720 p_hit.setDisToCir(dist);
721 p_hit.setRet(theta_l);
722 p_hit.setflag(flag);
723 // if( p_hit.getflag()==0 ) vec_rec.push_back(p_hit);
724 // vec_rec.push_back(p_hit);
725 if( p_hit.getflag()!=0 ) continue;
726 _recHitVec.push_back(p_hit);
727 naddStero++;
728 }
729 }
730 return naddStero;
731}

Referenced by MdcHoughFinder::execute().

◆ fit()

void HoughTrack::fit ( double bunchtime)

◆ fit2D()

int HoughTrack::fit2D ( double bunchtime)

Definition at line 190 of file HoughTrack.cxx.

190 {
191 sortHit();
192// cout<<"in fit2d"<<endl;
193 _bunchTime=bunchtime;
194 _stat2D = fitLeast();
195// outerHit();
196 _stat2D = fit_global2D(_recHitVec);
197 //printRecHit();
198 //collectAxialHit();
199 //_Hough2D.print();
200 //cald_layer();
201 return _stat2D;
202}
void sortHit()

Referenced by MdcHoughFinder::execute().

◆ fit3D()

int HoughTrack::fit3D ( )

Definition at line 298 of file HoughTrack.cxx.

298 {
299 sortHit();
300// cout<<"in fit3d"<<endl;
301 int nhit_zs = calzs();
302 if( nhit_zs >=3 ) fitzs();
303 else {
304 _tanl=0.;_z0=0.;
305 }
306 outerHit();
307 if(m_debug>0) { cout<< " before 3d fit "<<endl; this->printRecHit();}
308 _stat3D = fit_global3D(0);
309 return _stat3D;
310}
void outerHit()
void printRecHit() const

Referenced by MdcHoughFinder::execute().

◆ fit3D_inner()

int HoughTrack::fit3D_inner ( )

Definition at line 312 of file HoughTrack.cxx.

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

Referenced by MdcHoughFinder::execute().

◆ fitzs()

void HoughTrack::fitzs ( )

Definition at line 584 of file HoughTrack.cxx.

584 {
585 HoughZsFit zsfit(&_recHitVec);
586 _tanl=zsfit.getTanl();
587 _z0=zsfit.getZ0();
588 _tanl_zs=zsfit.getTanl();
589 _z0_zs=zsfit.getZ0();
590 t_pro_correct = zsfit.getPro();
591 if(m_debug>0) printRecHit();
592}

Referenced by fit3D(), and fit3D_inner().

◆ get2D()

Hough2D HoughTrack::get2D ( ) const
inline

Definition at line 27 of file HoughTrack.h.

27{ return _Hough2D;}

◆ get3D()

Hough3D HoughTrack::get3D ( ) const
inline

Definition at line 28 of file HoughTrack.h.

28{ return _Hough3D;}

◆ getCenterPeak()

HoughPeak HoughTrack::getCenterPeak ( ) const
inline

Definition at line 26 of file HoughTrack.h.

26{ return _centerPeak;}

◆ getCharge()

int HoughTrack::getCharge ( ) const
inline

Definition at line 32 of file HoughTrack.h.

32{return _charge;}

◆ getChi2_2D()

double HoughTrack::getChi2_2D ( ) const
inline

Definition at line 60 of file HoughTrack.h.

60{return _chi2_aver2D;}

◆ getChi2_3D()

double HoughTrack::getChi2_3D ( ) const
inline

Definition at line 59 of file HoughTrack.h.

59{return _chi2_aver;}

◆ getCirR()

double HoughTrack::getCirR ( ) const
inline

Definition at line 56 of file HoughTrack.h.

56{return _centerR;}

◆ getCirX()

double HoughTrack::getCirX ( ) const
inline

Definition at line 57 of file HoughTrack.h.

57{return _centerX;}

◆ getCirY()

double HoughTrack::getCirY ( ) const
inline

Definition at line 58 of file HoughTrack.h.

58{return _centerY;}

◆ getD0()

double HoughTrack::getD0 ( ) const
inline

Definition at line 40 of file HoughTrack.h.

40{return _d0;}

◆ getHitNum()

int HoughTrack::getHitNum ( int select) const

Definition at line 594 of file HoughTrack.cxx.

594 {
595 int size=_recHitVec.size();
596 int n0,n1,n2,n3,n4,n5,n6;
597 n0=n1=n2=n3=n4=n5=n6=0;
598 for(int i=0;i<size;i++){
599 int cir= _recHitVec[i].getCirList();
600 int index = _recHitVec[i].digi()->getTrackIndex();
601 int style= _recHitVec[i].getStyle();
602 n0++;
603 if( style == 1 ) n1++;
604 if( style == 2 ) n2++;
605 if( index < 0 ) n3++;
606 if( index >=0 && cir<=1 && style==0) n4++;
607 if( index <0 || cir>1 ) n5++;
608 if( index >=0 && cir==0 && style==0) n6++;
609 }
610 if( select == 0 ) return n0;
611 if( select == 1 ) return n1;
612 if( select == 2 ) return n2;
613 if( select == 3 ) return n3;
614 if( select == 4 ) return n4;
615 if( select == 5 ) return n5;
616 if( select == 6 ) return n6;
617}
int n2
Definition SD0Tag.cxx:55
int n1
Definition SD0Tag.cxx:54

◆ getHitNumA()

int HoughTrack::getHitNumA ( int select) const

Definition at line 618 of file HoughTrack.cxx.

618 {
619 int size=_recHitVec.size();
620 int n0,n1,n2,n3,n4,n5,n6;
621 n0=n1=n2=n3=n4=n5=n6=0;
622 for(int i=0;i<size;i++){
623 int cir= _recHitVec[i].getCirList();
624 int index = _recHitVec[i].digi()->getTrackIndex();
625 int type = _recHitVec[i].getSlayerType();
626 int style= _recHitVec[i].getStyle();
627 if( type ==0 ) n0++;
628 if( type==0 && style == 1 ) n1++;
629 if( type==0 && style == 2 ) n2++;
630 if( type==0 && index < 0 ) n3++;
631 if( type==0 && index >=0 && cir<=1 && style==0 ) n4++;
632 if( type==0 && (index <0 || cir>1) ) n5++;
633 if( type==0 && index >=0 && cir==0 && style==0 ) n6++;
634 }
635 if( select == 0 ) return n0;
636 if( select == 1 ) return n1;
637 if( select == 2 ) return n2;
638 if( select == 3 ) return n3;
639 if( select == 4 ) return n4;
640 if( select == 5 ) return n5;
641 if( select == 6 ) return n6;
642}

◆ getHitNumS()

int HoughTrack::getHitNumS ( int select) const

Definition at line 643 of file HoughTrack.cxx.

643 {
644 int size=_recHitVec.size();
645 int n0,n1,n2,n3,n4,n5,n6;
646 n0=n1=n2=n3=n4=n5=n6=0;
647 for(int i=0;i<size;i++){
648 int cir= _recHitVec[i].getCirList();
649 int index = _recHitVec[i].digi()->getTrackIndex();
650 int type = _recHitVec[i].getSlayerType();
651 int style= _recHitVec[i].getStyle();
652 if( type !=0 ) n0++;
653 if( type!=0 && style == 1 ) n1++;
654 if( type!=0 && style == 2 ) n2++;
655 if( type!=0 && index < 0 ) n3++;
656 if( type!=0 && index >=0 && cir<=1 && style==0) n4++;
657 if( type!=0 && (index <0 || cir>1) ) n5++;
658 if( type!=0 && index >=0 && cir==0 && style==0) n6++;
659 }
660 if( select == 0 ) return n0;
661 if( select == 1 ) return n1;
662 if( select == 2 ) return n2;
663 if( select == 3 ) return n3;
664 if( select == 4 ) return n4;
665 if( select == 5 ) return n5;
666 if( select == 6 ) return n6;
667}

◆ getHoughHitList()

recHitCol & HoughTrack::getHoughHitList ( )
inline

Definition at line 29 of file HoughTrack.h.

29{ return _recHitVec; }

◆ getMapRho()

double HoughTrack::getMapRho ( ) const
inline

Definition at line 87 of file HoughTrack.h.

87{return _maprho;}

◆ getMapTheta()

double HoughTrack::getMapTheta ( ) const
inline

Definition at line 88 of file HoughTrack.h.

88{return _maptheta;}

◆ getNfit()

double HoughTrack::getNfit ( ) const
inline

Definition at line 61 of file HoughTrack.h.

61{return _nfit;}

◆ getNfit2D()

int HoughTrack::getNfit2D ( ) const
inline

Definition at line 51 of file HoughTrack.h.

51{return _Hough2D.getNfit();}
double getNfit() const
Definition Hough2D.h:62

◆ getNfit3D()

int HoughTrack::getNfit3D ( ) const
inline

Definition at line 52 of file HoughTrack.h.

52{return _Hough3D.getNfit();}
int getNfit() const
Definition Hough3D.h:43

◆ getOmega()

double HoughTrack::getOmega ( ) const
inline

Definition at line 41 of file HoughTrack.h.

41{return _omega;}

◆ getP()

double HoughTrack::getP ( ) const
inline

Definition at line 36 of file HoughTrack.h.

36{return _p;}

◆ getPhi0()

double HoughTrack::getPhi0 ( ) const
inline

Definition at line 42 of file HoughTrack.h.

42{return _phi0;}

◆ getPro()

double HoughTrack::getPro ( ) const
inline

Definition at line 89 of file HoughTrack.h.

89{return t_pro_correct;}

◆ getPt2D()

double HoughTrack::getPt2D ( ) const
inline

Definition at line 34 of file HoughTrack.h.

34{return _pt2D;}

◆ getPt3D()

double HoughTrack::getPt3D ( ) const
inline

Definition at line 35 of file HoughTrack.h.

35{return _pt3D;}

Referenced by more_pt().

◆ getPt_least()

double HoughTrack::getPt_least ( ) const
inline

Definition at line 33 of file HoughTrack.h.

33{return _ptLeast;}

◆ getPz()

double HoughTrack::getPz ( ) const
inline

Definition at line 37 of file HoughTrack.h.

37{return _pz;}

◆ getRho()

double HoughTrack::getRho ( ) const
inline

Definition at line 38 of file HoughTrack.h.

38{return _centerPeak.getRho();}
double getRho() const
Definition HoughPeak.h:26

◆ getStat2D()

int HoughTrack::getStat2D ( ) const
inline

Definition at line 53 of file HoughTrack.h.

53{return _stat2D;}

◆ getStat3D()

int HoughTrack::getStat3D ( ) const
inline

Definition at line 54 of file HoughTrack.h.

54{return _stat3D;}

◆ getTanl()

double HoughTrack::getTanl ( ) const
inline

Definition at line 43 of file HoughTrack.h.

43{return _tanl;}

◆ getTanl_zs()

double HoughTrack::getTanl_zs ( ) const
inline

Definition at line 45 of file HoughTrack.h.

45{return _tanl_zs;}

◆ getTheta()

double HoughTrack::getTheta ( ) const
inline

Definition at line 39 of file HoughTrack.h.

39{return _centerPeak.getTheta();}
double getTheta() const
Definition HoughPeak.h:25

◆ getTrk()

TrkRecoTrk * HoughTrack::getTrk ( ) const
inline

Definition at line 22 of file HoughTrack.h.

22{return p_trk;}

◆ getTrk2D()

TrkRecoTrk * HoughTrack::getTrk2D ( ) const
inline

Definition at line 23 of file HoughTrack.h.

23{return p_trk2D;}

◆ getVecForClean3D()

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

Definition at line 25 of file HoughTrack.h.

25{return _Hough3D.getVecForClean();}
vector< MdcHit * > & getVecForClean()
Definition Hough3D.h:44

◆ getZ0()

double HoughTrack::getZ0 ( ) const
inline

Definition at line 44 of file HoughTrack.h.

44{return _z0;}

◆ getZ0_zs()

double HoughTrack::getZ0_zs ( ) const
inline

Definition at line 46 of file HoughTrack.h.

46{return _z0_zs;}

◆ judgeTrack()

int HoughTrack::judgeTrack ( )

Definition at line 669 of file HoughTrack.cxx.

669 {
670 // hit number test
671 int axialHit=0;
672 // int stereoHit=0;
673 // int innerHit=0;
674 vector<int> vec_layer;
675 for( int i =0;i<_recHitVec.size();i++){
676 int layer = _recHitVec[i].getLayerId();
677 int slant= _recHitVec[i].getSlayerType();
678 if( 0==slant ) axialHit++;
679 // if( 0!=slant ) stereoHit++;
680 // if( layer<8 ) innerHit++;
681 }
682 // if ( axialHit <5 || stereoHit <3 || innerHit ==0 ) return 0;
683 if ( axialHit <5 ) return 0;
684 else return 1;
685 // // continues hit test
686 // bool continues=false;
687 // for(int i =0;i<vec_layer.size();i++){
688 // int layer = vec_layer[i];
689 // vector<int>::iterator iter = find( vec_layer.begin(),vec_layer.end(),layer+1 );
690 // if( iter != vec_layer.end() ){
691 // vector<int>::iterator iter2 = find( vec_layer.begin(),vec_layer.end(),layer-1 );
692 // if( iter2 != vec_layer.end() ) continues = true;
693 // }
694 // }
695}

◆ Leastfit()

void HoughTrack::Leastfit ( vector< double > u,
vector< double > v,
double & k,
double & b )

Definition at line 857 of file HoughTrack.cxx.

857 {
858 int N = u.size();
859 if (N<=2) return;
860 double *x=new double[N];
861 double *y=new double[N];
862 for(int i=0;i<N;i++){
863 x[i]=u[i];
864 y[i]=v[i];
865 }
866
867 TF1 *fpol1=new TF1("fpol1","pol1",-50,50);
868 TGraph *tg=new TGraph(N,x,y);
869 tg->Fit("fpol1","QN");
870 double ktemp =fpol1->GetParameter(1);
871 double btemp =fpol1->GetParameter(0);
872 k = ktemp;
873 b = btemp;
874 delete []x;
875 delete []y;
876 delete fpol1;
877 delete tg;
878}
Double_t x[10]
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
double y[1000]

Referenced by cald_layer().

◆ operator=()

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

Definition at line 19 of file HoughTrack.cxx.

19 {
20 _dist=(other._dist);
21 _charge=(other._charge);
22 _ptLeast=(other._ptLeast);
23 _pt2D=(other._pt2D);
24 _pt3D=(other._pt3D);
25 _pz=(other._pz);
26 _p=(other._p);
27
28 _d0=other._d0;
29 _omega=other._omega;
30 _phi0=other._phi0;
31 _tanl=(other._tanl);
32 _z0=(other._z0);
33 _tanl_zs=(other._tanl_zs);
34 _z0_zs=(other._z0_zs);
35
36 _centerPeak=(other._centerPeak);
37 _Hough2D=(other._Hough2D);
38 _Hough3D=(other._Hough3D);
39 _bunchTime=(other._bunchTime);
40 _centerX=(other._centerX);
41 _centerY=(other._centerY);
42 _centerR=(other._centerR);
43 _chi2_aver=(other._chi2_aver);
44 _nfit=(other._nfit);
45 _chi2_aver2D=(other._chi2_aver2D);
46 _nfit2D=(other._nfit2D);
47 _recHitVec=(other._recHitVec);
48 _stat2D=(other._stat2D);
49 _stat3D=(other._stat3D);
50 p_trk=other.p_trk;
51 p_trk2D=other.p_trk2D;
52 _maprho = other._maprho;
53 _maptheta= other._maptheta;
54 t_pro_correct= other.t_pro_correct;
55 _houghList = other._houghList;
56 vec_mdcHit = other.vec_mdcHit;
57 // if(_recHitVec.size() != 0 ){
58 // for(int i =0;i<_recHitVec.size();i++){
59 // delete _recHitVec[i];
60 // _recHitVec[i]=NULL;
61 // }
62 // _recHitVec.clear();
63 // }
64 // for(int i =0;i<other._recHitVec.size();i++){
65 // //const HoughHit* p_hit= new HoughHit( *(other._recHitVec[i]));
66 // HoughRecHit p_hit ( (trackHitList[i])->digi(),0.,0. );
67 // _recHitVec.push_back(p_hit);
68 // }
69}

◆ outerHit()

void HoughTrack::outerHit ( )

Definition at line 207 of file HoughTrack.cxx.

207 {
208 vector<int> vec_layer_num[43];
209 for(int ilay=0;ilay<43;ilay++){
210 for(int ihit=0;ihit<_recHitVec.size();ihit++){
211 if( _recHitVec[ihit].getLayerId()==ilay && _recHitVec[ihit].getflag()==0 ) {
212 vec_layer_num[ilay].push_back( _recHitVec[ihit].getWireId() );
213 }
214 }
215 std::sort( vec_layer_num[ilay].begin(),vec_layer_num[ilay].end(),less_layer);
216 //for(int j=0;j<vec_layer_num[ilay].size();j++) cout<<"("<<ilay<<","<<vec_layer_num[ilay][j]<<")"<<endl;
217 if( vec_layer_num[ilay].size() < 4 ) continue;
218 for(int j=0;j<vec_layer_num[ilay].size();j++) {
219// 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]) ) {
220 for(int jhit=0;jhit<_recHitVec.size();jhit++) {
221 if( (ilay==_recHitVec[jhit].getLayerId()) && (vec_layer_num[ilay][j]==_recHitVec[jhit].getWireId() ) ) {_recHitVec[jhit].setflag(-1);}
222 }
223 //}
224 }
225 }
226}
bool less_layer(const int &a, const int &b)

Referenced by fit3D(), and fit3D_inner().

◆ print()

void HoughTrack::print ( )

Definition at line 994 of file HoughTrack.cxx.

994 {
995 cout<<"print HoughTrack : "<<p_trk->id()<<endl;
996 cout<<"par : "<<_d0<<","<<_omega<<","<<_phi0<<","<<_z0<<","<<_tanl<<", pt: "<<_pt3D<<endl;
997 TrkHitList* qhits = p_trk->hits();
998 TrkHotList::hot_iterator hotIter= qhits->hotList().begin();
999 int lay=((MdcHit*)(hotIter->hit()))->layernumber();
1000 int wir=((MdcHit*)(hotIter->hit()))->wirenumber();
1001 while (hotIter!=qhits->hotList().end()) {
1002 cout <<"(" <<((MdcHit*)(hotIter->hit()))->layernumber()
1003 <<","<<((MdcHit*)(hotIter->hit()))->wirenumber()
1004 <<":"<<hotIter->isActive()<<") ";
1005 cout << "nuse "<<hotIter->hit()->nUsedHits()<<endl;
1006
1007 hotIter++;
1008 }
1009}
const TrkHotList & hotList() const
hot_iterator end() const
Definition TrkHotList.h:45
hot_iterator begin() const
Definition TrkHotList.h:44
TrkHitList * hits()
Definition TrkRecoTrk.h:107
const TrkId & id() const

◆ printRecHit()

void HoughTrack::printRecHit ( ) const

Definition at line 795 of file HoughTrack.cxx.

795 {
796 cout<<"print rec hit"<<endl;
797 double rho = _centerPeak.getRho();
798 double theta= _centerPeak.getTheta();
799 int size=_recHitVec.size();
800 for(int i=0;i<size;i++){
801 int layer= _recHitVec[i].getLayerId();
802 int wire = _recHitVec[i].getWireId();
803 int slant= _recHitVec[i].getSlayerType();
804 int flag= _recHitVec[i].getflag();
805 int style= _recHitVec[i].getStyle();
806 int cirlist= _recHitVec[i].getCirList();
807 if( slant ==0 ) std::cout<<"axial hit ("<<layer<<","<<wire<<") "<<_recHitVec[i].getDisToTrack()<<" "<<_recHitVec[i].getDisToCir()<<" "<<flag<<" "<<style<<" "<<cirlist<<std::endl;
808 }
809 for(int i=0;i<size;i++){
810 int layer= _recHitVec[i].getLayerId();
811 int wire = _recHitVec[i].getWireId();
812 int slant= _recHitVec[i].getSlayerType();
813 int flag= _recHitVec[i].getflag();
814 int style= _recHitVec[i].getStyle();
815 int cirlist= _recHitVec[i].getCirList();
816 if( slant !=0 ) std::cout<<"stereo hit ("<<layer<<","<<wire<<") "<<_recHitVec[i].getDisToTrack()<<" "<<flag<<" "<<style<<" "<<cirlist<<std::endl;
817 }
818}

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

◆ setCharge()

void HoughTrack::setCharge ( int charge)
inline

Definition at line 31 of file HoughTrack.h.

31{_charge=charge;}
float charge

Referenced by MdcHoughFinder::execute().

◆ setHoughHitList()

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

Definition at line 63 of file HoughTrack.h.

63{_houghList=vec_hit;}

Referenced by MdcHoughFinder::execute().

◆ setMdcHit()

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

Definition at line 91 of file HoughTrack.h.

91{vec_mdcHit= mdchit;}

Referenced by MdcHoughFinder::execute().

◆ sortHit()

void HoughTrack::sortHit ( )

Definition at line 187 of file HoughTrack.cxx.

187 {
188 std::sort (_recHitVec.begin(),_recHitVec.end(),digi_in_track);
189}
bool digi_in_track(const HoughRecHit &hita, const HoughRecHit &hitb)

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

◆ trackCharge2D()

int HoughTrack::trackCharge2D ( )

Definition at line 820 of file HoughTrack.cxx.

820 {
821 int n_neg(0);
822 int n_pos(0);
823 for(int ihit=0;ihit<_recHitVec.size();ihit++){
824 double xhit =_recHitVec[ihit].getMidX();
825 double yhit =_recHitVec[ihit].getMidY();
826 double x_cir=_Hough2D.getCirX();
827 double y_cir=_Hough2D.getCirY();
828 double r_cir=_Hough2D.getCirR();
829 if( (x_cir*yhit - y_cir*xhit >=0) ) n_neg++;
830 if( (x_cir*yhit - y_cir*xhit <=0) ) n_pos++;
831 }
832 if( m_debug >0 ) cout<<" in track charge 2d "<<n_neg<<" "<<n_pos<<endl;
833 if( (_charge==-1&&n_neg<3) || (_charge==1&&n_pos<3) ) return 0;
834 else if( _charge ==0 ) cout<<" wrong ! in track charge 2D not set charge "<<endl;
835 else return 1;
836}
double getCirR() const
Definition Hough2D.h:35
double getCirX() const
Definition Hough2D.h:33
double getCirY() const
Definition Hough2D.h:34

Referenced by MdcHoughFinder::execute().

◆ trackCharge3D()

int HoughTrack::trackCharge3D ( )

Definition at line 838 of file HoughTrack.cxx.

838 {
839 int n_neg(0);
840 int n_pos(0);
841 for(int ihit=0;ihit<_recHitVec.size();ihit++){
842 if(_recHitVec[ihit].getSlayerType()==0 ) continue;
843 if(_recHitVec[ihit].getLayerId()>7 ) continue;
844 double xhit =_recHitVec[ihit].getMidX();
845 double yhit =_recHitVec[ihit].getMidY();
846 double x_cir=_Hough2D.getCirX();
847 double y_cir=_Hough2D.getCirY();
848 double r_cir=_Hough2D.getCirR();
849 if( (x_cir*yhit - y_cir*xhit >=0) ) n_neg++;
850 if( (x_cir*yhit - y_cir*xhit <=0) ) n_pos++;
851 }
852 if( m_debug >0 ) cout<<" in track charge 3d "<<n_neg<<" "<<n_pos<<endl;
853 if( (_charge==-1&&n_neg<2) || (_charge==1&&n_pos<2) ) return 0;
854 else if( _charge ==0 ) cout<<" wrong ! in track charge 3D not set charge "<<endl;
855 else return 1;
856}

Referenced by MdcHoughFinder::execute().

Member Data Documentation

◆ m_debug


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