1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //-----------------------------------------------------------------//
18 // AliTOFtracker Class //
19 // Task: Perform association of the ESD tracks to TOF Clusters //
20 // and Update ESD track with associated TOF Cluster parameters //
22 //-----------------------------------------------------------------//
26 #include "TClonesArray.h"
28 #include "TTreeStream.h"
30 #include "AliESDEvent.h"
31 #include "AliESDtrack.h"
33 #include "AliTOFRecoParam.h"
34 #include "AliTOFReconstructor.h"
35 #include "AliTOFcluster.h"
36 #include "AliTOFGeometry.h"
37 #include "AliTOFtrackerMI.h"
38 #include "AliTOFtrack.h"
39 #include "AliTOFpidESD.h"
43 extern TGeoManager *gGeoManager;
45 ClassImp(AliTOFtrackerMI)
47 //_____________________________________________________________________________
48 AliTOFtrackerMI::AliTOFtrackerMI():
65 fTracks(new TClonesArray("AliTOFtrack")),
66 fSeeds(new TClonesArray("AliESDtrack")),
69 //AliTOFtrackerMI main Ctor
71 fDy=AliTOFGeometry::XPad();
72 fDz=AliTOFGeometry::ZPad();
73 fDebugStreamer = new TTreeSRedirector("TOFdebug.root");
75 //_____________________________________________________________________________
76 AliTOFtrackerMI::AliTOFtrackerMI(const AliTOFtrackerMI &t):
94 fTracks(new TClonesArray("AliTOFtrack")),
95 fSeeds(new TClonesArray("AliESDtrack")),
98 //AliTOFtrackerMI copy Ctor
101 fNseedsTOF=t.fNseedsTOF;
102 fngoodmatch=t.fngoodmatch;
103 fnbadmatch=t.fnbadmatch;
104 fnunmatch=t.fnunmatch;
106 fRecoParam = t.fRecoParam;
110 fTOFHeigth=t.fTOFHeigth;
120 //_________________________________________________________________________________
121 AliTOFtrackerMI& AliTOFtrackerMI::operator=(const AliTOFtrackerMI &t)
123 //AliTOFtrackerMI assignment operator
125 this->fNseeds=t.fNseeds;
126 this->fNseedsTOF=t.fNseedsTOF;
127 this->fngoodmatch=t.fngoodmatch;
128 this->fnbadmatch=t.fnbadmatch;
129 this->fnunmatch=t.fnunmatch;
130 this->fnmatch=t.fnmatch;
131 this->fRecoParam = t.fRecoParam;
132 this->fGeom = t.fGeom;
135 this->fTOFHeigth=t.fTOFHeigth;
140 this->fSeeds=t.fSeeds;
141 this->fTracks=t.fTracks;
147 //_____________________________________________________________________________
148 AliTOFtrackerMI::~AliTOFtrackerMI(){
152 if (fDebugStreamer) {
153 //fDebugStreamer->Close();
154 delete fDebugStreamer;
171 //_____________________________________________________________________________
172 Int_t AliTOFtrackerMI::PropagateBack(AliESDEvent* event) {
174 // Gets seeds from ESD event and Match with TOF Clusters
177 // initialize RecoParam for current event
179 AliInfo("Initializing params for TOF... ");
181 fRecoParam = AliTOFReconstructor::GetRecoParam(); // instantiate reco param from STEER...
183 if (fRecoParam == 0x0) {
184 AliFatal("No Reco Param found for TOF!!!");
186 //fRecoParam->Dump();
187 if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
188 //fRecoParam->PrintParameters();
191 parPID[0]=fRecoParam->GetTimeResolution();
192 parPID[1]=fRecoParam->GetTimeNSigma();
193 fPid=new AliTOFpidESD(parPID);
195 //Initialise some counters
204 Int_t ntrk=event->GetNumberOfTracks();
206 TClonesArray &aESDTrack = *fSeeds;
209 //Load ESD tracks into a local Array of ESD Seeds
211 for (Int_t i=0; i<fNseeds; i++) {
212 AliESDtrack *t=event->GetTrack(i);
213 new(aESDTrack[i]) AliESDtrack(*t);
216 //Prepare ESD tracks candidates for TOF Matching
219 //First Step with Strict Matching Criterion
220 //MatchTracks(kFALSE);
222 //Second Step with Looser Matching Criterion
223 //MatchTracks(kTRUE);
224 MatchTracksMI(kFALSE); // assign track to clusters
225 MatchTracksMI(kTRUE); // assign clusters to esd
227 Info("PropagateBack","Number of matched tracks: %d",fnmatch);
228 Info("PropagateBack","Number of good matched tracks: %d",fngoodmatch);
229 Info("PropagateBack","Number of bad matched tracks: %d",fnbadmatch);
231 //Update the matched ESD tracks
233 for (Int_t i=0; i<ntrk; i++) {
234 AliESDtrack *t=event->GetTrack(i);
235 AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
236 if(seed->GetTOFsignal()>0){
237 t->SetTOFsignal(seed->GetTOFsignal());
238 t->SetTOFcluster(seed->GetTOFcluster());
240 seed->GetTOFLabel(tlab);
241 t->SetTOFLabel(tlab);
242 AliTOFtrack *track = new AliTOFtrack(*seed);
245 seed->GetTOFInfo(info);
246 seed->GetIntegratedTimes(times);
247 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
248 t->SetIntegratedLength(seed->GetIntegratedLength());
249 t->SetIntegratedTimes(times);
250 t->SetTOFsignalToT(seed->GetTOFsignalToT());
251 t->SetTOFCalChannel(seed->GetTOFCalChannel());
260 fPid->MakePID(event);
267 //_________________________________________________________________________
268 void AliTOFtrackerMI::CollectESD() {
269 //prepare the set of ESD tracks to be matched to clusters in TOF
271 TClonesArray &aTOFTrack = *fTracks;
274 for (Int_t i=0; i<fNseeds; i++) {
276 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
277 if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
279 // TRD good tracks, already propagated at 372 cm
281 AliTOFtrack *track = new AliTOFtrack(*t); // New
282 Double_t x = track->GetX(); //New
284 if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) &&
285 ( x >= AliTOFGeometry::RinTOF()) ){
286 track->SetSeedIndex(i);
287 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
288 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
294 // Propagate the rest of TPCbp
297 if(track->PropagateToInnerTOF()){ // temporary solution
298 track->SetSeedIndex(i);
299 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
300 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
309 printf("TRD\tOn\t%d\tOff\t%d\n",c0,c1);
311 // Sort according uncertainties on track position
324 //_________________________________________________________________________
325 void AliTOFtrackerMI::MatchTracks( Bool_t /*mLastStep*/){
330 //_________________________________________________________________________
331 void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){
333 //Match ESD tracks to clusters in TOF
334 const Float_t kTofOffset = 26; // time offset
335 const Float_t kMinQuality = -6.; // minimal quality
336 const Float_t kMaxQualityD = 1.; // max delta quality if cluster used
337 const Float_t kForbiddenR = 0.1; // minimal PID according TPC
339 static const Double_t kMasses[]={
340 0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
343 Int_t nSteps=(Int_t)(fTOFHeigth/0.1);
345 //AliTOFcalib *calib = new AliTOFcalib(); // AdC
347 //PH Arrays (moved outside of the loop)
348 Float_t * trackPos[4];
349 for (Int_t ii=0; ii<4; ii++) trackPos[ii] = new Float_t[nSteps];
350 Int_t * clind = new Int_t[fN];
355 Float_t quality[1000];
356 Float_t dist3D[1000][6];
357 Double_t times[1000][6];
358 Float_t mintimedist[1000];
359 Float_t likelihood[1000];
360 Float_t length[1000];
361 AliTOFcluster *clusters[1000];
365 for (Int_t i=0; i<fNseedsTOF; i++) {
367 AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(i);
368 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
369 Bool_t hasTime = ( (t->GetStatus()& AliESDtrack::kTIME)>0) ? kTRUE:kFALSE; // did we integrate time
370 Float_t trdquality = t->GetTRDQuality();
374 t->GetTPCpid(tpcpid);
376 for (Int_t ipid=0;ipid<5;ipid++){
377 sumpid+=tpcpid[ipid];
379 for (Int_t ipid=0;ipid<5;ipid++){
380 if (sumpid>0) tpcpid[ipid]/=sumpid;
386 if (trdquality<0) continue; // no chance
388 AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
390 //propagat track to the middle of TOF
392 Float_t xs = 379.2; // should be defined in the TOF geometry
393 Double_t ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
395 Double_t ysect=trackTOFin->GetYat(xs,skip);
398 ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
399 ysect=trackTOFin->GetYat(xs,skip);
402 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
405 } else if (ysect <-ymax) {
406 if (!trackTOFin->Rotate(-AliTOFGeometry::GetAlpha())) {
410 if(!trackTOFin->PropagateTo(xs)) {
414 // Determine a window around the track
417 trackTOFin->GetExternalParameters(x,par);
419 trackTOFin->GetExternalCovariance(cov);
420 Float_t scalefact=3.;
423 ((5*TMath::Sqrt(cov[0]) + 3.*fDy +10.*TMath::Abs(par[2]))/fR);
426 (5*TMath::Sqrt(cov[2]) + 3.*fDz +10.*TMath::Abs(par[3]));
428 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
429 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
430 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
435 // find the clusters in the window of the track
437 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
438 AliTOFcluster *c=fClusters[k];
439 if (c->GetZ() > z+dz) break;
440 // if (c->IsUsed()) continue;
442 Double_t dph=TMath::Abs(c->GetPhi()-phi);
443 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
444 if (TMath::Abs(dph)>dphi) continue;
451 // select close clusters
453 Double_t mom=t->GetP();
454 // Bool_t dump = kTRUE;
455 for (Int_t icl=0; icl<nc; icl++){
456 Float_t distances[5];
457 if (nfound>=1000) break;
458 index[nfound]=clind[icl];
459 AliTOFcluster *cluster = fClusters[clind[icl]];
460 GetLinearDistances(trackTOFin,cluster, distances);
461 dist3D[nfound][0] = distances[4];
462 dist3D[nfound][1] = distances[1];
463 dist3D[nfound][2] = distances[2];
465 if (TMath::Abs(dist3D[nfound][1])>20 || TMath::Abs(dist3D[nfound][2])>20) continue;
467 GetLikelihood(distances[1],distances[2],cov,trackTOFin, dist3D[nfound][3], dist3D[nfound][4]);
470 if (dist3D[nfound][3]*dist3D[nfound][4]<0.00000000000001) continue; // log likelihood
471 if (TMath::Log(dist3D[nfound][3]*dist3D[nfound][4])<-9) continue; // log likelihood
473 clusters[nfound] = cluster;
475 //length and TOF updates
476 trackTOFin->GetIntegratedTimes(times[nfound]);
477 length[nfound] = trackTOFin->GetIntegratedLength();
478 length[nfound]+=distances[4];
479 mintimedist[nfound]=1000;
480 Double_t tof2=AliTOFGeometry::TdcBinWidth()*cluster->GetTDC()+kTofOffset; // in ps
481 // Float_t tgamma = TMath::Sqrt(cluster->GetR()*cluster->GetR()+cluster->GetZ()*cluster->GetZ())/0.03; //time for "primary" gamma
482 //if (trackTOFin->GetPt()<0.7 && TMath::Abs(tgamma-tof2)<350) continue; // gamma conversion candidate - TEMPORARY
483 for(Int_t j=0;j<=5;j++){
484 Double_t mass=kMasses[j];
485 times[nfound][j]+=distances[4]/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom; // add time distance
486 if ( TMath::Abs(times[nfound][j]-tof2)<mintimedist[nfound] && tpcpid[j]>kForbiddenR){
487 mintimedist[nfound]=TMath::Abs(times[nfound][j]-tof2);
491 Float_t liketime = TMath::Exp(-mintimedist[nfound]/90.)+0.25*TMath::Exp(-mintimedist[nfound]/180.);
492 if (!hasTime) liketime=0.2;
493 likelihood[nfound] = TMath::Log(dist3D[nfound][3]*dist3D[nfound][4]*liketime);
495 if (TMath::Log(dist3D[nfound][3]*dist3D[nfound][4])<-1){
496 if (likelihood[nfound]<-9.) continue;
507 //choose the best cluster
509 //Float_t quality[1000];
511 for (Int_t kk=0; kk<1000; kk++) quality[kk]=0;
513 AliTOFcluster * cgold=0;
515 for (Int_t icl=0;icl<nfound;icl++){
516 quality[icl] = dist3D[icl][3]*dist3D[icl][4];
518 TMath::Sort(nfound,quality,index,kTRUE);
520 cgold = clusters[igold];
521 if (nfound>1 &&likelihood[index[1]]>likelihood[index[0]]){
522 if ( quality[index[0]]<quality[index[1]]+0.5){
524 cgold = clusters[igold];
529 Float_t qualityGold = TMath::Log(0.0000001+(quality[igold]*(0.1+TMath::Exp(-mintimedist[igold]/80.))*(0.2+trdquality)));
531 if (cgold->GetQuality()<qualityGold) cgold->SetQuality(qualityGold);
536 //signed better cluster
537 if (cgold->GetQuality()>qualityGold+kMaxQualityD) continue;
538 if (2.*qualityGold-cgold->GetQuality()<kMinQuality) continue;
543 for (Int_t icl=0;icl<nfound;icl++){
545 (clusters[index[icl]]->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
547 (clusters[index[icl]]->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
549 (clusters[index[icl]]->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
556 if (inonfake==0) fngoodmatch++;
562 tlab[0]=cgold->GetLabel(0);
563 tlab[1]=cgold->GetLabel(1);
564 tlab[2]=cgold->GetLabel(2);
565 // Double_t tof2=25.*cgold->GetTDC()-350; // in ps
566 Double_t tof2=AliTOFGeometry::TdcBinWidth()*cgold->GetTDC()+kTofOffset; // in ps
567 Float_t tgamma = TMath::Sqrt(cgold->GetR()*cgold->GetR()+cgold->GetZ()*cgold->GetZ())/0.03;
568 Float_t info[11]={dist3D[igold][0],dist3D[igold][1],dist3D[igold][2],dist3D[igold][3],dist3D[igold][4],mintimedist[igold],
569 -1,tgamma, qualityGold,cgold->GetQuality(),0};
570 // GetLinearDistances(trackTOFin,cgold,&info[6]);
573 // info[7] = mintimedist[index[inonfake]];
576 // Store quantities to be used for TOF Calibration
577 Float_t tToT=cgold->GetToT(); // in ps
578 t->SetTOFsignalToT(tToT);
580 ind[0]=cgold->GetDetInd(0);
581 ind[1]=cgold->GetDetInd(1);
582 ind[2]=cgold->GetDetInd(2);
583 ind[3]=cgold->GetDetInd(3);
584 ind[4]=cgold->GetDetInd(4);
585 Int_t calindex = AliTOFGeometry::GetIndex(ind);
586 t->SetTOFCalChannel(calindex);
589 t->SetTOFsignal(tof2);
590 t->SetTOFcluster(cgold->GetIndex());
592 AliDebug(2, Form("%7i %7i %10i %10i %10i %10i %7i",
595 TMath::Abs(trackTOFin->GetLabel()),
596 tlab[0], tlab[1], tlab[2],
599 AliTOFtrack *trackTOFout = new AliTOFtrack(*t);
600 trackTOFout->PropagateTo(379.);
601 t->UpdateTrackParams(trackTOFout,AliESDtrack::kTOFout);
602 t->SetIntegratedLength(length[igold]);
603 t->SetIntegratedTimes(times[igold]);
604 t->SetTOFLabel(tlab);
613 for (Int_t ii=0; ii<4; ii++) delete [] trackPos[ii];
615 //delete calib; // AdC
617 //_________________________________________________________________________
619 Int_t AliTOFtrackerMI::LoadClusters(TTree *cTree) {
620 //--------------------------------------------------------------------
621 //This function loads the TOF clusters
622 //--------------------------------------------------------------------
624 TBranch *branch=cTree->GetBranch("TOF");
626 AliError("can't get the branch with the TOF clusters !");
630 static TClonesArray dummy("AliTOFcluster",10000);
632 TClonesArray *clusters=&dummy;
633 branch->SetAddress(&clusters);
636 Int_t nc=clusters->GetEntriesFast();
637 AliInfo(Form("Number of clusters: %d",nc));
639 for (Int_t i=0; i<nc; i++) {
640 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
642 fClusters[i]=new AliTOFcluster(*c); fN++;
644 //AliInfo(Form("%4i %4i %f %f %f %f %f %2i %1i %2i %1i %2i",i, fClusters[i]->GetIndex(),fClusters[i]->GetZ(),fClusters[i]->GetR(),fClusters[i]->GetPhi(), fClusters[i]->GetTDC(),fClusters[i]->GetADC(),fClusters[i]->GetDetInd(0),fClusters[i]->GetDetInd(1),fClusters[i]->GetDetInd(2),fClusters[i]->GetDetInd(3),fClusters[i]->GetDetInd(4)));
645 //AliInfo(Form("%i %f",i, fClusters[i]->GetZ()));
648 //AliInfo(Form("Number of clusters: %d",fN));
652 //_________________________________________________________________________
653 void AliTOFtrackerMI::UnloadClusters() {
654 //--------------------------------------------------------------------
655 //This function unloads TOF clusters
656 //--------------------------------------------------------------------
657 for (Int_t i=0; i<fN; i++) {
667 //_________________________________________________________________________
668 Int_t AliTOFtrackerMI::InsertCluster(AliTOFcluster *c) {
669 //--------------------------------------------------------------------
670 //This function adds a cluster to the array of clusters sorted in Z
671 //--------------------------------------------------------------------
672 if (fN==kMaxCluster) {
673 AliError("Too many clusters !");
677 if (fN==0) {fClusters[fN++]=c; return 0;}
678 Int_t i=FindClusterIndex(c->GetZ());
679 memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTOFcluster*));
680 fClusters[i]=c; fN++;
685 //_________________________________________________________________________
686 Int_t AliTOFtrackerMI::FindClusterIndex(Double_t z) const {
687 //--------------------------------------------------------------------
688 // This function returns the index of the nearest cluster
689 //--------------------------------------------------------------------
691 if (z <= fClusters[0]->GetZ()) return 0;
692 if (z > fClusters[fN-1]->GetZ()) return fN;
693 Int_t b=0, e=fN-1, m=(b+e)/2;
694 for (; b<e; m=(b+e)/2) {
695 if (z > fClusters[m]->GetZ()) b=m+1;
703 Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *cluster, Float_t distances[5])
706 // calclates distance between cluster and track
707 // use linear aproximation
709 const Float_t kRaddeg = 180/3.14159265358979312;
711 // Float_t tiltangle = fGeom->GetAngles(cluster->fdetIndex[1],cluster->fdetIndex[2])/kRaddeg; //tiltangle
713 cind[0]= cluster->GetDetInd(0);
714 cind[1]= cluster->GetDetInd(1);
715 cind[2]= cluster->GetDetInd(2);
716 cind[3]= cluster->GetDetInd(3);
717 cind[4]= cluster->GetDetInd(4);
718 Float_t tiltangle = AliTOFGeometry::GetAngles(cluster->GetDetInd(1),cluster->GetDetInd(2))/kRaddeg; //tiltangle
720 Float_t cpos[3]; //cluster position
721 Float_t cpos0[3]; //cluster position
722 // fGeom->GetPos(cluster->fdetIndex,cpos);
723 //fGeom->GetPos(cluster->fdetIndex,cpos0);
725 fGeom->GetPos(cind,cpos);
726 fGeom->GetPos(cind,cpos0);
728 Float_t phi = TMath::ATan2(cpos[1],cpos[0]);
729 if(phi<0) phi=2.*TMath::Pi()+phi;
730 // Get the local angle in the sector philoc
731 Float_t phiangle = (Int_t (phi*kRaddeg/20.) + 0.5)*20./kRaddeg;
736 track->GetPxPyPz(dir);
737 dir[0]/=track->GetP();
738 dir[1]/=track->GetP();
739 dir[2]/=track->GetP();
743 Float_t sinphi = TMath::Sin(phiangle);
744 Float_t cosphi = TMath::Cos(phiangle);
745 Float_t sinth = TMath::Sin(tiltangle);
746 Float_t costh = TMath::Cos(tiltangle);
749 temp = cpos[0]*cosphi+cpos[1]*sinphi;
750 cpos[1] = -cpos[0]*sinphi+cpos[1]*cosphi;
752 temp = v0[0]*cosphi+v0[1]*sinphi;
753 v0[1] = -v0[0]*sinphi+v0[1]*cosphi;
756 temp = cpos[0]*costh+cpos[2]*sinth;
757 cpos[2] = -cpos[0]*sinth+cpos[2]*costh;
759 temp = v0[0]*costh+v0[2]*sinth;
760 v0[2] = -v0[0]*sinth+v0[2]*costh;
764 //rotate direction vector
766 temp = dir[0]*cosphi+dir[1]*sinphi;
767 dir[1] = -dir[0]*sinphi+dir[1]*cosphi;
770 temp = dir[0]*costh+dir[2]*sinth;
771 dir[2] = -dir[0]*sinth+dir[2]*costh;
775 Float_t k = (cpos[0]-v0[0])/dir[0];
776 v3[0] = v0[0]+k*dir[0];
777 v3[1] = v0[1]+k*dir[1];
778 v3[2] = v0[2]+k*dir[2];
780 distances[0] = v3[0]-cpos[0];
781 distances[1] = v3[1]-cpos[1];
782 distances[2] = v3[2]-cpos[2];
783 distances[3] = TMath::Sqrt( distances[0]*distances[0]+distances[1]*distances[1]+distances[2]*distances[2]); //distance
784 distances[4] = k; //length
787 // Debuging part of the matching
789 if (track->GetLabel()==cluster->GetLabel(0) ||track->GetLabel()==cluster->GetLabel(1) ){
790 TTreeSRedirector& cstream = *fDebugStreamer;
791 Float_t tdc = cluster->GetTDC();
798 "Dist0="<<distances[0]<<
799 "Dist1="<<distances[1]<<
800 "Dist2="<<distances[2]<<
809 void AliTOFtrackerMI::GetLikelihood(Float_t dy, Float_t dz, const Double_t *cov, AliTOFtrack * /*track*/, Float_t & py, Float_t &pz)
812 // get likelihood - track covariance taken
813 // 75 % of gauss with expected sigma
814 // 25 % of gauss with extended sigma
816 Double_t kMaxSigmaY = 0.6; // ~ 90% of TRD tracks
817 Double_t kMaxSigmaZ = 1.2; // ~ 90% of TRD tracks
818 Double_t kMeanSigmaY = 0.25; // mean TRD sigma
819 Double_t kMeanSigmaZ = 0.5; // mean TRD sigma
822 Float_t normwidth, normd, p0,p1;
823 Float_t sigmay = TMath::Max(TMath::Sqrt(cov[0]+kMeanSigmaY*kMeanSigmaY),kMaxSigmaY);
824 Float_t sigmaz = TMath::Max(TMath::Sqrt(cov[2]+kMeanSigmaZ*kMeanSigmaZ),kMaxSigmaZ);
829 // py calculation - 75% admixture of original sigma - 25% tails
831 normwidth = fDy/sigmay;
833 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
834 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
837 normwidth = fDy/(3.*sigmay);
838 normd = dy/(3.*sigmay);
839 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
840 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
843 // pz calculation - 75% admixture of original sigma - 25% tails
845 normwidth = fDz/sigmaz;
847 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
848 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
851 normwidth = fDz/(3.*sigmaz);
852 normd = dz/(3.*sigmaz);
853 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
854 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
857 //_________________________________________________________________________
859 void AliTOFtrackerMI::FillClusterArray(TObjArray* arr) const
862 // Returns the TOF cluster array
868 for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);