74 {
75 const int maxCell[43] = {
76 40,44,48,56, 64,72,80,80, 76,76,88,88,
77 100,100,112,112, 128,128,140,140, 160,160,160,160,
78 176,176,176,176, 208,208,208,208, 240,240,240,240,
79 256,256,256,256, 288,288,288 };
80 vector<HoughHit> vec_HoughHit[43];
81 vector<HoughHit>::const_iterator
iter=_houghHitList.begin();
82 for(
int order=0;
iter!=_houghHitList.end();
iter++,order++){
83 int layer = (*iter).getLayerId();
84
85 vec_HoughHit[layer].push_back(*
iter);
86 }
87 vector<HoughHit> vec_HoughHit_del;
88
89 for(int i=0;i<43;i++){
90
91 if(i<8) continue;
92 vector<int> vec_seeds;
93 std::sort(vec_HoughHit[i].begin(),vec_HoughHit[i].end(),
small_layer);
94 if(vec_HoughHit[i].size()<=4) continue;
95
96
97
98 for(unsigned int j=0;j<vec_HoughHit[i].size()-4;j++){
99 vector<int>::iterator iter_hit = find(vec_seeds.begin(),vec_seeds.end(),vec_HoughHit[i][j].getWireId());
100 if( iter_hit!=vec_seeds.end() ) continue;
101 int wire_last=vec_HoughHit[i][j].getWireId();
102 int wire=-999;
103
104 int seeds=1;
105 if(wire_last==0) {
106
107 for(unsigned int k=vec_HoughHit[i].size()-j-1;k>0;k--){
108 wire=vec_HoughHit[i][j+k].getWireId();
109 int charge = vec_HoughHit[i][j+k].getCharge();
110 int driftTime = vec_HoughHit[i][j+k].driftTime();
111
112
113
114 if( (wire-maxCell[i]+1)!=wire_last || (charge>0 && driftTime>0 && driftTime<800) ) break;
115
116 wire_last= wire-maxCell[i];
117 seeds++;
118
119 if(seeds==5) {
120 vec_seeds.push_back(wire+4-maxCell[i]);
121 vec_seeds.push_back(wire+3);
122 vec_seeds.push_back(wire+2);
123 vec_seeds.push_back(wire+1);
124 vec_seeds.push_back(wire);
125 }
126 if(seeds>5) vec_seeds.push_back(wire);
127 }
128 wire_last=0;
129
130 for(unsigned int k=1;k<vec_HoughHit[i].size()-j;k++){
131 vector<int>::iterator iter_hit0 = find(vec_seeds.begin(),vec_seeds.end(),vec_HoughHit[i][j].getWireId());
132 if( iter_hit0!=vec_seeds.end() ) continue;
133 wire=vec_HoughHit[i][j+k].getWireId();
134 int charge = vec_HoughHit[i][j+k].getCharge();
135 int driftTime = vec_HoughHit[i][j+k].driftTime();
136
137
138 if( wire<=maxCell[i] ) {
139
140 if( (wire-1)!=wire_last || (charge>0 && driftTime>0 && driftTime<800)) break;
141
142 wire_last= wire;
143 seeds++;
144
145 if(seeds==5) {
146 vec_seeds.push_back(wire-4);
147 vec_seeds.push_back(wire-3);
148 vec_seeds.push_back(wire-2);
149 vec_seeds.push_back(wire-1);
150 vec_seeds.push_back(wire);
151 }
152 if(seeds>5) vec_seeds.push_back(wire);
153 }
154 }
155 }
156
157 else {
158 for(unsigned int k=1;k<vec_HoughHit[i].size()-j;k++){
159 wire=vec_HoughHit[i][j+k].getWireId();
160 int charge = vec_HoughHit[i][j+k].getCharge();
161 int driftTime = vec_HoughHit[i][j+k].driftTime();
162
163
164 if( wire<=maxCell[i] ) {
165
166 if( (wire-1)!=wire_last || (charge>0 && driftTime>0 && driftTime<800)) break;
167
168 wire_last= wire;
169 seeds++;
170
171 if(seeds==5) {
172 vec_seeds.push_back(wire-4);
173 vec_seeds.push_back(wire-3);
174 vec_seeds.push_back(wire-2);
175 vec_seeds.push_back(wire-1);
176 vec_seeds.push_back(wire);
177 }
178 if(seeds>5) vec_seeds.push_back(wire);
179 }
180 }
181 }
182
183 }
184 for(unsigned int ihit=0;ihit<vec_seeds.size();ihit++){
185
186 for(unsigned int jhit=0;jhit<vec_HoughHit[i].size();jhit++){
187 if(vec_HoughHit[i][jhit].getWireId()==vec_seeds[ihit]) vec_HoughHit_del.push_back(vec_HoughHit[i][jhit]);
188 }
189 }
190 }
191 for(unsigned int ihit=0;ihit<vec_HoughHit_del.size();ihit++){
192
193 remove(vec_HoughHit_del[ihit]);
194 }
195}
bool small_layer(const HoughHit &a, const HoughHit &b)
void remove(const HoughHit &hit)