120 {
121 const int maxCell[43] = {
122 40,44,48,56, 64,72,80,80,
123 76,76,88,88, 100,100,112,112, 128,128,140,140,
124 160,160,160,160, 176,176,176,176, 208,208,208,208, 240,240,240,240,
125 256,256,256,256, 288,288,288 };
126 vector<HoughHit> vec_HoughHit[43];
127 vector<HoughHit>::const_iterator
iter=_houghHitList.begin();
128 for(
int order=0;
iter!=_houghHitList.end();
iter++,order++){
129 int layer = (*iter).getLayerId();
130
131 vec_HoughHit[layer].push_back(*
iter);
132 }
133 vector<HoughHit> vec_HoughHit_del;
134
135 for(int i=0;i<43;i++){
136
137 if(i<8) continue;
138 vector<int> vec_seeds;
139 std::sort(vec_HoughHit[i].begin(),vec_HoughHit[i].end(),
small_layer);
140 if(vec_HoughHit[i].size()<=4) continue;
141
142
143
144 for(unsigned int j=0;j<vec_HoughHit[i].size()-4;j++){
145 vector<int>::iterator iter_hit = find(vec_seeds.begin(),vec_seeds.end(),vec_HoughHit[i][j].getWireId());
146 if( iter_hit!=vec_seeds.end() ) continue;
147 int wire_last=vec_HoughHit[i][j].getWireId();
148 int wire=-999;
149
150 int seeds=1;
151 if(wire_last==0) {
152
153 for(unsigned int k=vec_HoughHit[i].size()-j-1;k>0;k--){
154 wire=vec_HoughHit[i][j+k].getWireId();
155 int charge = vec_HoughHit[i][j+k].getCharge();
156 int driftTime = vec_HoughHit[i][j+k].driftTime();
157
158
159
160 if( (wire-maxCell[i]+1)!=wire_last || (charge>0 && driftTime>0 && driftTime<800) ) break;
161
162 wire_last= wire-maxCell[i];
163 seeds++;
164
165 if(seeds==5) {
166 vec_seeds.push_back(wire+4-maxCell[i]);
167 vec_seeds.push_back(wire+3);
168 vec_seeds.push_back(wire+2);
169 vec_seeds.push_back(wire+1);
170 vec_seeds.push_back(wire);
171 }
172 if(seeds>5) vec_seeds.push_back(wire);
173 }
174 wire_last=0;
175
176 for(unsigned int k=1;k<vec_HoughHit[i].size()-j;k++){
177 vector<int>::iterator iter_hit0 = find(vec_seeds.begin(),vec_seeds.end(),vec_HoughHit[i][j].getWireId());
178 if( iter_hit0!=vec_seeds.end() ) continue;
179 wire=vec_HoughHit[i][j+k].getWireId();
180 int charge = vec_HoughHit[i][j+k].getCharge();
181 int driftTime = vec_HoughHit[i][j+k].driftTime();
182
183
184 if( wire<=maxCell[i] ) {
185
186 if( (wire-1)!=wire_last || (charge>0 && driftTime>0 && driftTime<800)) break;
187
188 wire_last= wire;
189 seeds++;
190
191 if(seeds==5) {
192 vec_seeds.push_back(wire-4);
193 vec_seeds.push_back(wire-3);
194 vec_seeds.push_back(wire-2);
195 vec_seeds.push_back(wire-1);
196 vec_seeds.push_back(wire);
197 }
198 if(seeds>5) vec_seeds.push_back(wire);
199 }
200 }
201 }
202
203 else {
204 for(unsigned int k=1;k<vec_HoughHit[i].size()-j;k++){
205 wire=vec_HoughHit[i][j+k].getWireId();
206 int charge = vec_HoughHit[i][j+k].getCharge();
207 int driftTime = vec_HoughHit[i][j+k].driftTime();
208
209
210 if( wire<=maxCell[i] ) {
211
212 if( (wire-1)!=wire_last || (charge>0 && driftTime>0 && driftTime<800)) break;
213
214 wire_last= wire;
215 seeds++;
216
217 if(seeds==5) {
218 vec_seeds.push_back(wire-4);
219 vec_seeds.push_back(wire-3);
220 vec_seeds.push_back(wire-2);
221 vec_seeds.push_back(wire-1);
222 vec_seeds.push_back(wire);
223 }
224 if(seeds>5) vec_seeds.push_back(wire);
225 }
226 }
227 }
228
229 }
230 for(unsigned int ihit=0;ihit<vec_seeds.size();ihit++){
231
232 for(unsigned int jhit=0;jhit<vec_HoughHit[i].size();jhit++){
233 if(vec_HoughHit[i][jhit].getWireId()==vec_seeds[ihit]) vec_HoughHit_del.push_back(vec_HoughHit[i][jhit]);
234 }
235 }
236 }
237 for(unsigned int ihit=0;ihit<vec_HoughHit_del.size();ihit++){
238
239 remove(vec_HoughHit_del[ihit]);
240 }
241}
bool small_layer(const HoughHit &a, const HoughHit &b)
void remove(const HoughHit &hit)