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();
85 vec_HoughHit[layer].push_back(*
iter);
87 vector<HoughHit> vec_HoughHit_del;
89 for(
int i=0;i<43;i++){
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;
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();
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();
114 if( (wire-maxCell[i]+1)!=wire_last || (
charge>0 && driftTime>0 && driftTime<800) )
break;
116 wire_last= wire-maxCell[i];
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);
126 if(seeds>5) vec_seeds.push_back(wire);
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();
138 if( wire<=maxCell[i] ) {
140 if( (wire-1)!=wire_last || (
charge>0 && driftTime>0 && driftTime<800))
break;
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);
152 if(seeds>5) vec_seeds.push_back(wire);
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();
164 if( wire<=maxCell[i] ) {
166 if( (wire-1)!=wire_last || (
charge>0 && driftTime>0 && driftTime<800))
break;
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);
178 if(seeds>5) vec_seeds.push_back(wire);
184 for(
unsigned int ihit=0;ihit<vec_seeds.size();ihit++){
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]);
191 for(
unsigned int ihit=0;ihit<vec_HoughHit_del.size();ihit++){
193 remove(vec_HoughHit_del[ihit]);
209 const MdcMcHit* truthHitPtr[43][288];
210 for(
int i=0;i<43;i++){
for(
int j=0;j<288;j++){ truthHitPtr[i][j]=
NULL; } }
211 IDataProviderSvc* eventSvc =
NULL;
212 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
213 SmartDataPtr<MdcMcHitCol> mdcMcHitCol(eventSvc,
"/Event/MC/MdcMcHitCol");
215 MdcMcHitCol::iterator iter_mchit = mdcMcHitCol->begin();
216 for (;iter_mchit != mdcMcHitCol->end(); iter_mchit++) {
217 const Identifier id= (*iter_mchit)->identify();
220 const MdcMcHit* mcHit = (*iter_mchit);
221 truthHitPtr[l][
w] = mcHit;
224 std::cout<<__FILE__<<
" Could not get MdcMcHitCol "<<std::endl;
230 int nHitTruthAdd = 0;
231 for(std::vector<HoughHit>::iterator
iter = _houghHitList.begin();
iter!= _houghHitList.end();
iter++){
232 int l = (*iter).getLayerId();
233 int w = (*iter).getWireId();
234 int mcTkId = (*iter).digi()->getTrackIndex();
235 if( mcTkId>=1000 ) mcTkId-=1000;
236 if(mcTkId>=0 &&
NULL!=truthHitPtr[l][
w]) {
237 (*iter).setTruthInfo(truthHitPtr[l][
w]);
239 if(mcTkPars.find(mcTkId)!= mcTkPars.end()){
283 if( mcTkId<0 ) (*iter).setStyle(-999);
293 if( _houghHitList.size()!=0) _houghHitList[0].setCirList(0);
294 for(
unsigned int id = 1;
id <_houghHitList.size();
id++){
296 if( ((_houghHitList[
id].getLayerId() < _houghHitList[
id-1].getLayerId()) )&& (cirlist==0||cirlist==2) ) cirlist++;
297 if(_houghHitList[
id].getLayerId() > _houghHitList[
id-1].getLayerId() && (cirlist==1||cirlist==3) ) cirlist++;
298 if(cirlist>3) cirlist=999;
299 _houghHitList[id].setCirList(cirlist);
301 int label_out_circle=999;
305 for(
unsigned int id = 0;
id <_houghHitList.size();
id++){
306 if(_houghHitList[
id].getStyle()==-999)
continue;
307 if( _houghHitList[
id].getLayerId()>max_layer) max_layer=_houghHitList[id].getLayerId();
309 for(
unsigned int id = 1;
id <_houghHitList.size();
id++){
310 if( (_houghHitList[
id-1].getLayerId() == _houghHitList[
id].getLayerId()) && (_houghHitList[
id].getLayerId() == _houghHitList[
id+1].getLayerId()) && (_houghHitList[
id+1].getLayerId() == _houghHitList[
id+2].getLayerId()) && (_houghHitList[
id+2].getLayerId() == _houghHitList[
id+3].getLayerId()) && _houghHitList[
id].getLayerId() == max_layer) label_out_circle=_houghHitList[
id-1].getLayerId();
312 for(
int unsigned id = 0;
id <_houghHitList.size();
id++){
313 if ( _houghHitList[
id].getLayerId() == label_out_circle ) label_num++;
314 if( label_num==1 ) label_fist = id;
316 for(
int id = 0;
id <label_num/2;
id++){
317 if( label_num %2 == 0 ) _houghHitList[label_fist+label_num/2+id].setCirList(1);
318 if( label_num %2 == 1 ) _houghHitList[label_fist+label_num/2+
id+1].setCirList(1);