1 | //Macro utilisée pour vérifier la consitance d'une variable d'un tree à un autre en superposant les deux histogrammes correspondant. |
---|
2 | |
---|
3 | void lecture() |
---|
4 | { |
---|
5 | TFile *f1 = new TFile("/Users/moretto/Documents/thesis/ESAF/Code/esaf_lal/esaf/camille_work/comparison_new_old_code/simu.mac.root"); |
---|
6 | TTree *etree1 = (TTree*)f1->Get("etree"); |
---|
7 | |
---|
8 | TFile *f2 = new TFile("/Users/moretto/Documents/thesis/ESAF/Code/esaf_lal/esaf/camille_work/comparison_new_old_code/simu.old_linux.root"); |
---|
9 | TTree *etree2 = (TTree*)f2->Get("etree"); |
---|
10 | |
---|
11 | //option 1: |
---|
12 | |
---|
13 | etree1->Project("h1", "fPhotons.fPosX"); |
---|
14 | etree2->Project("h2", "fPhotons.fPosX"); |
---|
15 | |
---|
16 | etree1->Project("h3", "fPhotons.fPosY"); |
---|
17 | etree2->Project("h4", "fPhotons.fPosY"); |
---|
18 | |
---|
19 | etree1->Project("h5", "fPhotons.fPosZ"); |
---|
20 | etree2->Project("h6", "fPhotons.fPosZ"); |
---|
21 | |
---|
22 | etree1->Project("h7", "fPhotons.fTime"); |
---|
23 | etree2->Project("h8", "fPhotons.fTime"); |
---|
24 | |
---|
25 | |
---|
26 | TCanvas *c1 = new TCanvas("c1", "Comparison new code vs old => Red: new on mac / Black: old on linux"); |
---|
27 | c1->Divide(2,2); |
---|
28 | |
---|
29 | c1->cd(1); |
---|
30 | h1->SetLineColor(kRed); |
---|
31 | h2->SetLineColor(kBlack); |
---|
32 | h1->Draw(); |
---|
33 | h2->Draw("Same"); |
---|
34 | |
---|
35 | c1->cd(2); |
---|
36 | h3->SetLineColor(kRed); |
---|
37 | h4->SetLineColor(kBlack); |
---|
38 | h3->Draw(); |
---|
39 | h4->Draw("Same"); |
---|
40 | |
---|
41 | c1->cd(3); |
---|
42 | h5->SetLineColor(kRed); |
---|
43 | h6->SetLineColor(kBlack); |
---|
44 | h5->Draw(); |
---|
45 | h6->Draw("Same"); |
---|
46 | |
---|
47 | c1->cd(4); |
---|
48 | h7->SetLineColor(kRed); |
---|
49 | h8->SetLineColor(kBlack); |
---|
50 | h7->Draw(); |
---|
51 | h8->Draw("Same"); |
---|
52 | |
---|
53 | //--------------------------------------- |
---|
54 | |
---|
55 | TFile *f3 = new TFile("/Users/moretto/Documents/thesis/ESAF/Code/esaf_lal/esaf/camille_work/comparison_new_old_code/simu.mac.root"); |
---|
56 | TTree *etree3 = (TTree*)f3->Get("etree"); |
---|
57 | |
---|
58 | TFile *f4 = new TFile("/Users/moretto/Documents/thesis/ESAF/Code/esaf_lal/esaf/camille_work/comparison_new_old_code/simu.old_linux.root"); |
---|
59 | TTree *etree4 = (TTree*)f4->Get("etree"); |
---|
60 | |
---|
61 | //option 1: |
---|
62 | |
---|
63 | etree3->Project("h9", "fPhotons.fPosX"); |
---|
64 | etree4->Project("h10", "fPhotons.fPosX"); |
---|
65 | |
---|
66 | etree3->Project("h11", "fPhotons.fPosY"); |
---|
67 | etree4->Project("h12", "fPhotons.fPosY"); |
---|
68 | |
---|
69 | etree3->Project("h13", "fPhotons.fPosZ"); |
---|
70 | etree4->Project("h14", "fPhotons.fPosZ"); |
---|
71 | |
---|
72 | etree3->Project("h15", "fPhotons.fTime"); |
---|
73 | etree4->Project("h16", "fPhotons.fTime"); |
---|
74 | |
---|
75 | |
---|
76 | TCanvas *c2 = new TCanvas("c2", "Comparison new code vs old => Red: new on mac / Black: new on linux"); |
---|
77 | c2->Divide(2,2); |
---|
78 | |
---|
79 | c2->cd(1); |
---|
80 | h9->SetLineColor(kRed); |
---|
81 | h10->SetLineColor(kBlack); |
---|
82 | h9->Draw(); |
---|
83 | h10->Draw("Same"); |
---|
84 | |
---|
85 | c2->cd(2); |
---|
86 | h11->SetLineColor(kRed); |
---|
87 | h12->SetLineColor(kBlack); |
---|
88 | h11->Draw(); |
---|
89 | h12->Draw("Same"); |
---|
90 | |
---|
91 | c2->cd(3); |
---|
92 | h13->SetLineColor(kRed); |
---|
93 | h14->SetLineColor(kBlack); |
---|
94 | h13->Draw(); |
---|
95 | h14->Draw("Same"); |
---|
96 | |
---|
97 | c2->cd(4); |
---|
98 | h15->SetLineColor(kRed); |
---|
99 | h16->SetLineColor(kBlack); |
---|
100 | h15->Draw(); |
---|
101 | h16->Draw("Same"); |
---|
102 | |
---|
103 | //--------------------------------------- |
---|
104 | |
---|
105 | TFile *f5 = new TFile("/Users/moretto/Documents/thesis/ESAF/Code/esaf_lal/esaf/camille_work/comparison_new_old_code/simu.new_linux.root"); |
---|
106 | TTree *etree5 = (TTree*)f5->Get("etree"); |
---|
107 | |
---|
108 | TFile *f6 = new TFile("/Users/moretto/Documents/thesis/ESAF/Code/esaf_lal/esaf/camille_work/comparison_new_old_code/simu.old_linux.root"); |
---|
109 | TTree *etree6 = (TTree*)f6->Get("etree"); |
---|
110 | |
---|
111 | //option 1: |
---|
112 | |
---|
113 | etree5->Project("h17", "fPhotons.fPosX"); |
---|
114 | etree6->Project("h18", "fPhotons.fPosX"); |
---|
115 | |
---|
116 | etree5->Project("h19", "fPhotons.fPosY"); |
---|
117 | etree6->Project("h20", "fPhotons.fPosY"); |
---|
118 | |
---|
119 | etree5->Project("h21", "fPhotons.fPosZ"); |
---|
120 | etree6->Project("h22", "fPhotons.fPosZ"); |
---|
121 | |
---|
122 | etree5->Project("h23", "fPhotons.fTime"); |
---|
123 | etree6->Project("h24", "fPhotons.fTime"); |
---|
124 | |
---|
125 | |
---|
126 | TCanvas *c3 = new TCanvas("c3", "Comparison new code vs old => Red: new on linux / Black: old on linux"); |
---|
127 | c3->Divide(2,2); |
---|
128 | |
---|
129 | c3->cd(1); |
---|
130 | h17->SetLineColor(kRed); |
---|
131 | h18->SetLineColor(kBlack); |
---|
132 | h17->Draw(); |
---|
133 | h18->Draw("Same"); |
---|
134 | |
---|
135 | c3->cd(2); |
---|
136 | h19->SetLineColor(kRed); |
---|
137 | h20->SetLineColor(kBlack); |
---|
138 | h19->Draw(); |
---|
139 | h20->Draw("Same"); |
---|
140 | |
---|
141 | c3->cd(3); |
---|
142 | h21->SetLineColor(kRed); |
---|
143 | h22->SetLineColor(kBlack); |
---|
144 | h21->Draw(); |
---|
145 | h22->Draw("Same"); |
---|
146 | |
---|
147 | c3->cd(4); |
---|
148 | h23->SetLineColor(kRed); |
---|
149 | h24->SetLineColor(kBlack); |
---|
150 | h23->Draw(); |
---|
151 | h24->Draw("Same"); |
---|
152 | |
---|
153 | |
---|
154 | |
---|
155 | //option 2: |
---|
156 | |
---|
157 | /*etree1->Draw("fPhotons.fPosX"); |
---|
158 | etree2->Draw("fPhotons.fPosX","", "Same");*/ |
---|
159 | |
---|
160 | } |
---|
161 | |
---|