Fixing Coverity reported problems (REVERSE INULL, UNIT_CTOR, FORWARD_NULL)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Nov 2010 14:15:59 +0000 (14:15 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Nov 2010 14:15:59 +0000 (14:15 +0000)
(Javier)

MUON/AliMUONAlignmentTask.cxx
MUON/AliMUONReAlignTask.cxx
MUON/AliMUONSurveyObj.cxx

index 7f98dfa..cbe2478 100644 (file)
@@ -165,6 +165,14 @@ AliMUONAlignmentTask::AliMUONAlignmentTask(const AliMUONAlignmentTask& obj)
   fMSDEz = obj.fMSDEz;
   fMSDEp = obj.fMSDEp;
   fList = obj.fList;  
+
+  // initialize parameters ...
+  for(Int_t k=0;k<4*156;k++) {
+    fParameters[k]=obj.fParameters[k];
+    fErrors[k]=obj.fErrors[k];
+    fPulls[k]=obj.fPulls[k];
+  }
+
 }
 
 //________________________________________________________________________
@@ -186,6 +194,13 @@ AliMUONAlignmentTask& AliMUONAlignmentTask::operator=(const AliMUONAlignmentTask
   fMSDEz = other.fMSDEz;
   fMSDEp = other.fMSDEp;
   fList = other.fList;  
+
+  // initialize parameters ...
+  for(Int_t k=0;k<4*156;k++) {
+    fParameters[k]=other.fParameters[k];
+    fErrors[k]=other.fErrors[k];
+    fPulls[k]=other.fPulls[k];
+  }
   
   return *this;
 }
index 8dad37c..9f03b5b 100644 (file)
@@ -391,10 +391,17 @@ void AliMUONReAlignTask::Exec(Option_t *)
        padInfo.SetPadADC(digit->ADC());
        padInfo.SetSaturated(digit->IsSaturated());
        padInfo.SetCalibrated(digit->IsCalibrated());
-       padInfo.SetPedestal(ped->ValueAsFloatFast(manuChannel,0), ped->ValueAsFloatFast(manuChannel,1));
-       padInfo.SetGain(gain->ValueAsFloatFast(manuChannel,0), gain->ValueAsFloatFast(manuChannel,1),
-                       gain->ValueAsIntFast(manuChannel,2), gain->ValueAsIntFast(manuChannel,3));
-       
+       if (ped) {
+         padInfo.SetPedestal(ped->ValueAsFloatFast(manuChannel,0), ped->ValueAsFloatFast(manuChannel,1));
+       } else {
+         padInfo.SetPedestal(-250.,-5.);
+       }
+       if (gain) {
+         padInfo.SetGain(gain->ValueAsFloatFast(manuChannel,0), gain->ValueAsFloatFast(manuChannel,1),
+                         gain->ValueAsIntFast(manuChannel,2), gain->ValueAsIntFast(manuChannel,3));
+       } else {
+         padInfo.SetGain(-1.,-0.1,-4095,-1);
+       }       
        fClusterInfo->AddPad(padInfo);
       }
          
index 353b9e7..d07a36a 100644 (file)
@@ -356,7 +356,7 @@ void AliMUONSurveyObj::DrawSTargets() {
   }
   gST->DrawClone("P0");
 
-  if (gST) gST->Delete();
+  delete gST;
 }
 
 Double_t AliMUONSurveyObj::FitPlane() {
@@ -388,7 +388,7 @@ Double_t AliMUONSurveyObj::FitPlane() {
   }
   gST->Fit(fPlane);
 
-  if (gST) gST->Delete();
+  delete gST;
 
   return fPlane->GetChisquare();
 }