various coverity fixes
authormiweber <m.weber@cern.ch>
Mon, 10 Mar 2014 10:12:23 +0000 (11:12 +0100)
committermiweber <m.weber@cern.ch>
Mon, 10 Mar 2014 10:15:36 +0000 (11:15 +0100)
PWGCF/Correlations/DPhi/AliAnalysisTaskDptDptCorrelations.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskAODFilterBitQA.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskEffContBF.cxx
PWGCF/EBYE/Fluctuations/AliEbyEMultFluctuationTask.cxx
PWGCF/EBYE/Fluctuations/AliEbyEMultFluctuationTask.h

index d7d58ef..7b6170a 100644 (file)
@@ -394,6 +394,8 @@ _dedxMax              ( 100000),
 _nClusterMin          ( 80), 
 _trackFilterBit       ( 0),
 fNSigmaCut            ( 3.),
+_tpcnclus             ( 50),
+_chi2ndf              (5.),
 _field    ( 1.),
 _nTracks  ( 0 ),
 _mult0    ( 0 ),
index cb080bd..4471bd3 100755 (executable)
@@ -261,18 +261,19 @@ void AliAnalysisTaskAODFilterBitQA::GetAcceptedTracks(AliVEvent *event, Double_t
 
 
     // AOD track cuts
-    for(Int_t iTrackBit = 0; iTrackBit < gBitMax; iTrackBit++){
-      fHistTrackStats->Fill(gCentrality,iTrackBit,aodTrack->TestFilterBit(1<<iTrackBit));
-      
-      if(aodTrack->TestFilterBit(1<<iTrackBit)){
-       fHistKinematics[iCharge][iTrackBit]->Fill(vEta,vPhi,vPt);
-       fHistDCAconstrained[iCharge][iTrackBit]->Fill(vDCAconstrainedxy,vDCAconstrainedz);
-       fHistDCAglobal[iCharge][iTrackBit]->Fill(vDCAglobalx,vDCAglobaly,vDCAglobalz);
-       fHistChiClus[iCharge][iTrackBit]->Fill(vChi2,vClus);
-      }
-      
-    }//bit loop
+    if(iCharge > -1){
+      for(Int_t iTrackBit = 0; iTrackBit < gBitMax; iTrackBit++){
+       fHistTrackStats->Fill(gCentrality,iTrackBit,aodTrack->TestFilterBit(1<<iTrackBit));
+       
+       if(aodTrack->TestFilterBit(1<<iTrackBit)){
+         fHistKinematics[iCharge][iTrackBit]->Fill(vEta,vPhi,vPt);
+         fHistDCAconstrained[iCharge][iTrackBit]->Fill(vDCAconstrainedxy,vDCAconstrainedz);
+         fHistDCAglobal[iCharge][iTrackBit]->Fill(vDCAglobalx,vDCAglobaly,vDCAglobalz);
+         fHistChiClus[iCharge][iTrackBit]->Fill(vChi2,vClus);
+       } 
+      }//bit loop
+    }//charge positive or negative
   }//track loop
-
+  
   return;  
 }
index 6d88ab9..37458f1 100644 (file)
@@ -348,8 +348,10 @@ void AliAnalysisTaskEffContBF::UserExec(Option_t *) {
     
     // AOD only
     AliAODMCHeader* header = (AliAODMCHeader*) fAOD->GetList()->FindObject(AliAODMCHeader::StdBranchName());
-    if (!header)
+    if (!header){
       AliFatal("fInjectedSignals set but no MC header found");
+      return;
+    }
     
     headers = header->GetNCocktailHeaders();
     eventHeader = header->GetCocktailHeader(0);
index 77ce26e..17ed978 100644 (file)
@@ -34,7 +34,7 @@ ClassImp(AliEbyEMultFluctuationTask)
 
 //________________________________________________________________________
 AliEbyEMultFluctuationTask::AliEbyEMultFluctuationTask(const char *name) 
-: AliAnalysisTaskSE(name),fAOD(0), fAODVertex(0),fHistNchPt(0),fHistNchEta(0),fHistNchEtaCent(0),fHistNchPhi(0),fHistDCAxy(0),fHistDCAz(0),fHistnclus(0),fHistchi2ndf(0),fHistchi2ndfvscs(0),fHistVz(0),fHistMultV0A(0),fHistMultV0C(0),fHistMultV0total(0),My_ntuple(0),fOutputList(0),fCentralityEstimator("V0M"),fCentralityCounter(0),fEventCounter(0),histcounter(0)
+: AliAnalysisTaskSE(name),fAOD(0), fAODVertex(0),fHistNchPt(0),fHistNchEta(0),fHistNchEtaCent(0),fHistNchPhi(0),fHistDCAxy(0),fHistDCAz(0),fHistnclus(0),fHistchi2ndf(0),fHistchi2ndfvscs(0),fHistVz(0),fHistMultV0A(0),fHistMultV0C(0),fHistMultV0total(0),My_ntuple(0),fOutputList(0),fCentralityEstimator("V0M"),fCentralityBins20(kFALSE),fCentralityCounter(0),fEventCounter(0),histcounter(0)
 
 
 {
@@ -61,11 +61,12 @@ AliEbyEMultFluctuationTask::AliEbyEMultFluctuationTask(const char *name)
 //________________________________________________________________________
 Bool_t AliEbyEMultFluctuationTask :: SelectEvent(AliAODVertex* vertex)
 {
-if(vertex) 
-  
-      if(vertex->GetNContributors() < 0) return kFALSE;
 
-         
+  if(vertex){ 
+  
+    if(vertex->GetNContributors() < 0) return kFALSE;
+    
+    
          Double_t lvx = vertex->GetX();
          Double_t lvy = vertex->GetY();
          Double_t lvz = vertex->GetZ();
@@ -74,13 +75,17 @@ if(vertex)
          
          
          if(TMath::Abs(lvx) > 0.3)  return kFALSE;
-           if(TMath::Abs(lvy) > 0.3) return kFALSE;
-           if(TMath::Abs(lvz) > 10) return kFALSE;
-           if(vertex->GetType()==AliAODVertex::kPileupSPD) return kFALSE;  
-            
-               fEventCounter->Fill(5);
-               fHistVz->Fill(lvz);             
-return kTRUE;
+         if(TMath::Abs(lvy) > 0.3) return kFALSE;
+         if(TMath::Abs(lvz) > 10) return kFALSE;
+         if(vertex->GetType()==AliAODVertex::kPileupSPD) return kFALSE;  
+         
+         fEventCounter->Fill(5);
+         fHistVz->Fill(lvz);           
+         return kTRUE;
+  }
+  else{
+    return kFALSE;
+  }
 }
 //_____________________________________________________________________________
 Int_t AliEbyEMultFluctuationTask :: SelectTrack(AliAODTrack* track)
@@ -291,13 +296,12 @@ if(!isSelected) return;
 
 // Get the event vertex.
        fAODVertex = fAOD->GetPrimaryVertex();
-       
-       if(TMath::Abs((fAODVertex->GetZ())-((fAOD->GetPrimaryVertexSPD())->GetZ())) > 0.5) return;
 
-       if (!fAODVertex) {
-               
-               return;
+       if (!fAODVertex) {      
+         return;
        }
+       
+       if(TMath::Abs((fAODVertex->GetZ())-((fAOD->GetPrimaryVertexSPD())->GetZ())) > 0.5) return;
 
 
     if (!SelectEvent(fAODVertex)) return;
index f2a0d7b..2867a43 100644 (file)
@@ -18,7 +18,7 @@ class AliAODTracklets;
 
 class AliEbyEMultFluctuationTask : public AliAnalysisTaskSE {
  public:
- AliEbyEMultFluctuationTask() : AliAnalysisTaskSE(), fAOD(0), fAODVertex(0),fHistNchPt(0),fHistNchEta(0),fHistNchEtaCent(0),fHistNchPhi(0),fHistDCAxy(0),fHistDCAz(0),fHistnclus(0),fHistchi2ndf(0),fHistchi2ndfvscs(0),fHistVz(0),fHistMultV0A(0),fHistMultV0C(0),fHistMultV0total(0),My_ntuple(0),fOutputList(0),fCentralityEstimator("V0M"),fCentralityCounter(0),fEventCounter(0),histcounter(0){
+ AliEbyEMultFluctuationTask() : AliAnalysisTaskSE(), fAOD(0), fAODVertex(0),fHistNchPt(0),fHistNchEta(0),fHistNchEtaCent(0),fHistNchPhi(0),fHistDCAxy(0),fHistDCAz(0),fHistnclus(0),fHistchi2ndf(0),fHistchi2ndfvscs(0),fHistVz(0),fHistMultV0A(0),fHistMultV0C(0),fHistMultV0total(0),My_ntuple(0),fOutputList(0),fCentralityEstimator("V0M"),fCentralityBins20(kFALSE),fCentralityCounter(0),fEventCounter(0),histcounter(0){
                for(Int_t ibin=0;ibin<91;ibin++)
                {
                        fMult[ibin]=NULL;