]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
coverty fixes
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Mar 2011 09:20:20 +0000 (09:20 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Mar 2011 09:20:20 +0000 (09:20 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithCumulants.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithFittingQDistribution.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithMCEventPlane.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx

index 8aaaa417b3f3a4256a5fbd39bf92e6d4ac299ef4..14b9937681e2a110d40d67b5883aa6ef284e449e 100644 (file)
@@ -1446,7 +1446,7 @@ void AliFlowAnalysisWithCumulants::CalculateIntegratedFlow(TString rpPoi)
  // Calculate final results for integrated flow of RPs and POIs. 
  // (to be improved - this method can be implemented much better)
   
- Int_t rp = -1;
+ Int_t rp = 0;
 
  if(rpPoi == "RP")
  {
@@ -1566,7 +1566,7 @@ void AliFlowAnalysisWithCumulants::FillCommonHistResultsForDifferentialFlow(TStr
  // Fill common result histograms for differential flow.
  // (to be improved - this method can be implemented much better)
  
- Int_t rp = -1;
+ Int_t rp = 0;
 
  if(rpPoi == "RP")
  {
@@ -1642,8 +1642,8 @@ void AliFlowAnalysisWithCumulants::CalculateDifferentialFlow(TString rpPoi, TStr
 {
  // Calculate differential flow for RPs/POIs vs pt/eta from cumulants.
  
- Int_t rp = -1; // RP or POI
- Int_t pe = -1; // pt or eta
+ Int_t rp = 0; // RP or POI
+ Int_t pe = 0; // pt or eta
 
  if(rpPoi == "RP")
  {
@@ -1714,8 +1714,8 @@ void AliFlowAnalysisWithCumulants::CalculateDifferentialFlowErrors(TString rpPoi
 {
  // Calculate errors of differential flow.
 
- Int_t rp = -1; // RP or POI
- Int_t pe = -1; // pt or eta
+ Int_t rp = 0; // RP or POI
+ Int_t pe = 0; // pt or eta
 
  if(rpPoi == "RP")
  {
@@ -1776,8 +1776,8 @@ void AliFlowAnalysisWithCumulants::CalculateCumulantsForDiffFlow(TString rpPoi,T
 {
  // Calculate cumulants for differential flow. 
  
- Int_t rp = -1; // RP or POI
- Int_t pe = -1; // pt or eta
+ Int_t rp = 0; // RP or POI
+ Int_t pe = 0; // pt or eta
 
  if(rpPoi == "RP")
  {
@@ -2379,6 +2379,7 @@ void AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
   if(fWeightsList->FindObject("phi_weights"))
   {
    fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
+   if(!fPhiWeights){printf("\n WARNING (GFC): !fPhiWeights !!!!\n");exit(0);}
    if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
    {
     cout<<endl;
@@ -2400,6 +2401,7 @@ void AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
   if(fWeightsList->FindObject("pt_weights"))
   {
    fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
+   if(!fPtWeights){printf("\n WARNING (GFC): !fPtWeights !!!!\n");exit(0);}
    if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
    {
     cout<<endl;
@@ -2421,6 +2423,7 @@ void AliFlowAnalysisWithCumulants::BookAndFillWeightsHistograms()
   if(fWeightsList->FindObject("eta_weights"))
   {
    fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
+   if(!fEtaWeights){printf("\n WARNING (GFC): !fEtaWeights !!!!\n");exit(0);}
    if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
    {
     cout<<endl;
index 603421f2abf5870dea4f4f4e171911665e1c3e7c..267fea4468d07a384378227661afa6889d82c4f7 100644 (file)
@@ -658,6 +658,7 @@ void AliFlowAnalysisWithFittingQDistribution::BookAndFillWeightsHistograms()
   if(fWeightsList->FindObject("phi_weights"))
   {
    fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
+   if(!fPhiWeights){printf("\n WARNING (FQD): !fPhiWeights !!!!\n");exit(0);}   
    if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
    {
     cout<<endl;
@@ -677,6 +678,7 @@ void AliFlowAnalysisWithFittingQDistribution::BookAndFillWeightsHistograms()
   if(fWeightsList->FindObject("pt_weights"))
   {
    fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
+   if(!fPtWeights){printf("\n WARNING (FQD): !fPtWeights !!!!\n");exit(0);}   
    if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
    {
     cout<<endl;
@@ -696,6 +698,7 @@ void AliFlowAnalysisWithFittingQDistribution::BookAndFillWeightsHistograms()
   if(fWeightsList->FindObject("eta_weights"))
   {
    fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
+   if(!fEtaWeights){printf("\n WARNING (FQD): !fEtaWeights !!!!\n");exit(0);}   
    if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
    {
     cout<<endl;
index 8a43215792d2f0928d48a0eb95cec4c3ea69e4a7..3b600aa94da3299f580ccc99dea3b8ddbbe61662 100644 (file)
@@ -402,7 +402,7 @@ void AliFlowAnalysisWithMCEventPlane::Finish() {
   
   //RP:
   TH1F* fHistPtRP = NULL;
-  if(fCommonHists)
+  if(fCommonHists && fCommonHists->GetHistPtRP())
   {
    fHistPtRP = fCommonHists->GetHistPtRP(); 
   }
@@ -448,7 +448,11 @@ void AliFlowAnalysisWithMCEventPlane::Finish() {
   }
                                                                                                                                    
   //POI:
-  TH1F* fHistPtPOI = fCommonHists->GetHistPtPOI(); 
+  TH1F* fHistPtPOI = NULL;
+  if(fCommonHists && fCommonHists->GetHistPtPOI())
+  {
+   fHistPtPOI = fCommonHists->GetHistPtPOI(); 
+  }
   Double_t dYieldPtPOI = 0.;
   Double_t dVPOI = 0.;
   Double_t dErrVPOI = 0.;
index 8a580e8f2deaa47b394485509b8d0bc9f908ae74..01b9ea3e986ae86ed13ea6ad9ab078b1f5d87f8c 100644 (file)
@@ -7434,7 +7434,8 @@ void AliFlowAnalysisWithQCumulants::GetPointersForParticleWeightsHistograms()
  // Get pointers for histograms with particle weights.
 
  TList *weightsList = dynamic_cast<TList*>(fHistList->FindObject("Weights"));
- if(weightsList) this->SetWeightsList(weightsList);
+ if(!weightsList){printf("\n WARNING (QC): weightsList is NULL in AFAWQC::GPFPWH() !!!!\n");exit(0);}
+ this->SetWeightsList(weightsList);
  TString fUseParticleWeightsName = "fUseParticleWeightsQC"; // to be improved (hirdwired label QC)
  fUseParticleWeightsName += fAnalysisLabel->Data();
  TProfile *useParticleWeights = dynamic_cast<TProfile*>(weightsList->FindObject(fUseParticleWeightsName.Data()));