-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrawrawbgnd.C
47 lines (43 loc) · 1 KB
/
drawrawbgnd.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
void drawrawbgnd(const char *fname)
{
const char *names[18] = {"hAllc", "hAllt", "hVetoc", "hVetot", "hNoVetoc", "hNoVetot", "h20c", "h20t", "hNo20c", "hNo20t",
"h2topc", "h2topt", "hNo2topc", "hNo2topt", "h2edgec", "h2edget", "hNo2edgec", "hNo2edget"};
int i;
char str[1024];
char *ptr;
TVirtualPad *pd;
TH1D *h;
TFile *f;
f = new TFile(fname);
if (!f->IsOpen()) return;
gStyle->SetOptStat(0);
strcpy(str, fname);
ptr = strchr(str, '.');
if (!ptr) ptr = &str[strlen(str)];
strcpy(ptr, ".pdf[");
TCanvas cv("CV", "CV", 1200, 1000);
cv.SaveAs(str);
ptr[4] = '\0';
for (i=0; i < sizeof(names) / sizeof(names[0]); i++) {
h = (TH1D*) f->Get(names[i]);
if (!h) continue;
cv.Clear();
cv.Divide(2,2);
pd = cv.cd(1);
pd->SetLogy(0);
h->DrawCopy();
pd = cv.cd(2);
pd->SetLogy(1);
h->DrawCopy();
h->GetXaxis()->SetRange(3,100);
pd = cv.cd(3);
pd->SetLogy(0);
h->DrawCopy();
pd = cv.cd(4);
pd->SetLogy(1);
h->DrawCopy();
cv.SaveAs(str);
}
ptr[4] = ']';
cv.SaveAs(str);
}