coverity fixes
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Feb 2012 08:10:32 +0000 (08:10 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Feb 2012 08:10:32 +0000 (08:10 +0000)
JETAN/DEV/AliJetBkg.cxx
JETAN/DEV/AliJetCalTrk.h
PWGJE/AliAnalysisTaskJetSpectrum2.cxx
PWGJE/AliFragmentationFunctionCorrections.cxx

index 7c15ca6..27188f3 100644 (file)
@@ -290,7 +290,7 @@ void AliJetBkg::SubtractBackgStat(const Int_t& nIn, const Int_t&nJ,Float_t&etbgT
       count=count+1;
     }
   }
-  sigmaN=TMath::Sqrt(TMath::Abs(sigmaN)/count);
+  if(count>0)sigmaN=TMath::Sqrt(TMath::Abs(sigmaN)/count);
 
 }
 
index d5a73e8..c1a4539 100644 (file)
@@ -113,7 +113,7 @@ class AliJetCalTrkEvent : public TObject
   Int_t                  GetNCalTrkTracks() const {return fNJetCalTrkTrack;}
 
   void                   Clear(Option_t* option = ""); 
-  void                   Print(const Option_t* /*option*/) const;
+  void                   Print(const Option_t* = "") const;
   
  private:
   AliJetCalTrkEvent& operator = (const AliJetCalTrkEvent& rhs);
index 5e74338..c99f2a6 100644 (file)
@@ -841,7 +841,7 @@ void AliAnalysisTaskJetSpectrum2::UserExec(Option_t */*option*/){
   fMultGen = genMult1;
   if(fMultGen<=0)fMultGen = genMult2;
 
-  Double_t var0[2] = {0,};
+  Double_t var0[3] = {0,};
   var0[0] = fCentrality;
   var0[1] = fMultRec;
   for(int it=0;it<fNTrigger;it++){
@@ -901,7 +901,7 @@ void AliAnalysisTaskJetSpectrum2::FillJetHistos(TList &jetsList,TList &particles
   Int_t ij0 = -1;
   Int_t ij1 = -1;
 
-  Double_t var1[6] = {0,}; // jet number;p_{T,jet};cent;# tracks;RP;area
+  Double_t var1[7] = {0,}; // jet number;p_{T,jet};cent;# tracks;RP;area
   var1[2] = fCentrality; 
   var1[3] = refMult;
 
index fac6af9..913163f 100644 (file)
@@ -1459,10 +1459,6 @@ void AliFragmentationFunctionCorrections::UnfoldHistos(const Int_t nIter, const
     if(type == kFlagPt)      hnResponse = fhnResponsePt[i];
     else if(type == kFlagZ)  hnResponse = fhnResponseZ[i];
     else if(type == kFlagXi) hnResponse = fhnResponseXi[i];
-    else{ 
-      Printf("%s%d unknown type",(char*)__FILE__,__LINE__);
-      return;
-    }
 
     TH1F* hPrior = 0;
     if(type == kFlagPt && fh1FFTrackPtPrior[i]  && ((TString(fh1FFTrackPtPrior[i]->GetName())).Length() > 0) ) hPrior = fh1FFTrackPtPrior[i];
@@ -3688,14 +3684,14 @@ void AliFragmentationFunctionCorrections::WriteJetSpecResponse(TString strInfile
 
   TList* list = 0;
 
-  if(strlist && strlist.Length()){
-    
+  if(strlist && strlist.Length()){ 
     if(!(list = (TList*) gDirectory->Get(strlist))){ 
       Printf("%s:%d -- error retrieving list %s from directory %s", (char*)__FILE__,__LINE__,strlist.Data(),strdir.Data());
       return;
     }
   }  
-  
+  if(list == 0)return; // catch strlist.Lenght() == 0;
+   
   THnSparse* hn6ResponseJetPt  = (THnSparse*) list->FindObject("fhnCorrelation");
  
   Int_t axis6RecJetPt = 0;