]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity fixes (Alberica)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Apr 2011 09:12:13 +0000 (09:12 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Apr 2011 09:12:13 +0000 (09:12 +0000)
ANALYSIS/AliCentralitySelectionTask.cxx
PWG2/EVCHAR/AliCentralityGlauberFit.cxx

index 07a6a6b948954d303a77872532caba440643b564..fca4376adc5794037ad1491c441ba5cbf8196cfe 100644 (file)
@@ -594,6 +594,7 @@ void AliCentralitySelectionTask::UserExec(Option_t */*option*/)
   // ***** Scaling for MC
   if (fIsMCInput) {
     fUseScaling=kFALSE;
+    fUseCleaning=kFALSE;
     Float_t tempScalefactorV0M = MyGetScaleFactorMC(fCurrentRun);
     v0Corr  = Short_t((multV0A+multV0C)  * tempScalefactorV0M);
   }
index a048faff1e617ca2d4e77e608e876e1bff63ae8c..f93ddde62fa1b6334b90449d16fe77adde20d217 100644 (file)
@@ -338,8 +338,9 @@ TH1F *AliCentralityGlauberFit::GlauberHisto(Double_t mu, Double_t k, Double_t al
     for (Int_t np=1; np<=fhAncestor->GetNbinsX(); ++np) {  
       Double_t nanc = fhAncestor->GetBinCenter(np);
       Double_t weights = fhAncestor->GetBinContent(np);
+
       if (weights <= 0) continue;
-      Int_t trials = 20 * nanc * (int) mu;
+      Int_t trials = (Int_t) (20 * nanc * (int) mu);
       if (trials <=0) continue;
       for (Int_t j=0; j<trials; j++) {
                double nbdvalue = NBD(j, mu * nanc, k * nanc);
@@ -370,8 +371,7 @@ TH1F *AliCentralityGlauberFit::GlauberHisto(Double_t mu, Double_t k, Double_t al
       fNpart = 2;
       fNcoll = 1;
     }
-
-    Int_t n=0.;
+    Int_t n=0;
     //if (fAncestor == 1)      n = (Int_t)(TMath::Power(fNpart,alpha));
     if (fAncestor == 1)      n = (Int_t)(TMath::Power(fNcoll,alpha));
     else if (fAncestor == 2) n = (Int_t)(alpha * fNpart + (1-alpha) * fNcoll);
@@ -585,11 +585,11 @@ TH1F *AliCentralityGlauberFit::MakeAncestor(Double_t alpha)
   Int_t nents = fGlauntuple->GetEntries(); 
   for (Int_t i=0;i<nents;++i) {
     fGlauntuple->GetEntry(i % nents);
-    Int_t n=0.0;
-    //if (fAncestor == 1)      n = TMath::Power(fNpart,alpha);
-    if (fAncestor == 1)      n = TMath::Power(fNcoll,alpha);
-    else if (fAncestor == 2) n = alpha * fNpart + (1-alpha) * fNcoll;
-    else if (fAncestor == 3) n = (1-alpha) * fNpart/2 + alpha * fNcoll;
+    Int_t n=0;
+    //if (fAncestor == 1)    n = (Int_t) (TMath::Power(fNpart,alpha));
+    if (fAncestor == 1)      n = (Int_t) (TMath::Power(fNcoll,alpha));
+    else if (fAncestor == 2) n = (Int_t) (alpha * fNpart + (1-alpha) * fNcoll);
+    else if (fAncestor == 3) n = (Int_t) ((1-alpha) * fNpart/2 + alpha * fNcoll);
     fhAncestor->Fill(n);
   }