FairRoot/PandaRoot
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
tutorials
analysis
plotTMVADemoData.C
Go to the documentation of this file.
1
void
confhist
(TH1*
h
,
int
color=1,
int
style
=1)
2
{
3
h->SetStats(0);
4
h->SetLineColor(color);
5
h->SetMarkerColor(color);
6
h->SetLineStyle(
style
);
7
h->SetLineWidth(2);
8
}
9
10
void
plotTMVADemoData
()
11
{
12
TFile *
f
=
new
TFile(
"demodata.root"
);
13
TTree *
t
= (TTree*) f->Get(
"ntp"
);
14
TString
vars
[6] = {
"m"
,
"v1"
,
"v2"
,
"v3"
,
"v4"
,
"v5"
};
15
16
TH1F *htot[6], *hs[6], *hb[6];
17
TH2F *hv24s =
new
TH2F(
"hv24s"
,
"v2:v4;v2;v4"
,100,t->GetMinimum(
"v2"
),t->GetMaximum(
"v2"
),100,t->GetMinimum(
"v4"
),t->GetMaximum(
"v4"
));
18
TH2F *hv24b =
new
TH2F(
"hv24b"
,
"v2:v4;v2;v4"
,100,t->GetMinimum(
"v2"
),t->GetMaximum(
"v2"
),100,t->GetMinimum(
"v4"
),t->GetMaximum(
"v4"
));
19
TH2F *hv53s =
new
TH2F(
"hv53s"
,
"v5:v3;v3;v5"
,100,t->GetMinimum(
"v5"
),t->GetMaximum(
"v5"
),100,t->GetMinimum(
"v3"
),t->GetMaximum(
"v3"
));
20
TH2F *hv53b =
new
TH2F(
"hv53b"
,
"v5:v3;v3;v5"
,100,t->GetMinimum(
"v5"
),t->GetMaximum(
"v5"
),100,t->GetMinimum(
"v3"
),t->GetMaximum(
"v3"
));
21
22
confhist
(hv24s,kGreen+2);
23
confhist
(hv53s,kGreen+2);
24
confhist
(hv24b,kRed+1);
25
confhist
(hv53b,kRed+1);
26
27
TCanvas *
c1
=
new
TCanvas(
"c1"
,
"c1"
,20,20,1600,800);
28
c1->Divide(4,2,0.001,0.001);
29
30
for
(
int
i
=0;
i
<6;++
i
)
31
{
32
c1->cd(
i
+1);
33
double
xmin
= t->GetMinimum(vars[
i
]);
34
double
xmax
= t->GetMaximum(vars[i]);
35
36
//cout <<i<<" "<<vars[i]<<" "<<xmin<<" "<<xmax<<endl;
37
htot[
i
] =
new
TH1F(
"htot"
+vars[i],vars[i]+
";"
+vars[i],100,xmin,xmax);
38
hs[
i
] =
new
TH1F(
"hs"
+vars[i],vars[i]+
";"
+vars[i],100,xmin,xmax);
39
hb[
i
] =
new
TH1F(
"hb"
+vars[i],vars[i]+
";"
+vars[i],100,xmin,xmax);
40
41
confhist
(htot[i],kGray+1,9);
42
confhist
(hs[i],kGreen+2);
43
confhist
(hb[i],kRed+1);
44
45
t->Project(
"htot"
+vars[i],vars[i]);
46
t->Project(
"hs"
+vars[i],vars[i],
"signal>0"
);
47
t->Project(
"hb"
+vars[i],vars[i],
"signal<1"
);
48
49
htot[
i
]->Draw();
50
hs[
i
]->Draw(
"same"
);
51
hb[
i
]->Draw(
"same"
);
52
53
c1->Update();
54
}
55
56
c1->cd(7);
57
t->Project(
"hv24s"
,
"v4:v2"
,
"signal"
);
58
t->Project(
"hv24b"
,
"v4:v2"
,
"signal<1"
);
59
hv24b->Draw();
60
hv24s->Draw(
"same"
);
61
62
c1->cd(8);
63
t->Project(
"hv53s"
,
"v3:v5"
,
"signal"
);
64
t->Project(
"hv53b"
,
"v3:v5"
,
"signal<1"
);
65
hv53b->Draw();
66
hv53s->Draw(
"same"
);
67
68
69
}
i
Int_t i
Definition:
run_full.C:25
xmax
Double_t xmax
Definition:
convolutionAnalysis.C:11
plotTMVADemoData
void plotTMVADemoData()
Definition:
plotTMVADemoData.C:10
confhist
void confhist(TH1 *h)
Definition:
analyse_phi2.C:16
h
Int_t h
Definition:
PndSttHelixTrackFitter.cxx:44
vars
TString vars[MAX]
Definition:
autocutx.C:34
style
void style()
Definition:
HypHitAnasigBg_AR.C:196
f
TFile * f
Definition:
bump_analys.C:12
TString
TString
Definition:
SimCompleteLinkDef.h:6
c1
c1
Definition:
plot_dirc.C:35
t
TTree * t
Definition:
bump_analys.C:13
xmin
Double_t xmin
Definition:
convolutionAnalysis.C:10
Generated on Wed Apr 3 2019 10:02:48 for FairRoot/PandaRoot by
1.8.5