Fixed coverity issues
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Jan 2013 19:35:33 +0000 (19:35 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Jan 2013 19:35:33 +0000 (19:35 +0000)
PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.cxx
PWGLF/FORWARD/analysis2/AliForwardMCFlowTaskQC.cxx
PWGLF/FORWARD/trains/ParUtilities.C
PWGLF/FORWARD/trains/trainMain.cxx

index e2c82fc..18dd727 100644 (file)
@@ -125,13 +125,16 @@ void AliForwardCreateResponseMatrices::UserExec(Option_t */*option*/)
   TH1D* dndetaSumForward    = (TH1D*)fOutput->FindObject("dndetaSumForward");
   TH1D* dndetaSumCentral    = (TH1D*)fOutput->FindObject("dndetaSumCentral");
   TH1D* dndetaSumMC         = (TH1D*)fOutput->FindObject("dndetaSumMC");
-  TH1D* dndetaEventForward  = (TH1D*)fOutput->FindObject("dndetaEventForward");
-  TH1D* dndetaEventCentral  = (TH1D*)fOutput->FindObject("dndetaEventCentral");
-  TH1D* dndetaEventMC       = (TH1D*)fOutput->FindObject("dndetaEventMC");
-
-  dndetaEventForward = forward.ProjectionX("dndetaForward",1,forward.GetNbinsY(),"");
-  dndetaEventCentral = central.ProjectionX("dndetaCentral",1,central.GetNbinsY(),"");
-  dndetaEventMC      = primHist->ProjectionX("dndetaMC",1,primHist->GetNbinsY(),"");
+  // TH1D* dndetaEventForward= (TH1D*)fOutput->FindObject("dndetaEventForward");
+  // TH1D* dndetaEventCentral= (TH1D*)fOutput->FindObject("dndetaEventCentral");
+  // TH1D* dndetaEventMC     = (TH1D*)fOutput->FindObject("dndetaEventMC");
+
+  TH1D* dndetaEventForward = forward.ProjectionX("dndetaForward",1,
+                                                forward.GetNbinsY(),"");
+  TH1D* dndetaEventCentral = central.ProjectionX("dndetaCentral",1,
+                                                central.GetNbinsY(),"");
+  TH1D* dndetaEventMC      = primHist->ProjectionX("dndetaMC",1,
+                                                  primHist->GetNbinsY(),"");
    
   // underflow eta bin of forward/central carry information on whether
   // there is acceptance. 1= acceptance, 0= no acceptance
index 84a0cd4..5f94410 100644 (file)
@@ -300,14 +300,13 @@ Bool_t AliForwardMCFlowTaskQC::LoopAODMC()
     return kFALSE;
   }
 
-  Double_t rp = 0;
   AliAODMCHeader* header = 
     dynamic_cast<AliAODMCHeader*>(fAOD->FindListObject(
                                   AliAODMCHeader::StdBranchName()));
   if (!header) 
     AliWarning("No header file found.");
   
-  rp = header->GetReactionPlaneAngle();
+  // Double_t rp = header->GetReactionPlaneAngle();
 
   Int_t ntracks = mcArray->GetEntriesFast();
   // TODO: Make this bit smarter...
@@ -322,8 +321,7 @@ Bool_t AliForwardMCFlowTaskQC::LoopAODMC()
     if (fAddFlow.Contains("eta"))  flowFlags |= AliForwardFlowWeights::kEta;
     if (fAddFlow.Contains("cent")) flowFlags |= AliForwardFlowWeights::kCent;
   }
-  Double_t b = -1.;
-  b = header->GetImpactParameter();
+  // Double_t b = header->GetImpactParameter();
 
   // Track loop: chek how many particles will be accepted
   Double_t weight = 0;
@@ -366,12 +364,11 @@ Double_t AliForwardMCFlowTaskQC::GetCentFromB() const
   // Get centrality from MC impact parameter.
   //
   Double_t cent = -1.;
-  Double_t b = -1.;
   AliAODMCHeader* header = 
     static_cast<AliAODMCHeader*>(fAOD->FindListObject(AliAODMCHeader::
                                                      StdBranchName()));
   if (!header) return cent;
-  b = header->GetImpactParameter();
+  Double_t b = header->GetImpactParameter();
 
   cent = fImpactParToCent->Eval(b);
 
@@ -390,9 +387,12 @@ void AliForwardMCFlowTaskQC::PrintFlowSetup() const
   printf("Doing flow analysis for      :\t");
   for (Int_t n  = 0; n < fV.GetSize(); n++) printf("v%d ", fV.At(n));
   printf("\n");
-  Printf("Satellite vertex flag           :\t%s", ((fFlowFlags & kSatVtx) ? "true" : "false"));
-  Printf("Symmetrize ref. flow wrt eta = 0:\t%s", ((fFlowFlags & kSymEta) ? "true" : "false"));
-  Printf("Use an eta-gap for ref. flow    :\t%s", ((fFlowFlags & kEtaGap) ? "true" : "false"));
+  Printf("Satellite vertex flag           :\t%s", ((fFlowFlags & kSatVtx) ? 
+                                                  "true" : "false"));
+  Printf("Symmetrize ref. flow wrt eta = 0:\t%s", ((fFlowFlags & kSymEta) ? 
+                                                  "true" : "false"));
+  Printf("Use an eta-gap for ref. flow    :\t%s", ((fFlowFlags & kEtaGap) ? 
+                                                  "true" : "false"));
   Printf("FMD sigma cut:               :\t%f", fFMDCut);
   Printf("SPD sigma cut:               :\t%f", fSPDCut);
   if ((fFlowFlags & kEtaGap)) 
index 2d6d57b..817596b 100644 (file)
@@ -296,7 +296,7 @@ struct ParUtilities
       retVal = true;
     }
     catch (TString& e) {
-      Error("ParUtilities::MakeScriptPAR", e.Data());
+      Error("ParUtilities::MakeScriptPAR", "%s", e.Data());
       retVal = false;
     }
     
index 2aa4ad8..e7480db 100644 (file)
@@ -152,7 +152,7 @@ main(int argc, char** argv)
   Bool_t  batch   = false;
   Bool_t  help    = false;
   Bool_t  urlSeen = false;
-  Bool_t  spawn   = true;
+  Bool_t  spawn   = false;
   // --- Parse options -----------------------------------------------
   for (int i = 1; i < argc; i++) { 
     if (argv[i][0] == '-' && argv[i][1] == '-') {