o add macro to create file with precalibrated SC mapcs
authorwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Oct 2013 22:48:56 +0000 (22:48 +0000)
committerwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Oct 2013 22:48:56 +0000 (22:48 +0000)
TPC/Upgrade/macros/createSCprecal.C [new file with mode: 0644]
TPC/Upgrade/macros/toyMCRecPlots.C

diff --git a/TPC/Upgrade/macros/createSCprecal.C b/TPC/Upgrade/macros/createSCprecal.C
new file mode 100644 (file)
index 0000000..2029c18
--- /dev/null
@@ -0,0 +1,26 @@
+void createSCprecal(TString input, Int_t gas=1)
+{
+  AliTPCSpaceCharge3D *spaceCharge = new AliTPCSpaceCharge3D;
+  spaceCharge->SetSCDataFileName(input.Data());
+  
+  const Int_t nOmegaTau = 5;
+  Double_t omegaTau[nOmegaTau] = {0.34, 0.32, 0.43, 1.77, 1.84};
+  Double_t T1[nOmegaTau]       = {1.00, 1.00, 0.99, 0.41, 0.41};
+  Double_t T2[nOmegaTau]       = {1.01, 0.99, 1.03, 0.70, 0.70};
+  
+  TString tGas[nOmegaTau] = {"NeCO2","NeCO2_2","ArCO2","NeCF4","NeCF4_2"}; // CF4 is the same as CO2 here, but different omegaTau
+  TString sGas[nOmegaTau] = {"Ne-CO_{2} (90-10)","Ne-CO_{2}-N_{2} (90-10-5)","Ar-CO_{2} (90-10)","Ne-CF_{4} (90-10)","Ne-CF_{4} (80-20)"};
+
+  spaceCharge->SetOmegaTauT1T2(omegaTau[iOmegaTau], T1[gas] , T2[gas]);
+  spaceCharge->InitSpaceCharge3DDistortion();
+
+  TString outName=input;
+  outName.ReplaceAll(".root","_precal.root");
+
+  TFile fout(outName,"recreate");
+  spaceCharge->Write("map");
+  fout.Write();
+  fout.Close();
+
+  delete spaceCharge;
+}
index b76a17c..0013f97 100644 (file)
@@ -11,7 +11,9 @@ void toyMCRecPlots(TString inFileName = "toyMC.debug.root",Bool_t doPlots = kFAL
   //
 
   //gStyle->SetOptStat(0);
-
+  st->SetTitleX(0.17);
+  st->SetTitleW(0.73);
+  
   // parameters
   const Int_t nT0          = 2;
   const Int_t nT02D        = 2;
@@ -19,7 +21,8 @@ void toyMCRecPlots(TString inFileName = "toyMC.debug.root",Bool_t doPlots = kFAL
   const Int_t nTrackParams = 9;
   const Int_t nTrackParamsITS = 9;
   const Int_t nEff         = 1;
-
+  Int_t nTrackParamsPlot=5;
+  Int_t ydiv=2;  //divisions in y for track parameters plot, usually 3
   Int_t col = kBlack;
 
   TString sT0[nT0] = {"fTime0-t0","fTime0-t0+z0*TMath::Sign(1,tOrig.Eta())/vDrift"};
@@ -28,6 +31,8 @@ void toyMCRecPlots(TString inFileName = "toyMC.debug.root",Bool_t doPlots = kFAL
   //TString sT02D[nT02D] = {"(fTime0-t0)*vDrift:tOrig.fP[3]","(fTime0-t0)*vDrift:tOrig.fP[4]"};
   TString sTrackParams[nTrackParams] = {"track.fP[0]-tOrig.fP[0]","track.fP[1]-tOrig.fP[1]","track.fP[2]-tOrig.fP[2]","track.fP[3]-tOrig.fP[3]","track.fP[4]-tOrig.fP[4]","track.fAlpha-tOrig.fAlpha","track.fX/tOrig.fX","track.fP[0]/tOrig.fP[0]","track.fP[1]/tOrig.fP[1]"};
   TString sTrackParamsITS[nTrackParamsITS] = {"trackITS.fP[0]-tOrigITS.fP[0]","trackITS.fP[1]-tOrigITS.fP[1]","trackITS.fP[2]-tOrigITS.fP[2]","trackITS.fP[3]-tOrigITS.fP[3]","trackITS.fP[4]-tOrigITS.fP[4]","trackITS.fAlpha-tOrigITS.fAlpha","trackITS.fX/tOrigITS.fX","trackITS.fP[0]/tOrigITS.fP[0]","trackITS.fP[1]/tOrigITS.fP[1]"};
+  TString sTrackParamsITS1[nTrackParamsITS] = {"trackITS1.fP[0]-tOrigITS1.fP[0]","trackITS1.fP[1]-tOrigITS1.fP[1]","trackITS1.fP[2]-tOrigITS1.fP[2]","trackITS1.fP[3]-tOrigITS1.fP[3]","trackITS1.fP[4]-tOrigITS1.fP[4]","trackITS1.fAlpha-tOrigITS1.fAlpha","trackITS1.fX/tOrigITS1.fX","trackITS1.fP[0]/tOrigITS1.fP[0]","trackITS1.fP[1]/tOrigITS1.fP[1]"};
+  TString sTrackParamsITS2[nTrackParamsITS] = {"trackITS2.fP[0]-tOrigITS2.fP[0]","trackITS2.fP[1]-tOrigITS2.fP[1]","trackITS2.fP[2]-tOrigITS2.fP[2]","trackITS2.fP[3]-tOrigITS2.fP[3]","trackITS2.fP[4]-tOrigITS2.fP[4]","trackITS2.fAlpha-tOrigITS2.fAlpha","trackITS2.fX/tOrigITS2.fX","trackITS2.fP[0]/tOrigITS2.fP[0]","trackITS2.fP[1]/tOrigITS2.fP[1]"};
   TString sZ0[nZ0] = {"(fTime0-t0)*vDrift","(fTime0-t0+z0*TMath::Sign(1,tOrig.Eta())/vDrift)*vDrift"};
   TString sEff[nEff] = {"nSeedClustersID/nClustersMC:nSeedClusters/nClustersMC"};
 
@@ -72,12 +77,22 @@ void toyMCRecPlots(TString inFileName = "toyMC.debug.root",Bool_t doPlots = kFAL
   TCanvas *cZ0 = new TCanvas(Form("cZ0_%s",sConfig.Data()),Form("cZ0_%s",sConfig.Data()),1200,500);
   cZ0->Divide(2,1);
 
+  //TCanvas *cTrackParams = new TCanvas(Form("cTrackParams_%s",sConfig.Data()),Form("cTrackParams_%s",sConfig.Data()),1200,900/3.*ydiv);
+  //cTrackParams->Divide(3,ydiv);
   TCanvas *cTrackParams = new TCanvas(Form("cTrackParams_%s",sConfig.Data()),Form("cTrackParams_%s",sConfig.Data()),4800,3600);
   cTrackParams->Divide(3,3);
 
+  //TCanvas *cTrackParamsITS = new TCanvas(Form("cTrackParamsITS_%s",sConfig.Data()),Form("cTrackParamsITS_%s",sConfig.Data()),1200,900/3.*ydiv);
+  //cTrackParamsITS->Divide(3,ydiv);
+  
+  TCanvas *cTrackParamsITS1 = new TCanvas(Form("cTrackParamsITS1_%s",sConfig.Data()),Form("cTrackParamsITS1_%s",sConfig.Data()),1200,900/3.*ydiv);
+  cTrackParamsITS1->Divide(3,ydiv);
   TCanvas *cTrackParamsITS = new TCanvas(Form("cTrackParamsITS_%s",sConfig.Data()),Form("cTrackParamsITS_%s",sConfig.Data()),4800,3600);
   cTrackParamsITS->Divide(3,3);
 
+  TCanvas *cTrackParamsITS2 = new TCanvas(Form("cTrackParamsITS2_%s",sConfig.Data()),Form("cTrackParamsITS2_%s",sConfig.Data()),1200,900/3.*ydiv);
+  cTrackParamsITS2->Divide(3,ydiv);
+  
   TCanvas *cEff = new TCanvas(Form("cEff_%s",sConfig.Data()),Form("cEff_%s",sConfig.Data()),1200,900);
   //cEff->Divide(2,1);
 
@@ -120,22 +135,28 @@ void toyMCRecPlots(TString inFileName = "toyMC.debug.root",Bool_t doPlots = kFAL
   }
 
   // draw track parameters
-  for(Int_t iTrackParams = 0; iTrackParams < nTrackParams; iTrackParams ++){
+  for(Int_t iTrackParams = 0; iTrackParams < nTrackParamsPlot ; iTrackParams ++){
 
     cTrackParams->cd(iTrackParams+1);
     if(inFileName.Contains("allClusters") && iTrackParams==nTrackParams-1) 
       TStatToolkit::DrawHistogram(Tracks,sTrackParams[iTrackParams].Data(),sSel.Data(),Form("hTrackParams_%s_%d",sConfig.Data(),iTrackParams),Form("%s",tTrackParams[iTrackParams].Data()),5);
     else
-      TStatToolkit::DrawHistogram(Tracks,sTrackParams[iTrackParams].Data(),sSel.Data(),Form("hTrackParams_%s_%d",sConfig.Data(),iTrackParams),Form("%s",tTrackParams[iTrackParams].Data()),3);
+      TStatToolkit::DrawHistogram(Tracks,sTrackParams[iTrackParams].Data(),sSel.Data(),Form("hTrackParams_%s_%d",sConfig.Data(),iTrackParams),Form("%s",tTrackParams[iTrackParams].Data()),6);
 
   }
 
 
   // draw track parameters at ITS outer layer
-  for(Int_t iTrackParamsITS = 0; iTrackParamsITS < nTrackParamsITS; iTrackParamsITS ++){
+  for(Int_t iTrackParamsITS = 0; iTrackParamsITS < nTrackParamsPlot; iTrackParamsITS ++){
 
     cTrackParamsITS->cd(iTrackParamsITS+1);
-    TStatToolkit::DrawHistogram(Tracks,sTrackParamsITS[iTrackParamsITS].Data(),sSel.Data(),Form("hTrackParamsITS_%s_%d",sConfig.Data(),iTrackParamsITS),Form("%s",tTrackParamsITS[iTrackParamsITS].Data()),3);
+    TStatToolkit::DrawHistogram(Tracks,sTrackParamsITS[iTrackParamsITS].Data(),sSel.Data(),Form("hTrackParamsITS_%s_%d",sConfig.Data(),iTrackParamsITS),Form("%s",tTrackParamsITS[iTrackParamsITS].Data()),6);
+
+    cTrackParamsITS1->cd(iTrackParamsITS+1);
+    TStatToolkit::DrawHistogram(Tracks,sTrackParamsITS1[iTrackParamsITS].Data(),sSel.Data(),Form("hTrackParamsITS1_%s_%d",sConfig.Data(),iTrackParamsITS),Form("%s",tTrackParamsITS[iTrackParamsITS].Data()),6);
+
+    cTrackParamsITS2->cd(iTrackParamsITS+1);
+    TStatToolkit::DrawHistogram(Tracks,sTrackParamsITS2[iTrackParamsITS].Data(),sSel.Data(),Form("hTrackParamsITS2_%s_%d",sConfig.Data(),iTrackParamsITS),Form("%s",tTrackParamsITS[iTrackParamsITS].Data()),6);
     
   }
 
@@ -155,19 +176,21 @@ void toyMCRecPlots(TString inFileName = "toyMC.debug.root",Bool_t doPlots = kFAL
   if(doPlots){
     TString outFileName = gSystem->BaseName(inFileName.Data());
     outFileName.ReplaceAll(".root","");
-    cT0->SaveAs(Form("%s_T0.eps",outFileName.Data()));
-    cZ0->SaveAs(Form("%s_Z0.eps",outFileName.Data()));
-    cT02D->SaveAs(Form("%s_T02D.eps",outFileName.Data()));
-    cTrackParams->SaveAs(Form("%s_TrackParams.eps",outFileName.Data()));
-    cTrackParamsITS->SaveAs(Form("%s_TrackParamsITS.eps",outFileName.Data()));
-    if(inFileName.Contains("allClusters"))
-      cEff->SaveAs(Form("%s_Eff.eps",outFileName.Data()));
+//     cT0->SaveAs(Form("%s_T0.eps",outFileName.Data()));
+//     cZ0->SaveAs(Form("%s_Z0.eps",outFileName.Data()));
+//     cT02D->SaveAs(Form("%s_T02D.eps",outFileName.Data()));
+//     cTrackParams->SaveAs(Form("%s_TrackParams.eps",outFileName.Data()));
+//     cTrackParamsITS->SaveAs(Form("%s_TrackParamsITS.eps",outFileName.Data()));
+//     if(inFileName.Contains("allClusters"))
+//       cEff->SaveAs(Form("%s_Eff.eps",outFileName.Data()));
 
     cT0->SaveAs(Form("%s_T0.png",outFileName.Data()));
     cZ0->SaveAs(Form("%s_Z0.png",outFileName.Data()));
     cT02D->SaveAs(Form("%s_T02D.png",outFileName.Data()));
     cTrackParams->SaveAs(Form("%s_TrackParams.png",outFileName.Data()));
     cTrackParamsITS->SaveAs(Form("%s_TrackParamsITS.png",outFileName.Data()));
+    cTrackParamsITS1->SaveAs(Form("%s_TrackParamsITS1.png",outFileName.Data()));
+    cTrackParamsITS2->SaveAs(Form("%s_TrackParamsITS2.png",outFileName.Data()));
     if(inFileName.Contains("allClusters"))
       cEff->SaveAs(Form("%s_Eff.eps",outFileName.Data()));