]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix for coverity
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Feb 2011 19:50:48 +0000 (19:50 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Feb 2011 19:50:48 +0000 (19:50 +0000)
TOF/AliTOFClusterFinder.cxx
TOF/AliTOFClusterFinderV1.cxx
TOF/AliTOFDigitizer.cxx
TOF/AliTOFGeometry.cxx
TOF/AliTOFLvHvDataPoints.cxx
TOF/AliTOFT0.cxx
TOF/AliTOFtracker.cxx
TOF/AliTOFtrackerMI.cxx
TOF/AliTOFtrackerV1.cxx
TOF/CheckActiveChannels.C

index c3dae59a9018249a9064f6615e284bb615e34a15..0d865279f74ae7ee9f78821f317081c33493d3aa 100644 (file)
@@ -156,6 +156,8 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliTOFcalib *calib):
 // Constructor
 //
 
+  for (Int_t ii=0; ii<kTofMaxCluster; ii++) fTofClusters[ii]=0x0;
+
   TString validity = (TString)fTOFcalib->GetOfflineValidity();
   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; ii<kTofMaxCluster; ii++) fTofClusters[ii]=0x0;
+
   TString validity = (TString)fTOFcalib->GetOfflineValidity();
   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; ii<kTofMaxCluster; ii++) fTofClusters[ii]=source.fTofClusters[ii];
+
 }
 
 //------------------------------------------------------------------------
@@ -227,6 +234,8 @@ AliTOFClusterFinder& AliTOFClusterFinder::operator=(const AliTOFClusterFinder &s
   fDecoderVersion=source.fDecoderVersion;
   fTOFcalib=source.fTOFcalib;
   fTOFRawStream=source.fTOFRawStream;
+  for (Int_t ii=0; ii<kTofMaxCluster; ii++) fTofClusters[ii]=source.fTofClusters[ii];
+
   return *this;
 
 }
index fe5f61e30389d1ab7ceff431d95ae2bcb00687ba..5e34090e2c5e7709b2d048841a22764d12e7f6cd 100644 (file)
@@ -84,6 +84,8 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliTOFcalib *calib):
 // Constructor
 //
 
+  for (Int_t ii=0; ii<kTofMaxCluster; ii++) fTofClusters[ii]=0x0;
+
   if (AliTOFReconstructor::GetRecoParam()) {
     fkRecoParam = AliTOFReconstructor::GetRecoParam();
     fMaxDeltaTime = fkRecoParam->GetMaxDeltaTime();
@@ -123,6 +125,8 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliRunLoader* runLoader, AliTOFcali
 // Constructor
 //
 
+  for (Int_t ii=0; ii<kTofMaxCluster; ii++) fTofClusters[ii]=0x0;
+
   if (AliTOFReconstructor::GetRecoParam()) {
     fkRecoParam = AliTOFReconstructor::GetRecoParam();
     fMaxDeltaTime = fkRecoParam->GetMaxDeltaTime();
@@ -160,6 +164,8 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(const AliTOFClusterFinderV1 &source
 {
   // copy constructor
 
+  for (Int_t ii=0; ii<kTofMaxCluster; ii++) fTofClusters[ii]=source.fTofClusters[ii];
+
   if (AliTOFReconstructor::GetRecoParam()) {
     fkRecoParam = AliTOFReconstructor::GetRecoParam();
     fMaxDeltaTime = fkRecoParam->GetMaxDeltaTime();
@@ -178,6 +184,7 @@ AliTOFClusterFinderV1& AliTOFClusterFinderV1::operator=(const AliTOFClusterFinde
     return *this;
 
   TObject::operator=(source);
+  for (Int_t ii=0; ii<kTofMaxCluster; ii++) fTofClusters[ii]=source.fTofClusters[ii];
   fDigits=source.fDigits;
   fRecPoints=source.fRecPoints;
   fVerbose=source.fVerbose;
@@ -242,8 +249,10 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr
   fDigits->Clear();
   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; jj<interestingCounter+1; jj++) indDet[jj][4] = padsCluster[2*jj+1+3];
              GetClusterPars(/*check,*/ interestingCounter+1, indDet, interestingWeight, posClus, covClus);
              for (jj=0; jj<interestingCounter+1; jj++) delete [] indDet[jj];
+             delete [] indDet;
 
              // To fill the track index array
              dummyCounter=-1;
@@ -2779,6 +2798,8 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector,
                  for (jj=0; jj<interestingCounter+1; jj++) indDet[jj][4] = padsCluster[2*jj+1+3];
                  GetClusterPars(/*check,*/ interestingCounter+1, indDet, interestingWeight, posClus, covClus);
                  for (jj=0; jj<interestingCounter+1; jj++) delete [] indDet[jj];
+                 delete [] indDet;
+
 
                  // To fill the track index array
                  dummyCounter=-1;
@@ -2993,6 +3014,7 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector,
              for (jj=0; jj<interestingCounter+1; jj++) indDet[jj][4] = padsCluster[2*jj+1+3];
              GetClusterPars(/*check,*/ interestingCounter+1, indDet, interestingWeight, posClus, covClus);
              for (jj=0; jj<interestingCounter+1; jj++) delete [] indDet[jj];
+             delete [] indDet;
 
              // To fill the track index array
              dummyCounter=-1;
@@ -3645,8 +3667,10 @@ void AliTOFClusterFinderV1::Digits2RecPoints(Int_t iEvent)
   AliLoader *localTOFLoader = (AliLoader*)fRunLoader->GetLoader("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;
 
 }
index 419ab6c92ade8ea07e8c276f6dee64d4f4444578..590ff4ed94c2a90e1a3f6904e7a5f10eb4162e0b 100644 (file)
@@ -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)
index 3da173ac3cfa505e1e5287aff7e25337626315ee..823e8330756f1c49fb1278aa4a8cc99efb1e1ec0 100644 (file)
@@ -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.;
index 507749d4b77d257601367392d74bb503b64f351b..29d90a5f09a5a47811c19020dd80000d9e75538a 100644 (file)
@@ -62,6 +62,10 @@ AliTOFLvHvDataPoints::AliTOFLvHvDataPoints():
 {
   // main constructor 
 
+  for (Int_t ii=0; ii<kNmaxDataPoints; ii++) fLVDataPoints[ii]= 0x0;
+  for (Int_t ii=0; ii<kNmaxDataPoints; ii++) fHVDataPoints[ii]= 0x0;
+  for (Int_t ii=0; ii<kNmaxDataPoints; ii++) fMap[ii]= 0x0;
+
 }
 
 //---------------------------------------------------------------
@@ -85,6 +89,10 @@ AliTOFLvHvDataPoints::AliTOFLvHvDataPoints(Int_t nRun, UInt_t startTime, UInt_t
 
   // constructor with arguments
 
+  for (Int_t ii=0; ii<kNmaxDataPoints; ii++) fLVDataPoints[ii]= 0x0;
+  for (Int_t ii=0; ii<kNmaxDataPoints; ii++) fHVDataPoints[ii]= 0x0;
+  for (Int_t ii=0; ii<kNmaxDataPoints; ii++) fMap[ii]= 0x0;
+
   AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s \n\tStartTime DCS Query %s \n\tEndTime DCS Query %s", nRun,
               TTimeStamp(startTime).AsString(),
               TTimeStamp(endTime).AsString(), 
@@ -124,6 +132,15 @@ AliTOFLvHvDataPoints::AliTOFLvHvDataPoints(const AliTOFLvHvDataPoints & data):
     for(int j=0;j<kNplates;j++)
       fAliasNamesXHVmap[i][j]=data.fAliasNamesXHVmap[i][j];
  
+
+  if (fLVDataPoints)
+    for (Int_t ii=0; ii<kNmaxDataPoints; ii++) if (fLVDataPoints[ii]) fLVDataPoints[ii]->Delete();
+  if (fHVDataPoints)
+    for (Int_t ii=0; ii<kNmaxDataPoints; ii++) if (fHVDataPoints[ii]) fHVDataPoints[ii]->Delete();
+  if (fMap)
+    for (Int_t ii=0; ii<kNmaxDataPoints; ii++) if (fMap[ii]) fMap[ii]->Delete();
+
+
 }
 //---------------------------------------------------------------
 
@@ -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();
index 0e2f7b4a261eed2efd8ade6cfafe13fe8c2f62c5..6dabb7a67109f43001f23b6b69ab58c48f4cb433 100644 (file)
@@ -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);
index c75ea2117640e97a9d47c3694b46babc296dd47c..1b60e287b973871c639cfbcb85be2b7d43f4975c 100644 (file)
@@ -93,6 +93,8 @@ AliTOFtracker::AliTOFtracker():
  { 
   //AliTOFtracker main Ctor
    
+   for (Int_t ii=0; ii<kMaxCluster; ii++) fClusters[ii]=0x0;
+
    // Gettimg the geometry 
    fGeom= new AliTOFGeometry();
 
@@ -138,6 +140,11 @@ AliTOFtracker::~AliTOFtracker() {
     fTOFtrackPoints=0x0;
   }
 
+  if (fClusters) {
+    for (Int_t ii=0; ii<kMaxCluster; ii++)
+      if (fClusters[ii]) fClusters[ii]->Delete();
+  }
+
 }
 //_____________________________________________________________________________
 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];
 
index f9f5aee3130a30f3ad9ec90b7a6b939943d29563..61aad6388833548fa04faec6fbc2c743a8cd70a7 100644 (file)
@@ -70,6 +70,8 @@ AliTOFtrackerMI::AliTOFtrackerMI():
  { 
   //AliTOFtrackerMI main Ctor
 
+   for (Int_t ii=0; ii<kMaxCluster; ii++) fClusters[ii]=0x0;
+
    fDy=AliTOFGeometry::XPad(); 
    fDz=AliTOFGeometry::ZPad(); 
    fDebugStreamer = new TTreeSRedirector("TOFdebug.root");   
@@ -96,6 +98,12 @@ AliTOFtrackerMI::~AliTOFtrackerMI(){
     delete fSeeds;
     fSeeds=0x0;
   }
+
+  if (fClusters) {
+    for (Int_t ii=0; ii<kMaxCluster; ii++)
+      if (fClusters[ii]) fClusters[ii]->Delete();
+  }
+
 }
 //_____________________________________________________________________________
 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; i<fNseedsTOF; i++) {
@@ -311,10 +319,10 @@ void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){
     //
     t->GetTPCpid(tpcpid);
     Double_t sumpid=0;
-    for (Int_t ipid=0;ipid<5;ipid++){
+    for (Int_t ipid=0;ipid<AliPID::kSPECIES;ipid++){
       sumpid+=tpcpid[ipid];
     }
-    for (Int_t ipid=0;ipid<5;ipid++){
+    for (Int_t ipid=0;ipid<AliPID::kSPECIES;ipid++){
       if (sumpid>0) tpcpid[ipid]/=sumpid;
       else{
        tpcpid[ipid]=0.2;
index e3ac610b7fceb6075531c858a61991a4ffe88bf8..ac4715359492687b3ea68dd1c98e358912315c95 100644 (file)
@@ -80,7 +80,9 @@ AliTOFtrackerV1::AliTOFtrackerV1():
   fHRecSigYVsPWin(0x0),
   fHRecSigZVsPWin(0x0)
  { 
-  //AliTOFtrackerV1 main Ctor
+   //AliTOFtrackerV1 main Ctor
+
+   for (Int_t ii=0; ii<kMaxCluster; ii++) fClusters[ii]=0x0;
 
    InitCheckHists();
 
@@ -117,6 +119,13 @@ AliTOFtrackerV1::~AliTOFtrackerV1() {
     delete fSeeds;
     fSeeds=0x0;
   }
+
+
+  if (fClusters) {
+    for (Int_t ii=0; ii<kMaxCluster; ii++)
+      if (fClusters[ii]) fClusters[ii]->Delete();
+  }
+
 }
 //_____________________________________________________________________________
 void AliTOFtrackerV1::GetPidSettings(AliESDpid *esdPID) {
index ea4c49165bc5bea3af356aaf8fd63232e9c6cb16..83c589a64729ca84e8d5a29c1f8477a86caddcb8 100644 (file)
@@ -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);