179 if (geoPath.Contains(
"PixeloBlo1")) {
182 if(o.X() < 0) Layer += 1;
184 else if (geoPath.Contains(
"PixeloBlo2")) {
187 if(o.X() < 0) Layer += 1;
189 else if (geoPath.Contains(
"StripoBl3o(Silicon)")) {
192 if(o.X() < 0) Layer += 1;
194 else if (geoPath.Contains(
"StripoBl4o(Silicon)")) {
197 if(o.X() < 0) Layer += 1;
201 else if (geoPath.Contains(
"PixeloSdkoco(Silicon)_1")){Layer=9;}
202 else if (geoPath.Contains(
"PixeloSdkoco(Silicon)_2")){Layer=11;}
204 else if (geoPath.Contains(
"PixeloSdkoco(Silicon)_3")){Layer=10;}
205 else if (geoPath.Contains(
"PixeloSdkoco(Silicon)_4")){Layer=12;}
208 else if (geoPath.Contains(
"PixeloLdkoco(Silicon)_1")){Layer=13;}
209 else if (geoPath.Contains(
"PixeloLdkoco(Silicon)_2")){Layer=15;}
210 else if (geoPath.Contains(
"PixeloLdkoco(Silicon)_3")){Layer=17;}
211 else if (geoPath.Contains(
"PixeloLdkoco(Silicon)_4")){Layer=19;}
213 else if (geoPath.Contains(
"PixeloLdkoco(Silicon)_5")){Layer=14;}
214 else if (geoPath.Contains(
"PixeloLdkoco(Silicon)_6")){Layer=16;}
215 else if (geoPath.Contains(
"PixeloLdkoco(Silicon)_7")){Layer=18;}
216 else if (geoPath.Contains(
"PixeloLdkoco(Silicon)_8")){Layer=20;}
219 else if (geoPath.Contains(
"Fwdo(Silicon)_1")){
223 if(o.Z() > 20) Layer += 2;
225 else if (geoPath.Contains(
"Fwdo(Silicon)_2")){
229 if(o.Z() > 20) Layer += 2;
231 else cout <<
"I have no idea" << endl;
281 if(layerID1 == tube2->
GetLayerID())
return kTRUE;
283 else if((layerID1 < 9 && layerID2 < 9) || (layerID1 > 8 && layerID2 > 8)) {
285 if(layerID1 == layerID2 - 1)
return kTRUE;
286 else if(layerID1 == layerID2 + 1)
return kTRUE;
291 if(layerID1 == 7 && layerID2 == 16)
return kTRUE;
292 else if(layerID1 == 16 && layerID2 == 7)
return kTRUE;
302 if(layerID1 == layerID2)
return kTRUE;
304 else if(layerID1 == layerID2 - 1)
return kTRUE;
305 else if(layerID1 == layerID2 + 1)
return kTRUE;
318 double tmpdistance = -1;
319 for(
int ihit = 0; ihit < cluster->
GetNofHits(); ihit++) {
322 if(dist > tmpdistance) {
329 for(
int ihit = 0; ihit < cluster->
GetNofHits(); ihit++) {
340 std::vector< int > failedhits, breakpoints;
341 for(
int ihit = 0; ihit < cluster->
GetNofHits(); ihit++) {
349 Bool_t pre = kTRUE, fol = kTRUE;
355 if(pre == kFALSE && fol == kFALSE) {
357 failedhits.push_back(ihit);
360 else if(previous == NULL && fol == kFALSE) {
363 failedhits.push_back(ihit);
369 else if(follow == NULL && pre == kFALSE) {
373 failedhits.push_back(ihit);
377 else if(pre == kTRUE && fol == kFALSE) {
378 if(find(failedhits.begin(), failedhits.end(), ihit - 1) == failedhits.end()) {
380 breakpoints.push_back(ihit);
392 for(
size_t ihit = 0; ihit < failedhits.size(); ihit++) {
394 int hitno = failedhits[ihit];
399 for(
size_t ihit = 0; ihit < breakpoints.size(); ihit++) {
400 int hitno = breakpoints[ihit];
416 for(
size_t jhit = 0; jhit < breakpoints.size(); jhit++) {
418 for(
size_t ihit = 0; ihit < failedhits.size(); ihit++) {
419 if(failedhits[ihit] < breakpoints[jhit]) counter++;
451 for(
int ihit = 0; ihit < hitlist->
GetNofHits(); ihit++) {
454 cout <<
"hit == ahit " << endl;
463 cout <<
"*** " << hit->
GetHitID() <<
" " << layerid <<
" " << tmplayerid << endl;
464 if(layerid == tmplayerid || layerid == tmplayerid + 1 || layerid == tmplayerid - 1) {
470 if(secondhit == NULL) {
483 for(
int ihit = 0; ihit < hitlist->
GetNofHits(); ihit++) {
488 if(*hit == *athit)
continue;
489 if(*hit == *secondhit)
continue;
505 if(breakpoints.size() == 0) {
518 for(
size_t ihit = 0; ihit < breakpoints.size(); ihit++) {
519 int hitno = breakpoints[ihit] - cluster1.
GetNofHits();
521 SplitAtHit(tmpcluster, athit, cluster1, cluster2);
522 tmpcluster = &cluster2;
540 int sectorcounter[6] = {0, 0, 0, 0, 0, 0};
541 for(
int ihit = 0; ihit < cluster->
GetNofHits(); ihit++) {
545 sectorcounter[sectorID]++;
548 int tmpsector = -1, tmpcounter = -1;
550 if(sectorcounter[
isec] > tmpcounter) {
551 tmpcounter = sectorcounter[
isec];
560 for(
int ihit = 0; ihit < cluster->
GetNofHits(); ihit++) {
564 if(
fabs(sectorID - sector) < 1.2) newcluster.
AddHit(hit);
574 cout <<
"MERGING on " << nmax << endl;
575 std::vector< int> merged;
577 for(
int imax = 0; imax < nmax; imax++) {
579 if(find(merged.begin(), merged.end(), imax) != merged.end())
continue;
590 for(
int jmax = imax + 1; jmax < nmax; jmax++) {
591 cout <<
"COMPARING " << imax <<
" " << jmax << endl;
595 cout << imax <<
" is similar to " << jmax << endl;
597 merged.push_back(jmax);
602 cout <<
"theta/r " << merge->
GetTheta() <<
" " << merge->
GetR() << endl;
608 cout <<
"ADD CLUSTER " << merge->
GetNofHits() << endl;
611 for(
int iclus = 0; iclus < newclusterlist.
GetNofClusters(); iclus++) {
614 cout <<
"theta-r " << cluster->
GetTheta() <<
" " << cluster->
GetR() << endl;
618 return newclusterlist;
int FindMvdLayer(int sensorID)
PndTrkClusterList MergeClusters(PndTrkClusterList *clusterlist)
TClonesArray * fTubeArray
void SetSortVariable(Double_t sortvar)
void AddHit(PndTrkHit *hit)
Bool_t CheckPairOfHits(PndTrkHit *hit1, PndTrkHit *hit2)
TString GetPath(Int_t shortID)
for a given shortID the path is returned
PndTrkHit * GetNextHit(int index)
PndTrkHit * GetHit(int index)
int MergeTo(PndTrkLegendreCluster *cluster2)
void AddCluster(PndTrkCluster *cluster)
void DeleteHits(std::vector< int > todelete)
void GetOUVPath(TString path, TVector3 &o, TVector3 &u, TVector3 &v)
for a volume given by its path the o, u, v vectors for the plane are returned
Bool_t IsSimilarTo(PndTrkCluster *cluster2)
Double_t GetDistance(PndTrkHit *fromhit)
Bool_t SplitAtHit(PndTrkCluster *hitlist, PndTrkHit *athit, PndTrkCluster &cluster1, PndTrkCluster &cluster2)
int CheckSectorDistribution(PndTrkCluster *cluster)
PndTrkClusterList Split(PndTrkCluster *cluster, std::vector< int > breakpoints)
PndTrkCluster CleanSectors(PndTrkCluster *cluster, int sector)
friend F32vec4 fabs(const F32vec4 &a)
static PndGeoHandling * Instance()
PndTrkHit * GetPreviousHit(int index)
Double_t GetXYDistance(PndTrkHit *fromhit)
PndTrkCluster * GetCluster(Int_t index)
PndTrkClusterList Cleanup2(PndTrkCluster *cluster)