Fixing some coverty reports
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 19:52:40 +0000 (19:52 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 19:52:40 +0000 (19:52 +0000)
JETAN/AliAnalysisTaskJetCluster.cxx
JETAN/AliAnalysisTaskJets.cxx
PWG4/JetTasks/AliJetSpectrumUnfolding.cxx

index 887110a..e0b7416 100644 (file)
@@ -350,14 +350,15 @@ void AliAnalysisTaskJetCluster::UserCreateOutputObjects()
        // case that we have an AOD extension we need to fetch the jets from the extended output
        // we identify the extension aod event by looking for the branchname
        AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
-       TObjArray* extArray = aodH->GetExtensions();
+       
+       TObjArray* extArray = (aodH?aodH->GetExtensions():0);
        if (extArray) {
          TIter next(extArray);
          while ((fAODExtension=(AliAODExtension*)next())){
            TObject *obj = fAODExtension->GetAOD()->FindListObject(fNonStdBranch.Data());
            if(fDebug>10){
              Printf("%s:%d Dumping..",(char*)__FILE__,__LINE__);
-             fAODExtension->GetAOD()->Dump();
+             if(fAODExtension->GetAOD())fAODExtension->GetAOD()->Dump();
            }
            if(obj){
              if(fDebug>1)Printf("AODExtension found for %s",fNonStdBranch.Data());
@@ -594,7 +595,7 @@ void AliAnalysisTaskJetCluster::UserCreateOutputObjects()
     fHistList->Add(fh2NConstLeadingPtRan);
     fHistList->Add(fh2TracksLeadingJetPhiPtRan);
     fHistList->Add(fh2TracksLeadingJetPhiPtWRan);
-    }
+  }
 
   // =========== Switch on Sumw2 for all histos ===========
   for (Int_t i=0; i<fHistList->GetEntries(); ++i) {
index 936b91e..a9bb38b 100644 (file)
@@ -271,7 +271,7 @@ void AliAnalysisTaskJets::UserExec(Option_t */*option*/)
   if(jarray)fHistos->FillHistos(jarray);
 
 
-  if(aodH&&fFilterPt>0){
+  if(jarray&&aodH&&fFilterPt>0){
     if(jarray->GetEntries()>0){
       AliAODJet *jet = (AliAODJet*)jarray->At(0);
       if(jet->Pt()>fFilterPt){
index 7020c55..d1d5f3f 100644 (file)
@@ -946,8 +946,8 @@ Double_t AliJetSpectrumUnfolding::BayesUncertaintyTerms(THnSparseF* const M, THn
   //
 
   Double_t result = 0;
-  Float_t term[9];
-  Int_t tmpBin[4], tmpBin1[4];
+  Float_t term[9] = {0.};
+  Int_t tmpBin[4] = {0}, tmpBin1[4] = {0};
   const Int_t nFilledBins = C->GetNbins();
   if (!(nt>0&&nt<0))
     return 0;