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 // -- Authors : S. Arcelli, C. Zampolli (Bologna University and INFN) //
23 // -- Contacts: Annalisa.De.Caro@cern.ch //
24 // -- : Chiara.Zampolli@bo.infn.it //
25 // -- : Silvia.Arcelli@bo.infn.it //
27 //--------------------------------------------------------------------//
31 #include "TClonesArray.h"
32 #include "TGeoManager.h"
37 #include "AliAlignObj.h"
38 #include "AliESDtrack.h"
41 #include "AliTrackPointArray.h"
43 #include "AliTOFcalib.h"
44 #include "AliTOFcluster.h"
45 #include "AliTOFGeometry.h"
46 #include "AliTOFtracker.h"
47 #include "AliTOFtrack.h"
49 extern TGeoManager *gGeoManager;
51 ClassImp(AliTOFtracker)
53 //_____________________________________________________________________________
54 AliTOFtracker::AliTOFtracker(AliTOFGeometry * geom, Double_t parPID[2]):
56 fTOFpid(new AliTOFpidESD(parPID)),
93 //AliTOFtracker main Ctor
95 fDy=AliTOFGeometry::XPad();
96 fDz=AliTOFGeometry::ZPad();
98 //_____________________________________________________________________________
99 AliTOFtracker::AliTOFtracker(const AliTOFtracker &t):
129 fHRecSigYVsPWin(0x0),
130 fHRecSigZVsPWin(0x0),
139 //AliTOFtracker copy Ctor
143 fNseedsTOF=t.fNseedsTOF;
144 fngoodmatch=t.fngoodmatch;
145 fnbadmatch=t.fnbadmatch;
146 fnunmatch=t.fnunmatch;
151 fTOFHeigth=t.fTOFHeigth;
163 //_____________________________________________________________________________
164 AliTOFtracker& AliTOFtracker::operator=(const AliTOFtracker &t)
166 //AliTOFtracker assignment operator
168 this->fHoles=t.fHoles;
169 this->fNseeds=t.fNseeds;
170 this->fNseedsTOF=t.fNseedsTOF;
171 this->fngoodmatch=t.fngoodmatch;
172 this->fnbadmatch=t.fnbadmatch;
173 this->fnunmatch=t.fnunmatch;
174 this->fnmatch=t.fnmatch;
175 this->fGeom = t.fGeom;
176 this->fTOFpid = t.fTOFpid;
178 this->fTOFHeigth=t.fTOFHeigth;
183 this->fDzMax=t.fDzMax;
184 this->fDyMax=t.fDyMax;
185 this->fSeeds=t.fSeeds;
186 this->fTracks=t.fTracks;
191 //_____________________________________________________________________________
192 AliTOFtracker::~AliTOFtracker() {
200 delete fHDigClusTime;
206 delete fHRecSigYVsPWin;
207 delete fHRecSigZVsPWin;
210 //_____________________________________________________________________________
211 Int_t AliTOFtracker::PropagateBack(AliESD* event) {
213 // Gets seeds from ESD event and Match with TOF Clusters
217 //Initialise some counters
226 Int_t ntrk=event->GetNumberOfTracks();
228 fSeeds= new TClonesArray("AliESDtrack",ntrk);
229 TClonesArray &aESDTrack = *fSeeds;
232 //Load ESD tracks into a local Array of ESD Seeds
234 for (Int_t i=0; i<fNseeds; i++) {
235 AliESDtrack *t=event->GetTrack(i);
236 new(aESDTrack[i]) AliESDtrack(*t);
239 //Prepare ESD tracks candidates for TOF Matching
242 //First Step with Strict Matching Criterion
245 for (Int_t ijk=0; ijk<fN; ijk++) {
246 AliInfo(Form("%4i %4i %f %f %f %f %f %2i %1i %2i %1i %2i",ijk, fClusters[ijk]->GetIndex(),fClusters[ijk]->GetZ(),fClusters[ijk]->GetR(),fClusters[ijk]->GetPhi(), fClusters[ijk]->GetTDC(),fClusters[ijk]->GetADC(),fClusters[ijk]->GetDetInd(0),fClusters[ijk]->GetDetInd(1),fClusters[ijk]->GetDetInd(2),fClusters[ijk]->GetDetInd(3),fClusters[ijk]->GetDetInd(4)));
250 //Second Step with Looser Matching Criterion
253 AliInfo(Form("Number of matched tracks: %d",fnmatch));
254 AliInfo(Form("Number of good matched tracks: %d",fngoodmatch));
255 AliInfo(Form("Number of bad matched tracks: %d",fnbadmatch));
257 //Update the matched ESD tracks
259 for (Int_t i=0; i<ntrk; i++) {
260 AliESDtrack *t=event->GetTrack(i);
261 AliESDtrack *seed =(AliESDtrack*)fSeeds->UncheckedAt(i);
262 if(seed->GetTOFsignal()>0){
263 t->SetTOFsignal(seed->GetTOFsignal());
264 t->SetTOFcluster(seed->GetTOFcluster());
265 t->SetTOFsignalToT(seed->GetTOFsignalToT());
266 t->SetTOFCalChannel(seed->GetTOFCalChannel());
267 Int_t tlab[3]; seed->GetTOFLabel(tlab);
268 t->SetTOFLabel(tlab);
269 AliTOFtrack *track = new AliTOFtrack(*seed);
270 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
277 fTOFpid->MakePID(event);
292 //_________________________________________________________________________
293 void AliTOFtracker::CollectESD() {
294 //prepare the set of ESD tracks to be matched to clusters in TOF
296 fTracks= new TClonesArray("AliTOFtrack");
297 TClonesArray &aTOFTrack = *fTracks;
298 for (Int_t i=0; i<fNseeds; i++) {
300 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(i);
301 if ((t->GetStatus()&AliESDtrack::kTPCout)==0)continue;
303 // TRD good tracks, already propagated at 371 cm
305 AliTOFtrack *track = new AliTOFtrack(*t); // New
306 Double_t x = track->GetX(); //New
308 if (((t->GetStatus()&AliESDtrack::kTRDout)!=0 ) &&
309 ( x >= fGeom->RinTOF()) ){
310 track->SetSeedIndex(i);
311 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
312 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
317 // Propagate the rest of TPCbp
320 if(track->PropagateToInnerTOF(fHoles)){ // temporary solution
321 // if(track->PropagateToInnerTOF(fGeom->GetHoles())){
322 track->SetSeedIndex(i);
323 t->UpdateTrackParams(track,AliESDtrack::kTOFout);
324 new(aTOFTrack[fNseedsTOF]) AliTOFtrack(*track);
331 AliInfo(Form("Number of TOF seedds %i",fNseedsTOF));
333 // Sort according uncertainties on track position
337 //_________________________________________________________________________
338 void AliTOFtracker::MatchTracks( Bool_t mLastStep){
340 //Match ESD tracks to clusters in TOF
343 Int_t nSteps=(Int_t)(fTOFHeigth/0.1);
345 AliTOFcalib *calib = new AliTOFcalib(fGeom);
346 //PH Arrays (moved outside of the loop)
347 Float_t * trackPos[4];
348 for (Int_t ii=0; ii<4; ii++) trackPos[ii] = new Float_t[nSteps];
350 for (Int_t ii=0;ii<6;ii++) clind[ii] = new Int_t[fN];
352 for (Int_t iseed=0; iseed<fNseedsTOF; iseed++) {
354 AliTOFtrack *track =(AliTOFtrack*)fTracks->UncheckedAt(iseed);
355 AliESDtrack *t =(AliESDtrack*)fSeeds->UncheckedAt(track->GetSeedIndex());
356 if(t->GetTOFsignal()>0. ) continue;
357 AliTOFtrack *trackTOFin =new AliTOFtrack(*track);
363 Float_t cxpos[10000];
364 Float_t crecL[10000];
365 TGeoHMatrix global[1000];
367 // Determine a window around the track
370 trackTOFin->GetExternalParameters(x,par);
372 trackTOFin->GetExternalCovariance(cov);
374 Float_t scalefact=3.;
377 ((5*TMath::Sqrt(cov[0]) + 0.5*fDy + 2.5*TMath::Abs(par[2]))/fR);
380 (5*TMath::Sqrt(cov[2]) + 0.5*fDz + 2.5*TMath::Abs(par[3]));
382 Double_t phi=TMath::ATan2(par[0],x) + trackTOFin->GetAlpha();
383 if (phi<-TMath::Pi())phi+=2*TMath::Pi();
384 if (phi>=TMath::Pi())phi-=2*TMath::Pi();
387 //upper limit on window's size.
389 if(dz> fDzMax) dz=fDzMax;
390 if(dphi*fR>fDyMax) dphi=fDyMax/fR;
395 // find the clusters in the window of the track
397 for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {
399 AliTOFcluster *c=fClusters[k];
400 if (c->GetZ() > z+dz) break;
401 if (c->IsUsed()) continue;
403 if (!c->GetStatus()) continue; // skip bad channels as declared in OCDB
405 //AliInfo(Form(" fClusters[k]->GetZ() (%f) z-dz (%f) %4i ", fClusters[k]->GetZ(), z-dz, k));
407 Double_t dph=TMath::Abs(c->GetPhi()-phi);
408 if (dph>TMath::Pi()) dph-=2.*TMath::Pi();
409 if (TMath::Abs(dph)>dphi) continue;
412 //Double_t maxChi2=150.; // "calibration constant". Needs to be tuned.
413 Double_t yc=(c->GetPhi() - trackTOFin->GetAlpha())*c->GetR();
414 Double_t p[2]={yc, c->GetZ()};
415 Double_t cov[3]={fDy*fDy/12., 0., fDz*fDz/12.};
416 if (trackTOFin->AliExternalTrackParam::GetPredictedChi2(p,cov) > 150.)
420 clind[0][nc] = c->GetDetInd(0);
421 clind[1][nc] = c->GetDetInd(1);
422 clind[2][nc] = c->GetDetInd(2);
423 clind[3][nc] = c->GetDetInd(3);
424 clind[4][nc] = c->GetDetInd(4);
433 fGeom->GetVolumePath(ind,path);
434 gGeoManager->cd(path);
435 global[nc] = *gGeoManager->GetCurrentMatrix();
439 //if (nc) AliInfo(Form("seed for TOF %4i and number of clusters in the track window %4i (cluster index %4i) %4i",i,nc, clind[5][0], fN));
441 //start fine propagation
443 Int_t nStepsDone = 0;
444 for( Int_t istep=0; istep<nSteps; istep++){
446 Float_t xs=fGeom->RinTOF()+istep*0.1;
447 Double_t ymax=xs*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
450 Double_t ysect=trackTOFin->GetYat(xs,skip);
453 if (!trackTOFin->Rotate(AliTOFGeometry::GetAlpha())) {
456 } else if (ysect <-ymax) {
457 if (!trackTOFin->Rotate(-AliTOFGeometry::GetAlpha())) {
462 if(!trackTOFin->PropagateTo(xs)) {
468 // store the running point (Globalrf) - fine propagation
471 trackTOFin->GetXYZ(r);
472 trackPos[0][istep]= (Float_t) r[0];
473 trackPos[1][istep]= (Float_t) r[1];
474 trackPos[2][istep]= (Float_t) r[2];
475 trackPos[3][istep]= trackTOFin->GetIntegratedLength();
480 for (Int_t istep=0; istep<nStepsDone; istep++) {
482 Bool_t isInside =kFALSE;
483 Float_t ctrackPos[3];
485 ctrackPos[0]= trackPos[0][istep];
486 ctrackPos[1]= trackPos[1][istep];
487 ctrackPos[2]= trackPos[2][istep];
489 //now see whether the track matches any of the TOF clusters
491 for (Int_t i=0; i<nc; i++){
493 cind[0]= clind[0][i];
494 cind[1]= clind[1][i];
495 cind[2]= clind[2][i];
496 cind[3]= clind[3][i];
497 cind[4]= clind[4][i];
498 Bool_t accept = kFALSE;
499 if( mLastStep)accept = (fGeom->DistanceToPad(cind,global[i],ctrackPos)<fdCut);
500 if(!mLastStep)accept = (fGeom->IsInsideThePad(cind,global[i],ctrackPos));
502 if(!mLastStep)isInside=kTRUE;
503 dist[nfound]=fGeom->DistanceToPad(cind,global[i],ctrackPos);
504 crecL[nfound]=trackPos[3][istep];
505 index[nfound]=clind[5][i]; // store cluster id
506 cxpos[nfound]=fGeom->RinTOF()+istep*0.1; //store prop.radius
510 } //end for on the clusters
514 } //end for on the steps
526 // now choose the cluster to be matched with the track.
531 Float_t mindist=1000.;
532 for (Int_t iclus= 0; iclus<nfound;iclus++){
533 if (dist[iclus]< mindist){
534 mindist = dist[iclus];
536 idclus =index[iclus];
537 recL=crecL[iclus]+fDx*0.5;
541 AliTOFcluster *c=fClusters[idclus];
542 c->Use(); //AliInfo(Form("I am using the cluster"));
544 // Track length correction for matching Step 2
547 Float_t rc=TMath::Sqrt(c->GetR()*c->GetR() + c->GetZ()*c->GetZ());
548 Float_t rt=TMath::Sqrt(trackPos[0][70]*trackPos[0][70]
549 +trackPos[1][70]*trackPos[1][70]
550 +trackPos[2][70]*trackPos[2][70]);
552 recL=trackPos[3][70]+dlt;
556 (c->GetLabel(0)==TMath::Abs(trackTOFin->GetLabel()))
558 (c->GetLabel(1)==TMath::Abs(trackTOFin->GetLabel()))
560 (c->GetLabel(2)==TMath::Abs(trackTOFin->GetLabel()))
564 //AliInfo(Form(" track label good %5i",trackTOFin->GetLabel()));
570 //AliInfo(Form(" track label bad %5i",trackTOFin->GetLabel()));
576 // Store quantities to be used in the TOF Calibration
577 Float_t tToT=AliTOFGeometry::TdcBinWidth()*c->GetToT()*1E-3; // in ns
578 t->SetTOFsignalToT(tToT);
580 ind[0]=c->GetDetInd(0);
581 ind[1]=c->GetDetInd(1);
582 ind[2]=c->GetDetInd(2);
583 ind[3]=c->GetDetInd(3);
584 ind[4]=c->GetDetInd(4);
585 Int_t calindex = calib->GetIndex(ind);
586 t->SetTOFCalChannel(calindex);
588 // keep track of the track labels in the matched cluster
590 tlab[0]=c->GetLabel(0);
591 tlab[1]=c->GetLabel(1);
592 tlab[2]=c->GetLabel(2);
594 Double_t tof=AliTOFGeometry::TdcBinWidth()*c->GetTDC()+32; // in ps
595 t->SetTOFsignal(tof);
596 //t->SetTOFcluster(c->GetIndex()); // pointing to the digits tree
597 t->SetTOFcluster(idclus); // pointing to the recPoints tree
598 Double_t time[10]; t->GetIntegratedTimes(time);
599 Double_t mom=t->GetP();
600 for(Int_t j=0;j<=AliPID::kSPECIES;j++){
601 Double_t mass=AliPID::ParticleMass(j);
602 time[j]+=(recL-trackPos[3][0])/3e-2*TMath::Sqrt(mom*mom+mass*mass)/mom;
605 AliTOFtrack *trackTOFout = new AliTOFtrack(*t);
606 trackTOFout->PropagateTo(xpos);
607 t->UpdateTrackParams(trackTOFout,AliESDtrack::kTOFout);
608 t->SetIntegratedLength(recL);
609 t->SetIntegratedTimes(time);
610 t->SetTOFLabel(tlab);
611 // Fill Reco-QA histos for Reconstruction
612 fHRecNClus->Fill(nc);
613 fHRecDist->Fill(mindist);
614 fHRecSigYVsP->Fill(mom,TMath::Sqrt(cov[0]));
615 fHRecSigZVsP->Fill(mom,TMath::Sqrt(cov[2]));
616 fHRecSigYVsPWin->Fill(mom,dphi*fR);
617 fHRecSigZVsPWin->Fill(mom,dz);
619 // Fill Tree for on-the-fly offline Calibration
621 if ( !((t->GetStatus() & AliESDtrack::kTIME)==0 )){
622 Float_t rawtime=AliTOFGeometry::TdcBinWidth()*c->GetTDCRAW()+32; // RAW time,in ps
633 for (Int_t ii=0; ii<4; ii++) delete [] trackPos[ii];
634 for (Int_t ii=0;ii<6;ii++) delete [] clind[ii];
637 //_________________________________________________________________________
638 Int_t AliTOFtracker::LoadClusters(TTree *cTree) {
639 //--------------------------------------------------------------------
640 //This function loads the TOF clusters
641 //--------------------------------------------------------------------
643 Int_t npadX = fGeom->NpadX();
644 Int_t npadZ = fGeom->NpadZ();
645 Int_t nStripA = fGeom->NStripA();
646 Int_t nStripB = fGeom->NStripB();
647 Int_t nStripC = fGeom->NStripC();
649 TBranch *branch=cTree->GetBranch("TOF");
651 AliError("can't get the branch with the TOF clusters !");
655 TClonesArray dummy("AliTOFcluster",10000), *clusters=&dummy;
656 branch->SetAddress(&clusters);
659 Int_t nc=clusters->GetEntriesFast();
660 fHDigNClus->Fill(nc);
662 AliInfo(Form("Number of clusters: %d",nc));
664 for (Int_t i=0; i<nc; i++) {
665 AliTOFcluster *c=(AliTOFcluster*)clusters->UncheckedAt(i);
666 fClusters[i]=new AliTOFcluster(*c); fN++;
668 // Fill Digits QA histos
670 Int_t isector = c->GetDetInd(0);
671 Int_t iplate = c->GetDetInd(1);
672 Int_t istrip = c->GetDetInd(2);
673 Int_t ipadX = c->GetDetInd(4);
674 Int_t ipadZ = c->GetDetInd(3);
676 Float_t time = (AliTOFGeometry::TdcBinWidth()*c->GetTDC())*1E-3; // in ns
677 Float_t tot = (AliTOFGeometry::TdcBinWidth()*c->GetToT())*1E-3;//in ns
679 Int_t stripOffset = 0;
685 stripOffset = nStripC;
688 stripOffset = nStripC+nStripB;
691 stripOffset = nStripC+nStripB+nStripA;
694 stripOffset = nStripC+nStripB+nStripA+nStripB;
697 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
700 Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
701 Int_t phiindex=npadX*isector+ipadX+1;
702 fHDigClusMap->Fill(zindex,phiindex);
703 fHDigClusTime->Fill(time);
704 fHDigClusToT->Fill(tot);
706 //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)));
707 //AliInfo(Form("%i %f",i, fClusters[i]->GetZ()));
710 //AliInfo(Form("Number of clusters: %d",fN));
714 //_________________________________________________________________________
715 void AliTOFtracker::UnloadClusters() {
716 //--------------------------------------------------------------------
717 //This function unloads TOF clusters
718 //--------------------------------------------------------------------
719 for (Int_t i=0; i<fN; i++) {
726 //_________________________________________________________________________
727 Int_t AliTOFtracker::FindClusterIndex(Double_t z) const {
728 //--------------------------------------------------------------------
729 // This function returns the index of the nearest cluster
730 //--------------------------------------------------------------------
732 if (z <= fClusters[0]->GetZ()) return 0;
733 if (z > fClusters[fN-1]->GetZ()) return fN;
734 Int_t b=0, e=fN-1, m=(b+e)/2;
735 for (; b<e; m=(b+e)/2) {
736 if (z > fClusters[m]->GetZ()) b=m+1;
742 //_________________________________________________________________________
743 Bool_t AliTOFtracker::GetTrackPoint(Int_t index, AliTrackPoint& p) const
745 // Get track space point with index i
746 // Coordinates are in the global system
747 AliTOFcluster *cl = fClusters[index];
749 xyz[0] = cl->GetR()*TMath::Cos(cl->GetPhi());
750 xyz[1] = cl->GetR()*TMath::Sin(cl->GetPhi());
752 Float_t phiangle = (Int_t(cl->GetPhi()*TMath::RadToDeg()/20.)+0.5)*20.*TMath::DegToRad();
753 Float_t sinphi = TMath::Sin(phiangle), cosphi = TMath::Cos(phiangle);
754 Float_t tiltangle = fGeom->GetAngles(cl->GetDetInd(1),cl->GetDetInd(2))*TMath::DegToRad();
755 Float_t sinth = TMath::Sin(tiltangle), costh = TMath::Cos(tiltangle);
756 Float_t sigmay2 = fGeom->XPad()*fGeom->XPad()/12.;
757 Float_t sigmaz2 = fGeom->ZPad()*fGeom->ZPad()/12.;
759 cov[0] = sinphi*sinphi*sigmay2 + cosphi*cosphi*sinth*sinth*sigmaz2;
760 cov[1] = -sinphi*cosphi*sigmay2 + sinphi*cosphi*sinth*sinth*sigmaz2;
761 cov[2] = -cosphi*sinth*costh*sigmaz2;
762 cov[3] = cosphi*cosphi*sigmay2 + sinphi*sinphi*sinth*sinth*sigmaz2;
763 cov[4] = -sinphi*sinth*costh*sigmaz2;
764 cov[5] = costh*costh*sigmaz2;
765 p.SetXYZ(xyz[0],xyz[1],xyz[2],cov);
767 // Detector numbering scheme
768 Int_t nSector = fGeom->NSectors();
769 Int_t nPlate = fGeom->NPlates();
770 Int_t nStripA = fGeom->NStripA();
771 Int_t nStripB = fGeom->NStripB();
772 Int_t nStripC = fGeom->NStripC();
774 Int_t isector = cl->GetDetInd(0);
775 if (isector >= nSector)
776 AliError(Form("Wrong sector number in TOF (%d) !",isector));
777 Int_t iplate = cl->GetDetInd(1);
778 if (iplate >= nPlate)
779 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
780 Int_t istrip = cl->GetDetInd(2);
782 Int_t stripOffset = 0;
788 stripOffset = nStripC;
791 stripOffset = nStripC+nStripB;
794 stripOffset = nStripC+nStripB+nStripA;
797 stripOffset = nStripC+nStripB+nStripA+nStripB;
800 AliError(Form("Wrong plate number in TOF (%d) !",iplate));
804 Int_t idet = (2*(nStripC+nStripB)+nStripA)*isector +
807 UShort_t volid = AliAlignObj::LayerToVolUID(AliAlignObj::kTOF,idet);
808 p.SetVolumeID((UShort_t)volid);
811 //_________________________________________________________________________
812 void AliTOFtracker::InitCheckHists() {
814 //Init histos for Digits/Reco QA and Calibration
817 fCalTree = new TTree("CalTree", "Tree for TOF calibration");
818 fCalTree->Branch("TOFchannelindex",&fIch,"iTOFch/I");
819 fCalTree->Branch("ToT",&fToT,"TOFToT/F");
820 fCalTree->Branch("TOFtime",&fTime,"TOFtime/F");
821 fCalTree->Branch("PionExpTime",&fExpTimePi,"PiExpTime/F");
822 fCalTree->Branch("KaonExpTime",&fExpTimeKa,"KaExpTime/F");
823 fCalTree->Branch("ProtonExpTime",&fExpTimePr,"PrExpTime/F");
826 fHDigClusMap = new TH2F("TOFDig_ClusMap", "",182,0.5,182.5,864, 0.5,864.5);
827 fHDigNClus = new TH1F("TOFDig_NClus", "",200,0.5,200.5);
828 fHDigClusTime = new TH1F("TOFDig_ClusTime", "",2000,0.,200.);
829 fHDigClusToT = new TH1F("TOFDig_ClusToT", "",500,0.,100);
832 fHRecNClus =new TH1F("TOFRec_NClusW", "",50,0.5,50.5);
833 fHRecDist=new TH1F("TOFRec_Dist", "",50,0.5,10.5);
834 fHRecSigYVsP=new TH2F("TOFDig_SigYVsP", "",40,0.,4.,100, 0.,5.);
835 fHRecSigZVsP=new TH2F("TOFDig_SigZVsP", "",40,0.,4.,100, 0.,5.);
836 fHRecSigYVsPWin=new TH2F("TOFDig_SigYVsPWin", "",40,0.,4.,100, 0.,50.);
837 fHRecSigZVsPWin=new TH2F("TOFDig_SigZVsPWin", "",40,0.,4.,100, 0.,50.);
840 //_________________________________________________________________________
841 void AliTOFtracker::SaveCheckHists() {
843 //write histos for Digits/Reco QA and Calibration
845 TDirectory *dir = gDirectory;
847 TFile *logFileTOF = 0;
849 TSeqCollection *list = gROOT->GetListOfFiles();
850 int N = list->GetEntries();
851 for(int i=0; i<N; i++) {
852 logFile = (TFile*)list->At(i);
853 if (strstr(logFile->GetName(), "AliESDs.root")) break;
856 Bool_t isThere=kFALSE;
857 for(int i=0; i<N; i++) {
858 logFileTOF = (TFile*)list->At(i);
859 if (strstr(logFileTOF->GetName(), "TOFQA.root")){
866 fHDigClusMap->Write(fHDigClusMap->GetName(), TObject::kOverwrite);
867 fHDigNClus->Write(fHDigNClus->GetName(), TObject::kOverwrite);
868 fHDigClusTime->Write(fHDigClusTime->GetName(), TObject::kOverwrite);
869 fHDigClusToT->Write(fHDigClusToT->GetName(), TObject::kOverwrite);
870 fHRecNClus->Write(fHRecNClus->GetName(), TObject::kOverwrite);
871 fHRecDist->Write(fHRecDist->GetName(), TObject::kOverwrite);
872 fHRecSigYVsP->Write(fHRecSigYVsP->GetName(), TObject::kOverwrite);
873 fHRecSigZVsP->Write(fHRecSigZVsP->GetName(), TObject::kOverwrite);
874 fHRecSigYVsPWin->Write(fHRecSigYVsPWin->GetName(), TObject::kOverwrite);
875 fHRecSigZVsPWin->Write(fHRecSigZVsPWin->GetName(), TObject::kOverwrite);
876 fCalTree->Write(fCalTree->GetName(),TObject::kOverwrite);
879 if(!isThere)logFileTOF = new TFile( "TOFQA.root","RECREATE");
881 fHDigClusMap->Write(fHDigClusMap->GetName(), TObject::kOverwrite);
882 fHDigNClus->Write(fHDigNClus->GetName(), TObject::kOverwrite);
883 fHDigClusTime->Write(fHDigClusTime->GetName(), TObject::kOverwrite);
884 fHDigClusToT->Write(fHDigClusToT->GetName(), TObject::kOverwrite);
885 fHRecNClus->Write(fHRecNClus->GetName(), TObject::kOverwrite);
886 fHRecDist->Write(fHRecDist->GetName(), TObject::kOverwrite);
887 fHRecSigYVsP->Write(fHRecSigYVsP->GetName(), TObject::kOverwrite);
888 fHRecSigZVsP->Write(fHRecSigZVsP->GetName(), TObject::kOverwrite);
889 fHRecSigYVsPWin->Write(fHRecSigYVsPWin->GetName(), TObject::kOverwrite);
890 fHRecSigZVsPWin->Write(fHRecSigZVsPWin->GetName(), TObject::kOverwrite);
891 fCalTree->Write(fCalTree->GetName(),TObject::kOverwrite);