3 void epsilonScanFineBinningForPerformanceNote(Int_t radiusScale=1, Int_t epsScale=1,Int_t iOmegaTau = 0, Double_t x = 85., Double_t y = 0., Double_t z = 10.,Double_t integrateStep = 0.,Bool_t bLowE = kFALSE){
5 // do for one gas (with omegaTau values accordingly) the correction
6 // use the integrate along drift line option if integrateStep > 0
9 // 1. Initialzation form space charge maps
11 AliTPCSpaceCharge3D *spaceCharge = new AliTPCSpaceCharge3D;
13 // omega tau parameters and TF1
14 const Int_t nOmegaTau = 1;
15 Double_t omegaTau[nOmegaTau] = {0.32};
16 TString tGas[nOmegaTau] = {"NeCO2_2"};
17 TString tGasOut[nOmegaTau] = {"NeCO2_2"};
18 TString sGas[nOmegaTau] = {"Ne-CO_{2}-N_{2} (90-10-5)"};
20 //if(bLowE) sLowE = "_lowE";
21 if(bLowE) sLowE = "_lowE2"; //second iteration
23 const Int_t nEps = 51;
24 Double_t epsilon[nEps];
25 for(Int_t iEps = 0; iEps < nEps; iEps++){
26 epsilon[iEps] = (Double_t)iEps;
28 TH1F *hR = new TH1F("hR",Form("distortion at x = %.0f, y = %.0f, z = %.0f",x,y,z),nEps,epsilon[0],epsilon[nEps-1]+1);
29 TH1F *hPhiR = new TH1F("hPhiR",Form("distortion at x = %.0f, y = %.0f, z = %.0f",x,y,z),nEps,epsilon[0],epsilon[nEps-1]+1);
31 //use always the integrate option here
34 for(Int_t iEps = 0; iEps < nEps; iEps++){
38 cout<<"Open file = "<<Form("/Users/physics/ALICE/TPCupgrade/SpaceCharge/Maps/SC_%s_eps%.0f_50kHz_radiusScaling%d_epsScaling%d/SpaceChargeMap.root",tGas[iOmegaTau].Data(),epsilon[iEps],radiusScale,epsScale)<<endl;
39 spaceCharge->SetSCDataFileName(Form("/Users/physics/ALICE/TPCupgrade/SpaceCharge/Maps/SC_%s_eps%.0f_50kHz_radiusScaling%d_epsScaling%d/SpaceChargeMap.root",tGas[iOmegaTau].Data(),epsilon[iEps],radiusScale,epsScale));
41 // select omegaTau value
43 spaceCharge->SetOmegaTauT1T2(omegaTau[iOmegaTau],1,0.99); // Ne CO2 N2
47 // init and add to corrections
48 spaceCharge->InitSpaceCharge3DDistortion();
49 spaceCharge->AddVisualCorrection(spaceCharge,1);
52 // 2. get TH1F with differences
54 // get corrections (at x, y and z) for visual correction 1 (last argument)
58 if(integrateStep < 0.0001){// == 0. --> old method
59 hR->Fill(epsilon[iEps],AliTPCCorrection::GetDistXYZ(x,y,z,0,1));
60 hPhiR->Fill(epsilon[iEps],AliTPCCorrection::GetDistXYZ(x,y,z,1,1));
62 else{// > 0. --> following driftlines
63 hR->Fill(epsilon[iEps],AliTPCCorrection::GetDistXYZIntegrateZ(x,y,z,0,1,integrateStep));
64 hPhiR->Fill(epsilon[iEps],AliTPCCorrection::GetDistXYZIntegrateZ(x,y,z,1,1,integrateStep));
70 // 3. Plot and store TH1Fs
73 TCanvas *cEpsilon = new TCanvas("cEpsilon","cEpsilon",1200,500);
74 cEpsilon->Divide(2,1);
76 TLegend *legend = new TLegend(0.6,0.3,0.85,0.75,"","brNDC");
77 setupLegend(legend,0.04);
79 TString outfilename = Form("epsilonScanFineBinning_performanceNote_radiusScaling%d_epsScaling%d_%s%s_x%0.f_y%.0f_z%.0f_int%.0f.root",radiusScale,epsScale,tGasOut[iOmegaTau].Data(),sLowE.Data(),x,y,z,integrateStep);
80 TFile *fOut = TFile::Open(Form("%s",outfilename.Data()),"recreate");
89 cEpsilon->SaveAs(Form("epsilonScanFineBinning_performanceNote_radiusScaling%d_epsScaling%d_%s%s_x%0.f_y%.0f_z%.0f_int%.0f.eps",radiusScale,epsScale,tGasOut[iOmegaTau].Data(),sLowE.Data(),x,y,z,integrateStep));
96 void epsilonScanFineBinningPlotOnly(Int_t radiusScale=1, Int_t epsScale=1,Int_t iOmegaTau = 0, Double_t x = 85., Double_t y = 0., Double_t z = 10.){
98 // do for one gas (with omegaTau values accordingly) the correction
99 // use the integrate along drift line option
101 gStyle->SetOptStat(0);
104 // 1. Plot and store TH1Fs
107 // omega tau parameters and TF1
108 const Int_t nOmegaTau = 1;
109 Double_t omegaTau[nOmegaTau] = {0.32};
110 TString tGas[nOmegaTau] = {"NeCO2_2"};
111 TString sGas[nOmegaTau] = {"Ne/CO_{2}/N_{2} (90-10-5)"};
114 TCanvas *cEpsilon = new TCanvas("cEpsilon","cEpsilon",1200,500);
115 cEpsilon->Divide(2,1);
117 TLegend *legend = new TLegend(0.15,0.6,0.6,0.85,Form("%s: 50 kHz",sGas[iOmegaTau].Data(),"brNDC"));
118 setupLegend(legend,0.05);
120 TString infilename0 = Form("epsilonScanFineBinning_performanceNote_radiusScaling%d_epsScaling%d_%s_x%0.f_y%.0f_z%.0f_int0.root",radiusScale,epsScale,tGas[iOmegaTau].Data(),x,y,z);
121 TString infilename1 = Form("epsilonScanFineBinning_performanceNote_radiusScaling%d_epsScaling%d_%s_x%0.f_y%.0f_z%.0f_int1.root",radiusScale,epsScale,tGas[iOmegaTau].Data(),x,y,z);
122 TFile *fIn0 = TFile::Open(Form("%s",infilename0.Data()),"read");
123 TFile *fIn1 = TFile::Open(Form("%s",infilename1.Data()),"read");
125 TH1F *hR0 = (TH1F*)fIn0->Get("hR");
126 TH1F *hPhiR0 = (TH1F*)fIn0->Get("hPhiR");
128 TH1F *hR1 = (TH1F*)fIn1->Get("hR");
129 TH1F *hPhiR1 = (TH1F*)fIn1->Get("hPhiR");
131 hR0->SetTitle(Form("x = %.0f, y = %.0f, z = %.0f",x,y,z));
132 hPhiR0->SetTitle(Form("x = %.0f, y = %.0f, z = %.0f",x,y,z));
134 hR1->SetTitle(Form("x = %.0f, y = %.0f, z = %.0f",x,y,z));
135 hPhiR1->SetTitle(Form("x = %.0f, y = %.0f, z = %.0f",x,y,z));
138 hR0->GetXaxis()->SetTitle("#varepsilon");
139 hR0->GetYaxis()->SetTitle("dr (cm)");
140 hR0->SetLineWidth(2);
142 hR1->SetLineWidth(2);
143 hR1->SetLineColor(2);
144 hR1->DrawCopy("lp,same");
146 legend->AddEntry(hR0,"linear","l");
147 legend->AddEntry(hR1,"integrated in z","l");
152 hPhiR0->GetXaxis()->SetTitle("#varepsilon");
153 hPhiR0->GetYaxis()->SetTitle("d(r#varphi) (cm)");
154 hPhiR0->SetLineWidth(2);
155 hPhiR0->DrawCopy("lp");
156 hPhiR1->SetLineWidth(2);
157 hPhiR1->SetLineColor(2);
158 hPhiR1->DrawCopy("lp,same");
161 cEpsilon->SaveAs(Form("epsilonScanFineBinning_performanceNote_radiusScaling%d_epsScaling%d_%s_x%0.f_y%.0f_z%.0f.eps",radiusScale,epsScale,tGas[iOmegaTau].Data(),x,y,z));
162 cEpsilon->SaveAs(Form("epsilonScanFineBinning_performanceNote_radiusScaling%d_epsScaling%d_%s_x%0.f_y%.0f_z%.0f.pdf",radiusScale,epsScale,tGas[iOmegaTau].Data(),x,y,z));
163 cEpsilon->SaveAs(Form("epsilonScanFineBinning_performanceNote_radiusScaling%d_epsScaling%d_%s_x%0.f_y%.0f_z%.0f.png",radiusScale,epsScale,tGas[iOmegaTau].Data(),x,y,z));
173 //____________________________________________________________//
174 void setupLegend(TLegend *currentLegend=0,float currentTextSize=0.07){
175 currentLegend->SetTextFont(42);
176 currentLegend->SetBorderSize(0);
177 currentLegend->SetFillStyle(0);
178 currentLegend->SetFillColor(0);
179 currentLegend->SetMargin(0.25);
180 currentLegend->SetTextSize(currentTextSize);
181 currentLegend->SetEntrySeparation(0.5);