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 "AliTOFcalib.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 fRecoParam=new AliTOFRecoParam();
72 fGeom=new AliTOFGeometry();
74 parPID[0]=fRecoParam->GetTimeResolution();
75 parPID[1]=fRecoParam->GetTimeNSigma();
76 fPid=new AliTOFpidESD(parPID);
77 fDy=AliTOFGeometry::XPad();
78 fDz=AliTOFGeometry::ZPad();
79 fDebugStreamer = new TTreeSRedirector("TOFdebug.root");
81 //_____________________________________________________________________________
82 AliTOFtrackerMI::AliTOFtrackerMI(const AliTOFtrackerMI &t):
100 fTracks(new TClonesArray("AliTOFtrack")),
101 fSeeds(new TClonesArray("AliESDtrack")),
104 //AliTOFtrackerMI copy Ctor
107 fNseedsTOF=t.fNseedsTOF;
108 fngoodmatch=t.fngoodmatch;
109 fnbadmatch=t.fnbadmatch;
110 fnunmatch=t.fnunmatch;
112 fRecoParam = t.fRecoParam;
116 fTOFHeigth=t.fTOFHeigth;
126 //_________________________________________________________________________________
127 AliTOFtrackerMI& AliTOFtrackerMI::operator=(const AliTOFtrackerMI &t)
129 //AliTOFtrackerMI assignment operator
131 this->fNseeds=t.fNseeds;
132 this->fNseedsTOF=t.fNseedsTOF;
133 this->fngoodmatch=t.fngoodmatch;
134 this->fnbadmatch=t.fnbadmatch;
135 this->fnunmatch=t.fnunmatch;
136 this->fnmatch=t.fnmatch;
137 this->fRecoParam = t.fRecoParam;
138 this->fGeom = t.fGeom;
141 this->fTOFHeigth=t.fTOFHeigth;
146 this->fSeeds=t.fSeeds;
147 this->fTracks=t.fTracks;
153 //_____________________________________________________________________________
154 AliTOFtrackerMI::~AliTOFtrackerMI(){
158 if (fDebugStreamer) {
159 //fDebugStreamer->Close();
160 delete fDebugStreamer;
177 //_____________________________________________________________________________
178 Int_t AliTOFtrackerMI::PropagateBack(AliESDEvent* event) {
180 // Gets seeds from ESD event and Match with TOF Clusters
184 //Initialise some counters
193 Int_t ntrk=event->GetNumberOfTracks();
195 TClonesArray &aESDTrack = *fSeeds;
198 //Load ESD tracks into a local Array of ESD Seeds
200 for (Int_t i=0; i<fNseeds; i++) {
201 AliESDtrack *t=event->GetTrack(i);
202 new(aESDTrack[i]) AliESDtrack(*t);
205 //Prepare ESD tracks candidates for TOF Matching
208 //First Step with Strict Matching Criterion
209 //MatchTracks(kFALSE);
211 //Second Step with Looser Matching Criterion
212 //MatchTracks(kTRUE);
213 MatchTracksMI(kFALSE); // assign track to clusters
214 MatchTracksMI(kTRUE); // assign clusters to esd
216 Info("PropagateBack","Number of matched tracks: %d",fnmatch);
217 Info("PropagateBack","Number of good matched tracks: %d",fngoodmatch);
218 Info("PropagateBack","Number of bad matched tracks: %d",fnbadmatch);
220 //Update the matched ESD tracks
222 for (Int_t i=0; i<ntrk; i++) {
223 AliESDtrack *t=event->GetTrack(i);
224 AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
225 if(seed->GetTOFsignal()>0){
226 t->SetTOFsignal(seed->GetTOFsignal());
227 t->SetTOFcluster(seed->GetTOFcluster());
229 seed->GetTOFLabel(tlab);
230 t->SetTOFLabel(tlab);
231 AliTOFtrack *track = new AliTOFtrack(*seed);
234 seed->GetTOFInfo(info);
235 seed->GetIntegratedTimes(times);
236 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
237 t->SetIntegratedLength(seed->GetIntegratedLength());
238 t->SetIntegratedTimes(times);
239 t->SetTOFsignalToT(seed->GetTOFsignalToT());
240 t->SetTOFCalChannel(seed->GetTOFCalChannel());
249 fPid->MakePID(event);
256 //_________________________________________________________________________
257 void AliTOFtrackerMI::CollectESD() {
258 //prepare the set of ESD tracks to be matched to clusters in TOF
260 TClonesArray &aTOFTrack = *fTracks;
263 for (Int_t i=0; i<fNseeds; i++) {
265 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
266 if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
268 // TRD good tracks, already propagated at 372 cm
270 AliTOFtrack *track = new AliTOFtrack(*t); // New
271 Double_t x = track->GetX(); //New
273 if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) &&
274 ( x >= AliTOFGeometry::RinTOF()) ){
275 track->SetSeedIndex(i);
276 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
277 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
283 // Propagate the rest of TPCbp
286 if(track->PropagateToInnerTOF()){ // temporary solution
287 track->SetSeedIndex(i);
288 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
289 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
298 printf("TRD\tOn\t%d\tOff\t%d\n",c0,c1);
300 // Sort according uncertainties on track position
313 //_________________________________________________________________________
314 void AliTOFtrackerMI::MatchTracks( Bool_t /*mLastStep*/){
319 //_________________________________________________________________________
320 void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){
322 //Match ESD tracks to clusters in TOF
323 const Float_t kTofOffset = 26; // time offset
324 const Float_t kMinQuality = -6.; // minimal quality
325 const Float_t kMaxQualityD = 1.; // max delta quality if cluster used
326 const Float_t kForbiddenR = 0.1; // minimal PID according TPC
328 static const Double_t kMasses[]={
329 0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
332 Int_t nSteps=(Int_t)(fTOFHeigth/0.1);
334 AliTOFcalib *calib = new AliTOFcalib();
336 //PH Arrays (moved outside of the loop)
337 Float_t * trackPos[4];
338 for (Int_t ii=0; ii<4; ii++) trackPos[ii] = new Float_t[nSteps];
339 Int_t * clind = new Int_t[fN];
344 Float_t quality[1000];
345 Float_t dist3D[1000][6];
346 Double_t times[1000][6];
347 Float_t mintimedist[1000];
348 Float_t likelihood[1000];
349 Float_t length[1000];
350 AliTOFcluster *clusters[1000];
354 for (Int_t i=0; i<fNseedsTOF; i++) {
356 AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(i);
357 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
358 Bool_t hasTime = ( (t->GetStatus()& AliESDtrack::kTIME)>0) ? kTRUE:kFALSE; // did we integrate time
359 Float_t trdquality = t->GetTRDQuality();
363 t->GetTPCpid(tpcpid);
365 for (Int_t ipid=0;ipid<5;ipid++){
366 sumpid+=tpcpid[ipid];
368 for (Int_t ipid=0;ipid<5;ipid++){
369 if (sumpid>0) tpcpid[ipid]/=sumpid;
375 if (trdquality<0) continue; // no chance
377 AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
379 //propagat track to the middle of TOF
381 Float_t xs = 379.2; // should be defined in the TOF geometry
382 Double_t ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
384 Double_t ysect=trackTOFin->GetYat(xs,skip);
387 ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
388 ysect=trackTOFin->GetYat(xs,skip);
391 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
394 } else if (ysect <-ymax) {
395 if (!trackTOFin->Rotate(-AliTOFGeometry::GetAlpha())) {
399 if(!trackTOFin->PropagateTo(xs)) {
403 // Determine a window around the track
406 trackTOFin->GetExternalParameters(x,par);
408 trackTOFin->GetExternalCovariance(cov);
409 Float_t scalefact=3.;
412 ((5*TMath::Sqrt(cov[0]) + 3.*fDy +10.*TMath::Abs(par[2]))/fR);
415 (5*TMath::Sqrt(cov[2]) + 3.*fDz +10.*TMath::Abs(par[3]));
417 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
418 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
419 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
424 // find the clusters in the window of the track
426 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
427 AliTOFcluster *c=fClusters[k];
428 if (c->GetZ() > z+dz) break;
429 // if (c->IsUsed()) continue;
431 Double_t dph=TMath::Abs(c->GetPhi()-phi);
432 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
433 if (TMath::Abs(dph)>dphi) continue;
440 // select close clusters
442 Double_t mom=t->GetP();
443 // Bool_t dump = kTRUE;
444 for (Int_t icl=0; icl<nc; icl++){
445 Float_t distances[5];
446 if (nfound>=1000) break;
447 index[nfound]=clind[icl];
448 AliTOFcluster *cluster = fClusters[clind[icl]];
449 GetLinearDistances(trackTOFin,cluster, distances);
450 dist3D[nfound][0] = distances[4];
451 dist3D[nfound][1] = distances[1];
452 dist3D[nfound][2] = distances[2];
454 if (TMath::Abs(dist3D[nfound][1])>20 || TMath::Abs(dist3D[nfound][2])>20) continue;
456 GetLikelihood(distances[1],distances[2],cov,trackTOFin, dist3D[nfound][3], dist3D[nfound][4]);
459 if (dist3D[nfound][3]*dist3D[nfound][4]<0.00000000000001) continue; // log likelihood
460 if (TMath::Log(dist3D[nfound][3]*dist3D[nfound][4])<-9) continue; // log likelihood
462 clusters[nfound] = cluster;
464 //length and TOF updates
465 trackTOFin->GetIntegratedTimes(times[nfound]);
466 length[nfound] = trackTOFin->GetIntegratedLength();
467 length[nfound]+=distances[4];
468 mintimedist[nfound]=1000;
469 Double_t tof2=AliTOFGeometry::TdcBinWidth()*cluster->GetTDC()+kTofOffset; // in ps
470 // Float_t tgamma = TMath::Sqrt(cluster->GetR()*cluster->GetR()+cluster->GetZ()*cluster->GetZ())/0.03; //time for "primary" gamma
471 //if (trackTOFin->GetPt()<0.7 && TMath::Abs(tgamma-tof2)<350) continue; // gamma conversion candidate - TEMPORARY
472 for(Int_t j=0;j<=5;j++){
473 Double_t mass=kMasses[j];
474 times[nfound][j]+=distances[4]/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom; // add time distance
475 if ( TMath::Abs(times[nfound][j]-tof2)<mintimedist[nfound] && tpcpid[j]>kForbiddenR){
476 mintimedist[nfound]=TMath::Abs(times[nfound][j]-tof2);
480 Float_t liketime = TMath::Exp(-mintimedist[nfound]/90.)+0.25*TMath::Exp(-mintimedist[nfound]/180.);
481 if (!hasTime) liketime=0.2;
482 likelihood[nfound] = TMath::Log(dist3D[nfound][3]*dist3D[nfound][4]*liketime);
484 if (TMath::Log(dist3D[nfound][3]*dist3D[nfound][4])<-1){
485 if (likelihood[nfound]<-9.) continue;
496 //choose the best cluster
498 //Float_t quality[1000];
500 for (Int_t kk=0; kk<1000; kk++) quality[kk]=0;
502 AliTOFcluster * cgold=0;
504 for (Int_t icl=0;icl<nfound;icl++){
505 quality[icl] = dist3D[icl][3]*dist3D[icl][4];
507 TMath::Sort(nfound,quality,index,kTRUE);
509 cgold = clusters[igold];
510 if (nfound>1 &&likelihood[index[1]]>likelihood[index[0]]){
511 if ( quality[index[0]]<quality[index[1]]+0.5){
513 cgold = clusters[igold];
518 Float_t qualityGold = TMath::Log(0.0000001+(quality[igold]*(0.1+TMath::Exp(-mintimedist[igold]/80.))*(0.2+trdquality)));
520 if (cgold->GetQuality()<qualityGold) cgold->SetQuality(qualityGold);
525 //signed better cluster
526 if (cgold->GetQuality()>qualityGold+kMaxQualityD) continue;
527 if (2.*qualityGold-cgold->GetQuality()<kMinQuality) continue;
532 for (Int_t icl=0;icl<nfound;icl++){
534 (clusters[index[icl]]->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
536 (clusters[index[icl]]->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
538 (clusters[index[icl]]->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
545 if (inonfake==0) fngoodmatch++;
551 tlab[0]=cgold->GetLabel(0);
552 tlab[1]=cgold->GetLabel(1);
553 tlab[2]=cgold->GetLabel(2);
554 // Double_t tof2=25.*cgold->GetTDC()-350; // in ps
555 Double_t tof2=AliTOFGeometry::TdcBinWidth()*cgold->GetTDC()+kTofOffset; // in ps
556 Float_t tgamma = TMath::Sqrt(cgold->GetR()*cgold->GetR()+cgold->GetZ()*cgold->GetZ())/0.03;
557 Float_t info[11]={dist3D[igold][0],dist3D[igold][1],dist3D[igold][2],dist3D[igold][3],dist3D[igold][4],mintimedist[igold],
558 -1,tgamma, qualityGold,cgold->GetQuality(),0};
559 // GetLinearDistances(trackTOFin,cgold,&info[6]);
562 // info[7] = mintimedist[index[inonfake]];
565 // Store quantities to be used for TOF Calibration
566 Float_t tToT=cgold->GetToT(); // in ps
567 t->SetTOFsignalToT(tToT);
569 ind[0]=cgold->GetDetInd(0);
570 ind[1]=cgold->GetDetInd(1);
571 ind[2]=cgold->GetDetInd(2);
572 ind[3]=cgold->GetDetInd(3);
573 ind[4]=cgold->GetDetInd(4);
574 Int_t calindex = AliTOFGeometry::GetIndex(ind);
575 t->SetTOFCalChannel(calindex);
578 t->SetTOFsignal(tof2);
579 t->SetTOFcluster(cgold->GetIndex());
580 AliTOFtrack *trackTOFout = new AliTOFtrack(*t);
581 trackTOFout->PropagateTo(379.);
582 t->UpdateTrackParams(trackTOFout,AliESDtrack::kTOFout);
583 t->SetIntegratedLength(length[igold]);
584 t->SetIntegratedTimes(times[igold]);
585 t->SetTOFLabel(tlab);
594 for (Int_t ii=0; ii<4; ii++) delete [] trackPos[ii];
598 //_________________________________________________________________________
600 Int_t AliTOFtrackerMI::LoadClusters(TTree *cTree) {
601 //--------------------------------------------------------------------
602 //This function loads the TOF clusters
603 //--------------------------------------------------------------------
605 TBranch *branch=cTree->GetBranch("TOF");
607 AliError("can't get the branch with the TOF clusters !");
611 static TClonesArray dummy("AliTOFcluster",10000);
613 TClonesArray *clusters=&dummy;
614 branch->SetAddress(&clusters);
617 Int_t nc=clusters->GetEntriesFast();
618 AliInfo(Form("Number of clusters: %d",nc));
620 for (Int_t i=0; i<nc; i++) {
621 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
623 fClusters[i]=new AliTOFcluster(*c); fN++;
625 //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)));
626 //AliInfo(Form("%i %f",i, fClusters[i]->GetZ()));
629 //AliInfo(Form("Number of clusters: %d",fN));
633 //_________________________________________________________________________
634 void AliTOFtrackerMI::UnloadClusters() {
635 //--------------------------------------------------------------------
636 //This function unloads TOF clusters
637 //--------------------------------------------------------------------
638 for (Int_t i=0; i<fN; i++) {
648 //_________________________________________________________________________
649 Int_t AliTOFtrackerMI::InsertCluster(AliTOFcluster *c) {
650 //--------------------------------------------------------------------
651 //This function adds a cluster to the array of clusters sorted in Z
652 //--------------------------------------------------------------------
653 if (fN==kMaxCluster) {
654 AliError("Too many clusters !");
658 if (fN==0) {fClusters[fN++]=c; return 0;}
659 Int_t i=FindClusterIndex(c->GetZ());
660 memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTOFcluster*));
661 fClusters[i]=c; fN++;
666 //_________________________________________________________________________
667 Int_t AliTOFtrackerMI::FindClusterIndex(Double_t z) const {
668 //--------------------------------------------------------------------
669 // This function returns the index of the nearest cluster
670 //--------------------------------------------------------------------
672 if (z <= fClusters[0]->GetZ()) return 0;
673 if (z > fClusters[fN-1]->GetZ()) return fN;
674 Int_t b=0, e=fN-1, m=(b+e)/2;
675 for (; b<e; m=(b+e)/2) {
676 if (z > fClusters[m]->GetZ()) b=m+1;
684 Float_t AliTOFtrackerMI::GetLinearDistances(AliTOFtrack * track, AliTOFcluster *cluster, Float_t distances[5])
687 // calclates distance between cluster and track
688 // use linear aproximation
690 const Float_t kRaddeg = 180/3.14159265358979312;
692 // Float_t tiltangle = fGeom->GetAngles(cluster->fdetIndex[1],cluster->fdetIndex[2])/kRaddeg; //tiltangle
694 cind[0]= cluster->GetDetInd(0);
695 cind[1]= cluster->GetDetInd(1);
696 cind[2]= cluster->GetDetInd(2);
697 cind[3]= cluster->GetDetInd(3);
698 cind[4]= cluster->GetDetInd(4);
699 Float_t tiltangle = AliTOFGeometry::GetAngles(cluster->GetDetInd(1),cluster->GetDetInd(2))/kRaddeg; //tiltangle
701 Float_t cpos[3]; //cluster position
702 Float_t cpos0[3]; //cluster position
703 // fGeom->GetPos(cluster->fdetIndex,cpos);
704 //fGeom->GetPos(cluster->fdetIndex,cpos0);
706 fGeom->GetPos(cind,cpos);
707 fGeom->GetPos(cind,cpos0);
709 Float_t phi = TMath::ATan2(cpos[1],cpos[0]);
710 if(phi<0) phi=2.*TMath::Pi()+phi;
711 // Get the local angle in the sector philoc
712 Float_t phiangle = (Int_t (phi*kRaddeg/20.) + 0.5)*20./kRaddeg;
717 track->GetPxPyPz(dir);
718 dir[0]/=track->GetP();
719 dir[1]/=track->GetP();
720 dir[2]/=track->GetP();
724 Float_t sinphi = TMath::Sin(phiangle);
725 Float_t cosphi = TMath::Cos(phiangle);
726 Float_t sinth = TMath::Sin(tiltangle);
727 Float_t costh = TMath::Cos(tiltangle);
730 temp = cpos[0]*cosphi+cpos[1]*sinphi;
731 cpos[1] = -cpos[0]*sinphi+cpos[1]*cosphi;
733 temp = v0[0]*cosphi+v0[1]*sinphi;
734 v0[1] = -v0[0]*sinphi+v0[1]*cosphi;
737 temp = cpos[0]*costh+cpos[2]*sinth;
738 cpos[2] = -cpos[0]*sinth+cpos[2]*costh;
740 temp = v0[0]*costh+v0[2]*sinth;
741 v0[2] = -v0[0]*sinth+v0[2]*costh;
745 //rotate direction vector
747 temp = dir[0]*cosphi+dir[1]*sinphi;
748 dir[1] = -dir[0]*sinphi+dir[1]*cosphi;
751 temp = dir[0]*costh+dir[2]*sinth;
752 dir[2] = -dir[0]*sinth+dir[2]*costh;
756 Float_t k = (cpos[0]-v0[0])/dir[0];
757 v3[0] = v0[0]+k*dir[0];
758 v3[1] = v0[1]+k*dir[1];
759 v3[2] = v0[2]+k*dir[2];
761 distances[0] = v3[0]-cpos[0];
762 distances[1] = v3[1]-cpos[1];
763 distances[2] = v3[2]-cpos[2];
764 distances[3] = TMath::Sqrt( distances[0]*distances[0]+distances[1]*distances[1]+distances[2]*distances[2]); //distance
765 distances[4] = k; //length
768 // Debuging part of the matching
770 if (track->GetLabel()==cluster->GetLabel(0) ||track->GetLabel()==cluster->GetLabel(1) ){
771 TTreeSRedirector& cstream = *fDebugStreamer;
772 Float_t tdc = cluster->GetTDC();
779 "Dist0="<<distances[0]<<
780 "Dist1="<<distances[1]<<
781 "Dist2="<<distances[2]<<
790 void AliTOFtrackerMI::GetLikelihood(Float_t dy, Float_t dz, const Double_t *cov, AliTOFtrack * /*track*/, Float_t & py, Float_t &pz)
793 // get likelihood - track covariance taken
794 // 75 % of gauss with expected sigma
795 // 25 % of gauss with extended sigma
797 Double_t kMaxSigmaY = 0.6; // ~ 90% of TRD tracks
798 Double_t kMaxSigmaZ = 1.2; // ~ 90% of TRD tracks
799 Double_t kMeanSigmaY = 0.25; // mean TRD sigma
800 Double_t kMeanSigmaZ = 0.5; // mean TRD sigma
803 Float_t normwidth, normd, p0,p1;
804 Float_t sigmay = TMath::Max(TMath::Sqrt(cov[0]+kMeanSigmaY*kMeanSigmaY),kMaxSigmaY);
805 Float_t sigmaz = TMath::Max(TMath::Sqrt(cov[2]+kMeanSigmaZ*kMeanSigmaZ),kMaxSigmaZ);
810 // py calculation - 75% admixture of original sigma - 25% tails
812 normwidth = fDy/sigmay;
814 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
815 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
818 normwidth = fDy/(3.*sigmay);
819 normd = dy/(3.*sigmay);
820 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
821 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
824 // pz calculation - 75% admixture of original sigma - 25% tails
826 normwidth = fDz/sigmaz;
828 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
829 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
832 normwidth = fDz/(3.*sigmaz);
833 normd = dz/(3.*sigmaz);
834 p0 = 0.5*(1+TMath::Erf(normd-normwidth*0.5));
835 p1 = 0.5*(1+TMath::Erf(normd+normwidth*0.5));
838 //_________________________________________________________________________
840 void AliTOFtrackerMI::FillClusterArray(TObjArray* arr) const
843 // Returns the TOF cluster array
849 for (Int_t i=0; i<fN; ++i) arr->Add(fClusters[i]);