/*
$Log$
+Revision 1.21 2003/01/27 16:34:49 cblume
+Update of tracking by Sergei and Chuncheng
+
Revision 1.20 2002/11/07 15:52:09 cblume
Update of tracking code for tilted pads
const Float_t AliTRDtracker::fMinClustersInTrack = 0.5;
const Float_t AliTRDtracker::fMinFractionOfFoundClusters = 0.8;
- const Float_t AliTRDtracker::fSkipDepth = 0.05;
+ const Float_t AliTRDtracker::fSkipDepth = 0.3;
const Float_t AliTRDtracker::fLabelFraction = 0.8;
const Float_t AliTRDtracker::fWideRoad = 20.;
- const Double_t AliTRDtracker::fMaxChi2 = 12.;
+ const Double_t AliTRDtracker::fMaxChi2 = 20.;
//____________________________________________________________________
}
fSY2corr = 0.025;
- fSZ2corr = 1.;
+ fSZ2corr = 12.;
// calculate max gap on track
//_____________________________________________________________________
inline Double_t f1trd(Double_t x1,Double_t y1,
- Double_t x2,Double_t y2,
- Double_t x3,Double_t y3)
+ Double_t x2,Double_t y2,
+ Double_t x3,Double_t y3)
{
//
// Initial approximation of the track curvature
//_____________________________________________________________________
inline Double_t f2trd(Double_t x1,Double_t y1,
- Double_t x2,Double_t y2,
- Double_t x3,Double_t y3)
+ Double_t x2,Double_t y2,
+ Double_t x3,Double_t y3)
{
//
// Initial approximation of the track curvature times X coordinate
//_____________________________________________________________________
inline Double_t f3trd(Double_t x1,Double_t y1,
- Double_t x2,Double_t y2,
- Double_t z1,Double_t z2)
+ Double_t x2,Double_t y2,
+ Double_t z1,Double_t z2)
{
//
// Initial approximation of the tangent of the track dip angle
sprintf(tname,"TRDb_%d",fEvent);
TTree *seedTree=(TTree*)in->Get(tname);
if (!seedTree) {
- cerr<<"AliTRDtracker::Clusters2Tracks(): ";
- cerr<<"can't get a tree with track seeds !\n";
- return 3;
+ cerr<<"AliTRDtracker::Clusters2Tracks(): ";
+ cerr<<"can't get a tree with track seeds !\n";
+ return 3;
}
AliTRDtrack *seed=new AliTRDtrack;
seedTree->SetBranchAddress("tracks",&seed);
Int_t n=(Int_t)seedTree->GetEntries();
for (Int_t i=0; i<n; i++) {
- seedTree->GetEvent(i);
- seed->ResetCovariance();
- AliTRDtrack *tr = new AliTRDtrack(*seed,seed->GetAlpha());
- fSeeds->AddLast(tr);
- fNseeds++;
+ seedTree->GetEvent(i);
+ seed->ResetCovariance();
+ AliTRDtrack *tr = new AliTRDtrack(*seed,seed->GetAlpha());
+ fSeeds->AddLast(tr);
+ fNseeds++;
}
delete seed;
delete seedTree;
// make a first turn with tight cut on initial curvature
for(Int_t turn = 1; turn <= 2; turn++) {
if(turn == 2) {
- nSteps = (Int_t) (fSeedDepth / (3*fSeedStep));
- step = (Int_t) (timeBins * (3*fSeedStep));
+ nSteps = (Int_t) (fSeedDepth / (3*fSeedStep));
+ step = (Int_t) (timeBins * (3*fSeedStep));
}
for(Int_t i=0; i<nSteps; i++) {
- Int_t outer=timeBins-1-i*step;
- Int_t inner=outer-gap;
+ Int_t outer=timeBins-1-i*step;
+ Int_t inner=outer-gap;
- nseed=fSeeds->GetEntriesFast();
+ nseed=fSeeds->GetEntriesFast();
- MakeSeeds(inner, outer, turn);
+ MakeSeeds(inner, outer, turn);
- nseed=fSeeds->GetEntriesFast();
- printf("\n turn %d, step %d: number of seeds for TRD inward %d\n",
- turn, i, nseed);
-
- for (Int_t i=0; i<nseed; i++) {
- AliTRDtrack *pt=(AliTRDtrack*)fSeeds->UncheckedAt(i), &t=*pt;
- FollowProlongation(t,innerTB);
- if (t.GetNumberOfClusters() >= foundMin) {
- UseClusters(&t);
- CookLabel(pt, 1-fLabelFraction);
- t.CookdEdx();
- cout<<found++<<'\r';
- iotrack_trd = pt;
- trd_tree.Fill();
- if(PropagateToTPC(t)) {
- AliTPCtrack *tpc = new AliTPCtrack(*pt,pt->GetAlpha());
- iotrack = tpc;
- tpc_tree.Fill();
- delete tpc;
- }
- }
- delete fSeeds->RemoveAt(i);
- fNseeds--;
- }
+ nseed=fSeeds->GetEntriesFast();
+ printf("\n turn %d, step %d: number of seeds for TRD inward %d\n",
+ turn, i, nseed);
+
+ for (Int_t i=0; i<nseed; i++) {
+ AliTRDtrack *pt=(AliTRDtrack*)fSeeds->UncheckedAt(i), &t=*pt;
+ FollowProlongation(t,innerTB);
+ if (t.GetNumberOfClusters() >= foundMin) {
+ UseClusters(&t);
+ CookLabel(pt, 1-fLabelFraction);
+ t.CookdEdx();
+ cout<<found++<<'\r';
+ iotrack_trd = pt;
+ trd_tree.Fill();
+ if(PropagateToTPC(t)) {
+ AliTPCtrack *tpc = new AliTPCtrack(*pt,pt->GetAlpha());
+ iotrack = tpc;
+ tpc_tree.Fill();
+ delete tpc;
+ }
+ }
+ delete fSeeds->RemoveAt(i);
+ fNseeds--;
+ }
}
}
}
// by the TPC tracker.
//
-
LoadEvent();
TDirectory *savedir=gDirectory;
Int_t nseed=fSeeds->GetEntriesFast();
- Float_t foundMin = fMinClustersInTrack * fTimeBinsPerPlane * fGeom->Nplan();
+ // Float_t foundMin = fMinClustersInTrack * fTimeBinsPerPlane * fGeom->Nplan();
+ Float_t foundMin = 0;
Int_t outermost_tb = fTrSec[0]->GetOuterTimeBin();
Int_t last_tb = fTrSec[0]->GetLayerNumber(s.GetX());
// printf("seed %d: found %d out of %d expected clusters, Min is %f\n",
- // i, foundClr, expectedClr, foundMin);
+ // i, foundClr, expectedClr, foundMin);
if (foundClr >= foundMin) {
- s.CookdEdx();
- CookLabel(ps, 1-fLabelFraction);
- UseClusters(ps);
+ if(foundClr >= 2) {
+ s.CookdEdx();
+ CookLabel(ps, 1-fLabelFraction);
+ UseClusters(ps);
+ }
otrack_trd=ps;
trdTree.Fill();
cout<<found++<<'\r';
if(((expectedClr < 10) && (last_tb == outermost_tb)) ||
((expectedClr >= 10) &&
- (((Float_t) foundClr) / ((Float_t) expectedClr) >=
+ (((Float_t) foundClr) / ((Float_t) expectedClr) >=
fMinFractionOfFoundClusters) && (last_tb == outermost_tb))) {
Double_t x_tof = 375.5;
if(PropagateToOuterPlane(s,x_tof)) {
- AliTPCtrack *pt = new AliTPCtrack(*ps,ps->GetAlpha());
- otrack = pt;
- tofTree1.Fill();
- delete pt;
+ AliTPCtrack *pt = new AliTPCtrack(*ps,ps->GetAlpha());
+ otrack = pt;
+ tofTree1.Fill();
+ delete pt;
- x_tof = 381.5;
+ x_tof = 381.5;
- if(PropagateToOuterPlane(s,x_tof)) {
- AliTPCtrack *pt = new AliTPCtrack(*ps,ps->GetAlpha());
- otrack = pt;
- tofTree2.Fill();
- delete pt;
-
- Double_t x_phos = 460.;
-
- if(PropagateToOuterPlane(s,x_phos)) {
- AliTPCtrack *pt = new AliTPCtrack(*ps,ps->GetAlpha());
- otrack = pt;
- phosTree.Fill();
- delete pt;
-
- Double_t x_rich = 490+1.267;
-
- if(PropagateToOuterPlane(s,x_rich)) {
- AliTPCtrack *pt = new AliTPCtrack(*ps,ps->GetAlpha());
- otrack = pt;
- richTree.Fill();
- delete pt;
- }
- }
- }
+ if(PropagateToOuterPlane(s,x_tof)) {
+ AliTPCtrack *pt = new AliTPCtrack(*ps,ps->GetAlpha());
+ otrack = pt;
+ tofTree2.Fill();
+ delete pt;
+
+ Double_t x_phos = 460.;
+
+ if(PropagateToOuterPlane(s,x_phos)) {
+ AliTPCtrack *pt = new AliTPCtrack(*ps,ps->GetAlpha());
+ otrack = pt;
+ phosTree.Fill();
+ delete pt;
+
+ Double_t x_rich = 490+1.267;
+
+ if(PropagateToOuterPlane(s,x_rich)) {
+ AliTPCtrack *pt = new AliTPCtrack(*ps,ps->GetAlpha());
+ otrack = pt;
+ richTree.Fill();
+ delete pt;
+ }
+ }
+ }
}
}
}
wChi2 = -1;
if (road>fWideRoad) {
- if (t.GetNumberOfClusters()>4)
- cerr<<t.GetNumberOfClusters()
- <<"FindProlongation warning: Too broad road !\n";
- return 0;
+ if (t.GetNumberOfClusters()>4)
+ cerr<<t.GetNumberOfClusters()
+ <<"FindProlongation warning: Too broad road !\n";
+ return 0;
}
AliTRDcluster *cl=0;
// Find the closest correct cluster for debugging purposes
if (time_bin) {
- Float_t minDY = 1000000;
- for (Int_t i=0; i<time_bin; i++) {
- AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
- if((c->GetLabel(0) != trackIndex) &&
- (c->GetLabel(1) != trackIndex) &&
- (c->GetLabel(2) != trackIndex)) continue;
- if(TMath::Abs(c->GetY() - y) > minDY) continue;
- minDY = TMath::Abs(c->GetY() - y);
- wYcorrect = c->GetY();
- wZcorrect = c->GetZ();
-
- Double_t h01 = GetTiltFactor(c);
- wChi2 = t.GetPredictedChi2(c, h01);
- }
+ Float_t minDY = 1000000;
+ for (Int_t i=0; i<time_bin; i++) {
+ AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
+ if((c->GetLabel(0) != trackIndex) &&
+ (c->GetLabel(1) != trackIndex) &&
+ (c->GetLabel(2) != trackIndex)) continue;
+ if(TMath::Abs(c->GetY() - y) > minDY) continue;
+ minDY = TMath::Abs(c->GetY() - y);
+ wYcorrect = c->GetY();
+ wZcorrect = c->GetZ();
+
+ Double_t h01 = GetTiltFactor(c);
+ wChi2 = t.GetPredictedChi2(c, h01);
+ }
}
// Now go for the real cluster search
if (time_bin) {
- for (Int_t i=time_bin.Find(y-road); i<time_bin; i++) {
- AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
- if (c->GetY() > y+road) break;
- if (c->IsUsed() > 0) continue;
- if((c->GetZ()-z)*(c->GetZ()-z) > 3 * sz2) continue;
-
- Double_t h01 = GetTiltFactor(c);
- Double_t chi2=t.GetPredictedChi2(c,h01);
-
- if (chi2 > max_chi2) continue;
- max_chi2=chi2;
- cl=c;
- index=time_bin.GetIndex(i);
- }
-
- if(!cl) {
-
- for (Int_t i=time_bin.Find(y-road); i<time_bin; i++) {
- AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
-
- if (c->GetY() > y+road) break;
- if (c->IsUsed() > 0) continue;
- if((c->GetZ()-z)*(c->GetZ()-z) > 12 * sz2) continue;
-
- Double_t h01 = GetTiltFactor(c);
- Double_t chi2=t.GetPredictedChi2(c, h01);
-
- if (chi2 > max_chi2) continue;
- max_chi2=chi2;
- cl=c;
- index=time_bin.GetIndex(i);
- }
- }
-
-
- if (cl) {
- wYclosest = cl->GetY();
- wZclosest = cl->GetZ();
- Double_t h01 = GetTiltFactor(cl);
-
- t.SetSampledEdx(cl->GetQ()/dx,t.GetNumberOfClusters());
- if(!t.Update(cl,max_chi2,index,h01)) {
- if(!try_again--) return 0;
- }
- else try_again=fMaxGap;
- }
- else {
- if (try_again==0) break;
- try_again--;
- }
-
- /*
- if((((Int_t) wTB)%15 == 0) || (((Int_t) wTB)%15 == 14)) {
-
- printf(" %f", wIndex); //1
- printf(" %f", wTB); //2
- printf(" %f", wYrt); //3
- printf(" %f", wYclosest); //4
- printf(" %f", wYcorrect); //5
- printf(" %f", wYwindow); //6
- printf(" %f", wZrt); //7
- printf(" %f", wZclosest); //8
- printf(" %f", wZcorrect); //9
- printf(" %f", wZwindow); //10
- printf(" %f", wPx); //11
- printf(" %f", wPy); //12
- printf(" %f", wPz); //13
- printf(" %f", wSigmaC2*1000000); //14
- printf(" %f", wSigmaTgl2*1000); //15
- printf(" %f", wSigmaY2); //16
- // printf(" %f", wSigmaZ2); //17
- printf(" %f", wChi2); //17
- printf(" %f", wC); //18
- printf("\n");
- }
- */
+ for (Int_t i=time_bin.Find(y-road); i<time_bin; i++) {
+ AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
+ if (c->GetY() > y+road) break;
+ if (c->IsUsed() > 0) continue;
+ if((c->GetZ()-z)*(c->GetZ()-z) > 3 * sz2) continue;
+
+ Double_t h01 = GetTiltFactor(c);
+ Double_t chi2=t.GetPredictedChi2(c,h01);
+
+ if (chi2 > max_chi2) continue;
+ max_chi2=chi2;
+ cl=c;
+ index=time_bin.GetIndex(i);
+ }
+
+ if(!cl) {
+
+ for (Int_t i=time_bin.Find(y-road); i<time_bin; i++) {
+ AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
+
+ if (c->GetY() > y+road) break;
+ if (c->IsUsed() > 0) continue;
+ if((c->GetZ()-z)*(c->GetZ()-z) > 12 * sz2) continue;
+
+ Double_t h01 = GetTiltFactor(c);
+ Double_t chi2=t.GetPredictedChi2(c, h01);
+
+ if (chi2 > max_chi2) continue;
+ max_chi2=chi2;
+ cl=c;
+ index=time_bin.GetIndex(i);
+ }
+ }
+
+
+ if (cl) {
+ wYclosest = cl->GetY();
+ wZclosest = cl->GetZ();
+ Double_t h01 = GetTiltFactor(cl);
+
+ t.SetSampledEdx(cl->GetQ()/dx,t.GetNumberOfClusters());
+ if(!t.Update(cl,max_chi2,index,h01)) {
+ if(!try_again--) return 0;
+ }
+ else try_again=fMaxGap;
+ }
+ else {
+ if (try_again==0) break;
+ try_again--;
+ }
+
+ /*
+ if((((Int_t) wTB)%15 == 0) || (((Int_t) wTB)%15 == 14)) {
+
+ printf(" %f", wIndex); //1
+ printf(" %f", wTB); //2
+ printf(" %f", wYrt); //3
+ printf(" %f", wYclosest); //4
+ printf(" %f", wYcorrect); //5
+ printf(" %f", wYwindow); //6
+ printf(" %f", wZrt); //7
+ printf(" %f", wZclosest); //8
+ printf(" %f", wZcorrect); //9
+ printf(" %f", wZwindow); //10
+ printf(" %f", wPx); //11
+ printf(" %f", wPy); //12
+ printf(" %f", wPz); //13
+ printf(" %f", wSigmaC2*1000000); //14
+ printf(" %f", wSigmaTgl2*1000); //15
+ printf(" %f", wSigmaY2); //16
+ // printf(" %f", wSigmaZ2); //17
+ printf(" %f", wChi2); //17
+ printf(" %f", wC); //18
+ printf("\n");
+ }
+ */
}
}
}
}
// printf("label %d, pl %d, lookForCluster %d \n",
- // trackIndex, nr+1, lookForCluster);
+ // trackIndex, nr+1, lookForCluster);
if(lookForCluster) {
expectedNumberOfClusters++;
wChi2 = -1;
if (road>fWideRoad) {
- if (t.GetNumberOfClusters()>4)
- cerr<<t.GetNumberOfClusters()
- <<"FindProlongation warning: Too broad road !\n";
- return 0;
+ if (t.GetNumberOfClusters()>4)
+ cerr<<t.GetNumberOfClusters()
+ <<"FindProlongation warning: Too broad road !\n";
+ return 0;
}
AliTRDcluster *cl=0;
// Find the closest correct cluster for debugging purposes
if (time_bin) {
- Float_t minDY = 1000000;
- for (Int_t i=0; i<time_bin; i++) {
- AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
- if((c->GetLabel(0) != trackIndex) &&
- (c->GetLabel(1) != trackIndex) &&
- (c->GetLabel(2) != trackIndex)) continue;
- if(TMath::Abs(c->GetY() - y) > minDY) continue;
- minDY = TMath::Abs(c->GetY() - y);
- wYcorrect = c->GetY();
- wZcorrect = c->GetZ();
-
- Double_t h01 = GetTiltFactor(c);
- wChi2 = t.GetPredictedChi2(c, h01);
- }
+ Float_t minDY = 1000000;
+ for (Int_t i=0; i<time_bin; i++) {
+ AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
+ if((c->GetLabel(0) != trackIndex) &&
+ (c->GetLabel(1) != trackIndex) &&
+ (c->GetLabel(2) != trackIndex)) continue;
+ if(TMath::Abs(c->GetY() - y) > minDY) continue;
+ minDY = TMath::Abs(c->GetY() - y);
+ wYcorrect = c->GetY();
+ wZcorrect = c->GetZ();
+
+ Double_t h01 = GetTiltFactor(c);
+ wChi2 = t.GetPredictedChi2(c, h01);
+ }
}
// Now go for the real cluster search
if (time_bin) {
- for (Int_t i=time_bin.Find(y-road); i<time_bin; i++) {
- AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
- if (c->GetY() > y+road) break;
- if (c->IsUsed() > 0) continue;
- if((c->GetZ()-z)*(c->GetZ()-z) > 3 * sz2) continue;
-
- Double_t h01 = GetTiltFactor(c);
- Double_t chi2=t.GetPredictedChi2(c,h01);
-
- if (chi2 > max_chi2) continue;
- max_chi2=chi2;
- cl=c;
- index=time_bin.GetIndex(i);
- }
-
- if(!cl) {
-
- for (Int_t i=time_bin.Find(y-road); i<time_bin; i++) {
- AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
-
- if (c->GetY() > y+road) break;
- if (c->IsUsed() > 0) continue;
- if((c->GetZ()-z)*(c->GetZ()-z) > 2.25 * 12 * sz2) continue;
-
- Double_t h01 = GetTiltFactor(c);
- Double_t chi2=t.GetPredictedChi2(c,h01);
-
- if (chi2 > max_chi2) continue;
- max_chi2=chi2;
- cl=c;
- index=time_bin.GetIndex(i);
- }
- }
+ for (Int_t i=time_bin.Find(y-road); i<time_bin; i++) {
+ AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
+ if (c->GetY() > y+road) break;
+ // if (c->IsUsed() > 0) continue;
+ if((c->GetZ()-z)*(c->GetZ()-z) > 3 * sz2) continue;
+
+ Double_t h01 = GetTiltFactor(c);
+ Double_t chi2=t.GetPredictedChi2(c,h01);
+
+ if (chi2 > max_chi2) continue;
+ max_chi2=chi2;
+ cl=c;
+ index=time_bin.GetIndex(i);
+ }
- if (cl) {
- wYclosest = cl->GetY();
- wZclosest = cl->GetZ();
-
- t.SetSampledEdx(cl->GetQ()/dx,t.GetNumberOfClusters());
- Double_t h01 = GetTiltFactor(cl);
- if(!t.Update(cl,max_chi2,index,h01)) {
- if(!try_again--) return 0;
- }
- else try_again=fMaxGap;
- }
- else {
- if (try_again==0) break;
- try_again--;
- }
-
- /*
- if((((Int_t) wTB)%15 == 0) || (((Int_t) wTB)%15 == 14)) {
-
- printf(" %f", wIndex); //1
- printf(" %f", wTB); //2
- printf(" %f", wYrt); //3
- printf(" %f", wYclosest); //4
- printf(" %f", wYcorrect); //5
- printf(" %f", wYwindow); //6
- printf(" %f", wZrt); //7
- printf(" %f", wZclosest); //8
- printf(" %f", wZcorrect); //9
- printf(" %f", wZwindow); //10
- printf(" %f", wPx); //11
- printf(" %f", wPy); //12
- printf(" %f", wPz); //13
- printf(" %f", wSigmaC2*1000000); //14
- printf(" %f", wSigmaTgl2*1000); //15
- printf(" %f", wSigmaY2); //16
- // printf(" %f", wSigmaZ2); //17
- printf(" %f", wChi2); //17
- printf(" %f", wC); //18
- printf("\n");
- }
- */
+ if(!cl) {
+
+ for (Int_t i=time_bin.Find(y-road); i<time_bin; i++) {
+ AliTRDcluster* c=(AliTRDcluster*)(time_bin[i]);
+
+ if (c->GetY() > y+road) break;
+ // if (c->IsUsed() > 0) continue;
+ if((c->GetZ()-z)*(c->GetZ()-z) > 2.25 * 12 * sz2) continue;
+
+ Double_t h01 = GetTiltFactor(c);
+ Double_t chi2=t.GetPredictedChi2(c,h01);
+
+ if (chi2 > max_chi2) continue;
+ max_chi2=chi2;
+ cl=c;
+ index=time_bin.GetIndex(i);
+ }
+ }
+
+ if (cl) {
+ wYclosest = cl->GetY();
+ wZclosest = cl->GetZ();
+
+ t.SetSampledEdx(cl->GetQ()/dx,t.GetNumberOfClusters());
+ Double_t h01 = GetTiltFactor(cl);
+ if(!t.Update(cl,max_chi2,index,h01)) {
+ if(!try_again--) return 0;
+ }
+ else try_again=fMaxGap;
+ }
+ else {
+ if (try_again==0) break;
+ try_again--;
+ }
+
+ /*
+ if((((Int_t) wTB)%15 == 0) || (((Int_t) wTB)%15 == 14)) {
+
+ printf(" %f", wIndex); //1
+ printf(" %f", wTB); //2
+ printf(" %f", wYrt); //3
+ printf(" %f", wYclosest); //4
+ printf(" %f", wYcorrect); //5
+ printf(" %f", wYwindow); //6
+ printf(" %f", wZrt); //7
+ printf(" %f", wZclosest); //8
+ printf(" %f", wZcorrect); //9
+ printf(" %f", wZwindow); //10
+ printf(" %f", wPx); //11
+ printf(" %f", wPy); //12
+ printf(" %f", wPz); //13
+ printf(" %f", wSigmaC2*1000000); //14
+ printf(" %f", wSigmaTgl2*1000); //15
+ printf(" %f", wSigmaY2); //16
+ // printf(" %f", wSigmaZ2); //17
+ printf(" %f", wChi2); //17
+ printf(" %f", wC); //18
+ printf("\n");
+ }
+ */
}
}
}
Double_t y1=r1[is]->GetY(), z1=r1[is]->GetZ();
for (Int_t js=0; js < nl2+nl+nm+nu+nu2; js++) {
-
- const AliTRDcluster *cl;
- Double_t x2, y2, z2;
- Double_t x3=0., y3=0.;
-
- if (js<nl2) {
- if(turn != 2) continue;
- AliTRDpropagationLayer& r2=*(fTrSec[(ns-2+max_sec)%max_sec]->GetLayer(i2));
- cl=r2[js];
- y2=cl->GetY(); z2=cl->GetZ();
-
- x2= xx2*cs2+y2*sn2;
- y2=-xx2*sn2+y2*cs2;
- }
- else if (js<nl2+nl) {
- if(turn != 1) continue;
- AliTRDpropagationLayer& r2=*(fTrSec[(ns-1+max_sec)%max_sec]->GetLayer(i2));
- cl=r2[js-nl2];
- y2=cl->GetY(); z2=cl->GetZ();
-
- x2= xx2*cs+y2*sn;
- y2=-xx2*sn+y2*cs;
- }
- else if (js<nl2+nl+nm) {
- if(turn != 1) continue;
- AliTRDpropagationLayer& r2=*(fTrSec[ns]->GetLayer(i2));
- cl=r2[js-nl2-nl];
- x2=xx2; y2=cl->GetY(); z2=cl->GetZ();
- }
- else if (js<nl2+nl+nm+nu) {
- if(turn != 1) continue;
- AliTRDpropagationLayer& r2=*(fTrSec[(ns+1)%max_sec]->GetLayer(i2));
- cl=r2[js-nl2-nl-nm];
- y2=cl->GetY(); z2=cl->GetZ();
-
- x2=xx2*cs-y2*sn;
- y2=xx2*sn+y2*cs;
- }
- else {
- if(turn != 2) continue;
- AliTRDpropagationLayer& r2=*(fTrSec[(ns+2)%max_sec]->GetLayer(i2));
- cl=r2[js-nl2-nl-nm-nu];
- y2=cl->GetY(); z2=cl->GetZ();
-
- x2=xx2*cs2-y2*sn2;
- y2=xx2*sn2+y2*cs2;
- }
-
- if(TMath::Abs(z1-z2) > fMaxSeedDeltaZ12) continue;
-
- Double_t zz=z1 - z1/x1*(x1-x2);
-
- if (TMath::Abs(zz-z2)>fMaxSeedDeltaZ) continue;
-
- Double_t d=(x2-x1)*(0.-y2)-(0.-x2)*(y2-y1);
- if (d==0.) {cerr<<"TRD MakeSeeds: Straight seed !\n"; continue;}
-
- x[0]=y1;
- x[1]=z1;
- x[4]=f1trd(x1,y1,x2,y2,x3,y3);
-
- if (TMath::Abs(x[4]) > fMaxSeedC) continue;
-
- x[2]=f2trd(x1,y1,x2,y2,x3,y3);
-
- if (TMath::Abs(x[4]*x1-x[2]) >= 0.99999) continue;
-
- x[3]=f3trd(x1,y1,x2,y2,z1,z2);
-
- if (TMath::Abs(x[3]) > fMaxSeedTan) continue;
-
- Double_t a=asin(x[2]);
- Double_t zv=z1 - x[3]/x[4]*(a+asin(x[4]*x1-x[2]));
-
- if (TMath::Abs(zv)>fMaxSeedVertexZ) continue;
-
- Double_t sy1=r1[is]->GetSigmaY2(), sz1=r1[is]->GetSigmaZ2();
- Double_t sy2=cl->GetSigmaY2(), sz2=cl->GetSigmaZ2();
- Double_t sy3=fSeedErrorSY3, sy=fSeedErrorSY, sz=fSeedErrorSZ;
-
- // Tilt changes
- Double_t h01 = GetTiltFactor(r1[is]);
+
+ const AliTRDcluster *cl;
+ Double_t x2, y2, z2;
+ Double_t x3=0., y3=0.;
+
+ if (js<nl2) {
+ if(turn != 2) continue;
+ AliTRDpropagationLayer& r2=*(fTrSec[(ns-2+max_sec)%max_sec]->GetLayer(i2));
+ cl=r2[js];
+ y2=cl->GetY(); z2=cl->GetZ();
+
+ x2= xx2*cs2+y2*sn2;
+ y2=-xx2*sn2+y2*cs2;
+ }
+ else if (js<nl2+nl) {
+ if(turn != 1) continue;
+ AliTRDpropagationLayer& r2=*(fTrSec[(ns-1+max_sec)%max_sec]->GetLayer(i2));
+ cl=r2[js-nl2];
+ y2=cl->GetY(); z2=cl->GetZ();
+
+ x2= xx2*cs+y2*sn;
+ y2=-xx2*sn+y2*cs;
+ }
+ else if (js<nl2+nl+nm) {
+ if(turn != 1) continue;
+ AliTRDpropagationLayer& r2=*(fTrSec[ns]->GetLayer(i2));
+ cl=r2[js-nl2-nl];
+ x2=xx2; y2=cl->GetY(); z2=cl->GetZ();
+ }
+ else if (js<nl2+nl+nm+nu) {
+ if(turn != 1) continue;
+ AliTRDpropagationLayer& r2=*(fTrSec[(ns+1)%max_sec]->GetLayer(i2));
+ cl=r2[js-nl2-nl-nm];
+ y2=cl->GetY(); z2=cl->GetZ();
+
+ x2=xx2*cs-y2*sn;
+ y2=xx2*sn+y2*cs;
+ }
+ else {
+ if(turn != 2) continue;
+ AliTRDpropagationLayer& r2=*(fTrSec[(ns+2)%max_sec]->GetLayer(i2));
+ cl=r2[js-nl2-nl-nm-nu];
+ y2=cl->GetY(); z2=cl->GetZ();
+
+ x2=xx2*cs2-y2*sn2;
+ y2=xx2*sn2+y2*cs2;
+ }
+
+ if(TMath::Abs(z1-z2) > fMaxSeedDeltaZ12) continue;
+
+ Double_t zz=z1 - z1/x1*(x1-x2);
+
+ if (TMath::Abs(zz-z2)>fMaxSeedDeltaZ) continue;
+
+ Double_t d=(x2-x1)*(0.-y2)-(0.-x2)*(y2-y1);
+ if (d==0.) {cerr<<"TRD MakeSeeds: Straight seed !\n"; continue;}
+
+ x[0]=y1;
+ x[1]=z1;
+ x[4]=f1trd(x1,y1,x2,y2,x3,y3);
+
+ if (TMath::Abs(x[4]) > fMaxSeedC) continue;
+
+ x[2]=f2trd(x1,y1,x2,y2,x3,y3);
+
+ if (TMath::Abs(x[4]*x1-x[2]) >= 0.99999) continue;
+
+ x[3]=f3trd(x1,y1,x2,y2,z1,z2);
+
+ if (TMath::Abs(x[3]) > fMaxSeedTan) continue;
+
+ Double_t a=asin(x[2]);
+ Double_t zv=z1 - x[3]/x[4]*(a+asin(x[4]*x1-x[2]));
+
+ if (TMath::Abs(zv)>fMaxSeedVertexZ) continue;
+
+ Double_t sy1=r1[is]->GetSigmaY2(), sz1=r1[is]->GetSigmaZ2();
+ Double_t sy2=cl->GetSigmaY2(), sz2=cl->GetSigmaZ2();
+ Double_t sy3=fSeedErrorSY3, sy=fSeedErrorSY, sz=fSeedErrorSZ;
+
+ // Tilt changes
+ Double_t h01 = GetTiltFactor(r1[is]);
sy1=sy1+sz1*h01*h01;
Double_t syz=sz1*(-h01);
- // end of tilt changes
-
+ // end of tilt changes
+
Double_t f40=(f1trd(x1,y1+sy,x2,y2,x3,y3)-x[4])/sy;
Double_t f42=(f1trd(x1,y1,x2,y2+sy,x3,y3)-x[4])/sy;
Double_t f43=(f1trd(x1,y1,x2,y2,x3,y3+sy)-x[4])/sy;
Double_t f32=(f3trd(x1,y1,x2,y2+sy,z1,z2)-x[3])/sy;
Double_t f34=(f3trd(x1,y1,x2,y2,z1,z2+sz)-x[3])/sz;
-
+
c[0]=sy1;
- // c[1]=0.; c[2]=sz1;
- c[1]=syz; c[2]=sz1*100;
+ // c[1]=0.; c[2]=sz1;
+ c[1]=syz; c[2]=sz1*100;
c[3]=f20*sy1; c[4]=0.; c[5]=f20*sy1*f20+f22*sy2*f22+f23*sy3*f23;
c[6]=f30*sy1; c[7]=f31*sz1; c[8]=f30*sy1*f20+f32*sy2*f22;
c[9]=f30*sy1*f30+f31*sz1*f31+f32*sy2*f32+f34*sz2*f34;
c[13]=f30*sy1*f40+f32*sy2*f42;
c[14]=f40*sy1*f40+f42*sy2*f42+f43*sy3*f43;
-
- UInt_t index=r1.GetIndex(is);
-
- AliTRDtrack *track=new AliTRDtrack(r1[is],index,x,c,x1,ns*alpha+shift);
-
- Int_t rc=FollowProlongation(*track, i2);
-
- if ((rc < 1) ||
- (track->GetNumberOfClusters() <
- (outer-inner)*fMinClustersInSeed)) delete track;
- else {
- fSeeds->AddLast(track); fNseeds++;
- cerr<<"\r found seed "<<fNseeds;
- }
+
+ UInt_t index=r1.GetIndex(is);
+
+ AliTRDtrack *track=new AliTRDtrack(r1[is],index,x,c,x1,ns*alpha+shift);
+
+ Int_t rc=FollowProlongation(*track, i2);
+
+ if ((rc < 1) ||
+ (track->GetNumberOfClusters() <
+ (outer-inner)*fMinClustersInSeed)) delete track;
+ else {
+ fSeeds->AddLast(track); fNseeds++;
+ cerr<<"\r found seed "<<fNseeds;
+ }
}
}
}
label=c->GetLabel(k);
label_added=kFALSE; j=0;
if (label >= 0) {
- while ( (!label_added) && ( j < range ) ) {
- if (s[j][0]==label || s[j][1]==0) {
- s[j][0]=label;
- s[j][1]=s[j][1]+1;
- label_added=kTRUE;
- }
- j++;
- }
+ while ( (!label_added) && ( j < range ) ) {
+ if (s[j][0]==label || s[j][1]==0) {
+ s[j][0]=label;
+ s[j][1]=s[j][1]+1;
+ label_added=kTRUE;
+ }
+ j++;
+ }
}
}
}
{
// Parametrised "expected" error of the cluster reconstruction in Z
- Double_t s = 6 * 6 /12.;
+ Double_t s = 9 * 9 /12.;
return s;
}
//_______________________________________________________
AliTRDtracker::AliTRDpropagationLayer::AliTRDpropagationLayer(Double_t x,
- Double_t dx, Double_t rho, Double_t rad_length, Int_t tb_index)
+ Double_t dx, Double_t rho, Double_t rad_length, Int_t tb_index)
{
//
// AliTRDpropagationLayer constructor
//_______________________________________________________
void AliTRDtracker::AliTRDpropagationLayer::SetHole(
- Double_t Zmax, Double_t Ymax, Double_t rho,
- Double_t rad_length, Double_t Yc, Double_t Zc)
+ Double_t Zmax, Double_t Ymax, Double_t rho,
+ Double_t rad_length, Double_t Yc, Double_t Zc)
{
//
// Sets hole in the layer
x = xin + i*dx + dx/2;
ppl = new AliTRDpropagationLayer(x,dx,rho,rad_length,-1);
if((fGeom->GetPHOShole()) && (fGeomSector >= 2) && (fGeomSector <= 6)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
if((fGeom->GetRICHhole()) && (fGeomSector >= 12) && (fGeomSector <= 14)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
InsertLayer(ppl);
}
ppl = new AliTRDpropagationLayer(x,dx,rho,rad_length,tb_index);
ppl->SetYmax(Ymax);
for(Int_t ch = 0; ch < nChambers; ch++) {
- ppl->SetZmax(ch, Zc[ch], Zmax[ch]);
+ ppl->SetZmax(ch, Zc[ch], Zmax[ch]);
}
if((fGeom->GetPHOShole()) && (fGeomSector >= 2) && (fGeomSector <= 6)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
if((fGeom->GetRICHhole()) && (fGeomSector >= 12) && (fGeomSector <= 14)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
InsertLayer(ppl);
}
ppl = new AliTRDpropagationLayer(x,dx,rho,rad_length,tb_index);
ppl->SetYmax(Ymax);
for(Int_t ch = 0; ch < nChambers; ch++) {
- ppl->SetZmax(ch, Zc[ch], Zmax[ch]);
+ ppl->SetZmax(ch, Zc[ch], Zmax[ch]);
}
if((fGeom->GetPHOShole()) && (fGeomSector >= 2) && (fGeomSector <= 6)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
if((fGeom->GetRICHhole()) && (fGeomSector >= 12) && (fGeomSector <= 14)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
InsertLayer(ppl);
}
x = xin + i*dx + dx/2;
ppl = new AliTRDpropagationLayer(x,dx,rho,rad_length,-1);
if((fGeom->GetPHOShole()) && (fGeomSector >= 2) && (fGeomSector <= 6)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
if((fGeom->GetRICHhole()) && (fGeomSector >= 12) && (fGeomSector <= 14)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
InsertLayer(ppl);
}
x = xin + i*dx + dx/2;
ppl = new AliTRDpropagationLayer(x,dx,rho,rad_length,-1);
if((fGeom->GetPHOShole()) && (fGeomSector >= 2) && (fGeomSector <= 6)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
if((fGeom->GetRICHhole()) && (fGeomSector >= 12) && (fGeomSector <= 14)) {
- holeYmax = x*TMath::Tan(0.5*alpha);
- ppl->SetHole(holeYmax, holeZmax);
+ holeYmax = x*TMath::Tan(0.5*alpha);
+ ppl->SetHole(holeYmax, holeZmax);
}
InsertLayer(ppl);
}
if(index >= (Int_t) kMAX_TIME_BIN_INDEX) {
printf("*** AliTRDtracker::MapTimeBinLayers: \n");
printf(" index %d exceeds allowed maximum of %d!\n",
- index, kMAX_TIME_BIN_INDEX-1);
+ index, kMAX_TIME_BIN_INDEX-1);
continue;
}
fTimeBinIndex[index] = i;
if(gap > 0.01) {
printf("*** warning: layers %d and %d have a large gap:\n",i,i+1);
printf(" (%f - %f) - (%f + %f) = %f\n",
- x2, dx2/2, x1, dx1, gap);
+ x2, dx2/2, x1, dx1, gap);
}
}
}
void AliTRDtracker::AliTRDpropagationLayer::GetPropagationParameters(
Double_t y, Double_t z, Double_t &dx, Double_t &rho, Double_t &rad_length,
- Bool_t &lookForCluster) const
+ Bool_t &lookForCluster) const
{
//
// Returns radial step <dx>, density <rho>, rad. length <rad_length>,
if(fTimeBinIndex >= 0) {
for(Int_t ch = 0; ch < (Int_t) kZONES; ch++) {
if(TMath::Abs(z - fZc[ch]) < fZmax[ch])
- lookForCluster = kTRUE;
+ lookForCluster = kTRUE;
+ // else { rho = 1.7; rad_length = 33.0; } // G10
}
if(TMath::Abs(y) > fYmax) lookForCluster = kFALSE;
if(!lookForCluster) {
//______________________________________________________
void AliTRDtracker::AliTRDpropagationLayer::InsertCluster(AliTRDcluster* c,
- UInt_t index) {
+ UInt_t index) {
// Insert cluster in cluster array.
// Clusters are sorted according to Y coordinate.