Coverity fixes
authorcblume <Christoph.Blume@cern.ch>
Fri, 20 Jun 2014 09:26:09 +0000 (11:26 +0200)
committercblume <Christoph.Blume@cern.ch>
Fri, 20 Jun 2014 09:26:09 +0000 (11:26 +0200)
TRD/AliTRDCalibTask.cxx
TRD/AliTRDCalibViewer.cxx
TRD/AliTRDCalibraFit.cxx
TRD/AliTRDCalibraVector.cxx
TRD/AliTRDclusterizer.cxx
TRD/AliTRDrawData.cxx

index 39cf64f..fe4e810 100644 (file)
@@ -855,7 +855,8 @@ void AliTRDCalibTask::UserExec(Option_t *)
       Int_t nbtracklets = 0;
       
       // Check some stuff
-      Bool_t standalonetracklet = kFALSE;  
+      // Coverity
+      //Bool_t standalonetracklet = kFALSE;  
       const AliTRDseedV1 *tracklet = 0x0;
       //////////////////////////////////////
       // Loop tracklets
@@ -872,8 +873,9 @@ void AliTRDCalibTask::UserExec(Option_t *)
        if(!(tracklet = fTrdTrack->GetTracklet(itr))) continue;
        if(!tracklet->IsOK()) continue;
        ++nbtracklets;
-       standalonetracklet = kFALSE; 
-       if(tracklet->IsStandAlone()) standalonetracklet = kTRUE;
+        // Coverity
+       //standalonetracklet = kFALSE; 
+       //if(tracklet->IsStandAlone()) standalonetracklet = kTRUE;
        
        nbclusters = 0;
        memset(phtb, 0, AliTRDseedV1::kNtb*sizeof(Double_t));
@@ -1493,7 +1495,8 @@ Bool_t AliTRDCalibTask::FindP1TrackPHtrackletV1Test(const AliTRDseedV1 *tracklet
   ////////////
   // results of the linear fit
   Double_t dydt                       = 0.0;                                // dydt tracklet after straight line fit
-  Double_t errorpar                   = 0.0;                                // error after straight line fit on dy/dt
+  // Coverity
+  //Double_t errorpar                   = 0.0;                                // error after straight line fit on dy/dt
   Double_t pointError                 = 0.0;                                // error after straight line fit 
   // pad row problemes: avoid tracklet that cross pad rows, tilting angle in the constant
   Int_t    crossrow                   = 0;                                  // if it crosses a pad row
@@ -1567,7 +1570,8 @@ Bool_t AliTRDCalibTask::FindP1TrackPHtrackletV1Test(const AliTRDseedV1 *tracklet
   linearFitterTracklet.Eval();
   linearFitterTracklet.GetParameters(pars);
   pointError  =  TMath::Sqrt(linearFitterTracklet.GetChisquare()/(nbli-2));
-  errorpar    =  linearFitterTracklet.GetParError(1)*pointError;
+  // Coverity
+  //errorpar    =  linearFitterTracklet.GetParError(1)*pointError;
   dydt        = pars[1]; 
   //printf("chis %f, nbli %d, pointError %f, parError %f, errorpar %f\n",linearFitterTracklet->GetChisquare(),nbli,pointError,linearFitterTracklet->GetParError(1),errorpar);
   linearFitterTracklet.ClearPoints();  
index 90d03a3..48fc3d7 100644 (file)
@@ -775,10 +775,12 @@ Bool_t AliTRDCalibViewer::DumpOCDBtoTreeDetails(const Char_t* runListFilename,
     if(!grpObject)
       cout << "No GRP info available for this run " << endl;
 
-    time_t startTimeGRP = 0;
+    // Coverity
+    //time_t startTimeGRP = 0;
     TObjString runType("");
     if(grpObject) {
-      startTimeGRP = grpObject->GetTimeStart();
+      // Coverity
+      //startTimeGRP = grpObject->GetTimeStart();
       TTimeStamp start(grpObject->GetTimeStart());
       TTimeStamp end(grpObject->GetTimeEnd());
       cout << "Start time: " << start.GetDate()/10000 << "/" 
index a56103a..de973c8 100644 (file)
@@ -1725,7 +1725,8 @@ void AliTRDCalibraFit::RemoveOutliers(Int_t type, Bool_t perdetector){
     return;
   }
   Int_t detector = -1;
-  Int_t sector = -1;
+  // Coverity
+  //Int_t sector = -1;
   Float_t value  = 0.0;
 
   /////////////////////////////////
@@ -1741,7 +1742,8 @@ void AliTRDCalibraFit::RemoveOutliers(Int_t type, Bool_t perdetector){
   ////////////
   for (Int_t k = 0; k < loop; k++) {
     detector  = ((AliTRDFitInfo *) fVectorFit.At(k))->GetDetector();
-    sector = GetSector(detector);
+    // Coverity
+    //sector = GetSector(detector);
     if(perdetector){
       value = ((AliTRDFitInfo *) fVectorFit.At(k))->GetCoef()[0];
       if(value > 0.0) {
@@ -1778,7 +1780,8 @@ void AliTRDCalibraFit::RemoveOutliers(Int_t type, Bool_t perdetector){
   if(type==1) defaultvalue = -1.5;
   for (Int_t k = 0; k < loop; k++) {
     detector  = ((AliTRDFitInfo *) fVectorFit.At(k))->GetDetector();
-    sector = GetSector(detector);
+    // Coverity
+    //sector = GetSector(detector);
     Int_t rowMax    = fGeo->GetRowMax(GetLayer(detector),GetStack(detector),GetSector(detector));
     Int_t colMax    = fGeo->GetColMax(GetLayer(detector));
     Float_t *coef = ((AliTRDFitInfo *) fVectorFit.At(k))->GetCoef();
@@ -1807,7 +1810,8 @@ void AliTRDCalibraFit::RemoveOutliers2(Bool_t perdetector){
     return;
   }
   Int_t detector = -1;
-  Int_t sector = -1;
+  // Coverity
+  //Int_t sector = -1;
   Float_t value  = 0.0;
 
   /////////////////////////////////
@@ -1823,7 +1827,8 @@ void AliTRDCalibraFit::RemoveOutliers2(Bool_t perdetector){
   ////////////
   for (Int_t k = 0; k < loop; k++) {
     detector  = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetDetector();
-    sector = GetSector(detector);
+    // Coverity
+    //sector = GetSector(detector);
     if(perdetector){
       value = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetCoef()[0];
       if(value < 70.0) {
@@ -1857,7 +1862,8 @@ void AliTRDCalibraFit::RemoveOutliers2(Bool_t perdetector){
   ////////////////////////////////////////////////
   for (Int_t k = 0; k < loop; k++) {
     detector  = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetDetector();
-    sector = GetSector(detector);
+    // Coverity
+    //sector = GetSector(detector);
     Int_t rowMax    = fGeo->GetRowMax(GetLayer(detector),GetStack(detector),GetSector(detector));
     Int_t colMax    = fGeo->GetColMax(GetLayer(detector));
     Float_t *coef = ((AliTRDFitInfo *) fVectorFit2.At(k))->GetCoef();
@@ -5759,12 +5765,14 @@ void AliTRDCalibraFit::FitTnpRange(Double_t *arraye, Double_t *arraym, Double_t
     Double_t pointError0  =  TMath::Sqrt(linearfitter.GetChisquare()/npoints);
     Double_t errorsx0     =  linearfitter.GetParError(2)*pointError0;
     Double_t min0         = 0.0;
-    Double_t ermin0       = 0.0;
+    // Coverity
+    //Double_t ermin0       = 0.0;
     //Double_t prfe0      = 0.0;
     Double_t prf0         = 0.0;
     if((pars0[2] > 0.000000000001) && (TMath::Abs(pars0[1]) >= 0.000000000001)) {
       min0 = -pars0[1]/(2*pars0[2]);
-      ermin0 = TMath::Abs(min0*(errorsx0/pars0[2]+linearfitter.GetParError(1)*pointError0/pars0[1]));
+      // Coverity
+      //ermin0 = TMath::Abs(min0*(errorsx0/pars0[2]+linearfitter.GetParError(1)*pointError0/pars0[1]));
       prf0 = pars0[0]+pars0[1]*min0+pars0[2]*min0*min0;
       if(prf0 > 0.0) {
        /*
@@ -5979,12 +5987,14 @@ void AliTRDCalibraFit::FitLandau(TH1 *projch, Double_t mean, Double_t nentries)
  
   fCurrentCoef[0]  = 0.0;
   fCurrentCoefE    = 0.0;
-  Double_t chisqrl = 0.0;
+  // Coverity
+  //Double_t chisqrl = 0.0;
   
   projch->Fit("landau","WWQ+",""
              ,(Double_t) mean/fBeginFitCharge
              ,lastvalue);
-  chisqrl = projch->GetFunction("landau")->GetChisquare();
+  // Coverity
+  //chisqrl = projch->GetFunction("landau")->GetChisquare();
  
   if (fDebugLevel == 1) {
     TCanvas *cp = new TCanvas("cp","cp",50,50,600,800);
index 8b928fe..341622d 100644 (file)
@@ -892,10 +892,11 @@ Bool_t AliTRDCalibraVector::FindTheMaxEntries(Int_t i, Int_t &detectormax, Int_t
   // Find detectormax and groupmax with the biggest number of entries
   //
 
-  Int_t numberofTB = 0;
-  if(i==0) numberofTB = (Int_t) GetNumberBinCharge();
-  if(i==1) numberofTB = GetTimeMax();
-  if(i==2) numberofTB = GetNumberBinPRF();
+  // Coverity
+  //Int_t numberofTB = 0;
+  //if(i==0) numberofTB = (Int_t) GetNumberBinCharge();
+  //if(i==1) numberofTB = GetTimeMax();
+  //if(i==2) numberofTB = GetNumberBinPRF();
   if((i!=0) && (i!=1) && (i!=2)) AliInfo("Didn't understand i");
 
 
index 61af8cd..6d57608 100644 (file)
@@ -1303,8 +1303,11 @@ Float_t AliTRDclusterizer::Unfold(Double_t eps, Int_t layer, const Double_t *con
     irc = calibration->PadResponse(ampRight,maxRight,layer,newRightSignal);
 
     // Calculate new overlapping ratio
-    ratio = TMath::Min((Double_t) 1.0
-                      ,newLeftSignal[2] / (newLeftSignal[2] + newRightSignal[0]));
+    // Coverity
+    if (irc != 0) {
+      ratio = TMath::Min((Double_t) 1.0
+                        ,newLeftSignal[2] / (newLeftSignal[2] + newRightSignal[0]));
+    }
 
   }
 
index d0bc0a2..f660a7e 100644 (file)
@@ -187,7 +187,8 @@ Bool_t AliTRDrawData::Digits2Raw(AliTRDdigitsManager *digitsManager)
 
   Bool_t newEvent = kFALSE;  // only for correct readout tree
   Bool_t newSM    = kFALSE;  // new SM flag, for writing SM index words
-  Bool_t newStack = kFALSE;  // new stack flag, for writing stack index words
+  // Coverity
+  //Bool_t newStack = kFALSE;  // new stack flag, for writing stack index words
 
   // Get digits parameter
   fDigitsParam = digitsManager->GetDigitsParam();
@@ -267,7 +268,8 @@ Bool_t AliTRDrawData::Digits2Raw(AliTRDdigitsManager *digitsManager)
        }
        
        if ( stack==0 && layer==0 ) newSM = kTRUE;  // new SM flag
-       if ( layer==0 ) newStack = kTRUE;           // new stack flag
+        // Coverity
+       //if ( layer==0 ) newStack = kTRUE;           // new stack flag
        AliDebug(15, Form("stack : %d, layer : %d, iDec : %d\n",stack,layer,iDet));
        // Get the digits array
        AliTRDarrayADC *digits = (AliTRDarrayADC *) digitsManager->GetDigits(iDet);