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");
76 //_____________________________________________________________________________
77 AliTOFtrackerMI::~AliTOFtrackerMI(){
82 //fDebugStreamer->Close();
83 delete fDebugStreamer;
100 //_____________________________________________________________________________
101 Int_t AliTOFtrackerMI::PropagateBack(AliESDEvent* event) {
103 // Gets seeds from ESD event and Match with TOF Clusters
106 // initialize RecoParam for current event
108 AliInfo("Initializing params for TOF... ");
110 fRecoParam = AliTOFReconstructor::GetRecoParam(); // instantiate reco param from STEER...
112 if (fRecoParam == 0x0) {
113 AliFatal("No Reco Param found for TOF!!!");
115 //fRecoParam->Dump();
116 //if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
117 //fRecoParam->PrintParameters();
120 parPID[0]=fRecoParam->GetTimeResolution();
121 parPID[1]=fRecoParam->GetTimeNSigma();
122 fPid=new AliTOFpidESD(parPID);
124 //Initialise some counters
133 Int_t ntrk=event->GetNumberOfTracks();
135 TClonesArray &aESDTrack = *fSeeds;
138 //Load ESD tracks into a local Array of ESD Seeds
140 for (Int_t i=0; i<fNseeds; i++) {
141 AliESDtrack *t=event->GetTrack(i);
142 new(aESDTrack[i]) AliESDtrack(*t);
145 //Prepare ESD tracks candidates for TOF Matching
148 //First Step with Strict Matching Criterion
149 //MatchTracks(kFALSE);
151 //Second Step with Looser Matching Criterion
152 //MatchTracks(kTRUE);
153 MatchTracksMI(kFALSE); // assign track to clusters
154 MatchTracksMI(kTRUE); // assign clusters to esd
156 Info("PropagateBack","Number of matched tracks: %d",fnmatch);
157 Info("PropagateBack","Number of good matched tracks: %d",fngoodmatch);
158 Info("PropagateBack","Number of bad matched tracks: %d",fnbadmatch);
160 //Update the matched ESD tracks
162 for (Int_t i=0; i<ntrk; i++) {
163 AliESDtrack *t=event->GetTrack(i);
164 AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
166 if ( (seed->GetStatus()&AliESDtrack::kTOFin)!=0 ) {
167 t->SetStatus(AliESDtrack::kTOFin);
168 //if(seed->GetTOFsignal()>0){
169 if ( (seed->GetStatus()&AliESDtrack::kTOFout)!=0 ) {
170 t->SetTOFsignal(seed->GetTOFsignal());
171 t->SetTOFcluster(seed->GetTOFcluster());
173 seed->GetTOFLabel(tlab);
174 t->SetTOFLabel(tlab);
175 AliTOFtrack *track = new AliTOFtrack(*seed);
177 seed->GetIntegratedTimes(times);
178 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
179 t->SetIntegratedLength(seed->GetIntegratedLength());
180 t->SetIntegratedTimes(times);
181 t->SetTOFsignalToT(seed->GetTOFsignalToT());
182 t->SetTOFCalChannel(seed->GetTOFCalChannel());
185 seed->GetTOFInfo(info);
194 fPid->MakePID(event);
201 //_________________________________________________________________________
202 void AliTOFtrackerMI::CollectESD() {
203 //prepare the set of ESD tracks to be matched to clusters in TOF
205 TClonesArray &aTOFTrack = *fTracks;
208 for (Int_t i=0; i<fNseeds; i++) {
210 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
211 if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
213 AliTOFtrack *track = new AliTOFtrack(*t); // New
214 Float_t x = (Float_t)track->GetX(); //New
216 // TRD good tracks, already propagated at 371 cm
217 if ( ( (t->GetStatus()&AliESDtrack::kTRDout)!=0 ) &&
218 ( x >= AliTOFGeometry::Rmin() ) ) {
219 if ( track->PropagateToInnerTOF() ) {
220 track->SetSeedIndex(i);
221 t->UpdateTrackParams(track,AliESDtrack::kTOFin);
222 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
229 // Propagate the rest of TPCbp
231 if ( track->PropagateToInnerTOF() ) { // temporary solution
232 track->SetSeedIndex(i);
233 t->UpdateTrackParams(track,AliESDtrack::kTOFin);
234 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
243 printf("TRD\tOn\t%d\tOff\t%d\n",c0,c1);
245 // Sort according uncertainties on track position
258 //_________________________________________________________________________
259 void AliTOFtrackerMI::MatchTracks( Bool_t /*mLastStep*/){
264 //_________________________________________________________________________
265 void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){
267 //Match ESD tracks to clusters in TOF
268 const Float_t kTofOffset = 26; // time offset
269 const Float_t kMinQuality = -6.; // minimal quality
270 const Float_t kMaxQualityD = 1.; // max delta quality if cluster used
271 const Float_t kForbiddenR = 0.1; // minimal PID according TPC
273 static const Double_t kMasses[]={
274 0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
277 Int_t nSteps=(Int_t)(fTOFHeigth/0.1);
279 //AliTOFcalib *calib = new AliTOFcalib(); // AdC
281 //PH Arrays (moved outside of the loop)
282 Float_t * trackPos[4];
283 for (Int_t ii=0; ii<4; ii++) trackPos[ii] = new Float_t[nSteps];
284 Int_t * clind = new Int_t[fN];
287 const Int_t kNclusterMax = 1000; // related to fN value
288 AliTOFcluster *clusters[kNclusterMax];
289 Int_t index[kNclusterMax];
290 Float_t quality[kNclusterMax];
291 Float_t dist3D[kNclusterMax][6];
292 Double_t times[kNclusterMax][6];
293 Float_t mintimedist[kNclusterMax];
294 Float_t likelihood[kNclusterMax];
295 Float_t length[kNclusterMax];
299 for (Int_t i=0; i<fNseedsTOF; i++) {
301 AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(i);
302 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
303 Bool_t hasTime = ( (t->GetStatus()& AliESDtrack::kTIME)>0) ? kTRUE:kFALSE; // did we integrate time
304 Float_t trdquality = t->GetTRDQuality();
308 t->GetTPCpid(tpcpid);
310 for (Int_t ipid=0;ipid<5;ipid++){
311 sumpid+=tpcpid[ipid];
313 for (Int_t ipid=0;ipid<5;ipid++){
314 if (sumpid>0) tpcpid[ipid]/=sumpid;
320 if (trdquality<0) continue; // no chance
322 AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
324 //propagat track to the middle of TOF
326 Float_t xs = 379.2; // should be defined in the TOF geometry
327 Double_t ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
329 Double_t ysect=trackTOFin->GetYat(xs,skip);
332 ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
333 ysect=trackTOFin->GetYat(xs,skip);
336 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
339 } else if (ysect <-ymax) {
340 if (!trackTOFin->Rotate(-AliTOFGeometry::GetAlpha())) {
344 if(!trackTOFin->PropagateTo(xs)) {
348 // Determine a window around the track
351 trackTOFin->GetExternalParameters(x,par);
353 trackTOFin->GetExternalCovariance(cov);
355 if (cov[0]<0. || cov[2]<0.) {
356 AliWarning(Form("Very strange track (%d)! At least one of its covariance matrix diagonal elements is negative!",i));
361 Float_t scalefact=3.;
364 ((5*TMath::Sqrt(TMath::Abs(cov[0])) + 3.*fDy + 10.*TMath::Abs(par[2]))/fR);
367 (5*TMath::Sqrt(TMath::Abs(cov[2])) + 3.*fDz + 10.*TMath::Abs(par[3]));
369 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
370 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
371 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
376 // find the clusters in the window of the track
378 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
380 if (nc>=kNclusterMax) {
381 AliWarning("No more matchable clusters can be stored! Please, increase the corresponding vectors size.");
385 AliTOFcluster *c=fClusters[k];
386 if (c->GetZ() > z+dz) break;
387 // if (c->IsUsed()) continue;
389 Double_t dph=TMath::Abs(c->GetPhi()-phi);
390 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
391 if (TMath::Abs(dph)>dphi) continue;
397 AliDebug(1,Form(" Number of matchable TOF clusters for the track number %d: %d",i,nc));
400 // select close clusters
402 Double_t mom=t->GetP();
403 // Bool_t dump = kTRUE;
404 for (Int_t icl=0; icl<nc; icl++){
405 Float_t distances[5];
407 index[nfound]=clind[icl];
408 AliTOFcluster *cluster = fClusters[clind[icl]];
409 GetLinearDistances(trackTOFin, cluster, distances);
410 dist3D[nfound][0] = distances[4];
411 dist3D[nfound][1] = distances[1];
412 dist3D[nfound][2] = distances[2];
414 if (TMath::Abs(dist3D[nfound][1])>20 || TMath::Abs(dist3D[nfound][2])>20) continue;
416 GetLikelihood(distances[1],distances[2],cov,trackTOFin, dist3D[nfound][3], dist3D[nfound][4]);
419 if (dist3D[nfound][3]*dist3D[nfound][4]<0.00000000000001) continue; // log likelihood
420 if (TMath::Log(dist3D[nfound][3]*dist3D[nfound][4])<-9) continue; // log likelihood
422 clusters[nfound] = cluster;
424 //length and TOF updates
425 trackTOFin->GetIntegratedTimes(times[nfound]);
426 length[nfound] = trackTOFin->GetIntegratedLength();
427 length[nfound]+=distances[4];
428 mintimedist[nfound]=1000;
429 Double_t tof2=AliTOFGeometry::TdcBinWidth()*cluster->GetTDC()+kTofOffset; // in ps
430 // Float_t tgamma = TMath::Sqrt(cluster->GetR()*cluster->GetR()+cluster->GetZ()*cluster->GetZ())/0.03; //time for "primary" gamma
431 //if (trackTOFin->GetPt()<0.7 && TMath::Abs(tgamma-tof2)<350) continue; // gamma conversion candidate - TEMPORARY
432 for(Int_t j=0;j<=5;j++){
433 Double_t mass=kMasses[j];
434 times[nfound][j]+=distances[4]/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom; // add time distance
435 if ( TMath::Abs(times[nfound][j]-tof2)<mintimedist[nfound] && tpcpid[j]>kForbiddenR){
436 mintimedist[nfound]=TMath::Abs(times[nfound][j]-tof2);
440 Float_t liketime = TMath::Exp(-mintimedist[nfound]/90.)+0.25*TMath::Exp(-mintimedist[nfound]/180.);
441 if (!hasTime) liketime=0.2;
442 likelihood[nfound] = TMath::Log(dist3D[nfound][3]*dist3D[nfound][4]*liketime);
444 if (TMath::Log(dist3D[nfound][3]*dist3D[nfound][4])<-1){
445 if (likelihood[nfound]<-9.) continue;
451 AliDebug(1,Form(" Number of track points for the track number %d: %d",i,nfound));
459 //choose the best cluster
461 //Float_t quality[kNclusterMax];
462 //Int_t index[kNclusterMax];
463 for (Int_t kk=0; kk<kNclusterMax; kk++) quality[kk]=0;
465 AliTOFcluster * cgold=0;
467 for (Int_t icl=0;icl<nfound;icl++){
468 quality[icl] = dist3D[icl][3]*dist3D[icl][4];
470 TMath::Sort(nfound,quality,index,kTRUE);
472 cgold = clusters[igold];
473 if (nfound>1 &&likelihood[index[1]]>likelihood[index[0]]){
474 if ( quality[index[0]]<quality[index[1]]+0.5){
476 cgold = clusters[igold];
481 Float_t qualityGold = TMath::Log(0.0000001+(quality[igold]*(0.1+TMath::Exp(-mintimedist[igold]/80.))*(0.2+trdquality)));
483 if (cgold->GetQuality()<qualityGold) cgold->SetQuality(qualityGold);
488 //signed better cluster
489 if (cgold->GetQuality()>qualityGold+kMaxQualityD) continue;
490 if (2.*qualityGold-cgold->GetQuality()<kMinQuality) continue;
495 for (Int_t icl=0;icl<nfound;icl++){
497 (clusters[index[icl]]->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
499 (clusters[index[icl]]->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
501 (clusters[index[icl]]->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
508 if (inonfake==0) fngoodmatch++;
514 tlab[0]=cgold->GetLabel(0);
515 tlab[1]=cgold->GetLabel(1);
516 tlab[2]=cgold->GetLabel(2);
517 // Double_t tof2=25.*cgold->GetTDC()-350; // in ps
518 Double_t tof2=AliTOFGeometry::TdcBinWidth()*cgold->GetTDC()+kTofOffset; // in ps
519 Float_t tgamma = TMath::Sqrt(cgold->GetR()*cgold->GetR()+cgold->GetZ()*cgold->GetZ())/0.03;
520 Float_t info[10]={dist3D[igold][0],
529 cgold->GetQuality()};
530 // GetLinearDistances(trackTOFin,cgold,&info[6]);
533 // info[7] = mintimedist[index[inonfake]];
536 // Store quantities to be used for TOF Calibration
537 Float_t tToT=cgold->GetToT(); // in ps
538 t->SetTOFsignalToT(tToT);
540 ind[0]=cgold->GetDetInd(0);
541 ind[1]=cgold->GetDetInd(1);
542 ind[2]=cgold->GetDetInd(2);
543 ind[3]=cgold->GetDetInd(3);
544 ind[4]=cgold->GetDetInd(4);
545 Int_t calindex = AliTOFGeometry::GetIndex(ind);
546 t->SetTOFCalChannel(calindex);
549 t->SetTOFsignal(tof2);
550 t->SetTOFcluster(cgold->GetIndex());
552 AliDebug(2, Form("%7i %7i %10i %10i %10i %10i %7i",
555 TMath::Abs(trackTOFin->GetLabel()),
556 tlab[0], tlab[1], tlab[2],
559 AliTOFtrack *trackTOFout = new AliTOFtrack(*t);
560 trackTOFout->PropagateTo(379.);
562 // Fill the track residual histograms.
563 FillResiduals(trackTOFout,cgold,kFALSE);
565 t->UpdateTrackParams(trackTOFout,AliESDtrack::kTOFout);
566 t->SetIntegratedLength(length[igold]);
567 t->SetIntegratedTimes(times[igold]);
568 t->SetTOFLabel(tlab);
577 for (Int_t ii=0; ii<4; ii++) delete [] trackPos[ii];
579 //delete calib; // AdC
581 //_________________________________________________________________________
583 Int_t AliTOFtrackerMI::LoadClusters(TTree *cTree) {
584 //--------------------------------------------------------------------
585 //This function loads the TOF clusters
586 //--------------------------------------------------------------------
588 TBranch *branch=cTree->GetBranch("TOF");
590 AliError("can't get the branch with the TOF clusters !");
594 static TClonesArray dummy("AliTOFcluster",10000);
596 TClonesArray *clusters=&dummy;
597 branch->SetAddress(&clusters);
600 Int_t nc=clusters->GetEntriesFast();
601 AliInfo(Form("Number of clusters: %d",nc));
603 for (Int_t i=0; i<nc; i++) {
604 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
606 fClusters[i]=new AliTOFcluster(*c); fN++;
608 //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)));
609 //AliInfo(Form("%i %f",i, fClusters[i]->GetZ()));
612 //AliInfo(Form("Number of clusters: %d",fN));
616 //_________________________________________________________________________
617 void AliTOFtrackerMI::UnloadClusters() {
618 //--------------------------------------------------------------------
619 //This function unloads TOF clusters
620 //--------------------------------------------------------------------
621 for (Int_t i=0; i<fN; i++) {
631 //_________________________________________________________________________
632 Int_t AliTOFtrackerMI::InsertCluster(AliTOFcluster *c) {
633 //--------------------------------------------------------------------
634 //This function adds a cluster to the array of clusters sorted in Z
635 //--------------------------------------------------------------------
636 if (fN==kMaxCluster) {
637 AliError("Too many clusters !");
641 if (fN==0) {fClusters[fN++]=c; return 0;}
642 Int_t i=FindClusterIndex(c->GetZ());
643 memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTOFcluster*));
644 fClusters[i]=c; fN++;
649 //_________________________________________________________________________
650 Int_t AliTOFtrackerMI::FindClusterIndex(Double_t z) const {
651 //--------------------------------------------------------------------
652 // This function returns the index of the nearest cluster
653 //--------------------------------------------------------------------
655 if (z <= fClusters[0]->GetZ()) return 0;
656 if (z > fClusters[fN-1]->GetZ()) return fN;
657 Int_t b=0, e=fN-1, m=(b+e)/2;
658 for (; b<e; m=(b+e)/2) {
659 if (z > fClusters[m]->GetZ()) b=m+1;
665 //_________________________________________________________________________
666 Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *cluster, Float_t distances[5])
669 // calclates distance between cluster and track
670 // use linear aproximation
672 //const Float_t kRaddeg = 180/3.14159265358979312;
673 const Float_t kRaddeg = TMath::RadToDeg();
675 // Float_t tiltangle = fGeom->GetAngles(cluster->fdetIndex[1],cluster->fdetIndex[2])/kRaddeg; //tiltangle
677 cind[0]= cluster->GetDetInd(0);
678 cind[1]= cluster->GetDetInd(1);
679 cind[2]= cluster->GetDetInd(2);
680 cind[3]= cluster->GetDetInd(3);
681 cind[4]= cluster->GetDetInd(4);
682 Float_t tiltangle = AliTOFGeometry::GetAngles(cluster->GetDetInd(1),cluster->GetDetInd(2))/kRaddeg; //tiltangle
684 Float_t cpos[3]; //cluster position
685 Float_t cpos0[3]; //cluster position
686 // fGeom->GetPos(cluster->fdetIndex,cpos);
687 //fGeom->GetPos(cluster->fdetIndex,cpos0);
689 fGeom->GetPos(cind,cpos);
690 fGeom->GetPos(cind,cpos0);
692 Float_t phi = TMath::ATan2(cpos[1],cpos[0]);
693 if(phi<0) phi=2.*TMath::Pi()+phi;
694 // Get the local angle in the sector philoc
695 Float_t phiangle = (Int_t (phi*kRaddeg/20.) + 0.5)*20./kRaddeg;
700 track->GetPxPyPz(dir);
701 dir[0]/=track->GetP();
702 dir[1]/=track->GetP();
703 dir[2]/=track->GetP();
707 Float_t sinphi = TMath::Sin(phiangle);
708 Float_t cosphi = TMath::Cos(phiangle);
709 Float_t sinth = TMath::Sin(tiltangle);
710 Float_t costh = TMath::Cos(tiltangle);
713 temp = cpos[0]*cosphi+cpos[1]*sinphi;
714 cpos[1] = -cpos[0]*sinphi+cpos[1]*cosphi;
716 temp = v0[0]*cosphi+v0[1]*sinphi;
717 v0[1] = -v0[0]*sinphi+v0[1]*cosphi;
720 temp = cpos[0]*costh+cpos[2]*sinth;
721 cpos[2] = -cpos[0]*sinth+cpos[2]*costh;
723 temp = v0[0]*costh+v0[2]*sinth;
724 v0[2] = -v0[0]*sinth+v0[2]*costh;
728 //rotate direction vector
730 temp = dir[0]*cosphi+dir[1]*sinphi;
731 dir[1] = -dir[0]*sinphi+dir[1]*cosphi;
734 temp = dir[0]*costh+dir[2]*sinth;
735 dir[2] = -dir[0]*sinth+dir[2]*costh;
739 Float_t k = (cpos[0]-v0[0])/dir[0];
740 v3[0] = v0[0]+k*dir[0];
741 v3[1] = v0[1]+k*dir[1];
742 v3[2] = v0[2]+k*dir[2];
744 distances[0] = v3[0]-cpos[0];
745 distances[1] = v3[1]-cpos[1];
746 distances[2] = v3[2]-cpos[2];
747 distances[3] = TMath::Sqrt( distances[0]*distances[0]+distances[1]*distances[1]+distances[2]*distances[2]); //distance
748 distances[4] = k; //length
751 // Debuging part of the matching
753 if (track->GetLabel()==cluster->GetLabel(0) ||
754 track->GetLabel()==cluster->GetLabel(1) ||
755 track->GetLabel()==cluster->GetLabel(2) ){
756 TTreeSRedirector& cstream = *fDebugStreamer;
757 Float_t tdc = cluster->GetTDC();
764 "Dist0="<<distances[0]<<
765 "Dist1="<<distances[1]<<
766 "Dist2="<<distances[2]<<
773 //_________________________________________________________________________
774 void AliTOFtrackerMI::GetLikelihood(Float_t dy, Float_t dz, const Double_t *cov, AliTOFtrack * /*track*/, Float_t & py, Float_t &pz)
777 // get likelihood - track covariance taken
778 // 75 % of gauss with expected sigma
779 // 25 % of gauss with extended sigma
781 Double_t kMaxSigmaY = 0.6; // ~ 90% of TRD tracks
782 Double_t kMaxSigmaZ = 1.2; // ~ 90% of TRD tracks
783 Double_t kMeanSigmaY = 0.25; // mean TRD sigma
784 Double_t kMeanSigmaZ = 0.5; // mean TRD sigma
787 Float_t normwidth, normd, p0,p1;
788 Float_t sigmay = TMath::Max(TMath::Sqrt(cov[0]+kMeanSigmaY*kMeanSigmaY),kMaxSigmaY);
789 Float_t sigmaz = TMath::Max(TMath::Sqrt(cov[2]+kMeanSigmaZ*kMeanSigmaZ),kMaxSigmaZ);
794 // py calculation - 75% admixture of original sigma - 25% tails
796 normwidth = fDy/sigmay;
798 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
799 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
802 normwidth = fDy/(3.*sigmay);
803 normd = dy/(3.*sigmay);
804 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
805 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
808 // pz calculation - 75% admixture of original sigma - 25% tails
810 normwidth = fDz/sigmaz;
812 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
813 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
816 normwidth = fDz/(3.*sigmaz);
817 normd = dz/(3.*sigmaz);
818 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
819 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
822 //_________________________________________________________________________
824 void AliTOFtrackerMI::FillClusterArray(TObjArray* arr) const
827 // Returns the TOF cluster array
833 for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);