]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug fix: variable used outside loop
authordstocco <diego.stocco@cern.ch>
Sat, 18 Oct 2014 17:13:44 +0000 (19:13 +0200)
committerzconesa <zaida.conesa.del.valle@cern.ch>
Sat, 18 Oct 2014 18:38:55 +0000 (20:38 +0200)
PWGPP/MUON/lite/MakeTrend.C

index 559b6fdd90075ae3f04bc865d521ebe437baf707..cf5df7d3bad944442ce84c33d22bb1f230287c1f 100644 (file)
@@ -289,8 +289,8 @@ void AddTrigVars ( TString filename, TList &parList )
   Int_t nHistos = sizeof(hChNames)/sizeof(hChNames[0]);
   for ( Int_t ihisto=0; ihisto<nHistos; ihisto++ ) {
     TH1* histo = (TH1*)inList->FindObject(hChNames[ihisto].Data());
-    Double_t currVal = ( histo ) ? histo->GetBinContent(ibin) : 0.;
     for ( Int_t ibin=1; ibin<=4; ibin++ ) {
+      Double_t currVal = ( histo ) ? histo->GetBinContent(ibin) : 0.;
       AddTreeVariable(parList, Form("%s%i",hChNames[ihisto].Data(),ibin),'F',currVal);
     }
   }