]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/scripts/OCDBscan/guiAlias.C
composition of the Alluminum alloy that constitutes the ITS-TPC support rings updated...
[u/mrichter/AliRoot.git] / TPC / scripts / OCDBscan / guiAlias.C
1 /*
2   //Make default Aliases for guiTime:
3   // 1. Run the guiTime
4   //  guiTime
5   // 2. Define aliases
6   .L $ALICE_ROOT/TPC/CalibMacros/guiAlias.C
7   guiAlias();
8   // 3. Use aliases inside the guiTime
9   //    You can use them as custom cuts
10   //
11   // browse special streamers
12   gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
13   gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
14   AliXRDPROOFtoolkit tool;
15   TChain * chainDCS = tool.MakeChainRandom("time.txt","dcs",0,10000);
16   TChain * chainCTP = tool.MakeChainRandom("time.txt","ctp",0,10000);
17   TChain * chainAlign = tool.MakeChainRandom("time.txt","align",0,10000);
18
19 */
20
21 TObjArray *picArray = new TObjArray;  
22
23 TTree * guiTree =  guiTime->GetChain();
24 void SetStyle();
25 void guiAlias(){
26   guiTree =  guiTime->GetChain();
27   MakeAliasCE(4);
28   MakeAliasLT(4);
29   MakeAliasCosmic(4);   
30   SetGoofieAlias();
31   SetStyle();
32 }
33
34 void SetStyle(){ 
35   Float_t mx0=0.15, mx1=0.05, my0=0.15, my1=0.1;
36   guiTime->GetCanvas()->SetTicks(1,1);
37   guiTime->GetCanvas()->SetMargin(mx0,mx1,my0,my1);
38   gStyle->SetTitleYSize(0.03);
39   gStyle->SetTitleXSize(0.03);
40   gStyle->SetTitleXOffset(2);
41   gStyle->SetTitleYOffset(6);
42 }
43
44 void MakeAliasCE(Double_t deltaT){
45   //
46   // Aliases cuts for CE
47   //
48   guiTree->SetAlias("ceCut0", "tdriftCE.fElements[72]>100 && tdriftCE.fElements[73]>100");
49   guiTree->SetAlias("dceCutTime", Form("sqrt(dcea^2+dcec^2)<%f",deltaT*3600));
50   guiTree->SetAlias("ceCut","dceCutTime&&ceCut0");
51 };
52
53 void MakeAliasLT(Double_t deltaT){
54   guiTree->SetAlias("ltCut", Form("sqrt(dla^2+dlc^2)<%f", deltaT*3600)); 
55 }
56
57 void MakeAliasCosmic(Double_t deltaT){
58   guiTree->SetAlias("cosmicCut", Form("abs(dcosmic)<%f", deltaT*3600));
59   guiTree->SetAlias("itsCut", Form("((dits!=0)&&abs(dits)<%f)", deltaT*3600));
60 }
61
62
63 void SetGoofieAlias(){
64   //
65   // goofie aliases
66   //
67   guiTree->SetAlias("ptrelG","(goofie.fElements[17]/0.3426-1)");
68   guiTree->SetAlias("vdriftGN","goofie.fElements[3]/(1+ptrelG)");
69   guiTree->SetAlias("goCut","goofie.fElements[3]>0");
70   //
71 }
72 //
73 // Make default plots
74 //
75
76
77 void DrawLaserDrift(){
78   //
79   // laser calibration default picture
80   // Data are filtered 
81
82   //
83   // draw laser residuals A side -C side - when it is defined
84   //
85   TH1 * his=0;
86   guiTree->Draw("CEgrDriftA-CEgrDriftC","CEgrDriftA>0&&CEgrDriftC>0");
87   his=(TH1*)htemp->Clone();
88   his->SetDirectory(0);
89   his->SetTitle("#Delta CE time");
90   his->SetName("#Delta CE time");
91   his->GetXaxis()->SetTitle("#Delta T (time bin)");
92   his->Draw();
93   picArray->AddLast(his);
94   //
95   // laser drift CE correction
96   //
97   guiTree->Draw("100*(vdriftCEA-vdriftCEC)","CEgrDriftA>0&&CEgrDriftC>0");
98   his=(TH1*)htemp->Clone();
99   his->SetDirectory(0);
100   his->SetTitle("#Delta CE drift");
101   his->SetName("#Delta CE drift");
102   his->GetXaxis()->SetTitle("#Delta v_{drift} (%) (laser A side - C side)");
103   his->Draw();
104   picArray->AddLast(his);
105   //
106   // laser track drift correction
107   //
108   guiTree->Draw("100*(vdriftLTA-vdriftLTC)","abs(dlaserA)<500&&abs(dlaserC)<500&&vdriftLTA!=0&&vdriftLTC!=0");
109   his=(TH1*)htemp->Clone();
110   his->SetDirectory(0);
111   his->SetTitle("#Delta LaserTracks drift");
112   his->SetName("#Delta LaserTracks drift");
113   his->GetXaxis()->SetTitle("#Delta v_{drift} (%) (laser A side - C side)");
114   his->Draw();
115   picArray->AddLast(his);
116   //
117   // laser track drift correction: time
118   //
119   guiTree->Draw("100*(vdriftLTA-vdriftLTC):time","abs(dlaserA)<500&&abs(dlaserC)<500&&vdriftLTA!=0&&vdriftLTC!=0","colz");
120   his=(TH1*)htemp->Clone();  
121   his->SetDirectory(0);
122   his->Draw();
123   his->SetTitle("#Delta LaserTracks drift");
124   his->SetName("#Delta LaserTracks drift");
125   his->GetYaxis()->SetTitle("#Delta v_{drift} (%) (laser A side - C side)");
126   his->GetXaxis()->SetTitle("time");
127   his->GetXaxis()->SetTimeDisplay(kTRUE);
128   his->Draw();
129   picArray->AddLast(his);
130   //
131   //
132   //
133   guiTree->Draw("250*(vlaserA0-vlaserC0)","abs(dlaserA)<500&&abs(dlaserC)<500&&vdriftLTA!=0&&vdriftLTC!=0");
134   his=(TH1*)htemp->Clone();
135   his->SetDirectory(0);
136   his->SetTitle("#Delta LaserTracks offset");
137   his->SetName("#Delta LaserTracks offset");
138   his->GetXaxis()->SetTitle("#Delta z0 (cm) (laser A side - C side)");
139   his->Draw();
140   picArray->AddLast(his);
141 }
142
143
144 void DrawITSVD(){
145   //
146   // ITS/TPC drift velocity correction
147   //
148   guiTree->Draw("100*(ALIGN_ITSP_TPC_DRIFTVD-ALIGN_ITSM_TPC_DRIFTVD)","abs(dits)<3000&&ALIGN_ITSM_TPC_DRIFTVD!=0");
149   his=(TH1*)htemp->Clone();
150   his->SetDirectory(0);
151   his->SetTitle("#Delta ITS/TPC drift correction positive and negative extrapolation");
152   his->SetName("#Delta ITS/TPC drift correction");
153   his->GetXaxis()->SetTitle("#Delta v_{dcorr} (%)");
154   his->Draw();
155   picArray->AddLast(his);
156   //
157   // comparison with laser
158   //
159   guiTree->Draw("100*(vdriftLTA-vdriftITS)","abs(dlaserA)<3600&&vdriftLTA!=0&&abs(dits)<3600");
160   his=(TH1*)htemp->Clone();
161   his->SetDirectory(0);
162   his->SetTitle("#Delta ITS/TPC drift correction - Laser track corr");
163   his->SetName("#Delta ITS/TPC drift correction - laser track corr");
164   his->GetXaxis()->SetTitle("#Delta v_{dcorr} (%)");
165   his->Draw();
166   picArray->AddLast(his);
167   //
168   guiTree->Draw("100*(vdriftLTA-ALIGN_ITS_TPC_DRIFTVD)","abs(dlaserA)<3600&&vdriftLTA!=0&&abs(dits)<3600");
169   his=(TH1*)htemp->Clone();
170   his->SetDirectory(0);
171   his->SetTitle("#Delta ITS/TPC non smmoth drift correction - Laser track corr");
172   his->SetName("#Delta ITS/TPC non smooth drift correction - laser track corr");
173   his->GetXaxis()->SetTitle("#Delta v_{dcorr} (%)");
174   his->Draw();
175   picArray->AddLast(his);
176   //
177   guiTree->Draw("100*(vdriftLTA-vdriftP)","abs(dlaserA)<1800&&vdriftLTA!=0&&abs(dp)<1800");
178   his=(TH1*)htemp->Clone();
179   his->SetDirectory(0);
180   his->SetTitle("#Delta TPC/TPC - Laser track corr");
181   his->SetName("#Delta TPC/TPC  - Laser track corr");
182   his->GetXaxis()->SetTitle("#Delta v_{dcorr} (%)");
183   his->Draw();
184   picArray->AddLast(his);
185   
186 }
187
188
189 void CEdrift(){
190   //
191   //
192   //
193   guiTree->SetAlias("vdriftCE0","250/CEgrDriftA");
194   guiTree->SetAlias("vdriftCE1","vdriftCE0/(1+ptrel0)");
195 }