16 if (
this == &other )
return *
this;
17 _height = other._height;
18 _theta = other._theta;
20 _thetaBin = other._thetaBin;
21 _rhoBin = other._rhoBin;
22 _isCandiTrack = other._isCandiTrack;
23 _peakNum = other._peakNum;
24 _charge = other._charge;
25 if ( _houghPeakHitList.size() != 0 )
27 for (
int i = 0; i < _houghPeakHitList.size(); i++ ) { _houghPeakHitList[i] = NULL; }
28 _houghPeakHitList.clear();
30 _houghPeakHitList = other._houghPeakHitList;
39 if ( _houghPeakHitList.size() != 0 )
41 for (
int i = 0; i < _houghPeakHitList.size(); i++ ) { _houghPeakHitList[i] = NULL; }
42 _houghPeakHitList.clear();
44 _height = other._height;
45 _theta = other._theta;
47 _thetaBin = other._thetaBin;
48 _rhoBin = other._rhoBin;
49 _houghPeakHitList = other._houghPeakHitList;
50 _isCandiTrack = other._isCandiTrack;
51 _peakNum = other._peakNum;
52 _charge = other._charge;
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++ )
109 int cir = _houghPeakHitList[i]->getCirList();
110 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
111 int style = _houghPeakHitList[i]->getStyle();
116 if ( style == 1 )
n1++;
117 if ( style == 2 )
n2++;
118 if ( index < 0 ) n3++;
119 if ( index >= 0 && cir <= 1 && style == 0 ) n4++;
120 if ( index < 0 || cir > 1 ) n5++;
121 if ( index >= 0 && cir == 0 && style == 0 ) n6++;
123 if ( select == 0 )
return n0;
124 if ( select == 1 )
return n1;
125 if ( select == 2 )
return n2;
126 if ( select == 3 )
return n3;
127 if ( select == 4 )
return n4;
128 if ( select == 5 )
return n5;
129 if ( select == 6 )
return n6;
130 std::cout <<
"HoughTrack::getHitNum: select " << select <<
" is out of range, exiting"
135 int size = _houghPeakHitList.size();
136 int n0,
n1,
n2, n3, n4, n5, n6;
137 n0 =
n1 =
n2 = n3 = n4 = n5 = n6 = 0;
138 for (
int i = 0; i < size; i++ )
140 int cir = _houghPeakHitList[i]->getCirList();
141 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
142 int type = _houghPeakHitList[i]->getSlayerType();
143 int style = _houghPeakHitList[i]->getStyle();
144 if (
type == 0 ) n0++;
145 if (
type == 0 && style == 1 )
n1++;
146 if (
type == 0 && style == 2 )
n2++;
147 if (
type == 0 && index < 0 ) n3++;
148 if (
type == 0 && index >= 0 && cir <= 1 && style == 0 ) n4++;
149 if (
type == 0 && ( index < 0 || cir > 1 ) ) n5++;
150 if (
type == 0 && index >= 0 && cir == 0 && style == 0 ) n6++;
152 if ( select == 0 )
return n0;
153 if ( select == 1 )
return n1;
154 if ( select == 2 )
return n2;
155 if ( select == 3 )
return n3;
156 if ( select == 4 )
return n4;
157 if ( select == 5 )
return n5;
158 if ( select == 6 )
return n6;
159 std::cout <<
"HoughTrack::getHitNum: select " << select <<
" is out of range, exiting"
164 int size = _houghPeakHitList.size();
165 int n0,
n1,
n2, n3, n4, n5, n6;
166 n0 =
n1 =
n2 = n3 = n4 = n5 = n6 = 0;
167 for (
int i = 0; i < size; i++ )
169 int cir = _houghPeakHitList[i]->getCirList();
170 int index = _houghPeakHitList[i]->digi()->getTrackIndex();
171 int type = _houghPeakHitList[i]->getSlayerType();
172 int style = _houghPeakHitList[i]->getStyle();
173 if (
type != 0 ) n0++;
174 if (
type != 0 && style == 1 )
n1++;
175 if (
type != 0 && style == 2 )
n2++;
176 if (
type != 0 && index < 0 ) n3++;
177 if (
type != 0 && index >= 0 && cir <= 1 && style == 0 ) n4++;
178 if (
type != 0 && ( index < 0 || cir > 1 ) ) n5++;
179 if (
type != 0 && index >= 0 && cir == 0 && style == 0 ) n6++;
181 if ( select == 0 )
return n0;
182 if ( select == 1 )
return n1;
183 if ( select == 2 )
return n2;
184 if ( select == 3 )
return n3;
185 if ( select == 4 )
return n4;
186 if ( select == 5 )
return n5;
187 if ( select == 6 )
return n6;
188 std::cout <<
"HoughTrack::getHitNum: select " << select <<
" is out of range, exiting"
195 double cirr_track = fabs( 1. / ( _rho ) );
196 double cirx_track = ( 1. / _rho ) *
cos( _theta );
197 double ciry_track = ( 1. / _rho ) *
sin( _theta );
198 std::vector<HoughHit>::const_iterator
iter = hitlist.
getList().begin();
204 double cirx_hit = hit->
getMidX();
205 double ciry_hit = hit->
getMidY();
207 if ( _charge == 1 && ( cirx_track * ciry_hit - ciry_track * cirx_hit >= 0 ) )
209 if ( _charge == -1 && ( cirx_track * ciry_hit - ciry_track * cirx_hit <= 0 ) )
211 double l1l2 = sqrt( ( cirx_hit - cirx_track ) * ( cirx_hit - cirx_track ) +
212 ( ciry_hit - ciry_track ) * ( ciry_hit - ciry_track ) );
213 double deltaD = 1.e9;
214 if ( l1l2 > cirr_track ) deltaD = l1l2 - cirr_track - cirr_hit;
215 if ( l1l2 <= cirr_track ) deltaD = l1l2 - cirr_track + cirr_hit;
220 double l_temp = 1.e9;
221 if ( cirx_track == 0 || cirx_hit - cirx_track == 0 ) { theta_temp = 0; }
224 theta_temp =
M_PI - atan2( ciry_hit - ciry_track, cirx_hit - cirx_track ) +
225 atan2( ciry_track, cirx_track );
226 if ( theta_temp > 2 *
M_PI ) { theta_temp = theta_temp - 2 *
M_PI; }
227 if ( theta_temp < 0 ) { theta_temp = theta_temp + 2 *
M_PI; }
230 if ( _charge == -1 ) { l_temp = cirr_track * theta_temp; }
233 theta_temp = 2 *
M_PI - theta_temp;
234 l_temp = cirr_track * ( theta_temp );
236 double pt = fabs( ( 1. / _rho ) / 333.567 );
240 if ( pt < 0.06 && fabs( deltaD ) < 0.1 && l_temp <= 35 )
241 _houghPeakHitList.push_back( hit );
242 if ( 0.06 < pt && pt < 0.07 && fabs( deltaD ) < 0.1 && l_temp <= 35 )
243 _houghPeakHitList.push_back( hit );
244 if ( 0.07 < pt && pt < 0.08 && fabs( deltaD ) < 0.1 && l_temp <= 43 )
245 _houghPeakHitList.push_back( hit );
246 if ( 0.08 < pt && pt < 0.09 && fabs( deltaD ) < 0.1 && l_temp <= 43 )
247 _houghPeakHitList.push_back( hit );
248 if ( 0.09 < pt && pt < 0.10 && fabs( deltaD ) < 0.1 && l_temp <= 41 )
249 _houghPeakHitList.push_back( hit );
250 if ( 0.10 < pt && pt < 0.11 && fabs( deltaD ) < 0.1 && l_temp <= 41 )
251 _houghPeakHitList.push_back( hit );
252 if ( 0.11 < pt && pt < 0.12 && fabs( deltaD ) < 0.1 && l_temp <= 41 )
253 _houghPeakHitList.push_back( hit );
255 if ( pt < 0.06 && fabs( deltaD ) < 0.1 && l_temp > 35 && l_temp < 45 )
256 _houghPeakHitList.push_back( hit );
257 if ( 0.06 < pt && pt < 0.07 && fabs( deltaD ) < 0.1 && l_temp > 35 && l_temp <= 45 )
258 _houghPeakHitList.push_back( hit );
259 if ( 0.07 < pt && pt < 0.08 && fabs( deltaD ) < 0.1 && l_temp > 43 && l_temp <= 50 )
260 _houghPeakHitList.push_back( hit );
261 if ( 0.08 < pt && pt < 0.09 && fabs( deltaD ) < 0.1 && l_temp > 43 && l_temp <= 50 )
262 _houghPeakHitList.push_back( hit );
267 if ( pt > 0.12 && fabs( deltaD ) < 0.1 ) _houghPeakHitList.push_back( hit );
269 return _houghPeakHitList.size();