CalibMacros/CalibTimeVdrift.C - Removed obsolete code
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Dec 2009 14:53:01 +0000 (14:53 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Dec 2009 14:53:01 +0000 (14:53 +0000)
                              - More graphs
macros/ConfigOCDBQA.C         - Print specific OCDB storage location
scripts/mergeCalibRun.sh      - Final merging on run level

Marian

TPC/CalibMacros/CalibTimeVdrift.C
TPC/macros/ConfigOCDBQA.C
TPC/scripts/mergeCalibRun.sh

index d6a5aaa..9a9f4d7 100644 (file)
@@ -21,11 +21,11 @@ ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
 //
 // 4. simple execution
 //
-CalibTimeVdriftGlobal()
+CalibTimeVdriftGlobal("CalibObjectsTrain1.root", 100000, AliCDBRunRange::Infinity())
 //
 // 5. try to visualize new entry
 //
-Int_t run=90000; //
+Int_t run=1041600; //
 //.x ConfigOCDB.C(run);
 
 ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
@@ -73,49 +73,48 @@ MakeDefaultPlots(arr,picArray);
 #include "AliTPCParamSR.h"
 
 TString ocdbStorage="dummy";
+const Int_t    kMinEntries=100;     // minimal number of entries
+Int_t startRun=0, endRun=0;
+Int_t startTime=0, endTime=0;
+TObjArray * vdriftArray = 0;
+AliTPCcalibTime * timeDrift=0;
 //
 //
 //
 void AddHistoGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift, Int_t minEntries);
 void AddAlignmentGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift);
 void AddLaserGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift);
-//
+void UpdateOCDBDrift(Int_t ustartRun, Int_t uendRun);
 
 TGraphErrors* FilterGraphMedianAbs(TGraphErrors * graph, Float_t cut,Double_t &medianY);
 TGraphErrors* FilterGraphDrift(TGraphErrors * graph, Float_t errSigmaCut, Float_t medianCutAbs);
 
 
-void CalibTimeVdriftGlobal(Char_t* file="CalibObjectsTrain1.root", Int_t startRun=0, Int_t endRun=0){
-
-  const Int_t    kMinEntries=500;     // minimal number of entries
-  //
-  // 1. Initialization and run range setting
-  TFile fcalib(file);
-  AliTPCcalibTime* timeDrift=(AliTPCcalibTime*)fcalib.Get("calibTime");
-//   Int_t startRun=0, endRun=0;
-  Int_t startTime=0, endTime=0;
-  //Int_t startPT=-1, endPT=-1;
 
 
+void GetRunRange(AliTPCcalibTime* timeDrift){
+  //
+  //
+  //
+  //
+  // find the fist and last run
+  //
   TObjArray *hisArray =timeDrift->GetHistoDrift();
   {for (Int_t i=0; i<hisArray->GetEntriesFast(); i++){
     THnSparse* addHist=(THnSparse*)hisArray->UncheckedAt(i);
     if (addHist->GetEntries()<kMinEntries) continue;
     if (!addHist) continue;
     TH1D* histo    =addHist->Projection(3);
-    
-    if (startRun==0){ 
+    TH1D* histoTime=addHist->Projection(0);
+    printf("%s\t%f\t%d\t%d\n",histo->GetName(), histo->GetEntries(),histo->FindFirstBinAbove(0),histo->FindLastBinAbove(0));
+
+    if (startRun<=0){ 
       startRun=histo->FindFirstBinAbove(0);
       endRun  =histo->FindLastBinAbove(0);
+    }else{
+      startRun=TMath::Min(histo->FindFirstBinAbove(0),startRun);
+      endRun  =TMath::Max(histo->FindLastBinAbove(0),endRun);
     }
-//     else{
-//       startRun=TMath::Min(histo->FindFirstBinAbove(0),startRun);
-//       endRun  =TMath::Max(histo->FindLastBinAbove(0),endRun);
-//     }
-
-    addHist->GetAxis(3)->SetRangeUser(startRun,endRun);
-    addHist->GetAxis(0)->SetRange(1,addHist->GetAxis(0)->GetNbins());
-    TH1D* histoTime=addHist->Projection(0);
     if (startTime==0){ 
       startTime=histoTime->FindFirstBinAbove(0);
       endTime  =histoTime->FindLastBinAbove(0);
@@ -126,22 +125,37 @@ void CalibTimeVdriftGlobal(Char_t* file="CalibObjectsTrain1.root", Int_t startRu
     delete histo;
     delete histoTime;
   }}
+  if (startRun<0) startRun=0;
+  if (endRun<0) endRun=100000000;
+  printf("Run range  :\t%d-%d\n", startRun, endRun);
+  printf("Time range :\t%d-%d\n", startTime, endTime);
 
+}
 
-  {
-    for (Int_t i=0; i<hisArray->GetEntriesFast(); i++){
-      THnSparse* addHist=(THnSparse*)hisArray->At(i);
-      if (!addHist) continue;
-      addHist->GetAxis(0)->SetRange(startTime-1,endTime+1);
-      addHist->GetAxis(3)->SetRange(startRun-1,endRun+1);
-    }
+
+
+void CalibTimeVdriftGlobal(Char_t* file="CalibObjectsTrain1.root", Int_t ustartRun=0, Int_t uendRun=AliCDBRunRange::Infinity()){
+
+  const Int_t    kMinEntries=500;     // minimal number of entries
+  //
+  // 1. Initialization and run range setting
+  TFile fcalib(file);
+  timeDrift=(AliTPCcalibTime*)fcalib.Get("calibTime");
+  startRun=ustartRun;
+  endRun=ustartRun; 
+  TObjArray *hisArray =timeDrift->GetHistoDrift();  
+  GetRunRange(timeDrift);
+  for (Int_t i=0; i<hisArray->GetEntriesFast(); i++){
+    THnSparse* addHist=(THnSparse*)hisArray->At(i);
+    if (!addHist) continue;
+    if (startTime<endTime) addHist->GetAxis(0)->SetRange(startTime-1,endTime+1);
+    if (startRun<endRun) addHist->GetAxis(3)->SetRange(startRun-1,endRun+1);
   }
-  printf("Run range  :\t%d-%d\n", startRun, endRun);
-  printf("Time range :\t%d-%d\n", startTime, endTime);
+  //
   //
   // 2. extraction of the information
   //
-  TObjArray * vdriftArray = new TObjArray();
+  vdriftArray = new TObjArray();
   AddAlignmentGraphs(vdriftArray,timeDrift);
   AddHistoGraphs(vdriftArray,timeDrift,kMinEntries);
   AddLaserGraphs(vdriftArray,timeDrift);
@@ -150,6 +164,10 @@ void CalibTimeVdriftGlobal(Char_t* file="CalibObjectsTrain1.root", Int_t startRu
   // 3. update of OCDB
   //
   //
+  UpdateOCDBDrift(ustartRun,uendRun);
+}
+
+void UpdateOCDBDrift( Int_t ustartRun, Int_t uendRun){
   AliCDBMetaData *metaData= new AliCDBMetaData();
   metaData->SetObjectClassName("TObjArray");
   metaData->SetResponsible("Marian Ivanov");
@@ -157,13 +175,13 @@ void CalibTimeVdriftGlobal(Char_t* file="CalibObjectsTrain1.root", Int_t startRu
   metaData->SetAliRootVersion("05-25-01"); //root version
   metaData->SetComment("Calibration of the time dependence of the drift velocity due to pressure and temperature changes");
   AliCDBId* id1=NULL;
-  id1=new AliCDBId("TPC/Calib/TimeDrift", startRun, endRun);
+  id1=new AliCDBId("TPC/Calib/TimeDrift", ustartRun, uendRun);
   AliCDBStorage* gStorage = AliCDBManager::Instance()->GetStorage(ocdbStorage);
   gStorage->Put(vdriftArray, (*id1), metaData);
 }
 
 
+
 void UpdateDriftParam(AliTPCParam *param, TObjArray *arr, Int_t startRun){
   //
   //  update the OCDB entry for the nominal time0
@@ -190,269 +208,6 @@ void UpdateDriftParam(AliTPCParam *param, TObjArray *arr, Int_t startRun){
 
 }
 
-void CalibTimeVdrift(Int_t runNumber, AliTPCcalibTime* vdrift, Int_t end=false){
-  TObjArray* vdriftArray = new TObjArray();
-  TObjArray * array=vdrift->GetHistoDrift();
-  if(!array) return;
-  TIterator* iterator = array->MakeIterator();
-  iterator->Reset();
-  THnSparse* hist=NULL;
-  while((hist=(THnSparseF*)iterator->Next())){
-    if(!hist) continue;
-    hist->Print();
-    if(end) hist->GetAxis(3)->SetRangeUser(runNumber-0.5,       end+0.5);
-    else    hist->GetAxis(3)->SetRangeUser(runNumber-0.5, runNumber+0.5);
-    TString name=hist->GetName();
-    Int_t dim[4]={0,1,2,3};
-    THnSparse* newHist=hist->Projection(4,dim);
-    newHist->SetName(name);
-    vdriftArray->Add(newHist);
-    TGraphErrors* graph=AliTPCcalibBase::FitSlices(newHist,2,0,400,100,0.05,0.95, kTRUE);
-    printf("name=%s graph=%i\n", name.Data(), graph==0);
-    if(!graph || !graph->GetN()) 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);
-    TString graphName=graph->ClassName();
-    graphName+=name;
-    graphName.ToUpper();
-    graph->SetName(graphName);
-    printf("name=%s\n", graphName.Data());
-    vdriftArray->Add(graph);
-//      AliSplineFit* fit=new AliSplineFit();
-//      fit->SetGraph(graph);
-//      fit->SetMinPoints(graph->GetN()+1);
-//      fit->InitKnots(graph,2,0,0.001);
-//      fit->SplineFit(0);
-//      TString fiName=fit->ClassName();
-//      fiName+=type;
-//      fiName+=trigger;
-//      fiName.ToUpper();
-//      fit->SetName(fiName.Data());
-//      printf("name=%s\n", fiName.Data());
-//      vdriftArray->Add(fit);
-  }
-  THnSparse* laserHist=NULL;
-  TGraphErrors* laserGraph=NULL;
-  TString laserName="";
-
-  laserHist=vdrift->GetHistVdriftLaserA(1);
-  laserName=laserHist->ClassName();
-  laserName+="_MEAN_DRIFT_LASER_ALL_A";
-  laserName.ToUpper();
-  laserHist->SetName(laserName);
-  vdriftArray->Add(laserHist);
-  laserGraph=AliTPCcalibBase::FitSlices(laserHist,2,0,400,100,0.05,0.95, kTRUE);
-  if(laserGraph && laserGraph->GetN()){
-    laserName=laserGraph->GetName();
-    laserName+="_MEAN_DRIFT_LASER_ALL_A";
-    laserName.ToUpper();
-    laserGraph->SetName(laserName);
-    vdriftArray->Add(laserGraph);
-  }
-
-  laserHist=vdrift->GetHistVdriftLaserC(1);
-  laserName=laserHist->ClassName();
-  laserName+="_MEAN_DRIFT_LASER_ALL_C";
-  laserName.ToUpper();
-  laserHist->SetName(laserName);
-  vdriftArray->Add(laserHist);
-  laserGraph=AliTPCcalibBase::FitSlices(laserHist,2,0,400,100,0.05,0.95, kTRUE);
-  if(laserGraph && laserGraph->GetN()){
-    laserName=laserGraph->GetName();
-    laserName+="_MEAN_DRIFT_LASER_ALL_C";
-    laserName.ToUpper();
-    laserGraph->SetName(laserName);
-    vdriftArray->Add(laserGraph);
-  }
-
-  AliCDBMetaData *metaData= new AliCDBMetaData();
-  metaData->SetObjectClassName("TObjArray");
-  metaData->SetResponsible("Dag Toppe Larsen");
-  metaData->SetBeamPeriod(1);
-  metaData->SetAliRootVersion("05-25-01"); //root version
-  metaData->SetComment("Calibration of the time dependence of the drift velocity due to pressure and temperature changes");
-  AliCDBId* id1=NULL;
-  if(end) id1=new AliCDBId("TPC/Calib/TimeDrift", runNumber, end);
-  else    id1=new AliCDBId("TPC/Calib/TimeDrift", runNumber, runNumber);
-  AliCDBStorage* gStorage = AliCDBManager::Instance()->GetStorage(ocdbStorage);
-  gStorage->Put(vdriftArray, (*id1), metaData);
-  printf("done runNumber=%i, end=%i\n", runNumber, end);
-}
-
-void CalibrateAll(Char_t* file="CalibObjectsTrain1.root"){
-  TFile fcalib(file);
-  AliTPCcalibTime* timeDrift=(AliTPCcalibTime*)fcalib.Get("calibTime");
-  THnSparse* addHist=timeDrift->GetHistoDrift("all");
-  TH1D* histo=addHist->Projection(3);
-  Int_t start=histo->FindFirstBinAbove(0);
-  Int_t end  =histo->FindLastBinAbove(0);
-  CalibTimeVdrift(start-1, timeDrift, end-1);
-  for(Int_t i=start;i<end;i++){
-    if(histo->GetBinContent(i)){
-      printf("start=%i i=%i end=%i i=%i center=%f", start, i, end, i, histo->GetBinCenter(i));
-      CalibTimeVdrift(i, timeDrift);
-    }
-  }
-}
-
-void MakePlot(Char_t* file="CalibObjects.root", Char_t* trigger="", /*Int_t useError=true,*/ Int_t separateFits=false, Int_t pointLimit=0, Int_t showHisto=true, Int_t otherColour=false, Int_t spline=true, Double_t yMin=0.0, Double_t yMax=0.0){
-  TFile fcalib(file);
-  AliTPCcalibTime* timeDrift=(AliTPCcalibTime*)fcalib.Get("calibTime");
-
-//Get graphs
-  TObjArray* grArray=new TObjArray();
-  TObjArray* hiArray=new TObjArray();
-  Int_t counter=0;
-  Int_t pos=counter+1;
-  Int_t colour=2;
-  TObjArray * addArray=timeDrift->GetHistoDrift();
-  if(!addArray) return;
-  TIterator* iterator = addArray->MakeIterator();
-  iterator->Reset();
-  THnSparse* addHist=NULL;
-
-  THnSparse* laserHist=NULL;
-  TString laserName="";
-
-  laserHist=timeDrift->GetHistVdriftLaserA(1);
-  laserName=laserHist->ClassName();
-  laserName+="_MEAN_VDRIFT_LASER_ALL_A";
-  laserName.ToUpper();
-  laserHist->SetName(laserName);
-  addArray->Add(laserHist);
-
-  laserHist=timeDrift->GetHistVdriftLaserC(1);
-  laserName=laserHist->ClassName();
-  laserName+="_MEAN_VDRIFT_LASER_ALL_C";
-  laserName.ToUpper();
-  laserHist->SetName(laserName);
-  addArray->Add(laserHist);
-
-  while((addHist=(THnSparseF*)iterator->Next())){
-    if (!addHist) continue;
-    TString histName=addHist->GetName();
-    if(!histName.Contains(trigger) && !histName.Contains("COSMICS_ALL")) continue;
-    addHist->Print();
-    TGraph* graph=AliTPCcalibBase::FitSlices(addHist,2,0,400,100,0.05,0.95, kTRUE);
-    TH2D* histo=addHist->Projection(2,0);
-    if(!graph || !histo || !graph->GetN()) continue;
-    if(spline){
-      AliSplineFit fit;
-      fit.SetGraph(graph);
-      fit.SetMinPoints(graph->GetN()+1);
-      fit.InitKnots(graph,2,0,0.001);
-      fit.SplineFit(0);
-      graph=fit.MakeGraph(graph->GetX()[0],graph->GetX()[graph->GetN()-1],50000,0);
-    }
-    graph->SetNameTitle(addHist->GetName(),"Relative drift velocity change");
-    graph->GetXaxis()->SetTitle("time");
-    graph->GetXaxis()->SetTimeFormat();
-    graph->GetXaxis()->SetTimeDisplay(1);
-    graph->GetYaxis()->SetTitleOffset(1.2);
-    graph->GetXaxis()->SetLabelSize(0.035);
-    graph->GetYaxis()->SetLabelSize(0.04);
-    graph->GetYaxis()->SetTitle("relative drift velocity change");
-    if(yMin) graph->SetMinimum(yMin);
-    if(yMax) graph->SetMaximum(yMax);
-    printf("bins=%i name=%s couter=%i pos=%i colour=%i Ymax=%f Ymin=%f Xmax=%f Xmin=%f\n", graph->GetXaxis()->GetNbins(), addHist->GetName(), counter, pos, colour, graph->GetYaxis()->GetXmax(), graph->GetYaxis()->GetXmin(), graph->GetXaxis()->GetXmax(), graph->GetXaxis()->GetXmin());
-    if(graph->GetXaxis()->GetNbins()<=pointLimit) continue;
-//    if(!useError&&!spline) for(Int_t j=0; j<graph->GetXaxis()->GetNbins(); j++) graph->SetPointError(j,0,0);
-//    if( *((Int_t*)(graph->GetName()))==*((Int_t*)("all")) ){
-    TString name=graph->GetName();
-    if(name.Contains("COSMICS_ALL")){
-      graph->SetLineColor(0+1);
-      graph->SetMarkerColor(0+1);
-      grArray->AddAtAndExpand(graph,0);
-      histo->SetLineColor(1);
-      histo->SetMarkerColor(1);
-      hiArray->AddAtAndExpand(histo,0);
-      pos=counter;
-    }
-    else{
-      graph->SetLineColor(colour);
-      graph->SetMarkerColor(colour);
-      grArray->AddAtAndExpand(graph,pos);
-      histo->SetLineColor(colour);
-      histo->SetMarkerColor(colour);
-      hiArray->AddAtAndExpand(histo,pos);
-      colour++;
-      if(colour==10) colour++;
-    }
-    pos++;
-    counter++;
-    graph=0;
-    addHist=0;
-  }
-
-  if(!separateFits){
-    TCanvas* plot = new TCanvas("plot", "Relative drift velocity change", 1500, 900);
-    //Draw graphs
-    TGraph* grTemp=0;
-    TH2D* hiTemp=0;
-    for(Int_t i=0; i<counter; i++){
-      if(!(*grArray)[i] || !(*hiArray)[i]) continue;
-      grTemp=(TGraph*)(*grArray)[i];
-      hiTemp=(TH2D*)(*hiArray)[i];
-      if(i==0) grTemp->Draw("alp");
-      else grTemp->Draw("lp");
-      if(showHisto) hiTemp->Draw("same");
-    }
-    //Add legends
-     TLegend* leg=NULL;
-     if(pointLimit){
-       leg = new TLegend(0.4,0.75,1,0.95,NULL,"brNDC");
-       leg->SetTextSize(0.03);
-     }
-     else{
-       leg = new TLegend(0.4,0.65,1,1,NULL,"brNDC");
-       leg->SetTextSize(0.02);
-     }
-    leg->SetLineColor(0);
-    leg->SetLineWidth(0);
-    leg->SetFillColor(0);
-    TLegendEntry* entry=0;
-    for(Int_t i=0; i<counter; i++){
-      if(!(*grArray)[i]) continue;
-      TString name=(*grArray)[i]->GetName();
-      Int_t pos=name.Index("_")+1+12;
-      name=name(pos,name.Capacity()-pos);
-      entry = leg->AddEntry((*grArray)[i],name,"l");
-      leg->Draw();
-    }
-    plot->SaveAs("relative_drift_velocity_change.pdf");
-    plot->SaveAs("relative_drift_velocity_change.png");
-  }
-  else{
-    //Draw graphs
-    TGraph* grTemp=0;
-    TH2D* hiTemp=0;
-    for(Int_t i=0; i<counter; i++){
-      if(!(*grArray)[i] || !(*hiArray)[i]) continue;
-      grTemp=(TGraph*)(*grArray)[i];
-      hiTemp=(TH2D*)(*hiArray)[i];
-      TString name=grTemp->GetName();
-      Int_t pos=name.Index("_")+1+12;
-      name=name(pos,name.Capacity()-pos);
-      grTemp->SetTitle(name);
-      if(otherColour){
-        grTemp->SetLineColor(2);
-        grTemp->SetMarkerColor(2);
-        hiTemp->SetLineColor(1);
-        hiTemp->SetMarkerColor(1);
-      }
-      TCanvas* plot = new TCanvas(name, name, 1500, 900);
-      grTemp->Draw("alp");
-      if(showHisto) hiTemp->Draw("same");
-      TString name2=name;
-      name+=".pdf";
-      name2+=".png";
-      plot->SaveAs(name);
-      plot->SaveAs(name2);
-    }
-  }
-}
-
 void MakeQaPlot(Char_t* file="CalibObjects.root"){
   TFile fcalib(file);
   AliTPCcalibTime* timeDrift=(AliTPCcalibTime*)fcalib.Get("calibTime");
@@ -700,22 +455,9 @@ void AddAlignmentGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift){
   arrayTRD=timeDrift->GetAlignTRDTPC();
   arrayTOF=timeDrift->GetAlignTOFTPC();
 
-  // additional protection
-  Int_t nacceptTRD=0;
-  Int_t entriesFastTRD = arrayTRD->GetEntriesFast();
-  for (Int_t ikalman=0; ikalman<entriesFastTRD; ikalman++){
-    AliRelAlignerKalman * kalman = (AliRelAlignerKalman *) arrayTRD->UncheckedAt(ikalman);
-    if (!kalman) continue;
-    if (TMath::Abs(kalman->GetTPCvdCorr()-1)>0.025) continue;
-    if (kalman->GetNUpdates()<50) continue;
-    if (kalman->GetNUpdates()/kalman->GetNTracks()<0.9) continue;
-    nacceptTRD++;
-  }
-  //
-
-  mstatITS= AliTPCcalibDButil::MakeStatRelKalman(arrayITS,0.9,50,0.025);
-  mstatTOF= AliTPCcalibDButil::MakeStatRelKalman(arrayTOF,0.9,1000,0.025);
-  if (nacceptTRD>0) mstatTRD= AliTPCcalibDButil::MakeStatRelKalman(arrayTRD,0.9,50,0.025);
+  if (arrayITS->GetEntries()>0) mstatITS= AliTPCcalibDButil::MakeStatRelKalman(arrayITS,0.9,50,0.025);
+  if (arrayTOF->GetEntries()>0) mstatTOF= AliTPCcalibDButil::MakeStatRelKalman(arrayTOF,0.9,1000,0.025);
+  if (arrayTRD->GetEntries()>0) mstatTRD= AliTPCcalibDButil::MakeStatRelKalman(arrayTRD,0.9,50,0.025);
   //
   TObjArray * arrayITSP= AliTPCcalibDButil::SmoothRelKalman(arrayITS,*mstatITS, 0, 5.);
   TObjArray * arrayITSM= AliTPCcalibDButil::SmoothRelKalman(arrayITS,*mstatITS, 1, 5.);
@@ -727,10 +469,9 @@ void AddAlignmentGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift){
   TObjArray * arrayTRDP= 0x0;
   TObjArray * arrayTRDM= 0x0;
   TObjArray * arrayTRDB= 0x0;
-  if (nacceptTRD>0) arrayTRDP= AliTPCcalibDButil::SmoothRelKalman(arrayTRD,*mstatTRD, 0, 5.);
-  if (nacceptTRD>0) arrayTRDM= AliTPCcalibDButil::SmoothRelKalman(arrayTRD,*mstatTRD, 1, 5.);
-  if (nacceptTRD>0) arrayTRDB= AliTPCcalibDButil::SmoothRelKalman(arrayTRDP,arrayTRDM);
-
+  arrayTRDP= AliTPCcalibDButil::SmoothRelKalman(arrayTRD,*mstatTRD, 0, 5.);
+  arrayTRDM= AliTPCcalibDButil::SmoothRelKalman(arrayTRD,*mstatTRD, 1, 5.);
+  arrayTRDB= AliTPCcalibDButil::SmoothRelKalman(arrayTRDP,arrayTRDM);
   //
   //
   Int_t entries=TMath::Max(arrayITS->GetEntriesFast(),arrayTOF->GetEntriesFast());
@@ -794,7 +535,7 @@ void AddLaserGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift){
   laserName.ToUpper();
   laserHist->SetName(laserName);
   laserGraph=AliTPCcalibBase::FitSlices(laserHist,2,0,300,10,0.05,0.95, kTRUE);
-  laserGraph=FilterGraphDrift(laserGraph, 5,0.04);
+  //laserGraph=FilterGraphDrift(laserGraph, 5,0.04);
   //
   if(laserGraph && laserGraph->GetN()){
     laserName=laserGraph->GetName();
@@ -815,7 +556,7 @@ void AddLaserGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift){
   laserHist->SetName(laserName);
   //vdriftArray->Add(laserHist);// really add the whole histogram ??
   laserGraph=AliTPCcalibBase::FitSlices(laserHist,2,0,300,10,0.05,0.95, kTRUE);
-  laserGraph = FilterGraphDrift(laserGraph, 5,0.04);
+  //laserGraph = FilterGraphDrift(laserGraph, 5,0.04);
   if(laserGraph && laserGraph->GetN()){
     laserName=laserGraph->GetName();
     laserName+="_MEAN_DRIFT_LASER_ALL_C";
@@ -875,7 +616,7 @@ void AddLaserGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift){
   laserHist->SetName(laserName);
   //vdriftArray->Add(laserHist);  // really add the whole histogram ??
   laserGraph=AliTPCcalibBase::FitSlices(laserHist,2,0,100,10,0.05,0.95, kTRUE);
-  laserGraph=FilterGraphDrift(laserGraph, 5,0.04);
+  //laserGraph=FilterGraphDrift(laserGraph, 5,0.04);
   if(laserGraph && laserGraph->GetN()){
     laserName=laserGraph->GetName();
     laserName+="_MEAN_GLOBALYGRADIENT_LASER_ALL_A";
@@ -894,7 +635,7 @@ void AddLaserGraphs(  TObjArray * vdriftArray, AliTPCcalibTime *timeDrift){
   laserName.ToUpper();
   laserHist->SetName(laserName);
   laserGraph=AliTPCcalibBase::FitSlices(laserHist,2,0,100,10,0.05,0.95, kTRUE);
-  laserGraph=FilterGraphDrift(laserGraph, 5,0.04);
+  //laserGraph=FilterGraphDrift(laserGraph, 5,0.04);
   if(laserGraph && laserGraph->GetN()){
     laserName=laserGraph->GetName();
     laserName+="_MEAN_GLOBALYGRADIENT_LASER_ALL_C";
@@ -953,6 +694,7 @@ void MakeDefaultPlots(TObjArray * arr, TObjArray *picArray){
   TGraphErrors* cross        =(TGraphErrors*)arr->FindObject("TGRAPHERRORS_VDRIFT_CROSS_ALL");
   TGraphErrors* itstpcP       =(TGraphErrors*)arr->FindObject("ALIGN_ITSP_TPC_DRIFTVD");
   TGraphErrors* itstpcM       =(TGraphErrors*)arr->FindObject("ALIGN_ITSM_TPC_DRIFTVD");
+  TGraphErrors* itstpcB       =(TGraphErrors*)arr->FindObject("ALIGN_ITSB_TPC_DRIFTVD");
   //
   if (laserA)  SetDefaultGraphDrift(laserA,2,25);
   if (laserC)  SetDefaultGraphDrift(laserC,4,26);
@@ -960,6 +702,7 @@ void MakeDefaultPlots(TObjArray * arr, TObjArray *picArray){
   if (cross)   SetDefaultGraphDrift(cross,4,28);
   if (itstpcP) SetDefaultGraphDrift(itstpcP,2,29);
   if (itstpcM) SetDefaultGraphDrift(itstpcM,4,30);
+  if (itstpcB) SetDefaultGraphDrift(itstpcB,1,31);
   //
   //
   TPad *pad=0;
@@ -987,21 +730,27 @@ void MakeDefaultPlots(TObjArray * arr, TObjArray *picArray){
     gPad->Clear();
     itstpcM->Draw("apl");
     itstpcP->Draw("p");
+    itstpcB->Draw("p");
     TLegend *legend = new TLegend(mx0+0.01,1-my1-0.2, 0.5, 1-my1-0.01, "Drift velocity correction");
-    legend->AddEntry(itstpcP,"ITS-TPC smooth forward");
-    legend->AddEntry(itstpcM,"ITS-TPC smooth back");
+    legend->AddEntry(itstpcP,"ITS-TPC smooth plus");
+    legend->AddEntry(itstpcM,"ITS-TPC smooth minus");
+    legend->AddEntry(itstpcB,"ITS-TPC smooth ");
     legend->Draw();    
     picArray->AddLast(pad);
   }
 
-  if (itstpcP&&laserA){
+  if (itstpcB&&laserA){
     pad = new TCanvas("ITSTPC_LASER","ITSTPC_LASER");
     SetPadStyle(pad,mx0,mx1,my0,my1);    
     laserA->Draw("alp");
+    itstpcP->Draw("p");
     itstpcM->Draw("p");
+    itstpcB->Draw("p");
     TLegend *legend = new TLegend(mx0+0.01,1-my1-0.2, 0.5, 1-my1-0.01, "Drift velocity correction");
     legend->AddEntry(laserA,"TPC laser");
-    legend->AddEntry(itstpcM,"ITS-TPC smooth back");
+    legend->AddEntry(itstpcP,"ITS-TPC smooth plus");   
+    legend->AddEntry(itstpcM,"ITS-TPC smooth minus");   
+    legend->AddEntry(itstpcB,"ITS-TPC smooth ");
     legend->Draw();
     picArray->AddLast(pad);
   }
@@ -1017,7 +766,7 @@ void MakeDefaultPlots(TObjArray * arr, TObjArray *picArray){
     TLegend *legend = new TLegend(mx0+0.01,1-my1-0.2, 0.5, 1-my1-0.01, "Drift velocity correction");
 
     legend->AddEntry(cross,"TPC cross tracks");
-    legend->AddEntry(itstpcP,"ITS-TPC smooth back");
+    legend->AddEntry(itstpcB,"ITS-TPC smooth");
     legend->Draw();        
     picArray->AddLast(pad);
   }
@@ -1032,7 +781,7 @@ void MakeDefaultPlots(TObjArray * arr, TObjArray *picArray){
     TLegend *legend = new TLegend(mx0+0.01,1-my1-0.2, 0.5, 1-my1-0.01, "Drift velocity correction");
 
     legend->AddEntry(cosmic,"TPC cross tracks0 up-down");
-    legend->AddEntry(itstpcP,"ITS-TPC smooth back");
+    legend->AddEntry(itstpcB,"ITS-TPC smooth");
     legend->Draw();        
     picArray->AddLast(pad);
   }
index abfef7c..d98f53b 100644 (file)
@@ -18,21 +18,22 @@ void ConfigOCDB(Int_t crun=-1){
   // 
   printf("SETUP OCBD for TPC\n");
   //
+  Int_t run =crun;
+  if (run<0) run =0;
   AliCDBManager::Instance()->SetDefaultStorage("local:///lustre/alice/alien/alice/data/2009/OCDB/");
+  AliCDBManager::Instance()->SetRun(run);
   //
   //
   // custom calibration to test before committing
   //
   TString ocdbStorage="local://";
   ocdbStorage+=gSystem->Getenv("workdir");
-  ocdbStorage+="../calibNoDrift/OCDB";
+  ocdbStorage+="/calibNoDrift/OCDB";
+  printf("OCDB storage\t%s\n",ocdbStorage.Data());
   AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeGain",ocdbStorage.Data());
   AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/TimeDrift",ocdbStorage.Data());
 
-  
-  Int_t run =crun;
-  if (run<0) run =0;
-  AliCDBManager::Instance()->SetRun(run);
+  AliCDBManager::Instance()->Get("TPC/Calib/TimeDrift",run)->Dump();
   SetupCustom(run);
   AliTPCcalibDB::Instance()->SetRun(run);
 }
index 82c891c..a4932a9 100755 (executable)
@@ -13,8 +13,8 @@ rm train2.txt
 touch train1.txt
 touch train2.txt
 for adir in `cat ../$runlist`; do
-ls $mydir/$adir/*_*/CalibObjectsTrain1.root >> train1.txt;
-ls $mydir/$adir/*_*/CalibObjectsTrain2.root >> train2.txt;
+ls $mydir/$adir/CalibObjectsTrain1.root >> train1.txt;
+ls $mydir/$adir/CalibObjectsTrain2.root >> train2.txt;
 done;
 aliroot -b -q  $ALICE_ROOT/TPC/macros/CalibFileMerger.C+\(\"CalibObjectsTrain1.root\",10000,\"train1.txt\"\)
 aliroot -b -q  $ALICE_ROOT/TPC/macros/CalibFileMerger.C+\(\"CalibObjectsTrain2.root\",10000,\"train2.txt\"\)