30 #include "AliCodeTimer.h"
48 fMaxSegAngle(180.-15.),
57 fMinTrackLength(fNDetMax),
84 fZVertRange[0] = fZVertRange[1] = 0.;
86 fHistList =
new TList();
88 fTracks =
new TClonesArray(
"AliMFTCATrack", 1000);
90 fRoads =
new TClonesArray(
"AliMFTCARoad", 1000);
92 for (Int_t iL = 0; iL < fNlayers; iL++) {
98 fLayers[iL]->SetID(iL);
99 fPlaneDetEff[iL] = 1.00;
102 hDA[iL] =
new TH1F(Form(
"hDA%d",iL),Form(
"#Delta #theta between two segments in Layer %d; #Delta #theta (deg)",iL),200,0.,0.5);
103 hDAv[iL] =
new TH1F(Form(
"hDAv%d",iL),Form(
"#Delta #theta with respect to the vertex in Layer %d; #Delta #theta (deg)",iL),200,0.,3.0);
104 fHistList->Add(hDA[iL]);
105 fHistList->Add(hDAv[iL]);
106 hDXY[iL] =
new TH2F(Form(
"hDXY%d",iL),Form(
"Distance between 2 hits on layer %d ; X (microns) ; Y (microns)",iL),100,0.,10.,100,0.,+10.);
108 fHistList->Add(hDXY[iL]);
111 hNGoodCell =
new TH1F(
"hNGoodCell",
"Number of good cell in the track",5,-0.5,4.5);
112 fHistList->Add(hNGoodCell);
113 hTrackType =
new TH1F(
"hTrackType",
"Track type",4,-0.5,3.5);
114 fHistList->Add(hTrackType);
115 hAngleCells =
new TH1F(
"hAngleCell1gap2gaps",
"#Delta #theta between two segments one 1 gap and one 2 layers gap; #Delta #theta (deg)",200,0.,45.);
116 fHistList->Add(hAngleCells);
117 hThetaCells =
new TH1F(
"hThetaCells",
"#theta of the cells; #theta (deg)",200,0.,15.);
118 fHistList->Add(hThetaCells);
121 hVertZ =
new TH1F(
"hVertZ",
"hVertZ",400,-10.,+10.);
122 hVertZa =
new TH1F(
"hVertZa",
"hVertZa",400,-10.,+10.);
124 fHistList->Add(hVertZ);
125 fHistList->Add(hVertZa);
128 hHitDifXY =
new TH2F(
"hHitDifXY",
"hHitDifXY",100,-0.04,+0.04,100,-0.04,+0.04);
129 fHistList->Add(hHitDifXY);
130 hAngDifAll =
new TH1F(
"hAngDifAll",
"hAngDifAll",1000,0.,+0.5);
131 fHistList->Add(hAngDifAll);
132 hAngDifDup =
new TH1F(
"hAngDifDup",
"hAngDifDup",1000,0.,+0.5);
133 fHistList->Add(hAngDifDup);
134 hIntDifXYAll =
new TH2F(
"hIntDifXYAll",
"hIntDifXYAll",100,-0.01,+0.01,100,-0.01,+0.01);
135 fHistList->Add(hIntDifXYAll);
137 hIntDifXYDup =
new TH2F(
"hIntDifXYDup",
"hIntDifXYDup",100,-0.01,+0.01,100,-0.01,+0.01);
139 hIntDifXYDup =
new TH2F(
"hIntDifXYDup",
"hIntDifXYDup",100,-0.1,+0.1,100,-0.1,+0.1);
141 fHistList->Add(hIntDifXYDup);
154 AliInfo(Form(
"Parameter file set to %s ",parfile));
167 AliCodeTimerAuto(
"",0);
172 Int_t nClusterFront = clusterArrayFront[iPlane]->GetEntriesFast();
173 Int_t nClusterBack = clusterArrayBack[iPlane]->GetEntriesFast();
174 AliDebug(1,Form(
"Loading %d + %d = %d Clusters for Plane %d",nClusterFront , nClusterBack,nClusterFront + nClusterBack, iPlane));
178 for (Int_t iCluster=0; iCluster<nClusterFront; iCluster++) {
179 caHit = caLayer->
AddHit();
187 for (Int_t iCluster=0; iCluster<nClusterBack; iCluster++) {
188 caHit = caLayer->
AddHit();
202 AliInfo(Form(
"Reading Parameter File %s ",parfile));
205 in.open(parfile,std::ios::in);
211 printf(
"Use the TrackFinder: %d \n",fUseTF);
213 getline(in,line); getline(in,line);
215 printf(
"Number of detecting planes: %d \n",fNlayers);
217 getline(in,line); getline(in,line);
219 printf(
"Layer thickness in X0: %5.3f \n",fThick);
221 getline(in,line); getline(in,line);
223 printf(
"Pixel noise: %4.2e \n",fPixelNoise);
225 printf(
"Add noise: %d \n",fAddNoise);
227 getline(in,line); getline(in,line);
229 printf(
"fMinTrackLength: %d \n",fMinTrackLength);
231 getline(in,line); getline(in,line);
233 printf(
"fXCut: %6.4f cm\n",fXCut);
235 printf(
"fYCut: %6.4f cm\n",fYCut);
237 getline(in,line); getline(in,line);
239 printf(
"fMaxSegAngle: %4.1f deg\n",fMaxSegAngle);
242 getline(in,line); getline(in,line);
243 for (Int_t i = 0; i <
fNlayers; i++) {
245 printf(
"fACutV[%d]: %4.2f \n",i,fACutV[i]);
248 getline(in,line); getline(in,line);
249 for (Int_t i = 0; i <
fNlayers; i++) {
251 printf(
"fACutN[%d]: %4.2f \n",i,fACutN[i]);
254 getline(in,line); getline(in,line);
255 for (Int_t i = 0; i <
fNlayers; i++) {
257 printf(
"PlaneDetEff[%d]: %4.2f \n",i,fPlaneDetEff[i]);
260 getline(in,line); getline(in,line);
262 printf(
"Calculate vertex: %d \n",fCalcVertex);
264 getline(in,line); getline(in,line);
266 printf(
"Add QED hits: %d \n",fAddQED);
268 printf(
"Hadronic MB Rate: %5.1f kHz\n",fMBRate);
270 printf(
"CMOS integration time: %5.1f microsec \n",fCMOSIntTime);
272 getline(in,line); getline(in,line);
274 printf(
"Read geometry: %d \n",fReadGeom);
276 if (fReadGeom)
printf(
"... from file: %s \n",fGeomName.Data());
279 printf(
"==================================\n");
289 for (Int_t iL = 0; iL <
fNlayers; iL++) {
307 for (Int_t iL = 0; iL <
fNlayers; iL++) {
323 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
325 for (Int_t iC = 0; iC < layer->
GetNcells(); iC++) {
336 Double_t *c1h1 = cell1->
GetHit1();
337 Double_t *c1h2 = cell1->
GetHit2();
338 Double_t *c2h1 = cell2->
GetHit1();
339 Double_t *c2h2 = cell2->
GetHit2();
341 TVector3 seg1 = TVector3(c1h2[0]-c1h1[0],c1h2[1]-c1h1[1],c1h2[2]-c1h1[2]);
342 TVector3 seg2 = TVector3(c2h2[0]-c2h1[0],c2h2[1]-c2h1[1],c2h2[2]-c2h1[2]);
344 return (seg1.Angle(seg2))*TMath::RadToDeg();
351 Double_t *ch1 = cell->
GetHit1();
352 Double_t *ch2 = cell->
GetHit2();
354 return ch1[0]+(ch2[0]-ch1[0])/(ch2[2]-ch1[2])*(z-ch1[2]);
361 Double_t *ch1 = cell->
GetHit1();
362 Double_t *ch2 = cell->
GetHit2();
364 return ch1[1]+(ch2[1]-ch1[1])/(ch2[2]-ch1[2])*(z-ch1[2]);
375 Double_t cellAngDifCut;
376 Double_t cellIntDifCut;
378 cellAngDifCut = 0.03;
379 cellIntDifCut = 0.01;
384 Int_t trkid1h1, trkid1h2, trkid2h1, trkid2h2;
385 Double_t xc1h1, xc1h2, xc2h1, xc2h2;
386 Double_t yc1h1, yc1h2, yc2h1, yc2h2;
387 Double_t zc1h1, zc1h2, zc2h1, zc2h2, zMin, zMax;
388 Double_t cellAngDif, cellIntDifX, cellIntDifY, zint;
389 Double_t cellDifX1, cellDifX2, cellDifY1, cellDifY2;
390 Double_t hit1[3], hit2[3];
392 TList *multCell =
new TList();
394 const Int_t nMaxh = 100;
395 Double_t xTr[nMaxh], yTr[nMaxh], zTr[nMaxh];
396 Double_t ax, axe, bx, bxe, ay, aye, by, bye;
397 Double_t xTrErrDet = 0.0025/TMath::Sqrt(12.);
398 Double_t yTrErrDet = 0.0025/TMath::Sqrt(12.);
399 Double_t xTrErrMS = 0.00055;
400 Double_t yTrErrMS = 0.00055;
401 Double_t xTrErr[nMaxh], yTrErr[nMaxh];
402 for (Int_t i = 0; i < nMaxh; i++) {
403 xTrErr[i] = TMath::Sqrt(xTrErrDet*xTrErrDet+xTrErrMS*xTrErrMS);
404 yTrErr[i] = TMath::Sqrt(yTrErrDet*yTrErrDet+yTrErrMS*yTrErrMS);
413 Int_t nCells, nCells1, nDiffTracks = 0;
414 Int_t nTrackID[10000], TrackID[10000];
415 for (Int_t i = 0; i < 10000; i++) {
419 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
424 for (Int_t i = 0; i < 10000; i++) {
430 for (Int_t iC = 0; iC < nCells; iC++) {
435 for (Int_t idt = 0; idt < nDiffTracks; idt++) {
444 nTrackID[nDiffTracks]++;
450 if (nDiffTracks < nCells1) {
451 printf(
"AnalyzeCells: L %d cells %d , %d diff tracks %d \n",iL,nCells,nCells1,nDiffTracks);
453 for (Int_t idt = 0; idt < nDiffTracks; idt++) {
454 if (nTrackID[idt] > 1) {
455 for (Int_t iC = 0; iC < nCells; iC++) {
469 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
475 for (Int_t iC1 = 0; iC1 < nCells; iC1++) {
486 for (Int_t iC2 = (iC1+1); iC2 < nCells; iC2++) {
498 if ((TMath::Abs(zc1h1-zc2h1) > 0.5*
fZGap) ||
499 (TMath::Abs(zc1h2-zc2h2) > 0.5*
fZGap)) {
517 cellDifX1 = xc1h1-xc2h1;
518 cellDifX2 = xc1h2-xc2h2;
519 cellDifY1 = yc1h1-yc2h1;
520 cellDifY2 = yc1h2-yc2h2;
522 if (trkid1h1 == trkid2h1 && trkid1h2 == trkid2h2) {
533 if (TMath::Abs(cellDifX1) < cellIntDifCut &&
534 TMath::Abs(cellDifX2) < cellIntDifCut &&
535 TMath::Abs(cellDifY1) < cellIntDifCut &&
536 TMath::Abs(cellDifY2) < cellIntDifCut) {
541 multCell->Add(cell1);
545 multCell->Add(cell2);
564 if (multCell->GetSize() > 0) {
571 for (Int_t imc = 0; imc < multCell->GetSize(); imc++) {
573 xTr[nTr] = cellM->
GetHit1()[0];
574 yTr[nTr] = cellM->
GetHit1()[1];
575 zTr[nTr] = cellM->
GetHit1()[2];
576 zMin = TMath::Min(zMin,zTr[nTr]);
577 zMax = TMath::Max(zMax,zTr[nTr]);
579 xTr[nTr] = cellM->
GetHit2()[0];
580 yTr[nTr] = cellM->
GetHit2()[1];
581 zTr[nTr] = cellM->
GetHit2()[2];
582 zMin = TMath::Min(zMin,zTr[nTr]);
583 zMax = TMath::Max(zMax,zTr[nTr]);
595 if (
LinFit(nTr,zTr,xTr,xTrErr,ax,axe,bx,bxe) &&
596 LinFit(nTr,zTr,yTr,yTrErr,ay,aye,by,bye)) {
597 hit1[0] = ax*zMin+bx;
598 hit1[1] = ay*zMin+by;
600 hit2[0] = ax*zMax+bx;
601 hit2[1] = ay*zMax+by;
621 printf(
"No line fit possible!\n");
644 Double_t h1[3], h2[3];
645 Int_t iL2, nH2, trackID1, trackID2;
649 for (Int_t iL1 = 0; iL1 < (
fNlayers-1); iL1++) {
653 for (Int_t iCL = 0; iCL < layerL->
GetNcells(); iCL++) {
668 for (Int_t iH2 = 0; iH2 < nH2; iH2++) {
674 TVector3
vec(h2[0]-h1[0],h2[1]-h1[1],h2[2]-h1[2]);
675 if (vec.Theta() <
fMaxSegAngle*TMath::DegToRad())
continue;
691 if (prn)
printf(
"Create gap (L) cell %d in layer %d. \n",cell->
GetGID(),iL1+1);
698 if ((iL1 > 1) && (cellL->
GetNNbL() == 0)) {
707 for (Int_t iH2 = 0; iH2 < nH2; iH2++) {
713 TVector3
vec(h1[0]-h2[0],h1[1]-h2[1],h1[2]-h2[2]);
714 if (vec.Theta() <
fMaxSegAngle*TMath::DegToRad())
continue;
730 if (prn)
printf(
"Create gap (R) cell %d in layer %d. \n",cell->
GetGID(),iL1-2);
740 printf(
"Found %d gap cells.\n",nGapCells);
753 Int_t iL1, iL2, nH1, nH2;
754 Int_t iL1min, iL1max;
755 Int_t iL2min, iL2max;
756 Int_t trackID1, trackID2, detElemID1, detElemID2;
758 Double_t h1[3], h2[3], h[3], hx, hy, dR;
759 Int_t mftClsId1, mftClsId2;
766 for (iL1 = iL1min; iL1 <= iL1max; iL1++) {
770 for (Int_t iH1 = 0; iH1 < nH1; iH1++) {
774 h1[0] = hit1->
GetPos()[0];
775 h1[1] = hit1->
GetPos()[1];
776 h1[2] = hit1->
GetPos()[2];
780 while (noCell && (iL2 <= iL2max)) {
783 for (Int_t iH2 = 0; iH2 < nH2; iH2++) {
785 h2[0] = hit2->
GetPos()[0];
786 h2[1] = hit2->
GetPos()[1];
787 h2[2] = hit2->
GetPos()[2];
818 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
827 printf(
"From %d combinations: \n",nCombi);
829 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
833 printf(
"Tot cells: %ld \n",nTotCell);
835 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
837 printf(
"L%1d C%2d \n",iL,nc);
851 Int_t iL1, iL2, nH1, nH2;
852 Int_t iL1min, iL1max;
853 Int_t iL2min, iL2max;
854 Int_t trackID1, trackID2, detElemID1, detElemID2;
856 Double_t h1[3], h2[3], h[3], hx, hy, dR;
862 for (iL1 = iL1min; iL1 <= iL1max; iL1++) {
866 for (Int_t iH1 = 0; iH1 < nH1; iH1++) {
870 h1[0] = hit1->
GetPos()[0];
871 h1[1] = hit1->
GetPos()[1];
872 h1[2] = hit1->
GetPos()[2];
875 while (noCell && (iL2 <= iL2max)) {
878 for (Int_t iH2 = 0; iH2 < nH2; iH2++) {
880 h2[0] = hit2->
GetPos()[0];
881 h2[1] = hit2->
GetPos()[1];
882 h2[2] = hit2->
GetPos()[2];
910 printf(
"From %d combinations: \n",nCombi);
912 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
916 printf(
"Tot cells: %ld \n",nTotCell);
930 Int_t nHits, nDiffTracks = 0;
931 Int_t nTrackID[10000], TrackID[10000];
932 for (Int_t i = 0; i < 10000; i++) {
936 for (Int_t iL = 0; iL <
fNlayers; iL++) {
939 for (Int_t i = 0; i < 10000; i++) {
943 for (Int_t iH = 0; iH < nHits; iH++) {
945 for (Int_t idt = 0; idt < nDiffTracks; idt++) {
946 if (TrackID[idt] ==
GetLayer(iL)->GetHit(iH)->GetTrackGID()) {
954 nTrackID[nDiffTracks]++;
958 printf(
"CreateCells: L %d hits %d diff tracks %d \n",iL,nHits,nDiffTracks);
965 Int_t nH1, nH2, trackID1, trackID2, detElemID1, detElemID2;
966 Double_t h1[3], h2[3];
967 Double_t nCombi = 0.;
977 if (prn)
printf(
"---> 1st Layer L %d with %d hits.\n",iL1,nH1);
980 if (prn)
printf(
"---> 2nd Layer R %d with %d hits.\n",iL2,nH2);
982 for (Int_t iH1 = 0; iH1 < nH1; iH1++) {
988 for (Int_t iH2 = 0; iH2 < nH2; iH2++) {
994 TVector3
vec(h2[0]-h1[0],h2[1]-h1[1],h2[2]-h1[2]);
995 if (vec.Theta() <
fMaxSegAngle*TMath::DegToRad())
continue;
1031 printf(
"From %.0f combinations: \n",nCombi);
1033 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
1037 printf(
"Tot cells: %ld \n",nTotCell);
1050 const Double_t *h1, *h2;
1051 Double_t a,
b, c, x0, y0, z0;
1052 Double_t n1, n2, n3, n4;
1055 for (Int_t iC = 0; iC < layer->
GetNcells(); iC++) {
1065 a = (h2[0]-h1[0])/(h2[2]-h1[2]);
1066 b = (h2[1]-h1[1])/(h2[2]-h1[2]);
1074 zmin = -(n1*n2+n3*n4)/(n2*n2+n4*n4);
1081 Float_t zvert = 0.,
sum = 0., maxsum = 0.;
1082 Int_t bin1, bin2, binW = 2;
1084 Int_t binMax =
hVertZ->GetNbinsX();
1086 hVertZ->Fit(
"pol1",
"QW0");
1087 TF1 *
f =
hVertZ->GetFunction(
"pol1");
1089 for (Int_t i = binMin; i <= binMax; i++) {
1090 hVertZ->SetBinContent(i,TMath::Max(0.,
hVertZ->GetBinContent(i)-f->Eval(
hVertZ->GetBinCenter(i))));
1093 for (Int_t i = binMin; i <= binMax; i++) {
1094 bin1 = TMath::Max(binMin,i-binW);
1095 bin2 = TMath::Min(binMax,i+binW);
1099 zvert =
hVertZ->GetBinCenter(i);
1115 Bool_t prn = kFALSE;
1117 if (prn) AliInfo(
"Run forward (roads) ==================================== \n");
1125 Double_t nCombiTot = 0;
1126 Double_t nCombiMatch = 0;
1127 Int_t cellLayers[2];
1139 for (iL = 0; iL < (
fNlayers-2); iL++) {
1146 for(Int_t i = 0; i < 2; i++) cellLayers[i] = cellL->
GetLayers()[i];
1148 iR = iL+(cellLayers[1]-cellLayers[0]);
1163 AliInfo(Form(
"Matching cells: L(%d) cellGID(%d) %d R(%d) cellGID(%d) %d \n",iL,iCL,cellL->
GetGID(),iR,iCR,cellR->
GetGID()));
1187 if (kFALSE || prn) {
1188 AliInfo(Form(
"Iteration: %5d ----------------- \n",iter));
1189 for (iL = 0; iL < (
fNlayers-1); iL++) {
1201 if (kFALSE || prn) {
1202 printf(
"End iteration: ----------------- \n");
1203 for (iL = 0; iL < (
fNlayers-1); iL++) {
1213 if (kFALSE || prn) {
1215 printf(
"RunForward after %d iterations, nr of Total combinations %.0f , nr of matched combinations %.0f\n",iter,nCombiTot, nCombiMatch);
1228 Bool_t prn = kFALSE;
1230 if (prn)
printf(
"Run forward ==================================== \n");
1236 Bool_t stch =
kTRUE;
1237 Int_t iL, iR, iter = 0;
1238 Double_t nCombiTot = 0;
1239 Double_t nCombiMatch = 0;
1241 Double_t nCombiIter, nCombiIterMatch;
1246 nCombiIterMatch = 0;
1251 for (iL = 0; iL < (
fNlayers-2); iL++) {
1257 for (Int_t iCL = 0; iCL < layerL->
GetNcells(); iCL++) {
1262 Int_t cellLayers[2];
1263 for(Int_t i = 0; i < 2; i++) cellLayers[i] = cellL->
GetLayers()[i];
1265 iR = iL+(cellLayers[1] - cellLayers[0]);
1274 for (Int_t iCR = 0; iCR < layerR->
GetNcells(); iCR++) {
1288 printf(
"Matching cells: L cellGID %d R cellGID %d \n",cellL->
GetGID(),cellR->
GetGID());
1289 printf(
"Layer L %d cell %d - Layer R %d cell %d \n",iL,iCL,iR,iCR);
1292 nCombiIterMatch += 1;
1311 printf(
"Iteration: %5d nr of combinations %.0f match %.0f \n",iter,nCombiIter,nCombiIterMatch);
1317 printf(
"Iteration: %5d ----------------- \n",iter);
1318 for (iL = 0; iL < (
fNlayers-1); iL++) {
1320 for (Int_t iCL = 0; iCL < layerL->
GetNcells(); iCL++) {
1332 printf(
"End iteration: ----------------- \n");
1333 for (iL = 0; iL < (
fNlayers-1); iL++) {
1335 for (Int_t iCL = 0; iCL < layerL->
GetNcells(); iCL++) {
1346 printf(
"RunForward after %d iterations, nr of Total combinations %.0f , nr of matched combinations %.0f\n",iter,nCombiTot, nCombiMatch);
1357 Bool_t prn = kFALSE;
1359 if (prn)
printf(
"Run backward road %d ==================================== \n",road->
GetID());
1363 Double_t chisqNbLprev, cellAngDif, cellAngDifPrev;
1364 Int_t addCellIdToTrack, iNbLchiSqMin, iCellAngDifMin, nHitSta;
1372 Bool_t addCellToTrack, hitSta[5];
1374 Int_t minStartLayer = 6;
1375 Int_t maxStartLayer = 8;
1377 for (Int_t startLayer = maxStartLayer; startLayer >= minStartLayer; startLayer--) {
1379 if (prn)
printf(
"Start layer %d \n",startLayer);
1386 if (cellR->
IsUsed())
continue;
1389 if (prn)
printf(
"Create new track %d \n",trackGID);
1397 addCellToTrack =
kTRUE;
1398 while (addCellToTrack) {
1402 addCellToTrack = kFALSE;
1409 cellAngDifPrev = -1.;
1413 for (Int_t iNNbL = 0; iNNbL < cellR->
GetNNbL(); iNNbL++) {
1417 if (kFALSE && prn) {
1422 if (cellL->
IsUsed())
continue;
1427 if (cellAngDifPrev < 0.) {
1428 cellAngDifPrev = cellAngDif;
1430 if (cellAngDif < cellAngDifPrev) {
1431 iCellAngDifMin = iNNbL;
1437 iNbLchiSqMin = iNNbL;
1454 addCellToTrack =
kTRUE;
1455 addCellIdToTrack = cellR->
GetNbLgid(iNbLchiSqMin);
1467 for (Int_t j = 0; j < 5; j++) hitSta[j] = kFALSE;
1468 for (Int_t iCell = 0; iCell < track->
GetNcells(); iCell++) {
1474 for (Int_t i = 0; i < 5; i++) {
1475 if (hitSta[i]) nHitSta++;
1478 for (Int_t iCell = 0; iCell < track->
GetNcells(); iCell++) {
1497 Bool_t prn = kFALSE;
1499 if (prn)
printf(
"Run backward ==================================== \n");
1503 Double_t chisqNbLprev, cellAngDif, cellAngDifPrev;
1504 Int_t addCellIdToTrack, iNbLchiSqMin, iCellAngDifMin, trackGID = 0;
1512 Bool_t addCellToTrack;
1515 Int_t maxStartLayer = (
fNlayers-1)-1;
1517 for (Int_t startLayer = maxStartLayer; startLayer >= minStartLayer; startLayer--) {
1519 if (prn)
printf(
"Start layer %d \n",startLayer);
1523 for (Int_t iCR = 0; iCR < layerR->
GetNcells(); iCR++) {
1526 if (cellR->
IsUsed())
continue;
1528 if (prn)
printf(
"Create new track %d \n",trackGID);
1538 addCellToTrack =
kTRUE;
1539 while (addCellToTrack) {
1541 addCellToTrack = kFALSE;
1544 cellAngDifPrev = -1.;
1546 for (Int_t iNNbL = 0; iNNbL < cellR->
GetNNbL(); iNNbL++) {
1549 if (cellL->
IsUsed())
continue;
1552 if (cellAngDifPrev < 0.) {
1553 cellAngDifPrev = cellAngDif;
1555 if (cellAngDif < cellAngDifPrev) {
1556 iCellAngDifMin = iNNbL;
1560 iNbLchiSqMin = iNNbL;
1572 addCellToTrack =
kTRUE;
1573 addCellIdToTrack = cellR->
GetNbLgid(iNbLchiSqMin);
1586 for (Int_t iCell = 0; iCell < track->
GetNcells(); iCell++) {
1604 AliCodeTimerAuto(
"",0);
1606 Bool_t prn = kFALSE;
1608 AliInfo(Form(
"Filtering %d tracks",
GetNtracks()));
1610 Int_t nTrkC = 0, nTrkG = 0, nTrkF = 0, nTrkN = 0;
1614 Int_t ndof, nptr, cellGID, cellGIDn, cellGIDprev = -1, nTrkSplitEnd = 0;
1615 const Int_t nMaxh = 100;
1616 Double_t xTr[nMaxh], yTr[nMaxh], zTr[nMaxh];
1617 Double_t a, ae,
b, be, x0, xS, y0, yS, zmin, chisqx, chisqy;
1618 Double_t trkPhi, trkThe;
1619 Bool_t splitTrack, recTrack, cleanTrack, goodTrack, fakeTrack, noiseTrack;
1620 const Int_t nTrackMax = 10000;
1621 Int_t nrHitTrackID[nTrackMax], idHitTrackID[nTrackMax], nDiffTracks;
1622 Int_t idMaxHitsTrack, nMaxHits, nNoisyPix;
1623 for (Int_t i = 0; i < nTrackMax; i++) {
1624 nrHitTrackID[i] = 0;
1625 idHitTrackID[i] = -2;
1627 Int_t nrAliMFTCATrackID[nTrackMax], idAliMFTCATrackID[nTrackMax], nDiffAliMFTCATracks = 0;
1628 for (Int_t i = 0; i < nTrackMax; i++) {
1629 nrAliMFTCATrackID[i] = 0;
1630 idAliMFTCATrackID[i] = -2;
1632 Double_t xTrErrDet = 0.0028/TMath::Sqrt(12.);
1633 Double_t yTrErrDet = 0.0028/TMath::Sqrt(12.);
1634 Double_t xTrErrMS = 0.00055;
1635 Double_t yTrErrMS = 0.00055;
1636 Double_t xTrErr[nMaxh], yTrErr[nMaxh];
1637 for (Int_t i = 0; i < nMaxh; i++) {
1638 xTrErr[i] = TMath::Sqrt(xTrErrDet*xTrErrDet+xTrErrMS*xTrErrMS);
1639 yTrErr[i] = TMath::Sqrt(yTrErrDet*yTrErrDet+yTrErrMS*yTrErrMS);
1644 Int_t nTotalHits = 0, nCleanTotalHits = 0;
1646 for (Int_t iTrack = 0; iTrack <
GetNtracks(); iTrack++) {
1650 for (Int_t iCell = 0; iCell < track->
GetNcells(); iCell++) {
1656 if (cellGIDprev >= 0) {
1657 if (cellGID == cellGIDprev) {
1662 splitTrack = kFALSE;
1665 cellGIDprev = cellGID;
1668 printf(
"Cell %4d from track %d ",cellGID,track->
GetGID());
1675 xTr[nptr] = cell->
GetHit2()[0];
1676 yTr[nptr] = cell->
GetHit2()[1];
1677 zTr[nptr] = cell->
GetHit2()[2];
1679 xTr[nptr] = cell->
GetHit1()[0];
1680 yTr[nptr] = cell->
GetHit1()[1];
1681 zTr[nptr] = cell->
GetHit1()[2];
1684 xTr[nptr] = cell->
GetHit1()[0];
1685 yTr[nptr] = cell->
GetHit1()[1];
1686 zTr[nptr] = cell->
GetHit1()[2];
1690 for (Int_t ihc = 0; ihc < 2; ihc++) {
1692 for (Int_t idt = 0; idt < nDiffTracks; idt++) {
1693 if (idHitTrackID[idt] == cell->
GetTrackGID(ihc)) {
1694 nrHitTrackID[idt]++;
1700 idHitTrackID[nDiffTracks] = cell->
GetTrackGID(ihc);
1701 nrHitTrackID[nDiffTracks] = 1;
1721 cleanTrack = goodTrack = fakeTrack = noiseTrack = kFALSE;
1722 if (nDiffTracks == 1 && idHitTrackID[0] >= 0) {
1724 idMaxHitsTrack = idHitTrackID[0];
1728 for (Int_t idt = 0; idt < nDiffTracks; idt++) {
1729 if (idHitTrackID[idt] == -1) {
1730 nNoisyPix = nrHitTrackID[idt];
1731 }
else if (nMaxHits < nrHitTrackID[idt]) {
1732 nMaxHits = nrHitTrackID[idt];
1733 idMaxHitsTrack = idHitTrackID[idt];
1738 if (nMaxHits >= (2*track->
GetNcells())-1) {
1741 if (nNoisyPix > 0) noiseTrack =
kTRUE;
1742 else fakeTrack =
kTRUE;
1747 if (nMaxHits >= (2*track->
GetNcells())-2) {
1750 if (nNoisyPix > 0) noiseTrack =
kTRUE;
1751 else fakeTrack =
kTRUE;
1756 if (nMaxHits >= (2*track->
GetNcells())-1) {
1759 if (nNoisyPix > 0) noiseTrack =
kTRUE;
1760 else fakeTrack =
kTRUE;
1768 for (Int_t idt = 0; idt < nDiffAliMFTCATracks; idt++) {
1769 if (idAliMFTCATrackID[idt] == idMaxHitsTrack) {
1770 nrAliMFTCATrackID[idt]++;
1776 idAliMFTCATrackID[nDiffAliMFTCATracks] = idMaxHitsTrack;
1777 nrAliMFTCATrackID[nDiffAliMFTCATracks] = 1;
1778 nDiffAliMFTCATracks++;
1783 nCleanTotalHits += nptr;
1799 if (
LinFit(nptr,zTr,xTr,xTrErr,a,ae,b,be)) {
1801 if (
LinFit(nptr,zTr,yTr,yTrErr,a,ae,b,be)) {
1805 for (Int_t iptr = 0; iptr < nptr; iptr++) {
1807 chisqx += (xTr[iptr]-(xS*zTr[iptr]+x0))*(xTr[iptr]-(xS*zTr[iptr]+x0))/(xTrErr[iptr]*xTrErr[iptr]);
1808 chisqy += (yTr[iptr]-(yS*zTr[iptr]+y0))*(yTr[iptr]-(yS*zTr[iptr]+y0))/(yTrErr[iptr]*yTrErr[iptr]);
1811 trkPhi = trkThe = 0.;
1812 if (TMath::Abs(xS) > 0.) {
1813 trkPhi = TMath::ATan(yS/xS);
1815 if (xS < 0. && yS > 0.) {
1816 trkPhi = TMath::Pi()+trkPhi;
1818 if (xS < 0. && yS < 0.) {
1819 trkPhi = TMath::Pi()+trkPhi;
1821 if (xS > 0. && yS < 0.) {
1822 trkPhi = TMath::TwoPi()+trkPhi;
1824 if (TMath::Abs(TMath::Sin(trkPhi)) > 0.) {
1825 trkThe = TMath::ATan(yS/TMath::Sin(trkPhi));
1827 trkThe = TMath::Abs(trkThe);
1828 trkPhi *= TMath::RadToDeg();
1829 trkThe *= TMath::RadToDeg();
1833 zmin = -(x0*xS+y0*yS)/(xS*xS+yS*yS);
1846 track->
SetChiSqX(chisqx/(Double_t)ndof);
1847 track->
SetChiSqY(chisqy/(Double_t)ndof);
1855 AliInfo(Form(
"Track found -> C: %5d G: %5d F: %5d N: %5d Dif: %5d TotalHits: %d Clean: %d",nTrkC,nTrkG,nTrkF,nTrkN,nDiffAliMFTCATracks,nTotalHits,nCleanTotalHits));
1862 Bool_t prn = kFALSE;
1866 Int_t cellGID, trackGID, nTrackS = 0;
1867 Bool_t single[10000], hitFromNoisyPix, hitFromDiffTrack;
1868 Int_t nGoodCell, firstHitTrackID, idTrack[10000], nGoodTracks = 0;
1869 for (Int_t i = 0; i < 10000; i++) idTrack[i] = -1;
1881 for (Int_t iT = 0; iT <
GetNtracks(); iT++) {
1890 for (Int_t iC = 0; iC < track->
GetNcells(); iC++) {
1895 if (single[iT]) nGoodCell++;
1929 for (Int_t iC = 0; iC < track->
GetNcells(); iC++) {
1937 hitFromNoisyPix = kFALSE;
1938 hitFromDiffTrack = kFALSE;
1939 firstHitTrackID = -1;
1940 for (Int_t iC = 0; iC < track->
GetNcells(); iC++) {
1943 if (iC == 0) firstHitTrackID = cell->
GetTrackGID(0);
1944 if (prn)
printf(
"\t%5d from track: ",cellGID);
1947 hitFromNoisyPix =
kTRUE;
1948 else if (cell->
GetTrackGID(0) != firstHitTrackID ||
1950 hitFromDiffTrack =
kTRUE;
1954 if (hitFromDiffTrack) {
1957 }
else if (hitFromNoisyPix) {
1961 if (idTrack[firstHitTrackID] >= 0) {
1963 printf(
"Double track %6d from %6d and %6d \n",firstHitTrackID,iT,idTrack[firstHitTrackID]);
1967 idTrack[firstHitTrackID] = iT;
1976 printf(
"... %d single. \n",nTrackS);
1977 printf(
"... %d (%d) good \n",(Int_t)
hTrackType->GetBinContent(1),nGoodTracks);
1987 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
1989 for (Int_t iC = 0; iC < layer->
GetNcells(); iC++) {
1991 if (gid == cell->
GetGID())
return cell;
2014 TVector3 *segL_ = cellL->
GetSeg();
2015 TVector3 *segR_ = cellR->
GetSeg();
2017 TVector3 segL = TVector3(*segL_);
2018 TVector3 segR = TVector3(*segR_);
2020 const Double_t *hitL[2];
2021 const Double_t *hitR[2];
2031 dx = (hitL[1][0]-hitR[0][0])*(hitL[1][0]-hitR[0][0]);
2032 dy = (hitL[1][1]-hitR[0][1])*(hitL[1][1]-hitR[0][1]);
2033 dx = (dx > 0.) ? (TMath::Sqrt(dx)) : 0.;
2034 dy = (dy > 0.) ? (TMath::Sqrt(dy)) : 0.;
2035 a = (segL.Angle(segR))*TMath::RadToDeg();
2081 Bool_t prn = kFALSE;
2083 Bool_t findCompatibleCells = kFALSE;
2086 if (iL1 >= 0) layer1 =
GetLayer(iL1);
2090 if (iL2 >= 0) layer2 =
GetLayer(iL2);
2092 for (Int_t iCell = 0; iCell < layer1->
GetNcells(); iCell++) {
2095 const Double_t *hit = cell->
GetHit1();
2098 Double_t dx = (hit[0]-hit1[0])*(hit[0]-hit1[0]);
2101 Double_t dy = (hit[1]-hit1[1])*(hit[1]-hit1[1]);
2105 if ((TMath::Abs(dx) >
fXCut) || (TMath::Abs(dy) >
fYCut))
continue;
2107 TVector3 *seg1_ = cell->
GetSeg();
2108 TVector3 seg1 = TVector3(*seg1_);
2110 TVector3 seg2(hit2[0]-hit1[0],hit2[1]-hit1[1],hit2[2]-hit1[2]);
2111 Double_t a = (seg1.Angle(seg2))*TMath::RadToDeg();
2117 printf(
"Compare with cell %d in layer %d \n",iCell,layer1->
GetID());
2120 if (a < 0.1) findCompatibleCells =
kTRUE;
2124 if (iL2 < 0)
return (!findCompatibleCells);
2126 for (Int_t iCell = 0; iCell < layer2->
GetNcells(); iCell++) {
2129 const Double_t *hit = cell->
GetHit2();
2132 Double_t dx = (hit[0]-hit2[0])*(hit[0]-hit2[0]);
2135 Double_t dy = (hit[1]-hit2[1])*(hit[1]-hit2[1]);
2139 if ((TMath::Abs(dx) >
fXCut) || (TMath::Abs(dy) >
fYCut))
continue;
2141 TVector3 *seg1_ = cell->
GetSeg();
2142 TVector3 seg1 = TVector3(*seg1_);
2144 TVector3 seg2(hit2[0]-hit1[0],hit2[1]-hit1[1],hit2[2]-hit1[2]);
2145 Double_t a = (seg1.Angle(seg2))*TMath::RadToDeg();
2151 printf(
"Compare with cell %d in layer %d \n",iCell,layer2->
GetID());
2154 if (a < 0.1) findCompatibleCells =
kTRUE;
2158 return (!findCompatibleCells);
2169 TVector3 *seg_ = cell->
GetSeg();
2171 TVector3 seg = TVector3(*seg_);
2173 const Double_t *hit;
2177 Double_t vert[3] = { 0., 0., 0. };
2184 segV = TVector3(hit[0]-vert[0],hit[1]-vert[1],hit[2]-vert[2]);
2185 a = (seg.Angle(segV))*TMath::RadToDeg();
2188 hDAv[layer]->Fill(a);
2190 if ( a >
fACutV[layer])
return kFALSE;
2201 Double_t a, av[2], acut;
2202 TVector3 segV, segVdet;
2204 TVector3 seg = TVector3(h2[0]-h1[0], h2[1]-h1[1], h2[2]-h1[2]);
2206 Double_t vert[3] = { 0., 0., 0. };
2210 segVdet = TVector3(h1[0]-vert[0],h1[1]-vert[1],h1[2]-vert[2]);
2211 a = (seg.Angle(segVdet))*TMath::RadToDeg();
2216 acut = f->Eval(180.-segVdet.Theta()*TMath::RadToDeg());
2224 AliDebug(2,
"Cell NOT Selected");
2227 AliDebug(2,
"Cell Selected");
2255 for (Int_t iC = 0; iC < trk.
GetNcells(); iC++) {
2270 for (Int_t ir = 0; ir <
fNRoads; ir++) {
2272 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
2289 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
2291 for (Int_t iC = 0; iC < layer->
GetNcells(); iC++) {
2306 printf(
"Track:\t%6d \n",
id);
2307 for (Int_t iC = 0; iC < track->
GetNcells(); iC++) {
2310 printf(
"cell\t%6d gid\t%6d \tfrom track: ",iC,cellGID);
2323 for (Int_t iL = 0; iL < (
fNlayers-1); iL++) {
2326 for (Int_t iC = 0; iC < layer->
GetNcells(); iC++) {
2359 printf(
"==== AliMFTTrackFinder::PrintParam ====\n");
2370 for (Int_t i = 0; i <
fNlayers; i++) {
2373 for (Int_t i = 0; i <
fNlayers; i++) {
2376 for (Int_t i = 0; i <
fNlayers; i++) {
2384 printf(
"============================\n");
2400 AliCodeTimerAuto(
"",0);
2402 Bool_t prn = kFALSE;
2411 Int_t iPla1Min = 0, iPla1Max = 3;
2412 Int_t iPla2Min[4] = { 6, 6, 6, 6 };
2413 Int_t iPla2Max[4] = { 9, 9, 7, 7 };
2416 Int_t roadLen, nRoads = 0, trackGID = 0;
2417 Double_t h1[3], h2[3], h[3], hx, hy, dR;
2419 Double_t dRmin = 0.0400;
2423 Bool_t hitSta[5] = { kFALSE, kFALSE, kFALSE, kFALSE, kFALSE };
2424 Bool_t isUsed, newRoad;
2426 for (Int_t iL1 = iPla1Min; iL1 <= iPla1Max; iL1++) {
2428 for (Int_t iL2 = iPla2Max[iL1]; iL2 >= iPla2Min[iL1]; iL2--) {
2431 roadLen = iL2/2-iL1/2;
2434 if(prn) AliInfo(Form(
"nH1 = %d ",nH1));
2435 for (Int_t iH1 = 0; iH1 < nH1; iH1++) {
2440 if (hit1->
IsUsed())
continue;
2458 h1[0] = hit1->
GetPos()[0];
2459 h1[1] = hit1->
GetPos()[1];
2460 h1[2] = hit1->
GetPos()[2];
2463 if(prn) AliInfo(Form(
"nH2 = %d ",nH2));
2465 for (Int_t iH2 = 0; iH2 < nH2; iH2++) {
2469 if (hit2->
IsUsed())
continue;
2487 h2[0] = hit2->
GetPos()[0];
2488 h2[1] = hit2->
GetPos()[1];
2489 h2[2] = hit2->
GetPos()[2];
2491 TVector3
vec(h2[0]-h1[0],h2[1]-h1[1],h2[2]-h1[2]);
2492 if (vec.Theta() <
fMaxSegAngle*TMath::DegToRad())
continue;
2497 for (Int_t i = 0; i < 5; i++) hitSta[i] = kFALSE;
2499 for (Int_t iL = (iL1+1); iL <= (iL2-1); iL++) {
2503 for (Int_t iH = 0; iH < nH; iH++) {
2507 if (hit->
IsUsed())
continue;
2513 hx = h1[0] + (h2[0]-h1[0])*(h[2]-h1[2])/(h2[2]-h1[2]);
2514 hy = h1[1] + (h2[1]-h1[1])*(h[2]-h1[2])/(h2[2]-h1[2]);
2516 dR = TMath::Sqrt((hx-h[0])*(hx-h[0])+(hy-h[1])*(hy-h[1]));
2517 if (dR >= dRmin)
continue;
2538 road->
SetID(nRoads++);
2545 hitSta[iL1/2] =
kTRUE;
2546 hitSta[iL2/2] =
kTRUE;
2556 hitSta[iL/2] =
kTRUE;
2565 for (Int_t i = 0; i < 5; i++)
2566 if (hitSta[i]) nHitSta++;
2572 for (Int_t j = 0; j <
fNlayers; j++) {
2609 AliCodeTimerAuto(
"",0);
2611 Bool_t prn = kFALSE;
2613 Double_t h1[3], h2[3], h[3], hx, hy;
2614 Double_t htr1[3], htr2[3];
2615 const Int_t nMaxh = 100;
2616 Double_t trX[nMaxh], trY[nMaxh], trZ[nMaxh];
2617 Int_t lay[nMaxh], trkid[nMaxh], hit[nMaxh], detid[nMaxh];
2618 Int_t nH1, nH2, nH, iL1, iL2, lay1, lay2, trkid1, trkid2, nptr;
2619 Int_t hit1, hit2, detid1, detid2, nHitSta;
2620 Int_t mftClsId1, mftClsId2;
2625 Double_t dR, dRmin, dRcut = 0.0100;
2627 TF1 *fACutF =
new TF1(
"fACutF",
"[0]+x*[1]",0.,1.);
2628 Float_t cut170 = 0.6;
2629 Float_t cut177 = 0.3;
2631 par[1] = (cut177-cut170)/(177.-170.);
2632 par[0] = cut170-par[1]*170.;
2633 fACutF->SetParameter(0,par[0]);
2634 fACutF->SetParameter(1,par[1]);
2636 Bool_t addHit, selCAgapCell;
2661 if (prn)
printf(
"iL1,iL2 %d %d \n",iL1,iL2);
2666 if (prn)
printf(
"nH1 %d nH2 %d\n",nH1,nH2);
2667 for (Int_t iH1 = 0; iH1 < nH1; iH1++) {
2669 if (
GetLayer(iL1)->GetHit(iH1)->IsUsed())
continue;
2676 if (prn)
printf(
"H1 %d (%.1f,%.1f,%.1f)\n",iH1,h1[0],h1[1],h1[2]);
2678 for (Int_t iH2 = 0; iH2 < nH2; iH2++) {
2680 if (
GetLayer(iL2)->GetHit(iH2)->IsUsed())
continue;
2687 TVector3
vec(h2[0]-h1[0],h2[1]-h1[1],h2[2]-h1[2]);
2689 if (vec.Theta() <
fMaxSegAngle*TMath::DegToRad())
continue;
2694 if (prn)
printf(
"H2 %d (%.1f,%.1f,%.1f)\n",iH2,h2[0],h2[1],h2[2]);
2698 for (Int_t i = 0; i < 5; i++) hitSta[i] = kFALSE;
2701 hitSta[iL1/2] =
kTRUE;
2702 hitSta[iL2/2] =
kTRUE;
2715 for (Int_t iL = (iL1+1); iL <= (iL2-1); iL++) {
2719 if (prn)
printf(
"L %d nH %d \n",iL,nH);
2724 for (Int_t iH = 0; iH < nH; iH++) {
2728 if (
GetLayer(iL)->GetHit(iH)->IsUsed())
continue;
2734 hx = h1[0] + (h2[0]-h1[0])*(h[2]-h1[2])/(h2[2]-h1[2]);
2735 hy = h1[1] + (h2[1]-h1[1])*(h[2]-h1[2])/(h2[2]-h1[2]);
2737 dR = TMath::Sqrt((hx-h[0])*(hx-h[0])+(hy-h[1])*(hy-h[1]));
2738 if (dR >= dRmin)
continue;
2739 AliDebug(1,Form(
"Hit %d added",iH));
2740 hitSta[iL/2] =
kTRUE;
2775 for (Int_t i = 0; i < 5; i++) {
2776 if (hitSta[i]) nHitSta++;
2778 AliDebug(2,Form(
"nHitSta %d fMinTrackLength %d",nHitSta,
fMinTrackLength));
2792 AliDebug(1,Form(
"Adding Track %d ",trackGID));
2797 for (Int_t iptr = (nptr-1); iptr >= 1; iptr--) {
2799 trkid1 = trkid[iptr-1];
2802 detid1 = detid[iptr-1];
2811 trkid2 = trkid[iptr];
2814 detid2 = detid[iptr];
2850 Double_t *ycl, Double_t *yerr,
2851 Double_t &a, Double_t &ae, Double_t &
b, Double_t &be,
2857 const Int_t nMaxh = 100;
2858 Double_t xCl[nMaxh], yCl[nMaxh], yErr[nMaxh];
2860 for (Int_t i = 0; i < nDet; i++) {
2861 if (i == skip)
continue;
2864 yErr[idet] = yerr[i];
2868 Double_t S1, SXY, SX, SY, SXX, SsXY, SsXX, SsYY, Xm, Ym, s, delta, difx;
2870 S1 = SXY = SX = SY = SXX = 0.0;
2871 SsXX = SsYY = SsXY = Xm = Ym = 0.;
2873 for (Int_t i = 0; i < idet; i++) {
2874 S1 += 1.0/(yErr[i]*yErr[i]);
2875 SXY += xCl[i]*yCl[i]/(yErr[i]*yErr[i]);
2876 SX += xCl[i]/(yErr[i]*yErr[i]);
2877 SY += yCl[i]/(yErr[i]*yErr[i]);
2878 SXX += xCl[i]*xCl[i]/(yErr[i]*yErr[i]);
2879 if (i > 0) difx += TMath::Abs(xCl[i]-xCl[i-1]);
2882 SsXX += xCl[i]*xCl[i];
2883 SsYY += yCl[i]*yCl[i];
2884 SsXY += xCl[i]*yCl[i];
2886 delta = SXX*S1 - SX*SX;
2890 a = (SXY*S1 - SX*SY)/delta;
2891 b = (SY*SXX - SX*SXY)/delta;
2893 Ym /= (Double_t)idet;
2894 Xm /= (Double_t)idet;
2895 SsYY -= (Double_t)idet*(Ym*Ym);
2896 SsXX -= (Double_t)idet*(Xm*Xm);
2897 SsXY -= (Double_t)idet*(Ym*Xm);
2898 Double_t eps = 1.E-24;
2899 if ((idet > 2) && (TMath::Abs(difx) > eps) && ((SsYY-(SsXY*SsXY)/SsXX) > 0.)) {
2900 s = TMath::Sqrt((SsYY-(SsXY*SsXY)/SsXX)/(idet-2));
2901 be = s*TMath::Sqrt(1./(Double_t)idet+(Xm*Xm)/SsXX);
2902 ae = s/TMath::Sqrt(SsXX);
void CreateCells(Bool_t calcVertex=kFALSE)
Double_t fPlanesZ[fNDetMax]
void CreateCellsOld(Bool_t calcVertex=kFALSE)
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void AddRightNeighbour(Int_t cellgid)
void SetLength(Int_t l1, Int_t l2)
void RunBackwardR(AliMFTCARoad *road, Int_t &trackGID)
virtual void Clear(Option_t *)
void DrawTracks(Double_t *pTot, Double_t *Theta)
void SetChiSqX(Double_t chisq)
const Int_t GetGID() const
Double_t fZVertCalc
! Calculated vertez z
AliMFTCACell * GetCellByGID(Int_t gid)
const Int_t GetDetElemID()
Int_t fCellGID
! Cell global identifier
void SetStartLayer(Int_t sl)
Float_t fXCut
Cut in x difference; RuleSelect.
TFile f("CalibObjects.root")
void AddCell(AliMFTCACell *cell)
Double_t fErrX
! Error in X
Double_t fErrY
! Error in Y
TClonesArray * fRoads
! Array of roads
void SetDebug(Int_t debug)
AliMFTCALayer * fLayers[fNDetMax]
! Array of layers
AliMFTCALayer * GetLayer(Int_t nl)
const Int_t GetMFTClsId()
Double_t fZVertRange[2]
! Limits of vertex z accepted range
const Int_t GetNcellsInLayer(Int_t nl)
virtual void Clear(const Option_t *)
static const Int_t fNMaxPlanes
TH1F * hAngleCells
! Angle between adjacent cells
Double_t GetCellInterceptY(AliMFTCACell *cell, Double_t z)
Double_t fZVertDet
! Vertex z given by ext detector
const Int_t GetNcells() const
void PrintCell(Option_t *opt)
void ReadParam(Char_t *parfile="param.txt")
void SetDetElemID(Int_t id1, Int_t id2)
void SetPhi(Double_t phi)
TH2F * hDXY[fNDetMax]
! Histogram with X,Y distance between end of cells
void SetMCindex(Int_t index)
void PrintTrack(Int_t id)
void SetMCflag(UChar_t mcf)
AliMFTCATrack * GetTrack(Int_t nt)
TH1F * hTrackType
! Histogram track Type: 0 = good track ; 1 = hits from other track ; 2 = hits from noisy pixels ...
Int_t fNRoads
! number of built roads
void CreateCellsR(AliMFTCARoad *road)
const Int_t GetTrackGID()
const Int_t GetNbLgid(Int_t id)
Float_t fACutV[fNDetMax]
Cut in angle difference: for cell vertex compatibility.
Float_t fYCut
Cut in y difference; RuleSelect.
void LoadClusters(TClonesArray *clusterArrayFront[AliMFTConstants::fNMaxPlanes], TClonesArray *clusterArrayBack[AliMFTConstants::fNMaxPlanes])
void SetMFTClsId(Int_t id)
Double_t GetCellInterceptX(AliMFTCACell *cell, Double_t z)
void AddLeftNeighbour(Int_t cellgid)
AliMFTCATrack * AddTrack(Int_t gid)
void SetGID(Int_t gid, Int_t trackid1, Int_t trackid2)
Bool_t LinFit(Int_t nDet, Double_t *xcl, Double_t *ycl, Double_t *yerr, Double_t &a, Double_t &ae, Double_t &b, Double_t &be, Int_t skip=-1)
Int_t fNlayers
Number of detection planes.
void SetLayers(Int_t iL1, Int_t iL2)
void SetVertZ(Double_t z)
Float_t fACutN[fNDetMax]
Cut in angle difference: for neighbor cells compatibility.
AliMFTCACell * GetCell(Int_t ic) const
Int_t fNtracks
! Number of tracks
Bool_t RuleSelectCell(AliMFTCACell *cell)
Float_t fMaxSegAngle
Max cut of the Theta angle of segments [deg].
Double_t GetCellAngleDif(AliMFTCACell *cell1, AliMFTCACell *cell2)
TH1F * hThetaCells
! Theta of the cells
const Double_t * GetPos()
AliMFTCACell * GetCellInLayer(Int_t nl, Int_t nc)
TClonesArray * fTracks
! Array of tracks
void Init(Char_t *parfile)
const Int_t GetStartLayer() const
Double_t AddCellToChiSq(AliMFTCACell *cell)
TH1F * hNGoodCell
! Histogram showing numbers of good cells in the track
const Int_t GetTrackGID(Int_t p)
Double_t fPlaneDetEff[fNDetMax]
TH1F * hDAv[fNDetMax]
! Histogram with angle with respect to the vertex
void SetChiSqY(Double_t chisq)
void SetVertY(Double_t y)
AliMFTCACell * GetCell(Int_t nc)
void AddHit(AliMFTCAHit *hit)
Int_t fMaxCellStatus
! Maximum value of a cell status after RunForward
const Int_t GetCellGID(Int_t ic) const
void SetPos(Double_t x, Double_t y, Double_t z)
const Int_t GetLastCellGID() const
void RunForwardR(AliMFTCARoad *road, Int_t &trackGID)
void SetHits(Double_t *h1, Double_t *h2, Double_t z1, Double_t z2)
void AddCell(AliMFTCACell *cell)
AliMFTCAHit * GetHitInLayer(Int_t nl, Int_t nh)
static const Int_t kNDisks
Number of Disk.
void SetTrackGID(Int_t gid, Int_t la, Int_t id, Int_t detid)
const Int_t GetNhitsInLayer(Int_t nl)
Bool_t RuleSelect2LayersGap(Int_t iL1, Int_t iL2, Double_t *hit1, Double_t *hit2)
Int_t GetMCLabel(Int_t track) const
ClassImp(AliMFTTrackFinder) AliMFTTrackFinder
AliMFTCARoad * GetRoad(Int_t nr)
TH1F * hDA[fNDetMax]
! Histogram with angle between cells
void SetMFTClsId(Int_t id1, Int_t id2)
AliMFTCACell * GetCellByGID(Int_t gid)
void SetTheta(Double_t the)
void SetVertX(Double_t x)
Bool_t RuleSelect(AliMFTCACell *cellL, AliMFTCACell *cellR)
AliMFTCAHit * GetHit(Int_t nh)