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);
178 seed->GetTOFInfo(info);
179 seed->GetIntegratedTimes(times);
180 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
181 t->SetIntegratedLength(seed->GetIntegratedLength());
182 t->SetIntegratedTimes(times);
183 t->SetTOFsignalToT(seed->GetTOFsignalToT());
184 t->SetTOFCalChannel(seed->GetTOFCalChannel());
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];
289 Float_t quality[1000];
290 Float_t dist3D[1000][6];
291 Double_t times[1000][6];
292 Float_t mintimedist[1000];
293 Float_t likelihood[1000];
294 Float_t length[1000];
295 AliTOFcluster *clusters[1000];
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);
354 Float_t scalefact=3.;
357 ((5*TMath::Sqrt(cov[0]) + 3.*fDy + 10.*TMath::Abs(par[2]))/fR);
360 (5*TMath::Sqrt(cov[2]) + 3.*fDz + 10.*TMath::Abs(par[3]));
362 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
363 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
364 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
369 // find the clusters in the window of the track
371 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
372 AliTOFcluster *c=fClusters[k];
373 if (c->GetZ() > z+dz) break;
374 // if (c->IsUsed()) continue;
376 Double_t dph=TMath::Abs(c->GetPhi()-phi);
377 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
378 if (TMath::Abs(dph)>dphi) continue;
385 // select close clusters
387 Double_t mom=t->GetP();
388 // Bool_t dump = kTRUE;
389 for (Int_t icl=0; icl<nc; icl++){
390 Float_t distances[5];
391 if (nfound>=1000) break;
392 index[nfound]=clind[icl];
393 AliTOFcluster *cluster = fClusters[clind[icl]];
394 GetLinearDistances(trackTOFin, cluster, distances);
395 dist3D[nfound][0] = distances[4];
396 dist3D[nfound][1] = distances[1];
397 dist3D[nfound][2] = distances[2];
399 if (TMath::Abs(dist3D[nfound][1])>20 || TMath::Abs(dist3D[nfound][2])>20) continue;
401 GetLikelihood(distances[1],distances[2],cov,trackTOFin, dist3D[nfound][3], dist3D[nfound][4]);
404 if (dist3D[nfound][3]*dist3D[nfound][4]<0.00000000000001) continue; // log likelihood
405 if (TMath::Log(dist3D[nfound][3]*dist3D[nfound][4])<-9) continue; // log likelihood
407 clusters[nfound] = cluster;
409 //length and TOF updates
410 trackTOFin->GetIntegratedTimes(times[nfound]);
411 length[nfound] = trackTOFin->GetIntegratedLength();
412 length[nfound]+=distances[4];
413 mintimedist[nfound]=1000;
414 Double_t tof2=AliTOFGeometry::TdcBinWidth()*cluster->GetTDC()+kTofOffset; // in ps
415 // Float_t tgamma = TMath::Sqrt(cluster->GetR()*cluster->GetR()+cluster->GetZ()*cluster->GetZ())/0.03; //time for "primary" gamma
416 //if (trackTOFin->GetPt()<0.7 && TMath::Abs(tgamma-tof2)<350) continue; // gamma conversion candidate - TEMPORARY
417 for(Int_t j=0;j<=5;j++){
418 Double_t mass=kMasses[j];
419 times[nfound][j]+=distances[4]/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom; // add time distance
420 if ( TMath::Abs(times[nfound][j]-tof2)<mintimedist[nfound] && tpcpid[j]>kForbiddenR){
421 mintimedist[nfound]=TMath::Abs(times[nfound][j]-tof2);
425 Float_t liketime = TMath::Exp(-mintimedist[nfound]/90.)+0.25*TMath::Exp(-mintimedist[nfound]/180.);
426 if (!hasTime) liketime=0.2;
427 likelihood[nfound] = TMath::Log(dist3D[nfound][3]*dist3D[nfound][4]*liketime);
429 if (TMath::Log(dist3D[nfound][3]*dist3D[nfound][4])<-1){
430 if (likelihood[nfound]<-9.) continue;
441 //choose the best cluster
443 //Float_t quality[1000];
445 for (Int_t kk=0; kk<1000; kk++) quality[kk]=0;
447 AliTOFcluster * cgold=0;
449 for (Int_t icl=0;icl<nfound;icl++){
450 quality[icl] = dist3D[icl][3]*dist3D[icl][4];
452 TMath::Sort(nfound,quality,index,kTRUE);
454 cgold = clusters[igold];
455 if (nfound>1 &&likelihood[index[1]]>likelihood[index[0]]){
456 if ( quality[index[0]]<quality[index[1]]+0.5){
458 cgold = clusters[igold];
463 Float_t qualityGold = TMath::Log(0.0000001+(quality[igold]*(0.1+TMath::Exp(-mintimedist[igold]/80.))*(0.2+trdquality)));
465 if (cgold->GetQuality()<qualityGold) cgold->SetQuality(qualityGold);
470 //signed better cluster
471 if (cgold->GetQuality()>qualityGold+kMaxQualityD) continue;
472 if (2.*qualityGold-cgold->GetQuality()<kMinQuality) continue;
477 for (Int_t icl=0;icl<nfound;icl++){
479 (clusters[index[icl]]->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
481 (clusters[index[icl]]->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
483 (clusters[index[icl]]->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
490 if (inonfake==0) fngoodmatch++;
496 tlab[0]=cgold->GetLabel(0);
497 tlab[1]=cgold->GetLabel(1);
498 tlab[2]=cgold->GetLabel(2);
499 // Double_t tof2=25.*cgold->GetTDC()-350; // in ps
500 Double_t tof2=AliTOFGeometry::TdcBinWidth()*cgold->GetTDC()+kTofOffset; // in ps
501 Float_t tgamma = TMath::Sqrt(cgold->GetR()*cgold->GetR()+cgold->GetZ()*cgold->GetZ())/0.03;
502 Float_t info[11]={dist3D[igold][0],dist3D[igold][1],dist3D[igold][2],dist3D[igold][3],dist3D[igold][4],mintimedist[igold],
503 -1,tgamma, qualityGold,cgold->GetQuality(),0};
504 // GetLinearDistances(trackTOFin,cgold,&info[6]);
507 // info[7] = mintimedist[index[inonfake]];
510 // Store quantities to be used for TOF Calibration
511 Float_t tToT=cgold->GetToT(); // in ps
512 t->SetTOFsignalToT(tToT);
514 ind[0]=cgold->GetDetInd(0);
515 ind[1]=cgold->GetDetInd(1);
516 ind[2]=cgold->GetDetInd(2);
517 ind[3]=cgold->GetDetInd(3);
518 ind[4]=cgold->GetDetInd(4);
519 Int_t calindex = AliTOFGeometry::GetIndex(ind);
520 t->SetTOFCalChannel(calindex);
523 t->SetTOFsignal(tof2);
524 t->SetTOFcluster(cgold->GetIndex());
526 AliDebug(2, Form("%7i %7i %10i %10i %10i %10i %7i",
529 TMath::Abs(trackTOFin->GetLabel()),
530 tlab[0], tlab[1], tlab[2],
533 AliTOFtrack *trackTOFout = new AliTOFtrack(*t);
534 trackTOFout->PropagateTo(379.);
536 // Fill the track residual histograms.
537 FillResiduals(trackTOFout,cgold,kFALSE);
539 t->UpdateTrackParams(trackTOFout,AliESDtrack::kTOFout);
540 t->SetIntegratedLength(length[igold]);
541 t->SetIntegratedTimes(times[igold]);
542 t->SetTOFLabel(tlab);
551 for (Int_t ii=0; ii<4; ii++) delete [] trackPos[ii];
553 //delete calib; // AdC
555 //_________________________________________________________________________
557 Int_t AliTOFtrackerMI::LoadClusters(TTree *cTree) {
558 //--------------------------------------------------------------------
559 //This function loads the TOF clusters
560 //--------------------------------------------------------------------
562 TBranch *branch=cTree->GetBranch("TOF");
564 AliError("can't get the branch with the TOF clusters !");
568 static TClonesArray dummy("AliTOFcluster",10000);
570 TClonesArray *clusters=&dummy;
571 branch->SetAddress(&clusters);
574 Int_t nc=clusters->GetEntriesFast();
575 AliInfo(Form("Number of clusters: %d",nc));
577 for (Int_t i=0; i<nc; i++) {
578 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
580 fClusters[i]=new AliTOFcluster(*c); fN++;
582 //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)));
583 //AliInfo(Form("%i %f",i, fClusters[i]->GetZ()));
586 //AliInfo(Form("Number of clusters: %d",fN));
590 //_________________________________________________________________________
591 void AliTOFtrackerMI::UnloadClusters() {
592 //--------------------------------------------------------------------
593 //This function unloads TOF clusters
594 //--------------------------------------------------------------------
595 for (Int_t i=0; i<fN; i++) {
605 //_________________________________________________________________________
606 Int_t AliTOFtrackerMI::InsertCluster(AliTOFcluster *c) {
607 //--------------------------------------------------------------------
608 //This function adds a cluster to the array of clusters sorted in Z
609 //--------------------------------------------------------------------
610 if (fN==kMaxCluster) {
611 AliError("Too many clusters !");
615 if (fN==0) {fClusters[fN++]=c; return 0;}
616 Int_t i=FindClusterIndex(c->GetZ());
617 memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTOFcluster*));
618 fClusters[i]=c; fN++;
623 //_________________________________________________________________________
624 Int_t AliTOFtrackerMI::FindClusterIndex(Double_t z) const {
625 //--------------------------------------------------------------------
626 // This function returns the index of the nearest cluster
627 //--------------------------------------------------------------------
629 if (z <= fClusters[0]->GetZ()) return 0;
630 if (z > fClusters[fN-1]->GetZ()) return fN;
631 Int_t b=0, e=fN-1, m=(b+e)/2;
632 for (; b<e; m=(b+e)/2) {
633 if (z > fClusters[m]->GetZ()) b=m+1;
641 Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *cluster, Float_t distances[5])
644 // calclates distance between cluster and track
645 // use linear aproximation
647 const Float_t kRaddeg = 180/3.14159265358979312;
649 // Float_t tiltangle = fGeom->GetAngles(cluster->fdetIndex[1],cluster->fdetIndex[2])/kRaddeg; //tiltangle
651 cind[0]= cluster->GetDetInd(0);
652 cind[1]= cluster->GetDetInd(1);
653 cind[2]= cluster->GetDetInd(2);
654 cind[3]= cluster->GetDetInd(3);
655 cind[4]= cluster->GetDetInd(4);
656 Float_t tiltangle = AliTOFGeometry::GetAngles(cluster->GetDetInd(1),cluster->GetDetInd(2))/kRaddeg; //tiltangle
658 Float_t cpos[3]; //cluster position
659 Float_t cpos0[3]; //cluster position
660 // fGeom->GetPos(cluster->fdetIndex,cpos);
661 //fGeom->GetPos(cluster->fdetIndex,cpos0);
663 fGeom->GetPos(cind,cpos);
664 fGeom->GetPos(cind,cpos0);
666 Float_t phi = TMath::ATan2(cpos[1],cpos[0]);
667 if(phi<0) phi=2.*TMath::Pi()+phi;
668 // Get the local angle in the sector philoc
669 Float_t phiangle = (Int_t (phi*kRaddeg/20.) + 0.5)*20./kRaddeg;
674 track->GetPxPyPz(dir);
675 dir[0]/=track->GetP();
676 dir[1]/=track->GetP();
677 dir[2]/=track->GetP();
681 Float_t sinphi = TMath::Sin(phiangle);
682 Float_t cosphi = TMath::Cos(phiangle);
683 Float_t sinth = TMath::Sin(tiltangle);
684 Float_t costh = TMath::Cos(tiltangle);
687 temp = cpos[0]*cosphi+cpos[1]*sinphi;
688 cpos[1] = -cpos[0]*sinphi+cpos[1]*cosphi;
690 temp = v0[0]*cosphi+v0[1]*sinphi;
691 v0[1] = -v0[0]*sinphi+v0[1]*cosphi;
694 temp = cpos[0]*costh+cpos[2]*sinth;
695 cpos[2] = -cpos[0]*sinth+cpos[2]*costh;
697 temp = v0[0]*costh+v0[2]*sinth;
698 v0[2] = -v0[0]*sinth+v0[2]*costh;
702 //rotate direction vector
704 temp = dir[0]*cosphi+dir[1]*sinphi;
705 dir[1] = -dir[0]*sinphi+dir[1]*cosphi;
708 temp = dir[0]*costh+dir[2]*sinth;
709 dir[2] = -dir[0]*sinth+dir[2]*costh;
713 Float_t k = (cpos[0]-v0[0])/dir[0];
714 v3[0] = v0[0]+k*dir[0];
715 v3[1] = v0[1]+k*dir[1];
716 v3[2] = v0[2]+k*dir[2];
718 distances[0] = v3[0]-cpos[0];
719 distances[1] = v3[1]-cpos[1];
720 distances[2] = v3[2]-cpos[2];
721 distances[3] = TMath::Sqrt( distances[0]*distances[0]+distances[1]*distances[1]+distances[2]*distances[2]); //distance
722 distances[4] = k; //length
725 // Debuging part of the matching
727 if (track->GetLabel()==cluster->GetLabel(0) ||track->GetLabel()==cluster->GetLabel(1) ){
728 TTreeSRedirector& cstream = *fDebugStreamer;
729 Float_t tdc = cluster->GetTDC();
736 "Dist0="<<distances[0]<<
737 "Dist1="<<distances[1]<<
738 "Dist2="<<distances[2]<<
747 void AliTOFtrackerMI::GetLikelihood(Float_t dy, Float_t dz, const Double_t *cov, AliTOFtrack * /*track*/, Float_t & py, Float_t &pz)
750 // get likelihood - track covariance taken
751 // 75 % of gauss with expected sigma
752 // 25 % of gauss with extended sigma
754 Double_t kMaxSigmaY = 0.6; // ~ 90% of TRD tracks
755 Double_t kMaxSigmaZ = 1.2; // ~ 90% of TRD tracks
756 Double_t kMeanSigmaY = 0.25; // mean TRD sigma
757 Double_t kMeanSigmaZ = 0.5; // mean TRD sigma
760 Float_t normwidth, normd, p0,p1;
761 Float_t sigmay = TMath::Max(TMath::Sqrt(cov[0]+kMeanSigmaY*kMeanSigmaY),kMaxSigmaY);
762 Float_t sigmaz = TMath::Max(TMath::Sqrt(cov[2]+kMeanSigmaZ*kMeanSigmaZ),kMaxSigmaZ);
767 // py calculation - 75% admixture of original sigma - 25% tails
769 normwidth = fDy/sigmay;
771 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
772 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
775 normwidth = fDy/(3.*sigmay);
776 normd = dy/(3.*sigmay);
777 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
778 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
781 // pz calculation - 75% admixture of original sigma - 25% tails
783 normwidth = fDz/sigmaz;
785 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
786 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
789 normwidth = fDz/(3.*sigmaz);
790 normd = dz/(3.*sigmaz);
791 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
792 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
795 //_________________________________________________________________________
797 void AliTOFtrackerMI::FillClusterArray(TObjArray* arr) const
800 // Returns the TOF cluster array
806 for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);