1 /***********************************************************************************************
2 *** provided by Gamma Conversion Group, PWG4, ******
3 *** Friederike Bock, fbock@physi.uni-heidelberg.de *** ******
4 ************************************************************************************************/
6 /************************************************************************************************
7 /************************************************************************************************
8 This header contains the functions to plot additional things, like logos and Lines
10 /************************************************************************************************
11 /************************************************************************************************
16 - DrawAliceLogoPerformance
17 - DrawAliceLogoPerformance2D
27 #include <Riostream.h>
29 /*********************************************************************************************************
30 DrawAliceLogoPi0Performace
31 * will draw you the ALICE Logo as well the text "ALICE Performance", "pp @ 7 TeV" and the date
32 which you can hand over
33 Float_t start_text_x, Float_t start_text_y, Float_t start_pi0_text_x, Float_t difference_text,
34 Float_t start_logo_x, Float_t start_logo_y, Float_t width_logo,
36 Bool_t LowEnergy, Bool_t MCfile
37 * float_t start_x, float_t start_y - give starting Point of Logo
38 * float_t width_logo - gives the width of the logo
39 * float_t text_height - gives you the heigth of the text
40 * char * date - date handed over
41 **********************************************************************************************************
42 **********************************************************************************************************/
44 void DrawAliceLogoPi0Performance(Float_t start_text_x, Float_t start_text_y, Float_t start_pi0_text_x, Float_t difference_text,
45 Float_t start_logo_x, Float_t start_logo_y, Float_t width_logo,
47 Bool_t LowEnergy, Bool_t MCfile , Bool_t RawData){
49 string alice_text = "ALICE Performance";
50 if(RawData) alice_text = "RAW DATA";
52 TLatex *alice = new TLatex(start_text_x,(start_text_y+(2*difference_text)),Form("%s",alice_text.c_str())); // Bo: this was modified
53 TLatex *energy = new TLatex(start_text_x,(start_text_y+difference_text),"pp @ 7TeV"); // Bo: this was modified
54 TLatex *process = new TLatex(start_pi0_text_x, (start_text_y + (4* difference_text)), "#pi^{0} #rightarrow #gamma #gamma #rightarrow e^{+}e^{-} e^{+}e^{-}");
55 TLatex *events = new TLatex(start_text_x,start_text_y,"1.233 x 10^{8} MinBias events"); // Bo: this was modified
56 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",start_logo_x,start_logo_y,(start_logo_x + width_logo),(start_logo_y + (width_logo*0.975)));
60 TLatex *alice = new TLatex(start_text_x,0.8,Form("%s",alice_text.c_str())); // Bo: this was modified
61 TLatex *energy = new TLatex(start_text_x,0.75,"pp @ 7TeV"); // Bo: this was modified
62 TLatex *process = new TLatex(0.35, 0.9, "#pi^{0} #rightarrow #gamma #gamma #rightarrow e^{+}e^{-} e^{+}e^{-}");
63 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",start_logo_x,start_logo_y,(start_logo_x + width_logo),(start_logo_y + (width_logo*0.975)));
67 TLatex *alice = new TLatex(start_text_x,0.8,Form("%s",alice_text.c_str())); // Bo: this was modified
68 TLatex *energy = new TLatex(start_text_x,0.75,"pp @ 7TeV"); // Bo: this was modified
69 TLatex *process = new TLatex(0.35, 0.9, "#pi^{0} #rightarrow #gamma #gamma #rightarrow e^{+}e^{-} e^{+}e^{-}");
70 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",start_logo_x,start_logo_y,(start_logo_x + width_logo),(start_logo_y + (width_logo*0.975)));
75 alice->SetTextColor(2);
76 alice->SetTextSize(text_size);
80 energy->SetTextColor(2);
81 energy->SetTextSize(text_size);
84 process->SetNDC(kTRUE); // <- use NDC coordinate
85 process->SetTextSize(text_size);
89 events->SetTextColor(2);
90 events->SetTextSize(text_size);
93 //myPadLogo->SetFillStyle(2000); // color to first figure out where is the pad then comment !
94 myPadLogo->SetBorderMode(0);
95 myPadLogo->SetBorderSize(2);
96 myPadLogo->SetFrameBorderMode(0);
97 myPadLogo->SetLeftMargin(0.0);
98 myPadLogo->SetTopMargin(0.0);
99 myPadLogo->SetBottomMargin(0.0);
100 myPadLogo->SetRightMargin(0.0);
101 TASImage *myAliceLogo = new TASImage("/home/fredi/Dokumente/CERN/ALICE/Photon/ALICE_logo.eps");
102 myPadLogo->Draw(); // to take out for not using a logo.
108 /*************************************************************************************************
109 DrawAliceLogo draws you the Alice logo + "work in progress" and " ALICE Performance"
110 be careful you have to set the path of the alice-logo for your system
111 * float_t start_x, float_t start_y - give starting Point of Logo
112 * float_t width_logo - gives the width of the logo
113 * float_t text_height - gives you the heigth of the text
114 **************************************************************************************************
115 **************************************************************************************************/
117 void DrawAliceLogo(Float_t start_x, Float_t start_y, Float_t width_logo, Float_t text_height){
119 Float_t alice_start_y = start_y - text_height * 1.1;
120 TLatex *alice = new TLatex(start_x-0.0225,alice_start_y,"ALICE Performance"); // Bo: this was modified
122 alice->SetTextColor(2);
123 alice->SetTextFont(42);
124 alice->SetTextSize(text_height);
125 alice->SetLineWidth(2);
128 Float_t wip_start_y = start_y - text_height *(1 + 1.1);
129 TLatex *wip = new TLatex((start_x-0.011),wip_start_y,"work in progress"); // Bo: this was modified
131 wip->SetTextColor(2);
132 wip->SetTextFont(51);
133 wip->SetTextSize(text_height);
134 wip->SetLineWidth(2);
136 Float_t end_x = start_x + width_logo;
137 Float_t end_y = start_y + width_logo;
139 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",start_x,start_y,end_x,end_y);
140 // myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
141 myPadLogo->SetBorderMode(0);
142 myPadLogo->SetBorderSize(2);
143 myPadLogo->SetFrameBorderMode(0);
144 myPadLogo->SetLeftMargin(0.0);
145 myPadLogo->SetTopMargin(0.0);
146 myPadLogo->SetBottomMargin(0.0);
147 myPadLogo->SetRightMargin(0.0);
148 TASImage *myAliceLogo = new TASImage("/home/fredi/Dokumente/CERN/ALICE/Photon/ALICE_logo.eps");
149 myPadLogo->Draw(); // to take out for not using a logo.
151 myAliceLogo->Draw("same");
155 /*************************************************************************************************
156 DrawAliceLogo1D draws you the Alice logo + "work in progress" and " ALICE Performance"
157 be careful you have to set the path of the alice-logo for your system
158 * float_t start_x, float_t start_y - give starting Point of Logo
159 * float_t width_logo - gives the width of the logo
160 * float_t text_height - gives you the heigth of the text
161 **************************************************************************************************
162 **************************************************************************************************/
164 void DrawAliceLogo1D(Float_t start_x, Float_t start_y, Float_t width_logo, Float_t text_height){
166 Float_t alice_start_y = start_y - text_height * 1.1;
167 TLatex *alice = new TLatex(start_x+0.008,alice_start_y,"ALICE Performance"); // Bo: this was modified
169 alice->SetTextColor(2);
170 alice->SetTextFont(42);
171 alice->SetTextSize(text_height);
172 alice->SetLineWidth(2);
175 Float_t wip_start_y = start_y - text_height *(1 + 1.1);
176 TLatex *wip = new TLatex((start_x+0.022),wip_start_y,"work in progress"); // Bo: this was modified
178 wip->SetTextColor(2);
179 wip->SetTextFont(51);
180 wip->SetTextSize(text_height);
181 wip->SetLineWidth(2);
183 Float_t end_x = start_x + width_logo;
184 Float_t end_y = start_y + width_logo;
186 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",start_x,start_y,end_x,end_y);
187 // myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
188 myPadLogo->SetBorderMode(0);
189 myPadLogo->SetBorderSize(2);
190 myPadLogo->SetFrameBorderMode(0);
191 myPadLogo->SetLeftMargin(0.0);
192 myPadLogo->SetTopMargin(0.0);
193 myPadLogo->SetBottomMargin(0.0);
194 myPadLogo->SetRightMargin(0.0);
195 TASImage *myAliceLogo = new TASImage("/home/fredi/Dokumente/CERN/ALICE/Photon/ALICE_logo.eps");
196 myPadLogo->Draw(); // to take out for not using a logo.
198 myAliceLogo->Draw("same");
202 /*********************************************************************************************************
203 DrawAliceLogoPerformace
204 * will draw you the ALICE Logo as well the text "ALICE Performance", "pp @ 7 TeV" and the date
205 which you can hand over
206 * float_t start_x, float_t start_y - give starting Point of Logo
207 * float_t width_logo - gives the width of the logo
208 * float_t text_height - gives you the heigth of the text
209 * char * date - date handed over
210 **********************************************************************************************************
211 **********************************************************************************************************/
213 void DrawAliceLogoPerformance(Float_t start_x, Float_t start_y, Float_t width_logo, Float_t text_height, Float_t decrease, char *date){
215 Float_t alice_start_y = start_y - text_height * 1.1;
216 TLatex *alice = new TLatex((start_x-decrease),alice_start_y,"ALICE Performance"); // Bo: this was modified
218 alice->SetTextColor(2);
219 alice->SetTextFont(62);
220 alice->SetTextSize(text_height);
221 alice->SetLineWidth(2);
223 TLatex *pp7 = new TLatex((start_x+decrease*0.3),(alice_start_y-text_height*1.1),"pp @ 7 TeV"); // Bo: this was modified
225 pp7->SetTextColor(2);
226 pp7->SetTextFont(62);
227 pp7->SetTextSize(text_height);
228 pp7->SetLineWidth(2);
230 TLatex *today = new TLatex((start_x-decrease*0),(alice_start_y-2*text_height*1.1),date); // Bo: this was modified
232 today->SetTextColor(2);
233 today->SetTextFont(62);
234 today->SetTextSize(text_height);
235 today->SetLineWidth(2);
239 Float_t end_x = start_x + width_logo;
240 Float_t end_y = start_y + width_logo;
242 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",start_x,start_y,end_x,end_y);
243 // myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
244 myPadLogo->SetBorderMode(0);
245 myPadLogo->SetBorderSize(2);
246 myPadLogo->SetFrameBorderMode(0);
247 myPadLogo->SetLeftMargin(0.0);
248 myPadLogo->SetTopMargin(0.0);
249 myPadLogo->SetBottomMargin(0.0);
250 myPadLogo->SetRightMargin(0.0);
251 TASImage *myAliceLogo = new TASImage("/home/fredi/Dokumente/CERN/ALICE/Photon/ALICE_logo.eps");
252 myPadLogo->Draw(); // to take out for not using a logo.
254 myAliceLogo->Draw("same");
257 /*********************************************************************************************************
258 DrawAliceLogoPerformace2D
259 * will draw you the ALICE Logo as well the text "ALICE Performance", "pp @ 7 TeV" and the date
260 which you can hand over
261 * float_t start_x, float_t start_y - give starting Point of Logo
262 * float_t width_logo - gives the width of the logo
263 * float_t text_height - gives you the heigth of the text
264 * float_t decrease - gives percentage in the canvas to which the text should be decreased in y
266 * char * date - date handed over
267 **********************************************************************************************************
268 **********************************************************************************************************/
270 void DrawAliceLogoPerformance2D(Float_t start_x, Float_t start_y, Float_t width_logo, Float_t text_height, Float_t decrease, char *date){
272 Float_t alice_start_y = start_y + 3* text_height * 1.1;
273 TLatex *alice = new TLatex((start_x-decrease),alice_start_y,"ALICE Performance"); // Bo: this was modified
275 alice->SetTextColor(2);
276 alice->SetTextFont(62);
277 alice->SetTextSize(text_height);
278 alice->SetLineWidth(2);
280 TLatex *pp7 = new TLatex((start_x+decrease*0.3),(alice_start_y-text_height*1.1),"pp @ 7 TeV"); // Bo: this was modified
282 pp7->SetTextColor(2);
283 pp7->SetTextFont(62);
284 pp7->SetTextSize(text_height);
285 pp7->SetLineWidth(2);
287 TLatex *today = new TLatex((start_x-decrease*0),(alice_start_y-2*text_height*1.1),date); // Bo: this was modified
289 today->SetTextColor(2);
290 today->SetTextFont(62);
291 today->SetTextSize(text_height);
292 today->SetLineWidth(2);
296 Float_t end_x = start_x + width_logo;
297 Float_t end_y = start_y + width_logo;
299 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",start_x , (start_y - width_logo), end_x,start_y);
300 // myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
301 myPadLogo->SetBorderMode(0);
302 myPadLogo->SetBorderSize(2);
303 myPadLogo->SetFrameBorderMode(0);
304 myPadLogo->SetLeftMargin(0.0);
305 myPadLogo->SetTopMargin(0.0);
306 myPadLogo->SetBottomMargin(0.0);
307 myPadLogo->SetRightMargin(0.0);
308 TASImage *myAliceLogo = new TASImage("/home/fredi/Dokumente/CERN/ALICE/Photon/ALICE_logo.eps");
309 myPadLogo->Draw(); // to take out for not using a logo.
311 myAliceLogo->Draw("same");
316 //***********************************************************************************************************
317 /* DrawAliceText draws you the "work in progress" and " ALICE Performance"
318 * float_t start_x, float_t start_y - give starting Point of Logo
319 * float_t text_height - gives you the heigth of the text
320 //***********************************************************************************************************/
321 //***********************************************************************************************************/
323 void DrawAliceText(Float_t start_x, Float_t start_y, Float_t text_height){
324 Float_t alice_start_y = start_y - text_height * 1.1;
325 TLatex *alice = new TLatex(start_x,alice_start_y,"ALICE Performance"); // Bo: this was modified
327 alice->SetTextColor(2);
328 alice->SetTextFont(42);
329 alice->SetTextSize(text_height);
330 alice->SetLineWidth(2);
333 Float_t wip_start_y = start_y - text_height *(1 + 1.1);
334 TLatex *wip = new TLatex(start_x,wip_start_y,"work in progress"); // Bo: this was modified
336 wip->SetTextColor(2);
337 wip->SetTextFont(51);
338 wip->SetTextSize(text_height);
339 wip->SetLineWidth(2);
343 /*****************************************************************************************************
344 DrawStructure() draws the structure of the Inner Alice Detectors labeled for a xy - Plot
346 ******************************************************************************************************
347 ******************************************************************************************************/
349 void DrawStructure(){
350 TLatex *ssdText = new TLatex(0.16,0.78,"SSD");
352 ssdText->SetTextFont(72);
353 ssdText->SetTextSize(0.03);
354 ssdText->SetLineWidth(4);
357 TLatex *sddText = new TLatex(0.14,0.7,"SDD");
359 sddText->SetTextFont(72);
360 sddText->SetTextSize(0.03);
361 sddText->SetLineWidth(4);
364 TLatex *spdText = new TLatex(0.14,0.25,"SPD");
366 spdText->SetTextFont(72);
367 spdText->SetTextSize(0.03);
368 spdText->SetLineWidth(4);
371 TLatex *tpcRText = new TLatex(0.52,0.115,"TPC Rods");
373 tpcRText->SetTextFont(72);
374 tpcRText->SetTextSize(0.03);
375 tpcRText->SetLineWidth(4);
378 TLatex *tpcIText = new TLatex(0.14,0.20,"TPC inner");
380 tpcIText->SetTextFont(72);
381 tpcIText->SetTextSize(0.03);
382 tpcIText->SetLineWidth(4);
385 TLatex *tpcIFText = new TLatex(0.14,0.17,"field cage");
387 tpcIFText->SetTextFont(72);
388 tpcIFText->SetTextSize(0.03);
389 tpcIFText->SetLineWidth(4);
392 TLatex *tpcIFVText = new TLatex(0.16,0.14,"vessel");
393 tpcIFVText->SetNDC();
394 tpcIFVText->SetTextFont(72);
395 tpcIFVText->SetTextSize(0.03);
396 tpcIFVText->SetLineWidth(4);
399 TLatex *tpc1IText = new TLatex(0.705,0.20,"TPC inner");
401 tpc1IText->SetTextFont(72);
402 tpc1IText->SetTextSize(0.03);
403 tpc1IText->SetLineWidth(4);
406 TLatex *tpcICText = new TLatex(0.69,0.17,"containment");
408 tpcICText->SetTextFont(72);
409 tpcICText->SetTextSize(0.03);
410 tpcICText->SetLineWidth(4);
413 TLatex *tpcICVText = new TLatex(0.72,0.14,"vessel");
414 tpcICVText->SetNDC();
415 tpcICVText->SetTextFont(72);
416 tpcICVText->SetTextSize(0.03);
417 tpcICVText->SetLineWidth(10);
420 TLatex *tpcGasText = new TLatex(0.78,0.28,"TPC");
421 tpcGasText->SetNDC();
422 tpcGasText->SetTextFont(72);
423 tpcGasText->SetTextSize(0.03);
424 tpcGasText->SetLineWidth(10);
427 TLatex *tpcGas2Text = new TLatex(0.76,0.25,"drift gas");
428 tpcGas2Text->SetNDC();
429 tpcGas2Text->SetTextFont(72);
430 tpcGas2Text->SetTextSize(0.03);
431 tpcGas2Text->SetLineWidth(10);
435 TArrow * arrow = new TArrow(-150.8049,145.,-11.99843,38.629599,0.02,">"); //SSD arrow
436 arrow->SetFillColor(1);
437 arrow->SetFillStyle(1001);
438 arrow->SetLineWidth(2.);
441 TArrow * arrow1 = new TArrow(-160.,105.,-11.99843,25.,0.02,">"); //SDD arrow
442 arrow1->SetFillColor(1);
443 arrow1->SetFillStyle(1001);
444 arrow1->SetLineWidth(2.);
448 TArrow * arrow2 = new TArrow(-150,-108.,-7.,2.,0.02,">"); //SPD arrow
449 arrow2->SetFillColor(1);
450 arrow2->SetFillStyle(1001);
451 arrow2->SetLineWidth(2.);
454 TArrow * arrow3 = new TArrow(-105.,-160.,-30.,-75.,0.02,">"); //TPC field cage vessel arrow
455 arrow3->SetFillColor(1);
456 arrow3->SetFillStyle(1001);
457 arrow3->SetLineWidth(2.);
461 TArrow * arrow4 = new TArrow(50.,-178.,15.,-88.,0.02,">"); //TPC rods arrow
462 arrow4->SetFillColor(1);
463 arrow4->SetFillStyle(1001);
464 arrow4->SetLineWidth(2.);
467 TArrow * arrow5 = new TArrow(130.,-130.,50.,-38.,0.02,">");// TPC inner constainment vessel arrow
468 arrow5->SetFillColor(1);
469 arrow5->SetFillStyle(1001);
470 arrow5->SetLineWidth(2.);
474 TArrow * arrow6 = new TArrow(160.,-90.,130.,-70.,0.02,">");// TPC gas
475 arrow6->SetFillColor(1);
476 arrow6->SetFillStyle(1001);
477 arrow6->SetLineWidth(2.);
481 /*************************************************************************************************************
482 DrawArmenteros() draws the labels for the particles in the Armenteros plot
483 **************************************************************************************************************/
485 void DrawArmenteros(){
486 TLatex *K0s = new TLatex(0.45,0.87,"K^{0}_{s}");
488 K0s->SetTextFont(62);
489 K0s->SetTextSize(0.05);
490 K0s->SetLineWidth(4);
493 TLatex *lambda = new TLatex(0.71,0.47,"#Lambda");
495 lambda->SetTextFont(62);
496 lambda->SetTextSize(0.05);
497 lambda->SetLineWidth(4);
500 TLatex *lambdabar = new TLatex(0.22,0.48,"#bar{#Lambda}");
502 lambdabar->SetTextFont(62);
503 lambdabar->SetTextSize(0.05);
504 lambdabar->SetLineWidth(4);
507 TLatex *gamma = new TLatex(0.49,0.18,"#gamma");
509 gamma->SetTextFont(62);
510 gamma->SetTextSize(0.05);
511 gamma->SetLineWidth(4);
517 /************************************************************************************************
519 * Float_t linewidth - will give the final linewidth in the plot
521 *************************************************************************************************
522 *************************************************************************************************/
523 void DrawdEdxLabel(){
524 TLatex *pion = new TLatex(0.23,0.7,"#pi"); //text at pion line
526 pion->SetTextColor(2);
527 pion->SetTextFont(62);
528 pion->SetTextSize(0.03);
529 pion->SetLineWidth(2);
531 TLatex *kaon = new TLatex(0.375,0.7,"K"); //text at kaon line
533 kaon->SetTextColor(4);
534 kaon->SetTextFont(62);
535 kaon->SetTextSize(0.03);
536 kaon->SetLineWidth(2);
538 TLatex *proton = new TLatex(0.455,0.7,"p"); //text at proton line
540 proton->SetTextColor(kGreen+3);
541 proton->SetTextFont(62);
542 proton->SetTextSize(0.03);
543 proton->SetLineWidth(2);
545 TLatex *electron = new TLatex(0.72,0.50,"e"); //text at electron line
547 electron->SetTextColor(1);
548 electron->SetTextFont(62);
549 electron->SetTextSize(0.03);
550 electron->SetLineWidth(2);
552 electron->Draw("same");
554 proton->Draw("same");
558 /* // DrawGammaLines will draw the lines in the histogram for you
559 * start_x - starting point of drawing in x
560 * end_x - end point of drawing in x
561 * start_y -starting point of drawing in y
562 * end_y - end point of drawing in y
565 void DrawGammaLines(Float_t start_x, Float_t end_x,
566 Float_t start_y, Float_t end_y,
568 TLine * l1 = new TLine (start_x,start_y,end_x,end_y);
570 l1->SetLineWidth(linew);