20 #include "TClonesArray.h"
47 if (NULL == ioman) {Fatal(
"CbmRichRingTrackAssignClosestD::Init",
"RootManager not instantised!");}
61 TClonesArray* richProj)
63 Int_t nofTracks = richProj->GetEntriesFast();
64 Int_t nofRings = rings->GetEntriesFast();
66 vector<Int_t> trackIndex;
67 vector<Double_t> trackDist;
68 trackIndex.resize(nofRings);
69 trackDist.resize(nofRings);
70 for (UInt_t i = 0; i < trackIndex.size(); i++){
75 for (Int_t iIter = 0; iIter < 4; iIter++){
76 for (Int_t iRing=0; iRing < nofRings; iRing++) {
77 if (trackIndex[iRing] != -1)
continue;
79 if (NULL == pRing)
continue;
84 cout <<
"xR:" << xRing <<
" yR:" << yRing << endl;
88 for (Int_t iTrack=0; iTrack < nofTracks; iTrack++) {
89 vector<Int_t>::iterator
it = find(trackIndex.begin(), trackIndex.end(), iTrack);
90 if (it != trackIndex.end())
continue;
93 Double_t xTrack = pTrack->
GetX();
94 Double_t yTrack = pTrack->
GetY();
95 cout <<
"xT:" << xTrack <<
" yT:" << yTrack << endl;
97 if (xTrack == 0 && yTrack == 0)
continue;
101 Double_t dist = TMath::Sqrt( (xRing-xTrack)*(xRing-xTrack) +
102 (yRing-yTrack)*(yRing-yTrack) );
109 trackIndex[iRing] = iTrackMin;
110 trackDist[iRing] = rMin;
113 for (UInt_t i1 = 0; i1 < trackIndex.size(); i1++){
114 for (UInt_t i2 = 0; i2 < trackIndex.size(); i2++){
115 if (i1 == i2)
continue;
116 if (trackIndex[i1] == trackIndex[i2] && trackIndex[i1] != -1){
117 if (trackDist[i1] >= trackDist[i2]){
118 trackDist[i1] = 999.;
121 trackDist[i2] = 999.;
131 for (UInt_t i = 0; i < trackIndex.size(); i++){
135 if (trackIndex[i] == -1)
continue;
148 if (trdIndex == -1)
return false;
149 CbmTrdTrack* trdTrack = (CbmTrdTrack*)
fTrdTracks->At(trdIndex);
150 if (NULL == trdTrack)
return false;