73 int size =
fHitList.GetEntriesFast();
80 int size =
fHitList.GetEntriesFast();
117 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
125 for(
size_t ihit = 0; ihit < todelete.size(); ihit++) {
126 int hitno = todelete[ihit];
137 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
151 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
165 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
179 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
194 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
209 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
240 int associations[
nhits] = {0};
241 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
244 for(
int jhit = 0; jhit <
GetNofHits(); jhit++) {
245 if(ihit == jhit)
continue;
250 associations[ihit]++;
256 Double_t tmpdistance1 = 1000, tmpdistance2 = -1;
258 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
259 if(associations[ihit] != 1)
continue;
264 if(distance < tmpdistance1) {
265 tmpdistance1 = distance;
266 firstextremity = *
hit;
269 if(distance > tmpdistance2) {
270 tmpdistance2 = distance;
271 secondextremity = *
hit;
275 if(counter == 2)
return kTRUE;
277 if(counter == 0) cout <<
"NO EXTREMITY FOUND :-(" << endl;
278 if(counter > 2) cout <<
"TOO MANY EXTREMITIES FOUND :-( " << counter << endl;
293 cout <<
"WARNING, V detected?" << endl;
295 if(firstextremity == NULL || secondextremity == NULL) {
296 cout <<
"NULL POINTER" << endl;
300 if(*firstextremity == *secondextremity) {
301 cout <<
"COINCIDENT EXTREMITIES" << endl;
307 if(*pca == *firstextremity || *pca == *secondextremity) {
308 cout <<
"POCA COINCIDENT TO ONE OF THE EXTREMITIES" << endl;
315 cout <<
"TWO POINTS ALIGNED" << endl;
318 cout <<
"circle " << x0 <<
" " << y0 <<
" " << radius << endl;
321 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
327 if(
GetNofHits() - counter < 3) cout <<
"***************** YES ***************** " << counter <<
" on " <<
GetNofHits() << endl;
328 else cout <<
" ********************** NO ******************* " << counter <<
" " <<
GetNofHits() << endl;
348 cout <<
"CLUS1: " << tmphit->
GetHitID() << endl;
349 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
353 cout <<
"hit == ahit " << endl;
360 if(secondhit == NULL) {
361 cout <<
"secondhit " << endl;
364 else cout <<
"sechit " << secondhit << endl;
365 cout <<
"CLUS1: " << hit->
GetHitID() << endl;
370 cout <<
"CLUS2: " << tmphit->
GetHitID() << endl;
373 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
376 cout <<
"athit " << athit << endl;
377 cout <<
"hit " << hit << endl;
378 cout <<
"secondhit " << secondhit << endl;
379 if(*hit == *athit)
continue;
380 if(*hit == *secondhit)
continue;
385 cout <<
"CLUS2: " << hit->
GetHitID() << endl;
400 cluster1.
AddHit(firstextremity);
401 cluster2.
AddHit(secondextremity);
405 TVector3 tmpposition = firstextremity->
GetPosition();
417 for(
int iclus = 0; iclus < 2; iclus++) {
421 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
432 tmphit = secondextremity;
435 double tmpdistance2 = 1000;
439 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
445 cout << (*hit == *firstextremity) <<
" " << (*hit == *secondextremity) <<
" " << (*hit == *tmphit) << endl;
448 if((iclus == 0 && cluster1.
SearchHit(hit) != 0) || (iclus == 1 && cluster2.
SearchHit(hit) != 0)) {
449 cout << hit->GetHitID() <<
" is already there .................." << endl;
452 if(*hit == *firstextremity || *hit == *secondextremity || *hit == *tmphit)
continue;
456 if(iclus == 0) cluster1.
AddHit(hit);
457 else cluster2.
AddHit(hit);
458 hit->SetUsedFlag(kTRUE);
459 tmpposition = hit->GetPosition();
461 tmpdistance2 = (hit->GetPosition() - athit->
GetPosition()).Perp();
468 cout <<
"here2" << endl;
479 for(
int ihit = 0; ihit < cluster1.
GetNofHits(); ihit++) (cluster1.
GetHit(ihit))->SetUsedFlag(kTRUE);
480 for(
int ihit = 0; ihit < cluster2.
GetNofHits(); ihit++) (cluster2.
GetHit(ihit))->SetUsedFlag(kTRUE);
493 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
497 if(criterion.CompareTo(
"xydistance") == 0) {
523 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
534 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
545 for(
int ihit = 0; ihit < cluster->
GetNofHits(); ihit++) {
561 for(
int ihit = 0; ihit < cluster->
GetNofHits(); ihit++) {
562 hit = cluster->
GetHit(ihit);
566 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
569 if(criterion.CompareTo(
"xydistance") == 0) {
590 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
595 if(distance < tmpdistance) {
596 tmpdistance = distance;
611 Double_t m1 = v1.Mag2() - v2.Mag2();
614 if((d2 * n1 - d1 * n2) == 0) {
615 cout <<
"allineati" << endl;
619 y0 = 0.5 * (d2 * m1 - d1 *
m2) / (d2 * n1 - d1 * n2);
620 if(d1 != 0) x0 = (m1 - 2 * n1 *
y0)/d1;
621 else x0 = (m2 - 2 * n2 *
y0)/d2;
623 R = (v1 - TVector3(x0, y0, 0)).Mag();
630 if(
fHitList.FindObject(hit) == 0)
return kFALSE;
652 if(index == 0)
return NULL;
667 if(((
double) similarity/
GetNofHits()) > 0.5 || ((
double) similarity/cluster2->
GetNofHits()) > 0.5)
return kTRUE;
674 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
689 if(((
double) similarity/
GetNofHits()) > limit || ((
double) similarity/cluster2->
GetNofHits()) > limit)
return kTRUE;
697 std::vector<int> tobeadded;
698 for(
int ihit = 0; ihit < cluster2->
GetNofHits(); ihit++) {
701 tobeadded.push_back(ihit);
704 for(
size_t ihit = 0; ihit < tobeadded.size(); ihit++) {
705 int hitno = tobeadded.at(ihit);
718 double distance = 1000000;
721 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
724 if(tmpdistance < distance) {
725 distance = tmpdistance;
750 cout <<
"###############################" << endl;
752 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
760 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
771 for(
int ihit = 0; ihit <
GetNofHits(); ihit++) {
Bool_t SharedAt(PndTrkCluster *cluster2, double limit)
PndTrkCluster GetMvdHitList()
void Replace(PndTrkHit *hit)
PndTrkCluster GetSttHitList()
PndTrkHit * SearchHit(PndTrkHit *hit)
Bool_t SplitAtHit(PndTrkHit *athit, PndTrkCluster &cluster1, PndTrkCluster &cluster2)
Bool_t ComputeCircle(TVector3 v1, TVector3 v2, TVector3 v3, double &x0, double &y0, double &R)
void AddClusterAndSortFrom(PndTrkCluster *cluster, TVector3 frompoint, TString criterion)
void Draw(Color_t color=kBlack)
Bool_t operator==(const PndTrkCluster cluster) const
int MergeTo(PndTrkCluster *cluster2)
void DeleteHitAndCompress(PndTrkHit *hit)
Double_t GetMinimumXYDistanceFromHit(PndTrkHit *hit)
PndTrkCluster GetSttSkewHitList()
void SetSortVariable(Double_t sortvar)
void AddHit(PndTrkHit *hit)
PndTrkHit * GetNextHit(int index)
void SetIRegion(int iregion)
PndTrkHit * GetHit(int index)
void DeleteHit(PndTrkHit *hit)
TString m2(TString pts, TString exts="e px py pz")
void SortFromHit(PndTrkHit *firstextremity, TString criterion)
Int_t NofSharedHits(PndTrkCluster *cluster2)
PndTrkCluster GetSttParallelHitList()
void DeleteHits(std::vector< int > todelete)
#define MAXNOFHITSINCLUSTER
void Clear(Option_t *="")
void SetUsedFlag(Bool_t used)
Bool_t IsSimilarTo(PndTrkCluster *cluster2)
Double_t GetDistance(PndTrkHit *fromhit)
friend F32vec4 fabs(const F32vec4 &a)
PndTrkHit * GetPreviousHit(int index)
void AddCluster(PndTrkCluster *cluster)
PndTrkCluster GetMvdPixelHitList()
PndTrkHit * GetPocaTo(TVector3 frompoint)
Bool_t FindExtremitiesFrom(TVector3 frompoint, PndTrkHit &firstextremity, PndTrkHit &secondextremity)
Bool_t DoesContain(PndTrkHit *hit)
Bool_t SplitV(PndTrkHit *athit, PndTrkHit *firstextremity, PndTrkHit *secondextremity, PndTrkCluster &cluster1, PndTrkCluster &cluster2)
Double_t GetXYDistance(PndTrkHit *fromhit)
PndTrkCluster & operator=(const PndTrkCluster &cluster)
Double_t GetSortVariable()
Bool_t SorterFunction(PndTrkHit *hit1, PndTrkHit *hit2)
PndTrkCluster GetMvdStripHitList()
Bool_t CheckClusterAgainsV(TVector3 frompoint, PndTrkHit *firstextremity, PndTrkHit *secondextremity)