]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity defects fix (Philippe P.)
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Dec 2011 17:04:03 +0000 (17:04 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Dec 2011 17:04:03 +0000 (17:04 +0000)
PWG3/muon/AliAnalysisTaskMuonQA.cxx
PWG3/muondep/AliAnalysisTaskMuonFakes.cxx
PWG3/muondep/AliAnalysisTaskMuonFakes.h
PWG3/muondep/AliAnalysisTaskMuonPerformance.cxx
PWG3/muondep/AliAnalysisTaskMuonRefit.cxx
PWG3/muondep/AliAnalysisTaskMuonRefit.h
PWG3/muondep/AliAnalysisTaskMuonResolution.cxx
PWG3/muondep/AliAnalysisTaskMuonResolution.h

index bbdb4621ea2d1932c4dd29fcec7fb8277b59a7e6..dd91c00640e1211333914088f3477963de25cd14 100644 (file)
@@ -807,7 +807,6 @@ TList* AliAnalysisTaskMuonQA::BuildListOfSelectedTriggerCases(TString& FiredTrig
       list->AddLast(new TObjString(Form("trigger:%s",trigClasseName->GetName())));
     }
     delete obj;
-    if(trigClasseName) delete trigClasseName;
   }
   
   // add case other if no specific trigger was found
index 12c441d7474cc61debe84788f655aee67804e15d..3a8095d36515fc561b74ea90a19f9dbaf3d40af3 100644 (file)
@@ -515,7 +515,7 @@ void AliAnalysisTaskMuonFakes::UserExec(Option_t *)
       
       // fill histograms
       if ((!fMatchTrig || trigger) && (!fApplyAccCut || inAcc)) {
-       ((TH1F*)fList->UncheckedAt(kFractionOfMatchedClusters))->Fill(((Float_t) nMatchClusters) / ((Float_t) nClusters));
+       if (nClusters > 0) ((TH1F*)fList->UncheckedAt(kFractionOfMatchedClusters))->Fill(((Float_t) nMatchClusters) / ((Float_t) nClusters));
        ((TH1F*)fList->UncheckedAt(kNumberOfClustersMC))->Fill(matchedTrackRef->GetNClusters());
        ((TH1F*)fList->UncheckedAt(kNumberOfClustersM))->Fill(nClusters);
        ((TH1F*)fList->UncheckedAt(kNumberOfChamberHitM))->Fill(nChamberHit);
index 51c58d7e9e5f61d1512099e18237e651fc352cc8..9b4df63669b4ded94abc661ddff4322ffe45876a 100644 (file)
@@ -17,6 +17,8 @@
 
 class TObjArray;
 class AliCounterCollection;
+class AliMUONVTrackStore;
+class AliMUONTrack;
 
 class AliAnalysisTaskMuonFakes : public AliAnalysisTaskSE {
 public:
index e1820ea73d12d9fa48d42f578d64749a14d079f8..a5a65d510975859854a8d62522ea89296e04d8a2 100644 (file)
@@ -108,6 +108,12 @@ fClusterList(0x0)
   //
   /// Default Constructor.
   //
+  fPRange[0] = 0.;
+  fPRange[1] = 0.;
+  fClusterMaxRes[0] = 0.;
+  fClusterMaxRes[1] = 0.;
+  for (Int_t i = 0; i < 1100; i++) fDEIndices[i] = 0;
+  for (Int_t i = 0; i < 200; i++) fDEIds[i] = 0;
 }
 
 
@@ -143,6 +149,8 @@ fClusterList(0x0)
   fPRange[1] = 300.;
   fClusterMaxRes[0] = 0.;
   fClusterMaxRes[1] = 0.;
+  for (Int_t i = 0; i < 1100; i++) fDEIndices[i] = 0;
+  for (Int_t i = 0; i < 200; i++) fDEIds[i] = 0;
   
   DefineOutput(1, AliCFContainer::Class());
   DefineOutput(2, TObjArray::Class());
index 6b5f5fdc067caf60eff468c1ba382fc43863399e..fcbb0c52863e328526cd84e2d643008baf6f4319 100644 (file)
@@ -33,6 +33,7 @@
 
 // MUON includes
 #include "AliMUONCDB.h"
+#include "AliMUONConstants.h"
 #include "AliMUONRecoParam.h"
 #include "AliMUONESDInterface.h"
 #include "AliMUONRefitter.h"
@@ -63,6 +64,7 @@ fESDInterface(NULL),
 fRefitter(NULL)
 {
   /// Default constructor
+  for (Int_t i = 0; i < 10; i++) ResetClusterResolution(i, -1., -1.);
 }
 
 //________________________________________________________________________
@@ -81,7 +83,7 @@ fESDInterface(NULL),
 fRefitter(NULL)
 {
   /// Constructor
-  for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); i++) ResetClusterResolution(i, -1., -1.);
+  for (Int_t i = 0; i < 10; i++) ResetClusterResolution(i, -1., -1.);
 }
 
 //________________________________________________________________________
index 180e8b3bf6961e758e6bce2e0d9b9b256e86bc89..19ea759dd8468063d4ded4a5edc40126695d6dce 100644 (file)
@@ -11,7 +11,6 @@
 //Author: Philippe Pillot - SUBATECH Nantes
 
 #include <TString.h>
-#include "AliMUONConstants.h"
 #include "AliAnalysisTaskSE.h"
 
 class AliMUONVCluster;
@@ -82,7 +81,7 @@ private:
 inline void AliAnalysisTaskMuonRefit::ResetClusterResolution(Int_t chId, Double_t valNB, Double_t valB)
 {
   /// set chamber non-bending and bending resolutions
-  if (chId < 0 || chId >= AliMUONConstants::NTrackingCh()) return;
+  if (chId < 0 || chId >= 10) return;
   fClusterResNB[chId] = valNB;
   fClusterResB[chId] = valB;
 }
@@ -91,7 +90,7 @@ inline void AliAnalysisTaskMuonRefit::ResetClusterResolution(Int_t chId, Double_
 inline void AliAnalysisTaskMuonRefit::ResetClusterResolution(Double_t valNB[10], Double_t valB[10])
 {
   /// set chambers non-bending and bending resolutions
-  for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); i++) {
+  for (Int_t i = 0; i < 10; i++) {
     fClusterResNB[i] = valNB[i];
     fClusterResB[i] = valB[i];
   }
index d06d09ad695b5d16b15dd8a930ecb1d25ed0ebdc..ba85023cceaf00943ea5e996203f29f71bc12908 100644 (file)
@@ -47,6 +47,7 @@
 
 // MUON includes
 #include "AliMUONCDB.h"
+#include "AliMUONConstants.h"
 #include "AliMUONRecoParam.h"
 #include "AliMUONESDInterface.h"
 #include "AliMUONVTrackReconstructor.h"
@@ -111,6 +112,11 @@ AliAnalysisTaskMuonResolution::AliAnalysisTaskMuonResolution() :
   fSelectTriggerClass(NULL)
 {
   /// Default constructor
+  
+  for (Int_t i = 0; i < 10; i++) SetStartingResolution(i, -1., -1.);
+  for (Int_t i = 0; i < 1100; i++) fDEIndices[i] = 0;
+  for (Int_t i = 0; i < 200; i++) fDEIds[i] = 0;
+  
 }
 
 //________________________________________________________________________
@@ -150,8 +156,9 @@ AliAnalysisTaskMuonResolution::AliAnalysisTaskMuonResolution(const char *name) :
 {
   /// Constructor
   
-  for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); i++) SetStartingResolution(i, -1., -1.);
-  
+  for (Int_t i = 0; i < 10; i++) SetStartingResolution(i, -1., -1.);
+  for (Int_t i = 0; i < 1100; i++) fDEIndices[i] = 0;
+  for (Int_t i = 0; i < 200; i++) fDEIds[i] = 0;
   FitResiduals();
   
   // Output slot #1 writes into a TObjArray container
index 0a23399ac4b4468b7266f1c733af236691240934..04fbd9b03b391e364d5d782449b27965e363d0f3 100644 (file)
@@ -13,7 +13,6 @@
 #include <TString.h>
 #include <TMatrixD.h>
 #include <TF1.h>
-#include "AliMUONConstants.h"
 #include "AliAnalysisTaskSE.h"
 
 class TH1;
@@ -234,7 +233,7 @@ private:
 inline void AliAnalysisTaskMuonResolution::SetStartingResolution(Int_t chId, Double_t valNB, Double_t valB)
 {
   /// set chamber non-bending and bending resolutions
-  if (chId < 0 || chId >= AliMUONConstants::NTrackingCh()) return;
+  if (chId < 0 || chId >= 10) return;
   fClusterResNB[chId] = valNB;
   fClusterResB[chId] = valB;
 }
@@ -243,7 +242,7 @@ inline void AliAnalysisTaskMuonResolution::SetStartingResolution(Int_t chId, Dou
 inline void AliAnalysisTaskMuonResolution::SetStartingResolution(Double_t valNB[10], Double_t valB[10])
 {
   /// set chambers non-bending and bending resolutions
-  for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); i++) {
+  for (Int_t i = 0; i < 10; i++) {
     fClusterResNB[i] = valNB[i];
     fClusterResB[i] = valB[i];
   }
@@ -253,7 +252,7 @@ inline void AliAnalysisTaskMuonResolution::SetStartingResolution(Double_t valNB[
 inline void AliAnalysisTaskMuonResolution::GetStartingResolution(Double_t valNB[10], Double_t valB[10]) const
 {
   /// set chambers non-bending and bending resolutions
-  for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); i++) {
+  for (Int_t i = 0; i < 10; i++) {
     valNB[i] = fClusterResNB[i];
     valB[i] = fClusterResB[i];
   }
@@ -276,7 +275,7 @@ inline void AliAnalysisTaskMuonResolution::FitResiduals(Bool_t flag)
 {
   /// set gaussian function to fit the residual distribution to extract the mean and the dispersion.
   /// if not set: take the mean and the RMS of the distribution
-  if (fGaus) delete fGaus;
+  delete fGaus;
   if (flag) fGaus = new TF1("fGaus","gaus");
   else fGaus = NULL;
 }