-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAtlasLabels.C
120 lines (94 loc) · 2.53 KB
/
AtlasLabels.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include "AtlasLabels.h"
#include "TLatex.h"
#include "TLine.h"
#include "TPave.h"
#include "TMarker.h"
void ATLASLabel(Double_t x,Double_t y,char* text,Color_t color)
{
TLatex l; //l.SetTextAlign(12); l.SetTextSize(tsize);
l.SetNDC();
l.SetTextFont(72);
l.SetTextColor(color);
double delx = 0.115*696*gPad->GetWh()/(472*gPad->GetWw());
l.DrawLatex(x,y,"ATLAS");
if (text) {
TLatex p;
p.SetNDC();
p.SetTextFont(42);
p.SetTextColor(color);
p.DrawLatex(x+delx,y,text);
// p.DrawLatex(x,y,"#sqrt{s}=900GeV");
}
}
void ATLASLabelOld(Double_t x,Double_t y,bool Preliminary,Color_t color)
{
TLatex l; //l.SetTextAlign(12); l.SetTextSize(tsize);
l.SetNDC();
l.SetTextFont(72);
l.SetTextColor(color);
l.DrawLatex(x,y,"ATLAS");
if (Preliminary) {
TLatex p;
p.SetNDC();
p.SetTextFont(42);
p.SetTextColor(color);
p.DrawLatex(x+0.115,y,"Preliminary");
}
}
void ATLASVersion(char* version,Double_t x,Double_t y,Color_t color)
{
if (version) {
char versionString[100];
sprintf(versionString,"Version %s",version);
TLatex l;
l.SetTextAlign(22);
l.SetTextSize(0.04);
l.SetNDC();
l.SetTextFont(72);
l.SetTextColor(color);
l.DrawLatex(x,y,versionString);
}
}
void myText(Double_t x,Double_t y,Color_t color,char *text)
{
//Double_t tsize=0.05;
TLatex l; //l.SetTextAlign(12); l.SetTextSize(tsize);
l.SetNDC();
l.SetTextColor(color);
l.DrawLatex(x,y,text);
}
void myBoxText(Double_t x, Double_t y,Double_t boxsize,Int_t mcolor,char *text)
{
Double_t tsize=0.06;
TLatex l; l.SetTextAlign(12); //l.SetTextSize(tsize);
l.SetNDC();
l.DrawLatex(x,y,text);
Double_t y1=y-0.25*tsize;
Double_t y2=y+0.25*tsize;
Double_t x2=x-0.3*tsize;
Double_t x1=x2-boxsize;
printf("x1= %f x2= %f y1= %f y2= %f \n",x1,x2,y1,y2);
TPave *mbox= new TPave(x1,y1,x2,y2,0,"NDC");
mbox->SetFillColor(mcolor);
mbox->SetFillStyle(1001);
mbox->Draw();
TLine mline;
mline.SetLineWidth(4);
mline.SetLineColor(1);
mline.SetLineStyle(1);
Double_t y_new=(y1+y2)/2.;
mline.DrawLineNDC(x1,y_new,x2,y_new);
}
void myMarkerText(Double_t x,Double_t y,Int_t color,Int_t mstyle,char *text)
{
// printf("**myMarker: text= %s\ m ",text);
Double_t tsize=0.06;
TMarker *marker = new TMarker(x-(0.4*tsize),y,8);
marker->SetMarkerColor(color); marker->SetNDC();
marker->SetMarkerStyle(mstyle);
marker->SetMarkerSize(2.0);
marker->Draw();
TLatex l; l.SetTextAlign(12); //l.SetTextSize(tsize);
l.SetNDC();
l.DrawLatex(x,y,text);
}