From 1d834a1eac7e6801091018f2bbc21a64b299e7eb Mon Sep 17 00:00:00 2001 From: decaro Date: Thu, 10 Feb 2011 19:50:48 +0000 Subject: [PATCH] Fix for coverity --- TOF/AliTOFClusterFinder.cxx | 9 ++++++ TOF/AliTOFClusterFinderV1.cxx | 58 +++++++++++++++++++++++++---------- TOF/AliTOFDigitizer.cxx | 6 ++-- TOF/AliTOFGeometry.cxx | 55 ++++++++++++++++++--------------- TOF/AliTOFLvHvDataPoints.cxx | 53 +++++++++++++++++++++++--------- TOF/AliTOFT0.cxx | 8 +++-- TOF/AliTOFtracker.cxx | 15 ++++++++- TOF/AliTOFtrackerMI.cxx | 14 +++++++-- TOF/AliTOFtrackerV1.cxx | 11 ++++++- TOF/CheckActiveChannels.C | 11 ++++--- 10 files changed, 171 insertions(+), 69 deletions(-) diff --git a/TOF/AliTOFClusterFinder.cxx b/TOF/AliTOFClusterFinder.cxx index c3dae59a901..0d865279f74 100644 --- a/TOF/AliTOFClusterFinder.cxx +++ b/TOF/AliTOFClusterFinder.cxx @@ -156,6 +156,8 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliTOFcalib *calib): // Constructor // + for (Int_t ii=0; iiGetOfflineValidity(); if (validity.CompareTo("valid")==0) { AliInfo(Form(" validity = %s - Using offline calibration parameters",validity.Data())); @@ -185,6 +187,8 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *c // Constructor // + for (Int_t ii=0; iiGetOfflineValidity(); if (validity.CompareTo("valid")==0) { AliInfo(Form(" validity = %s - Using offline calibration parameters",validity.Data())); @@ -210,6 +214,9 @@ AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source) : fTOFRawStream(source.fTOFRawStream) { // copy constructor + + for (Int_t ii=0; iiGetMaxDeltaTime(); @@ -123,6 +125,8 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliRunLoader* runLoader, AliTOFcali // Constructor // + for (Int_t ii=0; iiGetMaxDeltaTime(); @@ -160,6 +164,8 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(const AliTOFClusterFinderV1 &source { // copy constructor + for (Int_t ii=0; iiGetMaxDeltaTime(); @@ -178,6 +184,7 @@ AliTOFClusterFinderV1& AliTOFClusterFinderV1::operator=(const AliTOFClusterFinde return *this; TObject::operator=(source); + for (Int_t ii=0; iiClear(); TClonesArray &aDigits = *fDigits; - if (digitsTree == 0x0) + if (digitsTree == 0x0) { AliFatal("Can not get TreeD for TOF"); + return; + } TBranch *branch = digitsTree->GetBranch("TOF"); if (!branch) { @@ -659,8 +668,8 @@ void AliTOFClusterFinderV1::FillRecPoint() Int_t detectorIndex[5]; for (jj=0; jj<5; jj++) detectorIndex[jj] = -1; - Int_t parTOF[5]; - for (jj=0; jj<5; jj++) parTOF[jj] = -1; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = -1; Int_t trackLabels[3]; for (jj=0; jj<3; jj++) trackLabels[jj] = -1; Int_t digitIndex = -1; @@ -683,6 +692,8 @@ void AliTOFClusterFinderV1::FillRecPoint() parTOF[2] = fTofClusters[ii]->GetADC(); // ADC=TOT parTOF[3] = fTofClusters[ii]->GetTDCND(); // TDCND parTOF[4] = fTofClusters[ii]->GetTDCRAW();//RAW + parTOF[5] = 0; + parTOF[6] = 0; status = fTofClusters[ii]->GetStatus(); posClus[0] = fTofClusters[ii]->GetX(); @@ -759,8 +770,8 @@ void AliTOFClusterFinderV1::FindOnePadClusterPerStrip(Int_t nSector, Double_t covClus[6]; for (jj=0; jj<6; jj++) covClus[jj] = 0.; - Int_t parTOF[5]; - for (jj=0; jj<5; jj++) parTOF[jj] = 0; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = 0; Bool_t status = kTRUE; //assume all sim channels ok in the beginning... @@ -806,6 +817,8 @@ void AliTOFClusterFinderV1::FindOnePadClusterPerStrip(Int_t nSector, parTOF[2] = Int_t(digitInteresting->GetAdc()); parTOF[3] = Int_t(digitInteresting->GetTdcND()); parTOF[4] = Int_t(digitInteresting->GetTdc()); + parTOF[5] = 0; + parTOF[6] = 0; volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); //volIdClus = GetClusterVolIndex(det); @@ -880,8 +893,8 @@ void AliTOFClusterFinderV1::FindClustersWithoutTOT(Int_t nSector, Double_t covClus[6]; for (jj=0; jj<6; jj++) covClus[jj] = 0.; - Int_t parTOF[5]; - for (jj=0; jj<5; jj++) parTOF[jj] = 0; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = 0; Bool_t status = kTRUE; //assume all sim channels ok in the beginning... Int_t tracks[kMaxNumberOfTracksPerDigit]; @@ -927,6 +940,8 @@ void AliTOFClusterFinderV1::FindClustersWithoutTOT(Int_t nSector, parTOF[2] = Int_t(digitInteresting->GetAdc()); parTOF[3] = Int_t(digitInteresting->GetTdcND()); parTOF[4] = Int_t(digitInteresting->GetTdc()); + parTOF[5] = 0; + parTOF[6] = 0; volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); //volIdClus = GetClusterVolIndex(det); @@ -1034,8 +1049,8 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, Int_t iPadX = -1; Int_t iPadZ = -1; - Int_t parTOF[5]; - for (jj=0; jj<5; jj++) parTOF[jj] = 0; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = 0; Double_t posClus[3]; for (jj=0; jj<3; jj++) posClus[jj] = 0.; Int_t det[5]; @@ -1325,6 +1340,7 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, for (jj=0; jj<3; jj++) indDet[jj][4] = padsCluster[2*jj+1+3]; GetClusterPars(/*check,*/ 3, indDet, interestingWeight, posClus, covClus); for (jj=0; jj<3; jj++) delete [] indDet[jj]; + delete [] indDet; // To fill the track index array dummyCounter=-1; @@ -1499,8 +1515,8 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, Int_t iPadZ = -1; Bool_t check = kFALSE; - Int_t parTOF[5]; - for (jj=0; jj<5; jj++) parTOF[jj] = 0; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = 0; Double_t posClus[3]; for (jj=0; jj<3; jj++) posClus[jj] = 0.; Int_t det[5]; @@ -1759,6 +1775,7 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, for (jj=0; jj<2; jj++) indDet[jj][4] = padsCluster[2*jj+1+3]; GetClusterPars(/*check,*/ 2, indDet, interestingWeight, posClus, covClus); for (jj=0; jj<2; jj++) delete [] indDet[jj]; + delete [] indDet; // To fill the track index array dummyCounter=-1; @@ -1905,8 +1922,8 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, Int_t iPadZ = -1; Bool_t check = kFALSE; - Int_t parTOF[5]; - for (jj=0; jj<5; jj++) parTOF[jj] = 0; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = 0; Double_t posClus[3]; for (jj=0; jj<3; jj++) posClus[jj] = 0.; Int_t det[5]; @@ -2166,6 +2183,7 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, for (jj=0; jj<2; jj++) indDet[jj][4] = padsCluster[2*jj+1+3]; GetClusterPars(/*check,*/ 2, indDet, interestingWeight, posClus, covClus); for (jj=0; jj<2; jj++) delete [] indDet[jj]; + delete [] indDet; // To fill the track index array dummyCounter=-1; @@ -2322,8 +2340,8 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, Int_t iPadZ = -1; Bool_t check = kFALSE; - Int_t parTOF[5]; - for (jj=0; jj<5; jj++) parTOF[jj] = 0; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = 0; Double_t posClus[3]; for (jj=0; jj<3; jj++) posClus[jj] = 0.; Int_t det[5]; @@ -2615,6 +2633,7 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (jj=0; jjGetLoader("TOFLoader"); TTree * localTreeD = (TTree*)localTOFLoader->TreeD(); - if (localTreeD == 0x0) + if (localTreeD == 0x0) { AliFatal("Can not get TreeD"); + return; + } TBranch *branch = localTreeD->GetBranch("TOF"); if (!branch) { @@ -3778,5 +3802,7 @@ void AliTOFClusterFinderV1::AverageCalculations(Int_t number, Float_t *interesti parTOF[2] = Int_t(adcAverage); parTOF[3] = Int_t(tofAverage);//tofND parTOF[4] = Int_t(tofAverage);//tofRAW + parTOF[5] = 0; + parTOF[6] = 0; } diff --git a/TOF/AliTOFDigitizer.cxx b/TOF/AliTOFDigitizer.cxx index 419ab6c92ad..590ff4ed94c 100644 --- a/TOF/AliTOFDigitizer.cxx +++ b/TOF/AliTOFDigitizer.cxx @@ -150,8 +150,10 @@ void AliTOFDigitizer::Exec(Option_t* /*option*/) AliTOF * tof = (AliTOF *) gAlice->GetDetector("TOF") ; //Make branches - char branchname[20]; - sprintf (branchname, "%s", tof->GetName ()); + + const Int_t kSize = 20; + char branchname[kSize]; + snprintf(branchname,kSize,"%s", tof->GetName ()); AliRunLoader* outrl = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); if (outrl == 0x0) diff --git a/TOF/AliTOFGeometry.cxx b/TOF/AliTOFGeometry.cxx index 3da173ac3cf..823e8330756 100644 --- a/TOF/AliTOFGeometry.cxx +++ b/TOF/AliTOFGeometry.cxx @@ -526,14 +526,17 @@ void AliTOFGeometry::GetVolumePath(const Int_t * const ind, Char_t *path ) { // This function returns the colume path of a given pad //-------------------------------------------------------------------- Int_t sector = ind[0]; - Char_t string1[100]; - Char_t string2[100]; - Char_t string3[100]; + + const Int_t kSize = 100; + + Char_t string1[kSize]; + Char_t string2[kSize]; + Char_t string3[kSize]; Int_t icopy=-1; icopy=sector; - sprintf(string1,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy); + snprintf(string1,kSize,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy); Int_t iplate=ind[1]; Int_t istrip=ind[2]; @@ -543,16 +546,16 @@ void AliTOFGeometry::GetVolumePath(const Int_t * const ind, Char_t *path ) { if( iplate==3) icopy=istrip+NStripC()+NStripB()+NStripA(); if( iplate==4) icopy=istrip+NStripC()+2*NStripB()+NStripA(); icopy++; - sprintf(string2,"FTOA_0/FLTA_0/FSTR_%i",icopy); + snprintf(string2,kSize,"FTOA_0/FLTA_0/FSTR_%i",icopy); if(fHoles && (sector==13 || sector==14 || sector==15)){ - if(iplate<2) sprintf(string2,"FTOB_0/FLTB_0/FSTR_%i",icopy); - if(iplate>2) sprintf(string2,"FTOC_0/FLTC_0/FSTR_%i",icopy); + if(iplate<2) snprintf(string2,kSize,"FTOB_0/FLTB_0/FSTR_%i",icopy); + if(iplate>2) snprintf(string2,kSize,"FTOC_0/FLTC_0/FSTR_%i",icopy); } Int_t padz = ind[3]+1; Int_t padx = ind[4]+1; - sprintf(string3,"FPCB_1/FSEN_1/FSEZ_%i/FPAD_%i",padz,padx); - sprintf(path,"%s/%s/%s",string1,string2,string3); + snprintf(string3,kSize,"FPCB_1/FSEN_1/FSEZ_%i/FPAD_%i",padz,padx); + snprintf(path,2*kSize,"%s/%s/%s",string1,string2,string3); } //_____________________________________________________________________________ @@ -561,12 +564,14 @@ void AliTOFGeometry::GetVolumePath(Int_t sector, Char_t *path ){ // This function returns the colume path of a given sector //-------------------------------------------------------------------- - Char_t string[100]; + const Int_t kSize = 200; + + Char_t string[kSize]; Int_t icopy = sector; - sprintf(string,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy); - sprintf(path,"%s",string); + snprintf(string,kSize,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy); + snprintf(path,kSize,"%s",string); } //_____________________________________________________________________________ @@ -575,13 +580,15 @@ void AliTOFGeometry::GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_ // This function returns the colume path of a given strip //-------------------------------------------------------------------- - Char_t string1[100]; - Char_t string2[100]; - Char_t string3[100]; + const Int_t kSize = 200; + + Char_t string1[kSize]; + Char_t string2[kSize]; + Char_t string3[kSize]; Int_t icopy = sector; - sprintf(string1,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy); + snprintf(string1,kSize,"/ALIC_1/B077_1/BSEGMO%i_1/BTOF%i_1",icopy,icopy); if(plate==0) icopy=strip; if(plate==1) icopy=strip+NStripC(); @@ -589,14 +596,14 @@ void AliTOFGeometry::GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_ if(plate==3) icopy=strip+NStripC()+NStripB()+NStripA(); if(plate==4) icopy=strip+NStripC()+2*NStripB()+NStripA(); icopy++; - sprintf(string2,"FTOA_0/FLTA_0/FSTR_%i",icopy); + snprintf(string2,kSize,"FTOA_0/FLTA_0/FSTR_%i",icopy); if(fHoles && (sector==13 || sector==14 || sector==15)){ - if(plate<2) sprintf(string2,"FTOB_0/FLTB_0/FSTR_%i",icopy); - if(plate>2) sprintf(string2,"FTOC_0/FLTC_0/FSTR_%i",icopy); + if(plate<2) snprintf(string2,kSize,"FTOB_0/FLTB_0/FSTR_%i",icopy); + if(plate>2) snprintf(string2,kSize,"FTOC_0/FLTC_0/FSTR_%i",icopy); } - sprintf(string3,"FPCB_1/FSEN_1"); - sprintf(path,"%s/%s/%s",string1,string2,string3); + snprintf(string3,kSize,"FPCB_1/FSEN_1"); + snprintf(path,2*kSize,"%s/%s/%s",string1,string2,string3); } //_____________________________________________________________________________ @@ -1112,7 +1119,7 @@ Float_t AliTOFGeometry::GetX(const Int_t * const det) const Translation(posLocal,step); // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame - Double_t angles[6]; + Double_t angles[6] = {0.,0.,0.,0.,0.,0.}; if (GetAngles(iplate,istrip) >0.) { angles[0] = 90.; angles[1] = 0.; @@ -1224,7 +1231,7 @@ Float_t AliTOFGeometry::GetY(const Int_t * const det) const // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame - Double_t angles[6]; + Double_t angles[6] = {0.,0.,0.,0.,0.,0.}; if (GetAngles(iplate,istrip) >0.) { angles[0] = 90.; angles[1] = 0.; @@ -1321,7 +1328,7 @@ Float_t AliTOFGeometry::GetZ(const Int_t * const det) const Translation(posLocal,step); // FSTR reference frame -> FTOA/B/C = FLTA/B/C reference frame - Double_t angles[6]; + Double_t angles[6] = {0.,0.,0.,0.,0.,0.}; if (GetAngles(iplate,istrip) >0.) { angles[0] = 90.; angles[1] = 0.; diff --git a/TOF/AliTOFLvHvDataPoints.cxx b/TOF/AliTOFLvHvDataPoints.cxx index 507749d4b77..29d90a5f09a 100644 --- a/TOF/AliTOFLvHvDataPoints.cxx +++ b/TOF/AliTOFLvHvDataPoints.cxx @@ -62,6 +62,10 @@ AliTOFLvHvDataPoints::AliTOFLvHvDataPoints(): { // main constructor + for (Int_t ii=0; iiDelete(); + if (fHVDataPoints) + for (Int_t ii=0; iiDelete(); + if (fMap) + for (Int_t ii=0; iiDelete(); + + } //--------------------------------------------------------------- @@ -877,17 +894,19 @@ void AliTOFLvHvDataPoints::DrawHVandLVMap(Int_t index) // Draw HV+LV map labelled as index // + const Int_t kSize = 100; + if(!fIsProcessed) return; if (index>=fNumberOfHVandLVmaps) return; AliTOFDCSmaps *mappa=(AliTOFDCSmaps*)GetHVandLVmap(index); - char title[100]; - if (index==0) sprintf(title,"HVandLV map at time %d (%dst map)",mappa->GetTime(),index+1); - else if (index==1) sprintf(title,"HVandLV map at time %d (%dnd map)",mappa->GetTime(),index+1); - else if (index==2) sprintf(title,"HVandLV map at time %d (%drd map)",mappa->GetTime(),index+1); - else if (index>=3) sprintf(title,"HVandLV map at time %d (%dth map)",mappa->GetTime(),index+1); + char title[kSize]; + if (index==0) snprintf(title,kSize,"HVandLV map at time %d (%dst map)",mappa->GetTime(),index+1); + else if (index==1) snprintf(title,kSize,"HVandLV map at time %d (%dnd map)",mappa->GetTime(),index+1); + else if (index==2) snprintf(title,kSize,"HVandLV map at time %d (%drd map)",mappa->GetTime(),index+1); + else if (index>=3) snprintf(title,kSize,"HVandLV map at time %d (%dth map)",mappa->GetTime(),index+1); fHisto->Delete(); fHisto = new TH1C("histo","",kNpads,-0.5,kNpads-0.5); //fHisto->Clear(); @@ -907,17 +926,19 @@ void AliTOFLvHvDataPoints::DrawLVMap(Int_t index) // Draw LV map labelled as index // + const Int_t kSize = 100; + if(!fIsProcessed) return; if (index>=fNumberOfLVdataPoints) return; AliTOFDCSmaps *mappa=(AliTOFDCSmaps*)GetLVmap(index); - char title[100]; - if (index==0) sprintf(title,"LV map at time %d (%dst map)",mappa->GetTime(),index+1); - else if (index==1) sprintf(title,"LV map at time %d (%dnd map)",mappa->GetTime(),index+1); - else if (index==2) sprintf(title,"LV map at time %d (%drd map)",mappa->GetTime(),index+1); - else if (index>=3) sprintf(title,"LV map at time %d (%dth map)",mappa->GetTime(),index+1); + char title[kSize]; + if (index==0) snprintf(title,kSize,"LV map at time %d (%dst map)",mappa->GetTime(),index+1); + else if (index==1) snprintf(title,kSize,"LV map at time %d (%dnd map)",mappa->GetTime(),index+1); + else if (index==2) snprintf(title,kSize,"LV map at time %d (%drd map)",mappa->GetTime(),index+1); + else if (index>=3) snprintf(title,kSize,"LV map at time %d (%dth map)",mappa->GetTime(),index+1); fHisto->Delete(); fHisto = new TH1C("histo","",kNpads,-0.5,kNpads-0.5); //fHisto->Clear(); @@ -937,17 +958,19 @@ void AliTOFLvHvDataPoints::DrawHVMap(Int_t index) // Draw HV map labelled as index // + const Int_t kSize = 100; + if(!fIsProcessed) return; if (index>=fNumberOfHVdataPoints) return; AliTOFDCSmaps *mappa=(AliTOFDCSmaps*)GetHVmap(index); - char title[100]; - if (index==0) sprintf(title,"HV map at time %d (%dst map)",mappa->GetTime(),index+1); - else if (index==1) sprintf(title,"HV map at time %d (%dnd map)",mappa->GetTime(),index+1); - else if (index==2) sprintf(title,"HV map at time %d (%drd map)",mappa->GetTime(),index+1); - else if (index>=3) sprintf(title,"HV map at time %d (%dth map)",mappa->GetTime(),index+1); + char title[kSize]; + if (index==0) snprintf(title,kSize,"HV map at time %d (%dst map)",mappa->GetTime(),index+1); + else if (index==1) snprintf(title,kSize,"HV map at time %d (%dnd map)",mappa->GetTime(),index+1); + else if (index==2) snprintf(title,kSize,"HV map at time %d (%drd map)",mappa->GetTime(),index+1); + else if (index>=3) snprintf(title,kSize,"HV map at time %d (%dth map)",mappa->GetTime(),index+1); fHisto->Delete(); fHisto = new TH1C("histo","",kNpads,-0.5,kNpads-0.5); //fHisto->Clear(); diff --git a/TOF/AliTOFT0.cxx b/TOF/AliTOFT0.cxx index 0e2f7b4a261..6dabb7a6710 100644 --- a/TOF/AliTOFT0.cxx +++ b/TOF/AliTOFT0.cxx @@ -299,9 +299,9 @@ void AliTOFT0::Exec(Option_t *option) gAlice->GetMCApp()->ResetHits(); hitTree->GetEvent(track); - AliMC *mcApplication = (AliMC*)gAlice->GetMCApp(); + //AliMC *mcApplication = (AliMC*)gAlice->GetMCApp(); - particle = mcApplication->Particle(track); + //particle = mcApplication->Particle(track); Int_t nhits = tofHits->GetEntriesFast(); for (Int_t hit = 0; hit < nhits; hit++) @@ -493,7 +493,9 @@ void AliTOFT0::Exec(Option_t *option) delete c3; c3=0; // generating output filename only if not previously specified using SetTZeroFile - char outFileName[70]; + + const Int_t kSize = 70; + char outFileName[kSize]; strcpy(outFileName,"ht010tr120ps"); // global time resolution has to be converted from Int_t to char // in order to have in the output filename this parameter strcat(outFileName,fHeadersFile); diff --git a/TOF/AliTOFtracker.cxx b/TOF/AliTOFtracker.cxx index c75ea211764..1b60e287b97 100644 --- a/TOF/AliTOFtracker.cxx +++ b/TOF/AliTOFtracker.cxx @@ -93,6 +93,8 @@ AliTOFtracker::AliTOFtracker(): { //AliTOFtracker main Ctor + for (Int_t ii=0; iiDelete(); + } + } //_____________________________________________________________________________ void AliTOFtracker::GetPidSettings(AliESDpid *esdPID) { @@ -317,7 +324,8 @@ Int_t AliTOFtracker::PropagateBack(AliESDEvent * const event) { // fPid->MakePID(event,timeZero); fSeeds->Clear(); - fTracks->Delete(); + //fTracks->Delete(); + fTracks->Clear(); return 0; } @@ -632,6 +640,11 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){ } } // loop on found TOF track points + if (idclus==-1) { + AliDebug(1,Form("Reconstructed track %d doesn't match any TOF cluster", iseed)); + delete trackTOFin; + continue; + } AliTOFcluster *c=fClusters[idclus]; diff --git a/TOF/AliTOFtrackerMI.cxx b/TOF/AliTOFtrackerMI.cxx index f9f5aee3130..61aad638883 100644 --- a/TOF/AliTOFtrackerMI.cxx +++ b/TOF/AliTOFtrackerMI.cxx @@ -70,6 +70,8 @@ AliTOFtrackerMI::AliTOFtrackerMI(): { //AliTOFtrackerMI main Ctor + for (Int_t ii=0; iiDelete(); + } + } //_____________________________________________________________________________ void AliTOFtrackerMI::GetPidSettings(AliESDpid *esdPID) { @@ -297,7 +305,7 @@ void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){ Float_t mintimedist[kNclusterMax]; Float_t likelihood[kNclusterMax]; Float_t length[kNclusterMax]; - Double_t tpcpid[5]; + Double_t tpcpid[AliPID::kSPECIES]; dist3D[0][0]=1; for (Int_t i=0; iGetTPCpid(tpcpid); Double_t sumpid=0; - for (Int_t ipid=0;ipid<5;ipid++){ + for (Int_t ipid=0;ipid0) tpcpid[ipid]/=sumpid; else{ tpcpid[ipid]=0.2; diff --git a/TOF/AliTOFtrackerV1.cxx b/TOF/AliTOFtrackerV1.cxx index e3ac610b7fc..ac471535949 100644 --- a/TOF/AliTOFtrackerV1.cxx +++ b/TOF/AliTOFtrackerV1.cxx @@ -80,7 +80,9 @@ AliTOFtrackerV1::AliTOFtrackerV1(): fHRecSigYVsPWin(0x0), fHRecSigZVsPWin(0x0) { - //AliTOFtrackerV1 main Ctor + //AliTOFtrackerV1 main Ctor + + for (Int_t ii=0; iiDelete(); + } + } //_____________________________________________________________________________ void AliTOFtrackerV1::GetPidSettings(AliESDpid *esdPID) { diff --git a/TOF/CheckActiveChannels.C b/TOF/CheckActiveChannels.C index ea4c49165bc..83c589a6472 100644 --- a/TOF/CheckActiveChannels.C +++ b/TOF/CheckActiveChannels.C @@ -1,5 +1,5 @@ CheckActiveChannels(const Char_t *); -CheckActiveChannels(Int_t); +CheckActiveChannels(Int_t nrun=-1); CheckActiveChannelsFromCDBEntry(AliCDBEntry *); //____________________________________________________________________ @@ -15,14 +15,17 @@ CheckActiveChannels(const Char_t *fileName) //____________________________________________________________________ -CheckActiveChannels(Int_t run) +CheckActiveChannels(Int_t nrun) { TGrid *alien = TGrid::Connect("alien://"); if (!alien || !alien->IsConnected()) return; AliCDBManager *cdbm = AliCDBManager::Instance(); cdbm->SetDefaultStorage("raw://"); - cdbm->SetRun(80015); + if (nrun==-1) + cdbm->SetRun(80015); + else + cdbm->SetRun(nrun); AliCDBEntry *cdbe = cdbm->Get("TOF/Calib/Status"); CheckActiveChannelsFromCDBEntry(cdbe); @@ -41,7 +44,7 @@ CheckActiveChannelsFromCDBEntry(AliCDBEntry *cdbe) Bool_t hw_ok, pulser_ok, noise_ok; for (Int_t i = 0; i < array->GetSize(); i++) { hw_ok = array->GetHWStatus(i) & AliTOFChannelOnlineStatusArray::kTOFHWOk; - pulser_ok = array->GetPulserStatus(i) & AliTOFChannelOnlineStatusArray::kTOFPulserOk; + pulser_ok = !(array->GetPulserStatus(i) & AliTOFChannelOnlineStatusArray::kTOFPulserBad); noise_ok = array->GetNoiseStatus(i) & AliTOFChannelOnlineStatusArray::kTOFNoiseOk; hStatus_hw_ok->SetBinContent(i + 1, hw_ok); hStatus_pulser_ok->SetBinContent(i + 1, pulser_ok); -- 2.43.5