113 #include "StFgtSeededClusterAlgo.h"
114 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
116 #include "StRoot/StEvent/StFgtCollection.h"
117 #include "StRoot/StEvent/StFgtStripCollection.h"
118 #include "StRoot/StEvent/StFgtStrip.h"
119 #include "StRoot/StEvent/StFgtHitCollection.h"
120 #include "StRoot/StEvent/StFgtHit.h"
121 #include "StRoot/StFgtUtil/StFgtConsts.h"
122 #include "StRoot/StFgtDbMaker/StFgtDbMaker.h"
123 #include "StRoot/StFgtDbMaker/StFgtDb.h"
131 #include <TGraphAsymmErrors.h>
132 #include <TGraphErrors.h>
138 StFgtSeededClusterAlgo::StFgtSeededClusterAlgo():up(true),down(false),stepTwo(true),mThreshold2AddStrip(3.0),numAdditionalStrips(2),mDb(0)
144 Int_t StFgtSeededClusterAlgo::Init()
146 hGaussFitStatus=
new TH1D(
"fgt_gFitStatus",
"gFitStatus",10,-1,8);
147 hGaussFitChi2=
new TH1D(
"fgt_gFitChi2overNdf",
"gFitChi2overNdf",100,0,10);
148 hTbFitStatus=
new TH1D(
"fgt_tbFitStatus",
"tbFitStatus",10,-1,8);
149 hTbFitChi2=
new TH1D(
"fgt_tbFitChi2",
"tbFitChi2",100,0,10);
151 hTbMaxCorr=
new TH2D(
"fgt_tbmaxcorr",
"tbmaxcorr",200,0,1000,200,0,1000);
152 hTbMaxRatio=
new TH1D(
"fgt_tbmaxratio",
"tbmaxratio",200,0,1);
153 hTbSideCorr=
new TH2D(
"fgt_tbsidecorr",
"tbsidecorr",200,0,1000,200,0,1000);
154 hTbSideRatio=
new TH1D(
"fgt_tbsideratio",
"tbsideratio",200,0,1);
159 void StFgtSeededClusterAlgo::doStripFit(
void* stripsT)
161 stripWeightMap_t& strips = *((stripWeightMap_t*) stripsT);
166 int numStripsInClu=strips.size();
168 TF1 *func =
new TF1(
"func",
"[0]*(x>[1])*(x-[1])**2*exp(-(x-[1])*0.55)");
169 func->SetParName(0,
"A");
170 func->SetParName(1,
"t0");
176 for(stripWeightMap_t::iterator it=strips.begin();it!=strips.end();it++)
182 for(
int tb=0;tb<mMaxTimeBin;tb++)
184 y[tb]=it->first->getAdc(tb);
185 if(y[tb]>stripMaxAdc)
194 for(stripWeightMap_t::iterator it=strips.begin();it!=strips.end();it++)
200 for(
int tb=0;tb<mMaxTimeBin;tb++)
203 y[tb]=it->first->getAdc(tb);
204 ey[tb]=it->first->getPedErr();
209 TGraphErrors* tg1=
new TGraphErrors(mMaxTimeBin,x,y,ex,ey);
210 Int_t tbFitStatus=tg1->Fit(func);
211 float amp,t0,invtau,chi2Ndf, chi2;
212 amp=func->GetParameter(0);
213 t0=func->GetParameter(1);
215 chi2Ndf=func->GetChisquare()/(float)func->GetNDF();
216 chi2=func->GetChisquare();
217 if(chi2Ndf>0.1 && chi2Ndf<2&& tbFitStatus==0)
219 if(stripIt==stripMaxPos)
221 hTbMaxCorr->Fill(it->first->getCharge(),amp);
222 hTbMaxRatio->Fill(amp/it->first->getCharge());
226 hTbSideCorr->Fill(it->first->getCharge(),amp);
227 hTbSideRatio->Fill(amp/it->first->getCharge());
229 it->first->setCharge(amp);
232 hTbFitStatus->Fill(tbFitStatus);
233 hTbFitChi2->Fill(chi2Ndf);
240 Float_t StFgtSeededClusterAlgo::doClusterShapeFit(
void* stripsT)
242 stripWeightMap_t& strips = *((stripWeightMap_t*) stripsT);
247 Double_t ordinate, lowerSpan, upperSpan;
248 Short_t disc, quadrant;
250 Double_t firstOrd,lastOrd;
251 StFgtGeom::getPhysicalCoordinate(strips.begin()->first->getGeoId(),disc,quadrant,layer,firstOrd,lowerSpan,upperSpan);
252 StFgtGeom::getPhysicalCoordinate((strips.rbegin())->first->getGeoId(),disc,quadrant,layer,lastOrd,lowerSpan,upperSpan);
255 Double_t tmpOrd=lastOrd;
259 Double_t sigGuess=(lastOrd-firstOrd)/2;
260 Double_t ampGuess=-9999;
261 Double_t meanGuess=0;
267 for(stripWeightMap_t::iterator it=strips.begin();it!=strips.end();it++)
271 StFgtGeom::getPhysicalCoordinate(it->first->getGeoId(),disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
272 x[binCounter]=ordinate;
273 y[binCounter]=it->first->getCharge();
274 if(y[binCounter]>ampGuess)
275 ampGuess=y[binCounter];
277 ey[binCounter]=it->first->getChargeUncert()*1.6;
282 meanGuess/=strips.size();
284 TGraphErrors* tg=
new TGraphErrors(binCounter,x,y,ex,ey);
288 TF1* f1=
new TF1(
"f1",
"gaus",firstOrd-0.001,lastOrd+0.001);
289 f1->SetParameters(ampGuess,meanGuess,sigGuess);
291 Int_t fitStatus=tg->Fit(
"f1");
292 hGaussFitChi2->Fill(f1->GetChisquare()/(float)f1->GetNDF());
293 hGaussFitStatus->Fill(fitStatus);
296 float fAmp=f1->GetParameter(1);
305 if(binCounter>=3&&fitStatus==0&& fAmp>=firstOrd && fAmp<=lastOrd)
314 Double_t ordinate, lowerSpan, upperSpan;
315 Short_t disc, quadrant;
317 Double_t accuCharge=0;
318 Double_t accuChargeWeight=0;
319 Double_t accuChargeWeightEven=0;
320 Double_t accuChargeEven=0;
321 Double_t accuChargeUneven=0;
322 Double_t accuChargeSq=0;
323 Double_t accuChargeSqEven=0;
324 Double_t accuChargeSqWeight=0;
325 Double_t accuChargeError=0;
326 Double_t accuChargeErrorEven=0;
328 Int_t numStripsEven=0;
329 Double_t meanOrdinate=0;
330 Double_t meanOrdinateWeight=0;
331 Double_t meanSqOrdinate=0;
332 Double_t meanOrdinateEven=0;
333 Double_t meanOrdinateEvenWeight=0;
334 Double_t meanSqOrdinateEven=0;
335 Double_t meanGeoId=0;
336 Double_t meanGeoIdEven=0;
337 Bool_t chargeEven=
false;
339 stripWeightMap_t &strips = cluster->getStripWeightMap();
341 float a[kFgtNumTimeBins]; memset(a,0,
sizeof(a));
342 float e[kFgtNumTimeBins]; memset(e,0,
sizeof(e));
343 int flag[kFgtNumTimeBins]; memset(flag,0,
sizeof(flag));
348 #ifdef DO_FGT_STRIP_FIT
352 Float_t clusterShapeFitAmp=-1;
353 #ifdef DO_FGT_CLUSTER_SHAPE_FIT
354 clusterShapeFitAmp=doClusterShapeFit(&strips);
357 for(stripWeightMap_t::iterator it=strips.begin();it!=strips.end();it++)
359 Double_t charge=it->first->getCharge();
361 Double_t weight=charge;
366 accuChargeWeight+=weight;
367 for(
int i=0; i<mMaxTimeBin; i++) {
368 a[i]+=it->first->getAdc(i);
369 e[i]+=it->first->getPedErr() * it->first->getPedErr();
370 if(it->first->getAdc(i) > 2800) {flag[i]=1;}
372 int type=it->first->getClusterSeedType();
373 if(type>=kFgtSeedType1 && type<kFgtSeedTypeMax) {
374 if(seedtype==0) {seedtype=type;}
375 else if(type<seedtype) {seedtype=type;}
378 StFgtGeom::getPhysicalCoordinate(it->first->getGeoId(),disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
379 if(it->first->getGeoId()%2)
380 accuChargeUneven+=charge;
383 accuChargeWeightEven+=weight;
385 accuChargeEven+=charge;
387 accuChargeSqEven+=(weight*weight);
388 accuChargeErrorEven+=it->first->getChargeUncert();
390 meanSqOrdinateEven+=ordinate*ordinate*weight*weight;
392 meanGeoIdEven+=((it->first->getGeoId())*(weight));
393 meanOrdinateEven+=ordinate*charge;
394 meanOrdinateEvenWeight+=ordinate*weight;
398 accuChargeSq+=(weight*weight);
399 accuChargeError+=it->first->getChargeUncert();
402 meanOrdinate+=ordinate*charge;
403 meanOrdinateWeight+=ordinate*weight;
405 meanSqOrdinate+=ordinate*ordinate*weight*weight;
408 meanGeoId+=((it->first->getGeoId())*(weight));
411 cluster->setSeedType(seedtype);
415 for(
int i=0; i<mMaxTimeBin; i++){
422 cluster->setMaxTimeBin(maxtbin);
423 cluster->calcMaxAdc();
425 #ifdef __LANDAU_FIT__
427 TGraphAsymmErrors *g =
new TGraphAsymmErrors(mMaxTimeBin);
428 for(
int i=0; i<mMaxTimeBin; i++){
429 g->SetPoint(i,
float(i),
float(a[i]));
431 if(flag[i]==1) eh=2000;
432 g->SetPointError(i,0,0,e[i],eh);
435 int res=g->Fit(
"landau",
"0Q");
436 TF1 *f = g->GetFunction(
"landau");
437 float chi2=f->GetChisquare()/float(f->GetNDF());
438 cluster->setLandau(f->GetParameter(0),f->GetParameter(1),f->GetParameter(2),chi2);
442 float asy=(accuChargeEven-accuChargeUneven)/accuCharge;
443 cluster->setEvenOddChargeAsy(asy);
444 if(asy>0.8 && layer==
'P' && numStripsEven>=2)
451 stripWeightMap_t::iterator it=strips.begin();
452 while(it!=strips.end())
455 if(it->first->getGeoId()%2)
460 if(it->first->getClusterSeedType()==kFgtSeedTypeNo || it->first->getClusterSeedType()>kFgtClusterSeedInSeaOfNoise)
461 it->first->setClusterSeedType(kFgtNextToCluster);
474 stripWeightMap_t::reverse_iterator itBack=strips.rbegin();
477 if(itBack->first->getClusterSeedType()==kFgtClusterPart)
478 itBack->first->setClusterSeedType(kFgtClusterEndUp);
480 if(strips.begin()->first->getClusterSeedType()==kFgtClusterPart)
481 (strips.begin())->first->setClusterSeedType(kFgtClusterEndDown);
486 cluster->setCharge(accuChargeEven);
487 meanOrdinateEven /= (Double_t)accuChargeEven;
488 meanOrdinateEvenWeight /= (Double_t)accuChargeWeightEven;
490 meanGeoIdEven /= accuChargeWeightEven;
491 meanSqOrdinateEven /= (Double_t)accuChargeSqEven;
493 meanGeoId=meanGeoIdEven;
494 meanOrdinate=meanOrdinateEven;
495 meanOrdinateWeight=meanOrdinateEvenWeight;
497 meanSqOrdinate=meanSqOrdinateEven;
498 meanSqOrdinate=-meanOrdinate*meanOrdinate;
499 accuChargeError=accuChargeErrorEven;
500 numStrips=numStripsEven;
504 cluster->setCharge(accuCharge);
505 meanOrdinate /= (Double_t)accuCharge;
506 meanOrdinateWeight /= (Double_t)accuChargeWeight;
507 meanGeoId /= accuChargeWeight;
508 meanSqOrdinate /= (Double_t)accuChargeSq;
509 meanSqOrdinate -= meanOrdinate*meanOrdinate;
511 numStrips > 1 ? cluster->setChargeUncert(sqrt(accuChargeError/((Double_t)numStrips-1))) : cluster->setChargeUncert(sqrt(accuChargeError/((Double_t)numStrips)));
517 if( meanSqOrdinate > 0 )
518 meanSqOrdinate = sqrt(meanSqOrdinate);
522 Double_t pitch = ( layer ==
'R' ? StFgtGeom::radStrip_pitch() : StFgtGeom::phiStrip_pitch() );
527 if(clusterShapeFitAmp>0)
528 meanOrdinate=clusterShapeFitAmp;
529 if( meanSqOrdinate < 0.001 )
530 meanSqOrdinate = pitch;
533 cluster->setPositionR(meanOrdinateWeight);
534 cluster->setErrorR(meanSqOrdinate);
538 cluster->setPositionPhi(meanOrdinateWeight);
539 cluster->setErrorPhi(meanSqOrdinate);
546 cluster->setCentralStripGeoId(floor(meanGeoId+0.5));
560 cluster->setNstrip(numStrips);
567 stripWeightMap_t::iterator itFirstStrip=strips.begin();
568 stripWeightMap_t::reverse_iterator itLastStrip=strips.rbegin();
569 Int_t firstGeoId=itFirstStrip->first->getGeoId();
570 Int_t lastGeoId=itLastStrip->first->getGeoId();
571 StFgtGeom::getPhysicalCoordinate(firstGeoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
573 Int_t clusterQuad=quadrant;
574 Int_t clusterLayer=layer;
575 Int_t clusterDisk=disc;
577 Int_t rdo, arm, apv, chan;
583 for(
int iGeo=firstGeoId;iGeo>(firstGeoId-(chargeEven+1)*numAdditionalStrips);iGeo--)
585 Int_t ret=StFgtGeom::getPhysicalCoordinate(iGeo,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
589 if(disc==clusterDisk&&layer==clusterLayer&&quadrant==clusterQuad)
591 for( StSPtrVecFgtStripIterator it=allStrips.getStripVec().begin();it!=allStrips.getStripVec().end();++it)
593 if((*it)->getGeoId()==iGeo)
595 if((*it)->getClusterSeedType()==kFgtSeedTypeNo || (*it)->getClusterSeedType()>kFgtClusterSeedInSeaOfNoise)
596 (*it)->setClusterSeedType(kFgtNextToCluster);
632 for(
int iGeo=lastGeoId;iGeo<(lastGeoId+(chargeEven+1)*numAdditionalStrips);iGeo++)
634 Int_t ret=StFgtGeom::getPhysicalCoordinate(iGeo,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
637 if(disc==clusterDisk&&layer==clusterLayer&&quadrant==clusterQuad)
640 for( StSPtrVecFgtStripIterator it=allStrips.getStripVec().begin();it!=allStrips.getStripVec().end();++it)
642 if((*it)->getGeoId()==iGeo)
645 if((*it)->getClusterSeedType()==kFgtSeedTypeNo || (*it)->getClusterSeedType()>kFgtClusterSeedInSeaOfNoise)
646 (*it)->setClusterSeedType(kFgtNextToCluster);
685 Int_t StFgtSeededClusterAlgo::Finish()
690 hGaussFitStatus->Write();
691 hGaussFitChi2->Write();
692 hTbFitStatus->Write();
695 hTbMaxRatio->Write();
696 hTbSideCorr->Write();
697 hTbSideRatio->Write();
713 if((*nextStrip)->getCharge()< 2*(*nextStrip)->getChargeUncert() && ((*itSeed)->getCharge()<2*(*itSeed)->getChargeUncert()))
716 if((*nextStrip)->getCharge() > mThreshold2AddStrip*(*nextStrip)->getChargeUncert() && (*nextStrip)->getChargeUncert() >0 && (*nextStrip)->getClusterSeedType()!=kFgtDeadStrip)
724 Bool_t direction, Int_t sidedSize)
727 Short_t seedDisc, seedQuad, seedStrip;
728 Short_t disc, quadrant,strip;
730 Char_t layer,seedLayer;
734 StFgtGeom::decodeGeoId((*itSeed)->getGeoId(),seedDisc,seedQuad,seedLayer,seedStrip);
735 if(debug) cout <<
"Layer="<<seedLayer<<
" adding strips from gid=" << (*itSeed)->getGeoId();
738 if(direction==down) {
739 if(debug) cout <<
" down : ";
742 if(debug) cout <<
" up : ";
744 isPhi=(seedLayer==
'P');
748 StSPtrVecFgtStripIterator nextStrip=itSeed+inc;
749 if(nextStrip<itVecBegin || nextStrip >=itVecEnd) {
750 if(debug) { cout <<
" Not added because run out of strips"<<endl;}
753 StFgtGeom::decodeGeoId((*nextStrip)->getGeoId(),disc,quadrant,layer,strip);
754 if(seedLayer!=layer || seedQuad!=quadrant || seedDisc!=disc){
755 if(debug) { cout <<
" Not added because not in same quad/layer"<<endl;}
759 Int_t deadStripsSkipped=0;
763 while(nextStrip>=itVecBegin && nextStrip <itVecEnd && (*nextStrip)->getClusterSeedType()==kFgtDeadStrip) {
766 StFgtGeom::decodeGeoId((*nextStrip)->getGeoId(),disc,quadrant,layer,strip);
767 if(seedLayer!=layer || seedQuad!=quadrant || seedDisc!=disc){
768 if(debug) { cout <<
" Skipped dead strip, and next is not added because not in same quad/layer"<<endl;}
776 bool adjacentStrip =
false;
777 if(nextStrip >=itVecBegin && nextStrip <itVecEnd){
779 StFgtGeom::decodeGeoId((*nextStrip)->getGeoId(),disc,quadrant,layer,strip);
786 adjacentStrip=((layer==seedLayer)&&(quadrant==seedQuad)&&((abs(strip-seedStrip)<(2+deadStripsSkipped))));
794 if(stepTwo && isPhi && adjacentStrip && !isHit && seedStrip%2==0){
795 if(debug) cout <<
"\n adjacent has no charge but phi and even. Looking for next gid="<<(*(nextStrip+inc))->getGeoId();
796 if((nextStrip+inc) >=itVecBegin && (nextStrip+inc)<itVecEnd)
799 short disc2,quadrant2,strip2;
801 StFgtGeom::decodeGeoId((*(nextStrip+inc))->getGeoId(),disc2,quadrant2,layer2,strip2);
802 adjacentStrip=(layer2==seedLayer && quadrant2==seedQuad && abs(strip2-seedStrip)<=(2+deadStripsSkipped) && strip2%2==0);
804 if(isHit) nextStrip+=inc;
806 cout <<
"geoid of next next: " << (*(nextStrip+inc))->getGeoId() <<
" of seed: " << (*itSeed)->getGeoId() <<
" deadStrips skipped: " << deadStripsSkipped<<endl;
807 cout <<
"diff in geo: " <<(abs((*nextStrip+inc)->getGeoId()-(*itSeed)->getGeoId()==(2+deadStripsSkipped)))<< endl;
808 cout <<
"adjacentStrip="<<adjacentStrip;
814 if(stepTwo && isPhi && !isHit && seedStrip%2==0){
815 if(debug) cout <<
"\n This is not adjacent but phi and even. Check this strips"<<endl;
816 if(nextStrip>=itVecBegin && nextStrip<itVecEnd)
818 StFgtGeom::decodeGeoId((*nextStrip)->getGeoId(),disc,quadrant,layer,strip);
819 adjacentStrip=(layer==seedLayer && quadrant==seedQuad && abs(strip-seedStrip)==2);
822 if(debug){ cout <<
" Checked this strip because phi and even isHit=" << isHit << endl; }
830 (*nextStrip)->setClusterSeedType(kFgtClusterPart);
831 stripWeightMap_t &stripWeightMap = clus->getStripWeightMap();
832 stripWeightMap[ *nextStrip ] = 1;
834 if(sidedSize+1<=kFgtMaxClusterSize/2){
835 if(debug) cout <<
" Added\n";
836 return addStrips2Cluster(clus,nextStrip,itVecBegin,itVecEnd,direction,sidedSize+1);
839 return kFgtClusterTooBig;
843 if(adjacentStrip) {cout <<
" Not added because not adjacent"<<endl;}
844 else {cout <<
" Not added because no charge"<<endl;}
857 if(&fgtCollection){ mMaxTimeBin=fgtCollection.getNumTimeBins(); }
858 if(mMaxTimeBin==0)
return kStOk;
862 strips.sortByGeoId();
863 Float_t defaultError = 0.001;
864 Short_t disc, quadrant;
867 Double_t ordinate, lowerSpan, upperSpan;
868 Double_t accuCharge=0;
872 Double_t meanGeoId=0;
879 Int_t lastGeoIdInCluster=-1;
880 for( StSPtrVecFgtStripIterator it=strips.getStripVec().begin();it!=strips.getStripVec().end();++it)
887 if((*it)->getGeoId()<lastGeoIdInCluster && lastGeoIdInCluster>0)
890 if( (*it)->getClusterSeedType() >=kFgtSeedType1 && (*it)->getClusterSeedType() < kFgtSeedTypeMax )
907 int searchRange=(int)(floor(kFgtMaxClusterSize/2)+kFgtNumAdditionalStrips);
908 StSPtrVecFgtStripIterator firstStrip=it-(int)(floor(kFgtMaxClusterSize/2)+kFgtNumAdditionalStrips);
909 StSPtrVecFgtStripIterator lastStrip=it+(int)(floor(kFgtMaxClusterSize/2)+kFgtNumAdditionalStrips);
910 if(firstStrip<strips.getStripVec().begin())
911 firstStrip=strips.getStripVec().begin();
912 Int_t stripsW_Charge=0;
913 Int_t stripsWO_Charge=0;
916 for(StSPtrVecFgtStripIterator it2=firstStrip;(it2!=strips.getStripVec().end())&&(it2<=lastStrip);it2++)
918 if(fabs((*it)->getGeoId()-(*it2)->getGeoId())<searchRange)
920 if((*it2)->getClusterSeedType()!=kFgtDeadStrip)
922 if((*it2)->getCharge()>2*(*it2)->getChargeUncert())
932 if(stripsW_Charge>searchRange && stripsW_Charge > kFgtMaxClusterSize)
934 (*it)->setClusterSeedType(kFgtClusterSeedInSeaOfNoise);
935 #ifndef KEEP_BIG_AND_NOISY_CLUSTERS
943 StFgtGeom::getPhysicalCoordinate((*it)->getGeoId(),disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
946 newCluster=
new StFgtHit(clusters.getHitVec().size(),meanGeoId,accuCharge, disc, quadrant, layer, ordinate, defaultError,ordinate, defaultError,0.0,0.0);
947 stripWeightMap_t &stripWeightMap = newCluster->getStripWeightMap();
948 stripWeightMap[ *it ] = 1;
953 if(
addStrips2Cluster(newCluster, it, strips.getStripVec().begin(),strips.getStripVec().end(), down,0)==kFgtClusterTooBig)
958 #ifndef KEEP_BIG_AND_NOISY_CLUSTERS
960 for(stripWeightMap_t::iterator it=newCluster->getStripWeightMap().begin();it!=newCluster->getStripWeightMap().end();it++)
962 if(it->first->getClusterSeedType()<kFgtSeedType1 || it->first->getClusterSeedType()>kFgtSeedTypeMax)
963 it->first->setClusterSeedType(kFgtClusterTooBig);
970 if(
addStrips2Cluster(newCluster, it, strips.getStripVec().begin(),strips.getStripVec().end(), up,0)==kFgtClusterTooBig)
973 #ifndef KEEP_BIG_AND_NOISY_CLUSTERS
976 for(stripWeightMap_t::iterator it=newCluster->getStripWeightMap().begin();it!=newCluster->getStripWeightMap().end();it++)
978 if(it->first->getClusterSeedType()<kFgtSeedType1 || it->first->getClusterSeedType()>kFgtSeedTypeMax)
979 it->first->setClusterSeedType(kFgtClusterTooBig);
987 stripWeightMap_t &stripWM = newCluster->getStripWeightMap();
991 StSPtrVecFgtStripIterator stripInClu=0;
992 for(StSPtrVecFgtStripIterator it=firstStrip;it<=lastStrip&&it!=strips.getStripVec().end();it++)
994 if((*it)->getGeoId()==stripWM.begin()->first->getGeoId())
1000 StSPtrVecFgtStripIterator stripLow=stripInClu;
1002 if(stripLow>=strips.getStripVec().begin())
1005 stripWM[*stripLow]=1;
1007 StSPtrVecFgtStripIterator stripHigh=stripInClu;
1009 if(stripHigh<strips.getStripVec().end())
1012 stripWM[*stripHigh]=1;
1020 StSPtrVecFgtStripIterator stripInClu=0;
1021 for(StSPtrVecFgtStripIterator it=firstStrip;it<=lastStrip&& it<=lastStrip&&it!=strips.getStripVec().end();it++)
1025 if((*it)->getGeoId()==stripWM.begin()->first->getGeoId())
1038 StSPtrVecFgtStripIterator stripHigh=stripInClu;
1039 StSPtrVecFgtStripIterator stripNew=stripInClu;
1042 if(stripHigh< strips.getStripVec().end())
1044 if((*stripHigh)->getCharge() >(*stripInClu)->getCharge())
1051 stripNew=stripInClu;
1055 if(stripNew>=strips.getStripVec().begin()&& stripNew<strips.getStripVec().end())
1058 stripWM[*stripNew]=1;
1069 clusters.getHitVec().push_back(newCluster);
1071 lastGeoIdInCluster=newCluster->getStripWeightMap().rbegin()->first->getGeoId();
1080 StFgtSeededClusterAlgo::~StFgtSeededClusterAlgo()
Bool_t isSameCluster(StFgtStrip **itSeed, StFgtStrip **nextStrip)
function to check if the strip belongs to the cluster. If it returns false we stop adding strips to t...
virtual Int_t doClustering(const StFgtCollection &fgtCollection, StFgtStripCollection &strips, StFgtHitCollection &clusters)
the main function, using a collection of strips tht fired to build clusters of neighbouring strips ...
Int_t addStrips2Cluster(StFgtHit *clus, StFgtStrip **itSeed, StFgtStrip **itVecBegin, StFgtStrip **itVecEnd, Bool_t direction, Int_t sidedSize)
migrated to A2C maker
void FillClusterInfo(StFgtHit *cluster, StFgtStripCollection &allStrips)
fill in cluster info like charge from the strips