Coverity fix.
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Mar 2011 19:55:57 +0000 (19:55 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Mar 2011 19:55:57 +0000 (19:55 +0000)
TPC/AliTPCExBEffectiveSector.cxx
TPC/AliTPCPreprocessorOffline.cxx
TPC/AliTPCcalibCosmic.cxx
TPC/AliTPCcalibV0.cxx

index fcd1b9c..4f4e1b0 100644 (file)
@@ -265,7 +265,7 @@ void  AliTPCExBEffectiveSector::MakeResidualMap(THnSparse * hisInput, const char
       Double_t slopeAE=f1->GetParError(1); 
       Double_t chi2A=f1->GetChisquare()/f1->GetNumberFreeParameters();
       profAC->Fit("pol1","QNR","QNR",-1.1,-0.1);
-      if (!f1) f1=(TF1*)gROOT->FindObject("pol1");
+      f1=(TF1*)gROOT->FindObject("pol1");
       Double_t offsetC=f1->GetParameter(0);
       Double_t slopeC=f1->GetParameter(1); 
       Double_t offsetCE=f1->GetParError(0);
@@ -320,10 +320,9 @@ void  AliTPCExBEffectiveSector::MakeResidualMap(THnSparse * hisInput, const char
          if (!fgaus) {     
            his->Fit("gaus","Q","goff");
            fgaus= (TF1*)((his->GetListOfFunctions()->FindObject("gaus"))->Clone());
-           fgaus->SetName("gausk");
          }
-         if (fgaus) his->Fit(fgaus,"Q","goff");
-         if (fgaus){
+         if (fgaus) {
+           his->Fit(fgaus,"Q","goff");
            meanG=fgaus->GetParameter(1);
            rmsG=fgaus->GetParameter(2);
          }
index a0dff6f..0e4b533 100644 (file)
@@ -385,7 +385,13 @@ TGraphErrors* AliTPCPreprocessorOffline::FilterGraphMedianAbs(TGraphErrors * gra
   Double_t *erry=new Double_t[npoints0];
   //
   //
-  if (npoints0<kMinPoints) return 0;
+  if (npoints0<kMinPoints) {
+    delete []outx;
+    delete []outy;
+    delete []errx;
+    delete []erry;
+    return 0;
+  }
   for (Int_t iter=0; iter<3; iter++){
     npoints=0;
     for (Int_t ipoint=0; ipoint<npoints0; ipoint++){
@@ -432,6 +438,10 @@ void AliTPCPreprocessorOffline::AddHistoGraphs(  TObjArray * vdriftArray, AliTPC
       THnSparse* newHist=hist->Projection(4,dim);
       newHist->SetName(name);
       TGraphErrors* graph=AliTPCcalibBase::FitSlices(newHist,2,0,400,100,0.05,0.95, kTRUE);
+      if (!graph) {
+       printf("Graph =%s filtered out\n", name.Data());
+       continue;
+      }
       printf("name=%s graph=%i, N=%i\n", name.Data(), graph==0, graph->GetN());
       Int_t pos=name.Index("_");
       name=name(pos,name.Capacity()-pos);
@@ -440,10 +450,6 @@ void AliTPCPreprocessorOffline::AddHistoGraphs(  TObjArray * vdriftArray, AliTPC
       graphName.ToUpper();
       //
       graph = FilterGraphDrift(graph, kErrSigmaCut, kMedianCutAbs);
-      if (!graph) {
-       printf("Graph =%s filtered out\n", name.Data());
-       continue;
-      }
       //
       if (graph){
         graph->SetMarkerStyle(i%8+20);
@@ -550,9 +556,9 @@ void AliTPCPreprocessorOffline::AddLaserGraphs(  TObjArray * vdriftArray, AliTPC
   // add graphs for laser
   //
   const Double_t delayL0L1 = 0.071;  //this is hack for 1/2 weeks
-  THnSparse *hisN=0;
+  //THnSparse *hisN=0;
   TGraphErrors *grLaser[6]={0,0,0,0,0,0};
-  hisN = timeDrift->GetHistVdriftLaserA(0);
+  //hisN = timeDrift->GetHistVdriftLaserA(0);
   if (timeDrift->GetHistVdriftLaserA(0)){
     grLaser[0]=MakeGraphFilter0(timeDrift->GetHistVdriftLaserA(0),0,2,5,delayL0L1);
     grLaser[0]->SetName("GRAPH_MEAN_DELAY_LASER_ALL_A");
@@ -1169,9 +1175,11 @@ void AliTPCPreprocessorOffline::MakeQAPlot(Float_t  FPtoMIPratio) {
        fGraphCosmic->GetY()[i] *= FPtoMIPratio;        
       }
     }
-    fGraphCosmic->Draw("lp");
-    grfFitCosmic->SetLineColor(2);
-    grfFitCosmic->Draw("lu");
+    fGraphCosmic->Draw("lp"); 
+    if (grfFitCosmic) {
+      grfFitCosmic->SetLineColor(2);
+      grfFitCosmic->Draw("lu");
+    }
     fGainArray->AddLast(gainHistoCosmic);
     //fGainArray->AddLast(canvasCosmic->Clone());
     delete canvasCosmic;    
@@ -1268,6 +1276,7 @@ void AliTPCPreprocessorOffline::MakeChainTime(){
   AliTPCcalibTime  *calibTime= (AliTPCcalibTime*) f.Get("calibTime");
   if (!calibTime) return;
   TTreeSRedirector *pcstream = new TTreeSRedirector("meanITSVertex.root");
+  //
   Int_t ihis=0;
   THnSparse *his = calibTime->GetResHistoTPCITS(ihis);
   if (his){
@@ -1276,6 +1285,14 @@ void AliTPCPreprocessorOffline::MakeChainTime(){
     his->GetAxis(3)->SetRangeUser(-0.35,0.35);
     AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("ITS%s",hname[ihis]),run,85.,ihis,5);
   }
+  ihis=1;
+  his = calibTime->GetResHistoTPCITS(ihis);
+  if (his){
+    his->GetAxis(1)->SetRangeUser(-1.1,1.1);
+    his->GetAxis(2)->SetRange(0,1000000);
+    his->GetAxis(3)->SetRangeUser(-0.35,0.35);
+    AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("ITS%s",hname[ihis]),run,85.,ihis,5);
+  }
   ihis=2;
   his = calibTime->GetResHistoTPCITS(ihis);
   if (his){
@@ -1301,6 +1318,33 @@ void AliTPCPreprocessorOffline::MakeChainTime(){
     AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("Vertex%s",hname[ihis]),run,0.,ihis,5);
 
   }
+  ihis=1;
+  his = calibTime->GetResHistoTPCvertex(ihis);
+  if (his){
+    his->GetAxis(1)->SetRangeUser(-1.1,1.1);
+    his->GetAxis(2)->SetRange(0,1000000);
+    his->GetAxis(3)->SetRangeUser(-0.35,0.35);
+    AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("Vertex%s",hname[ihis]),run,0.,ihis,5);
+
+  }
+  ihis=0;
+  his = calibTime->GetResHistoTPCTOF(ihis);
+  if (his){
+    his->GetAxis(1)->SetRangeUser(-1.1,1.1);
+    his->GetAxis(2)->SetRange(0,1000000);
+    his->GetAxis(3)->SetRangeUser(-0.35,0.35);
+    AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("TOF%s",hname[ihis]),run,0.,ihis,10);
+
+  }
+  ihis=0;
+  his = calibTime->GetResHistoTPCTRD(ihis);
+  if (his){
+    his->GetAxis(1)->SetRangeUser(-1.1,1.1);
+    his->GetAxis(2)->SetRange(0,1000000);
+    his->GetAxis(3)->SetRangeUser(-0.35,0.35);
+    AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("TRD%s",hname[ihis]),run,0.,ihis,10);
+
+  }
   delete pcstream;
 }
 
@@ -1463,7 +1507,7 @@ void AliTPCPreprocessorOffline::CreateAlignTime(TString fstring, TVectorD paramC
   rAngles[2]=paramC[index+1]*0.001; rAngles[6] =-paramC[index+1]*0.001;
   matrixGlobal->SetRotation(rAngles);
   //
-  AliTPCCalibGlobalMisalignment *fitAlignTime  =new  AliTPCCalibGlobalMisalignment;
+  AliTPCCalibGlobalMisalignment *fitAlignTime  =0;
   fitAlignTime  =new  AliTPCCalibGlobalMisalignment;
   fitAlignTime->SetName("FitAlignTime");
   fitAlignTime->SetTitle("FitAlignTime");
index 56a4d99..66e960d 100644 (file)
@@ -1520,6 +1520,7 @@ void AliTPCcalibCosmic::MakeFitTree(TTree * treeInput, TTreeSRedirector *pcstrea
       } //loop over parameters
     } // dump results
   }//loop tracks
+  delete [] distortions;
 }
 
 
index 7a51a4e..d35fe1a 100644 (file)
@@ -103,10 +103,9 @@ void  AliTPCcalibV0::ProcessESD(AliESDEvent *esd, AliStack *stack){
   if (TMath::Abs(AliTracker::GetBz())<1) return;  
   DumpToTree(esd);
   DumpToTreeHPT(esd);
-  return;
   //
-  MakeV0s();
   if (stack) {
+    MakeV0s();
     fStack = stack;
     MakeMC();
   }else{
@@ -1016,7 +1015,6 @@ void AliTPCcalibV0::MakeV0s(){
   }
   ProcessV0(1);
   fV0s->Clear();
-  return;
   //
   // combinatorial
   //