]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity (Marian)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Jul 2011 12:31:32 +0000 (12:31 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Jul 2011 12:31:32 +0000 (12:31 +0000)
PWG1/TPC/AliMCTrackingTestTask.cxx
TPC/AliTPCPreprocessorOffline.cxx

index df90c77f4651f5b24d38d3f4dc46ade2aae6ef98..baf0df29208dcc200f2e7ecce281e0314770d98a 100644 (file)
@@ -298,6 +298,8 @@ AliExternalTrackParam * AliMCTrackingTestTask::MakeTrack(const AliTrackReference
   // Make track out of the track ref
   // part - TParticle used to determine chargr
   // the covariance matrix - equal 0 - starting from ideal MC position
+  if (!ref) return 0x0;
+  if (!part) return 0x0;
   Double_t xyz[3]={ref->X(),ref->Y(),ref->Z()};
   Double_t pxyz[3]={ref->Px(),ref->Py(),ref->Pz()};
   Double_t cv[21];
@@ -596,7 +598,7 @@ void  AliMCTrackingTestTask::ProcessMCInfo(){
 
   }
 
-  trefs->Clear("C");
+  if (trefs) trefs->Clear("C");
   //delete particle;
   //delete tpcIn;
 
@@ -699,6 +701,7 @@ void  AliMCTrackingTestTask::FitTrackRefs(TParticle * part, TClonesArray * trefs
   printf("FitTrackRefs\n");
 #endif
 
+  if (!trefs) return;
   const Int_t kMinRefs=6;
   Int_t nrefs = trefs->GetEntries();
   if (nrefs<kMinRefs) return; // we should have enough references
index edb954b4e9e09d67fde5b2e2af07c66d0baad22b..5197e36781a91c5af20ba26253b014e8488b930b 100644 (file)
@@ -134,8 +134,8 @@ void AliTPCPreprocessorOffline::GetRunRange(AliTPCcalibTime * const  timeDrift){
   TObjArray *hisArray =timeDrift->GetHistoDrift();
   {for (Int_t i=0; i<hisArray->GetEntriesFast(); i++){
     THnSparse* addHist=(THnSparse*)hisArray->UncheckedAt(i);
-    if (addHist->GetEntries()<fMinEntries) continue;
     if (!addHist) continue;
+    if (addHist->GetEntries()<fMinEntries) continue;
     TH1D* histo    =addHist->Projection(3);
     TH1D* histoTime=addHist->Projection(0);
     printf("%s\t%f\t%d\t%d\n",histo->GetName(), histo->GetEntries(),histo->FindFirstBinAbove(0),histo->FindLastBinAbove(0));