ATO-98 AddCorrectionCompact - Bug fix check fWeights pointer
authormivanov <marian.ivanov@cern.ch>
Mon, 15 Dec 2014 21:30:09 +0000 (22:30 +0100)
committermivanov <marian.ivanov@cern.ch>
Mon, 15 Dec 2014 23:11:38 +0000 (00:11 +0100)
TPC/TPCbase/AliTPCComposedCorrection.cxx

index d7d396c..d7b7d83 100644 (file)
@@ -130,7 +130,8 @@ Bool_t AliTPCComposedCorrection::AddCorrectionCompact(AliTPCCorrection* corr, Do
     Int_t ncorrs= corrC->fCorrections->GetEntries();
     Bool_t isOK=kTRUE;
     for (Int_t icorr=0; icorr<ncorrs; icorr++){
-      isOK&=AddCorrectionCompact(corrC->GetSubCorrection(icorr),weight*(*((corrC->fWeights)))[icorr]);
+      Double_t weight0=((corrC->fWeights)==NULL)?1:(*(corrC->fWeights))[icorr];
+      isOK&=AddCorrectionCompact(corrC->GetSubCorrection(icorr),weight*weight0);
     }
     return isOK;
   }