-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathUnfold.cxx
70 lines (57 loc) · 2.28 KB
/
Unfold.cxx
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
#include "Unfold.h"
Unfold::Unfold(int nb, double xlo, double xhi)
: response_SliceID_Int(nb, xlo, xhi)
, response_SliceID_Inc(nb, xlo, xhi)
, response_SliceID_Ini(nb, xlo, xhi)
{
response_SliceID_Int.UseOverflow(false);
response_SliceID_Inc.UseOverflow(false);
response_SliceID_Ini.UseOverflow(false);
eff_num_Int = new TH1D("eff_num_Int", "eff_num_Int", nb, xlo, xhi);
eff_den_Int = new TH1D("eff_den_Int", "eff_den_Int", nb, xlo, xhi);
eff_num_Inc = new TH1D("eff_num_Inc", "eff_num_Inc", nb, xlo, xhi);
eff_den_Inc = new TH1D("eff_den_Inc", "eff_den_Inc", nb, xlo, xhi);
pur_num_Int = new TH1D("pur_num_Int", "pur_num_Int", nb, xlo, xhi);
pur_num_Inc = new TH1D("pur_num_Inc", "pur_num_Inc", nb, xlo, xhi);
pur_den = new TH1D("pur_den", "pur_den", nb, xlo, xhi);
eff_num_Int->Sumw2();
eff_den_Int->Sumw2();
eff_num_Inc->Sumw2();
eff_den_Inc->Sumw2();
pur_num_Int->Sumw2();
pur_num_Inc->Sumw2();
pur_den->Sumw2();
}
void Unfold::SaveHistograms(){
eff_num_Int->Write("eff_num_Int");
eff_den_Int->Write("eff_den_Int");
eff_num_Inc->Write("eff_num_Inc");
eff_den_Inc->Write("eff_den_Inc");
pur_num_Int->Write("pur_num_Int");
pur_num_Inc->Write("pur_num_Inc");
pur_den->Write("pur_den");
eff_Int = (TH1D*)eff_num_Int->Clone("eff_Int");
eff_Int->Divide(eff_den_Int);
eff_Int->Write("eff_Int");
eff_Inc = (TH1D*)eff_num_Inc->Clone("eff_Inc");
eff_Inc->Divide(eff_den_Inc);
eff_Inc->Write("eff_Inc");
pur_Int = (TH1D*)pur_num_Int->Clone("pur_Int");
pur_Int->Divide(pur_den);
pur_Int->Write("pur_Int");
pur_Inc = (TH1D*)pur_num_Inc->Clone("pur_Inc");
pur_Inc->Divide(pur_den);
pur_Inc->Write("pur_Inc");
TH2D *hint = (TH2D*)response_SliceID_Int.Hresponse();
hint->SetTitle("Interactions;Reco Slice ID;True Slice ID");
hint->Write("hresponse_SliceID_Int");
TH2D *hinc = (TH2D*)response_SliceID_Inc.Hresponse();
hinc->SetTitle("Incidents; Reco Slice ID; True Slice ID");
hinc->Write("hresponse_SliceID_Inc");
TH2D *hini = (TH2D*)response_SliceID_Ini.Hresponse();
hini->SetTitle("Initial; Reco Slice ID; True Slice ID");
hini->Write("hresponse_SliceID_Ini");
response_SliceID_Int.Write("response_SliceID_Int");
response_SliceID_Inc.Write("response_SliceID_Inc");
response_SliceID_Ini.Write("response_SliceID_Ini");
}