136 Bool_t warn = kFALSE;
139 Int_t nHits = fHits->GetEntriesFast();
146 for (Int_t iHit=0; iHit<nHits; iHit++) {
149 cout <<
"-W- " << GetName() <<
"::Exec: Empty hit at index "
160 Int_t iType = sector->
GetType();
166 Double_t xH = hit->GetX();
167 Double_t yH = hit->GetY();
168 Double_t dX = hit->GetDx();
169 Double_t dY = hit->GetDy();
172 Int_t iMatchF = hit->
GetDigi(0);
176 cout <<
"-E- " << GetName() <<
"::Exec: "
177 <<
"No DigiMatchF for hit " << iHit << endl;
178 hit->SetRefIndex(-1);
186 Int_t iMatchB = hit->
GetDigi(1);
190 cout <<
"-E- " << GetName() <<
"::Exec: "
191 <<
"No DigiMatchB for hit " << iHit << endl;
192 hit->SetRefIndex(-1);
206 for (Int_t jMatchF=0; jMatchF<3; jMatchF++) {
208 if ( iPointF < 0 )
continue;
213 cout <<
"-E- " << GetName() <<
"::Exec: "
214 <<
"No StsPoint (" << iPointF <<
") for pixel hit "
220 Double_t xP = point->
GetX(station->
GetZ());
221 Double_t yP = point->
GetY(station->
GetZ());
222 Double_t
dist = TMath::Sqrt( (xP-xH)*(xP-xH) + (yP-yH)*(yP-yH) );
223 fCandMap[
dist] = iPointF;
227 else if ( iType == 2 || iType == 3 ) {
230 for ( Int_t jMatchF=0; jMatchF<3; jMatchF++) {
232 if ( iPointF < 0 )
continue;
234 for ( Int_t jMatchB=0; jMatchB<3; jMatchB++) {
236 if ( iPointB < 0 )
continue;
237 if ( jMatchF == 0 ) nPointsB++;
238 if ( iPointB != iPointF )
continue;
242 cout <<
"-E- " << GetName() <<
"::Exec: "
243 <<
"No StsPoint (" << iPointF <<
") for strip hit "
249 Double_t xP = point->
GetX(station->
GetZ());
250 Double_t yP = point->
GetY(station->
GetZ());
251 Double_t
dist = TMath::Sqrt( (xP-xH)*(xP-xH) +
253 fCandMap[
dist] = iPointF;
260 cout <<
"-E- " << GetName() <<
"::Exec: Unknwon sensor type "
262 Fatal(
"Exec",
"Unknwon sensor type");
265 if ( fVerbose > 1 ) cout <<
"-I- " << GetName() <<
": Hit "
266 << iHit <<
", type " << iType
267 <<
", points " << nPointsF <<
" / "
268 << nPointsB <<
", candidates "
275 if ( fCandMap.empty() ) {
276 hit->SetRefIndex(-1);
277 if (fVerbose>1) cout <<
", background " << endl;
283 Double_t distMin = 999999.;
285 for (fIter=fCandMap.begin(); fIter!=fCandMap.end(); fIter++) {
286 if ( (*fIter).first < distMin ) {
287 distMin = (*fIter).first;
288 iPoint = (*fIter).second;
292 cout <<
"-E- " << GetName() <<
"::Exec: "
293 <<
"No closest point found in candidate map!" << endl;
294 Fatal(
"Exec",
"No closest point");
297 if (fVerbose>1) cout <<
", matched to " << iPoint <<
", distance "
304 Double_t xP = point->
GetX(station->
GetZ());
305 Double_t yP = point->
GetY(station->
GetZ());
306 if ( TMath::Abs(xP-xH) > 5. * dX ||
307 TMath::Abs(yP-yH) > 5. * dY ) {
308 hit->SetRefIndex(-2);
310 if (fVerbose>1) cout <<
", distant" << endl;
311 if ( iType == 1 || iType == 2) {
312 cout <<
"-W- " << fName <<
"::Exec: "
313 <<
"Distant hit in pixel / strip MSU station" << endl;
314 cout <<
"Hit " << iHit <<
" coordinates " << xH
315 <<
", " << yH << endl;
316 cout <<
"Matched point " << iPoint <<
", distance "
318 cout <<
"Distance y " << TMath::Abs(xP-xH) <<
" Error " << dX << endl;
319 cout <<
"Distance y " << TMath::Abs(yP-yH) <<
" Error " << dY << endl;
327 hit->SetRefIndex(iPoint);
329 if (fVerbose>1) cout <<
", good match" << endl;
333 if ( TMath::Abs(hit->GetZ() - point->GetZ()) > 1. ) {
334 cout <<
"-E- " << GetName() <<
"::Exec: Hit " << iHit
335 <<
" is at z = " << hit->GetZ() <<
" cm, but matched point "
336 << iPoint <<
" is at z = " << point->GetZ() <<
"cm " << endl;
337 Fatal(
"Exec",
"Different stations for hit and point");
345 if ( warn ) cout <<
"- ";
347 cout << setw(15) << left << fName <<
": " << setprecision(4) << setw(8)
348 << fixed << right << fTimer.RealTime()
349 <<
" s, hits " << nHits <<
", matched " << nMatched <<
", distant "
350 << nDistant <<
", background " << setw(6) << nBackgrd << endl;
354 if ( warn) fNEventsFailed++;
357 fTime += fTimer.RealTime();
358 fNHits += Double_t(nHits);
359 fNMatched += Double_t(nMatched);
360 fNDistant += Double_t(nDistant);
361 fNBackgrd += Double_t(nBackgrd);