9 for(
int i =0;i<_houghPeakHitList.size();i++){
11 _houghPeakHitList[i]=NULL;
13 _houghPeakHitList.clear();
17 if(
this == &other )
return *
this;
18 _height=other._height;
21 _thetaBin=other._thetaBin;
22 _rhoBin=other._rhoBin;
23 _isCandiTrack=other._isCandiTrack;
24 _peakNum=other._peakNum;
25 _charge=other._charge;
26 if(_houghPeakHitList.size() != 0 ){
27 for(
int i =0;i<_houghPeakHitList.size();i++){
28 _houghPeakHitList[i]=NULL;
30 _houghPeakHitList.clear();
32 _houghPeakHitList = other._houghPeakHitList;
42 if(_houghPeakHitList.size() != 0 ){
43 for(
int i =0;i<_houghPeakHitList.size();i++){
44 _houghPeakHitList[i]=NULL;
46 _houghPeakHitList.clear();
48 _height=other._height;
51 _thetaBin=other._thetaBin;
52 _rhoBin=other._rhoBin;
53 _houghPeakHitList = other._houghPeakHitList;
54 _isCandiTrack=other._isCandiTrack;
55 _peakNum=other._peakNum;
56 _charge=other._charge;
63HoughPeak::HoughPeak(
int itheta ,
int irho,
double theta,
double rho,vector< const HoughHit* >** mapHitList,
bool isCandiTrack,
int peakNum){
68 _houghPeakHitList = mapHitList[itheta][irho];
69 _isCandiTrack =isCandiTrack;
85 _isCandiTrack =isCandiTrack;
92 int size=_houghPeakHitList.size();
93 if( size ==0 ) return ;
94 cout<<
"Print hitlist in HoughPeak " <<endl;
95 cout<<
"at center ("<<_theta<<
" ,"<<_rho<<
"): "<<size<<endl;
96 for(
int i=0;i<size;i++){
97 int layer= _houghPeakHitList[i]->getLayerId();
98 int wire = _houghPeakHitList[i]->getWireId();
99 std::cout<<
"Peak ("<<layer<<
","<<wire<<
") "<< _houghPeakHitList[i]<<std::endl;
104 int size=_houghPeakHitList.size();
105 int n0,
n1,
n2,n3,n4,n5,n6;
106 n0=
n1=
n2=n3=n4=n5=n6=0;
107 for(
int i=0;i<size;i++){
108 int cir= _houghPeakHitList[i]->getCirList();
109 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
110 int style= _houghPeakHitList[i]->getStyle();
113 if( style == 1 )
n1++;
114 if( style == 2 )
n2++;
115 if( index < 0 ) n3++;
116 if( index >=0 && cir<=1 && style==0 ) n4++;
117 if( index <0 || cir>1 ) n5++;
118 if( index >=0 && cir==0 && style==0 ) n6++;
120 if( select == 0 )
return n0;
121 if( select == 1 )
return n1;
122 if( select == 2 )
return n2;
123 if( select == 3 )
return n3;
124 if( select == 4 )
return n4;
125 if( select == 5 )
return n5;
126 if( select == 6 )
return n6;
129 int size=_houghPeakHitList.size();
130 int n0,
n1,
n2,n3,n4,n5,n6;
131 n0=
n1=
n2=n3=n4=n5=n6=0;
132 for(
int i=0;i<size;i++){
133 int cir= _houghPeakHitList[i]->getCirList();
134 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
135 int type = _houghPeakHitList[i]->getSlayerType();
136 int style= _houghPeakHitList[i]->getStyle();
138 if( type==0 && style == 1 )
n1++;
139 if( type==0 && style == 2 )
n2++;
140 if( type==0 && index < 0 ) n3++;
141 if( type==0 && index >=0 && cir<=1 && style==0) n4++;
142 if( type==0 && (index <0 || cir>1) ) n5++;
143 if( type==0 && index >=0 && cir==0 && style==0) n6++;
145 if( select == 0 )
return n0;
146 if( select == 1 )
return n1;
147 if( select == 2 )
return n2;
148 if( select == 3 )
return n3;
149 if( select == 4 )
return n4;
150 if( select == 5 )
return n5;
151 if( select == 6 )
return n6;
154 int size=_houghPeakHitList.size();
155 int n0,
n1,
n2,n3,n4,n5,n6;
156 n0=
n1=
n2=n3=n4=n5=n6=0;
157 for(
int i=0;i<size;i++){
158 int cir= _houghPeakHitList[i]->getCirList();
159 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
160 int type = _houghPeakHitList[i]->getSlayerType();
161 int style= _houghPeakHitList[i]->getStyle();
163 if( type!=0 && style == 1 )
n1++;
164 if( type!=0 && style == 2 )
n2++;
165 if( type!=0 && index < 0 ) n3++;
166 if( type!=0 && index >=0 && cir<=1 && style==0) n4++;
167 if( type!=0 && (index <0 || cir>1) ) n5++;
168 if( type!=0 && index >=0 && cir==0 && style==0) n6++;
170 if( select == 0 )
return n0;
171 if( select == 1 )
return n1;
172 if( select == 2 )
return n2;
173 if( select == 3 )
return n3;
174 if( select == 4 )
return n4;
175 if( select == 5 )
return n5;
176 if( select == 6 )
return n6;
181 double cirr_track = fabs(1./(_rho));
182 double cirx_track = (1./_rho)*
cos(_theta);
183 double ciry_track = (1./_rho)*
sin(_theta);
184 std::vector<HoughHit>::const_iterator
iter= hitlist.
getList().begin();
189 double cirx_hit = hit->
getMidX();
190 double ciry_hit = hit->
getMidY();
192 if( _charge == 1 && (cirx_track*ciry_hit - ciry_track*cirx_hit>=0) )
continue;
193 if( _charge ==-1 && (cirx_track*ciry_hit - ciry_track*cirx_hit<=0) )
continue;
194 double l1l2 = sqrt( (cirx_hit-cirx_track)*(cirx_hit-cirx_track)+(ciry_hit-ciry_track)*(ciry_hit-ciry_track) );
196 if( l1l2>cirr_track ) deltaD = l1l2-cirr_track-cirr_hit;
197 if( l1l2<=cirr_track ) deltaD = l1l2-cirr_track+cirr_hit;
203 if(cirx_track==0||cirx_hit-cirx_track==0){
207 theta_temp=
M_PI-atan2(ciry_hit-ciry_track,cirx_hit-cirx_track)+atan2(ciry_track,cirx_track);
208 if(theta_temp>2*
M_PI){
209 theta_temp=theta_temp-2*
M_PI;
212 theta_temp=theta_temp+2*
M_PI;
217 l_temp=cirr_track*theta_temp;
220 theta_temp=2*
M_PI-theta_temp;
221 l_temp=cirr_track*(theta_temp);
223 double pt = fabs( (1./_rho)/333.567 );
227 if( pt<0.06 && fabs(deltaD)<0.1&& l_temp<=35 ) _houghPeakHitList.push_back(hit);
228 if( 0.06<pt&&pt<0.07 && fabs(deltaD)<0.1 && l_temp<=35 ) _houghPeakHitList.push_back(hit);
229 if( 0.07<pt&&pt<0.08 && fabs(deltaD)<0.1 && l_temp<=43 ) _houghPeakHitList.push_back(hit);
230 if( 0.08<pt&&pt<0.09 && fabs(deltaD)<0.1 && l_temp<=43 ) _houghPeakHitList.push_back(hit);
231 if( 0.09<pt&&pt<0.10 && fabs(deltaD)<0.1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
232 if( 0.10<pt&&pt<0.11 && fabs(deltaD)<0.1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
233 if( 0.11<pt&&pt<0.12 && fabs(deltaD)<0.1 && l_temp<=41 ) _houghPeakHitList.push_back(hit);
235 if( pt<0.06 && fabs(deltaD)<0.1&& l_temp>35&&l_temp<45 ) _houghPeakHitList.push_back(hit);
236 if( 0.06<pt&&pt<0.07 && fabs(deltaD)<0.1 && l_temp>35&& l_temp<=45) _houghPeakHitList.push_back(hit);
237 if( 0.07<pt&&pt<0.08 && fabs(deltaD)<0.1 && l_temp>43&& l_temp<=50) _houghPeakHitList.push_back(hit);
238 if( 0.08<pt&&pt<0.09 && fabs(deltaD)<0.1 && l_temp>43&& l_temp<=50) _houghPeakHitList.push_back(hit);
242 if( pt>0.12 && fabs(deltaD)<0.1) _houghPeakHitList.push_back(hit);
246 return _houghPeakHitList.size();
double sin(const BesAngle a)
double cos(const BesAngle a)
const std::vector< HoughHit > & getList() const
int getSlayerType() const
double getDriftDist() const
int getHitNumS(int) const
HoughPeak & operator=(const HoughPeak &other)
int collectHits(const HoughHitList &)
int getHitNumA(int) const