1 void SCdistortionsForPerformanceNoteAll(){
3 SCdistortionsForPerformanceNote(1,1);
4 SCdistortionsForPerformanceNote(2,1);
5 SCdistortionsForPerformanceNote(1.5,1);
9 void SCdistortionsForPerformanceNote(Double_t radiusScale=1.5, Int_t epsScale=1,Int_t iOmegaTau = 0){
11 // do for one file (given by directory) the correction (specify the gas = iOmegaTau)
12 // use the integrate along drift line option
14 // 1. Initialzation form space charge maps
16 AliTPCSpaceCharge3D *spaceCharge = new AliTPCSpaceCharge3D;
17 const Double_t fgke0 = 8.854187817e-12; // vacuum permittivity [A·s/(V·m)]
19 // omega tau parameters and TF1
21 Int_t eps[nEps] = {20,10};
22 Int_t col[nEps] = {kBlack,kRed};
23 Int_t sty[nEps] = {1,2};
25 const Int_t nOmegaTau = 1;
26 Double_t omegaTau[nOmegaTau] = {0.32};
27 TString tGas[nOmegaTau] = {"NeCO2_2"};
28 TString sGas[nOmegaTau] = {"Ne-CO_{2}-N_{2} (90-10-5)"};
30 TF1 * fdiffPhiR[nEps];
32 TH1F * hdiffPhiR[nEps];
35 //use always the integrate option here
36 Double_t integrateStep = 1.;
40 TCanvas *cOmegaTau = new TCanvas("cOmegaTau","cOmegaTau",1200,500);
41 cOmegaTau->Divide(2,1);
43 TString outfilename = Form("SCdistortions_SC_NeCO2_50kHz_radiusScaling%.0f_epsScaling%d",radiusScale,epsScale);
44 if(radiusScale>1.1 && radiusScale < 1.9) outfilename = Form("SCdistortions_SC_NeCO2_50kHz_radiusScaling%.1f_epsScaling%d",radiusScale,epsScale);
46 TLegend *legend = new TLegend(0.35,0.6,0.8,0.85,Form("%s: 50 kHz",sGas[iOmegaTau].Data(),"brNDC"));
47 setupLegend(legend,0.05);
50 for(Int_t iEps = 0; iEps < nEps; ++iEps){
52 cMap[iEps] = new TCanvas(Form("cMap%d",iEps),Form("cMap%d",iEps),600,500);
53 cMap[iEps]->SetPhi(150);
58 if(radiusScale>1.1 && radiusScale < 1.9){
59 cout<<"Open file = "<<Form("/Users/physics/ALICE/TPCupgrade/SpaceCharge/Maps/SC_%s_eps%d_50kHz_radiusScaling%.1f_epsScaling%d/SpaceChargeMap.root",tGas[iOmegaTau].Data(),eps[iEps],radiusScale,epsScale)<<endl;
60 spaceCharge->SetSCDataFileName(Form("/Users/physics/ALICE/TPCupgrade/SpaceCharge/Maps/SC_%s_eps%d_50kHz_radiusScaling%.1f_epsScaling%d/SpaceChargeMap.root",tGas[iOmegaTau].Data(),eps[iEps],radiusScale,epsScale));
63 cout<<"Open file = "<<Form("/Users/physics/ALICE/TPCupgrade/SpaceCharge/Maps/SC_%s_eps%d_50kHz_radiusScaling%.0f_epsScaling%d/SpaceChargeMap.root",tGas[iOmegaTau].Data(),eps[iEps],radiusScale,epsScale)<<endl;
64 spaceCharge->SetSCDataFileName(Form("/Users/physics/ALICE/TPCupgrade/SpaceCharge/Maps/SC_%s_eps%d_50kHz_radiusScaling%.0f_epsScaling%d/SpaceChargeMap.root",tGas[iOmegaTau].Data(),eps[iEps],radiusScale,epsScale));
67 // select omegaTau value
69 spaceCharge->SetOmegaTauT1T2(omegaTau[iOmegaTau],1,0.99); // Ne CO2 N2
74 // init and add to corrections
75 spaceCharge->InitSpaceCharge3DDistortion();
76 spaceCharge->AddVisualCorrection(spaceCharge,1);
80 hMap[iEps] = (TH2F*)spaceCharge->CreateHistoSCinZR(0.);
81 hMap[iEps]->Scale(fgke0/1e6*1e15); // C/m^3/e0 --> fC/cm^3
82 hMap[iEps]->GetXaxis()->SetTitle("z (cm)");
83 hMap[iEps]->GetYaxis()->SetTitle("r (cm)");
84 hMap[iEps]->GetZaxis()->SetTitle("#rho_{SC} (fC/cm^{3})");
85 hMap[iEps]->SetTitleSize(0.05,"XYZ");
86 hMap[iEps]->SetTitleOffset(1.5,"XY");
87 hMap[iEps]->SetTitleOffset(0.9,"Z");
88 hMap[iEps]->SetTitle(Form("%s: 50 kHz, #varepsilon = %d",sGas[iOmegaTau].Data(),eps[iEps]));
89 hMap[iEps]->DrawCopy("surf2fb");
93 // 2. get TF1 with differences
95 // get corrections (at y = 0 and z = 10) for visual correction 1 (last argument)
99 fdiffR[iEps] = new TF1(Form("fdiffR%d",iEps), Form("AliTPCCorrection::GetDistXYZIntegrateZ(x,0,10,0,1,%f)",integrateStep),85,245);
100 fdiffPhiR[iEps] = new TF1(Form("fdiffPhiR%d",iEps), Form("AliTPCCorrection::GetDistXYZIntegrateZ(x,0,10,1,1,%f)",integrateStep),85,245);
102 hdiffR[iEps] = (TH1F*)fdiffR[iEps]->GetHistogram();
103 hdiffPhiR[iEps] = (TH1F*)fdiffPhiR[iEps]->GetHistogram();
106 hdiffR[iEps]->SetName(fdiffR[iEps]->GetName());
107 hdiffPhiR[iEps]->SetName(fdiffPhiR[iEps]->GetName());
112 // 3. Plot and store TH1Fs
115 hdiffR[iEps]->GetXaxis()->SetTitle("r (cm)");
116 hdiffPhiR[iEps]->GetXaxis()->SetTitle("r (cm)");
118 hdiffR[iEps]->GetYaxis()->SetTitle("dr (cm)");
119 hdiffPhiR[iEps]->GetYaxis()->SetTitle("d(r#varphi) (cm)");
121 hdiffR[iEps]->SetTitle("dr (cm)");
122 hdiffPhiR[iEps]->SetTitle("d(r#varphi) (cm)");
124 hdiffR[iEps]->SetMarkerColor(col[iEps]);
125 hdiffPhiR[iEps]->SetMarkerColor(col[iEps]);
127 hdiffR[iEps]->SetLineColor(col[iEps]);
128 hdiffPhiR[iEps]->SetLineColor(col[iEps]);
130 hdiffR[iEps]->SetLineStyle(sty[iEps]);
131 hdiffPhiR[iEps]->SetLineStyle(sty[iEps]);
133 hdiffR[iEps]->SetFillColor(col[iEps]);
134 hdiffPhiR[iEps]->SetFillColor(col[iEps]);
136 hdiffR[iEps]->SetTitleSize(0.05,"XYZ");
137 hdiffPhiR[iEps]->SetTitleSize(0.05,"XYZ");
139 legend->AddEntry(hdiffR[iEps],Form("#varepsilon = %d",eps[iEps]),"lp");
143 hdiffR[iEps]->DrawCopy("lf");
145 hdiffR[iEps]->DrawCopy("lf,same");
151 hdiffPhiR[iEps]->DrawCopy("fl");
153 hdiffPhiR[iEps]->DrawCopy("fl,same");
157 for(Int_t iEps = 0; iEps < nEps; iEps++){
158 cMap[iEps]->SaveAs(Form("%s_epsilon%d_SC_performanceNote.eps",outfilename.Data(),eps[iEps]));
159 cMap[iEps]->SaveAs(Form("%s_epsilon%d_SC_performanceNote.pdf",outfilename.Data(),eps[iEps]));
161 cOmegaTau->SaveAs(Form("%s_Distortions_performanceNote.eps",outfilename.Data()));
162 cOmegaTau->SaveAs(Form("%s_Distortions_performanceNote.pdf",outfilename.Data()));
166 //____________________________________________________________//
167 void setupLegend(TLegend *currentLegend=0,float currentTextSize=0.07){
168 currentLegend->SetTextFont(42);
169 currentLegend->SetBorderSize(0);
170 currentLegend->SetFillStyle(0);
171 currentLegend->SetFillColor(0);
172 currentLegend->SetMargin(0.25);
173 currentLegend->SetTextSize(currentTextSize);
174 currentLegend->SetEntrySeparation(0.5);