histCorr.C 9.69 KB
Newer Older
Muzalevsky I.A's avatar
Muzalevsky I.A committed
1 2 3
#include "TH2F.h"
#include "TH3F.h"
#include "TStyle.h"
4

5
void histCorr(
Muzalevsky I.A's avatar
Muzalevsky I.A committed
6 7


8
//		const char *filename = "Neurad_7_08_NEW.root",
Muzalevsky I.A's avatar
Muzalevsky I.A committed
9
		const char *filename1 = "analysis_08_2.root",
10
		const char *filename = "analysis_07_8.root",
Muzalevsky I.A's avatar
Muzalevsky I.A committed
11
		const char *foldername = "report",
12
//		const char *foldername = "8_2",
13 14
//		const char *ext = ".eps",
		const char *ext = ".gif",
15

16 17
		const Bool_t can1 = 1, const Bool_t can2 = 1,
		const Bool_t can3 = 1, const Bool_t can4 = 1,
Muzalevsky I.A's avatar
Muzalevsky I.A committed
18
		const Bool_t can5 = 1, const Bool_t can6 = 1)
19
{
Muzalevsky I.A's avatar
Muzalevsky I.A committed
20 21
	using std::cout;
	using std::endl;
22
	gSystem->Load("../libData.so");
23 24
	TFile *f = new TFile(Form("../data/dataDSR4/%s", filename));
//	TFile *f = new TFile("../data/dataDSR4/analysis_08_2.root");
25
	TTree *t = (TTree*)f->Get("atree");
26

Muzalevsky I.A's avatar
Muzalevsky I.A committed
27 28 29
	TFile *f1 = new TFile(Form("../data/dataDSR4/%s", filename1));
//	TFile *f = new TFile("../data/dataDSR4/analysis_08_2.root");
	TTree *t1 = (TTree*)f1->Get("atree");
30

Muzalevsky I.A's avatar
Muzalevsky I.A committed
31 32 33
	gStyle->SetCanvasDefH(900);
	gStyle->SetCanvasDefW(1500);
//	gStyle->SetCanvas
34

Muzalevsky I.A's avatar
Muzalevsky I.A committed
35 36 37
	if (can1) { // t1 - коллимированные данные!!!
		TCanvas *c1 = new TCanvas("c5", "Changing CFD parameters");
		c1->Divide(2,2);
38
		c1->cd(1);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
39 40 41 42 43 44 45

		TH1F *h1 = new TH1F("h1", "delta tau_CFD for NONcollimated data",1000	, -200., 200);

		//t->Draw("Ach0.fTimeCFD - Ach3.fTimeCFD >> h1","(Ach0.fTimeCFD - Ach3.fTimeCFD)>0 && (Ach0.fTimeCFD - Ach3.fTimeCFD)<8","");
		t->Draw("Ach0.fTimeCFD - Ach3.fTimeCFD >> h1","","");
		h1->GetXaxis()->SetRangeUser(-65, 8);
		h1->GetXaxis()->SetTitle("delta tauCFD [ns]");
46 47 48
		h1->GetXaxis()->CenterTitle();

		c1->cd(2);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
49 50 51 52 53 54
		TH1F *h2 = new TH1F("h2", "delta tau_LED for NONcollimated data",1000, -200., 200);

		//t->Draw("Ach0.fTimeLED - Ach3.fTimeLED >> h2","(Ach0.fTimeLED - Ach3.fTimeLED)>0 && (Ach0.fTimeLED - Ach3.fTimeLED)<8","");
		t->Draw("Ach0.fTimeLED - Ach3.fTimeLED >> h2","","");
		h2->GetXaxis()->SetRangeUser(-65, 8);
		h2->GetXaxis()->SetTitle("delta tauLED [ns]");
55 56 57
		h2->GetXaxis()->CenterTitle();

		c1->cd(3);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
58 59 60 61 62 63 64

		TH1F *h3 = new TH1F("h3", "delta tau_CFD for collimated data",1000	, 0, 200);

		t1->Draw("Ach0.fTimeCFD - Ach1.fTimeCFD >> h3","(Ach0.fTimeCFD - Ach1.fTimeCFD)>0 && (Ach0.fTimeCFD - Ach1.fTimeCFD)<150","");
		//t1->Draw("Ach0.fTimeCFD - Ach1.fTimeCFD >> h3","","");
		h3->GetXaxis()->SetRangeUser(0, 150);
		h3->GetXaxis()->SetTitle("delta tauCFD [ns]");
65 66 67
		h3->GetXaxis()->CenterTitle();

		c1->cd(4);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
68 69 70 71 72 73
		TH1F *h4 = new TH1F("h4", "delta tau_LED for collimated data",1000	, -200., 200);

		t1->Draw("Ach0.fTimeLED - Ach1.fTimeLED >> h4","(Ach0.fTimeLED - Ach1.fTimeLED)>-2 && (Ach0.fTimeLED - Ach1.fTimeLED)<15","");
		//t1->Draw("Ach0.fTimeLED - Ach1.fTimeLED >> h4","","");
		h4->GetXaxis()->SetRangeUser(-2,15);
		h4->GetXaxis()->SetTitle("delta tauLED [ns]");
74
		h4->GetXaxis()->CenterTitle();
Muzalevsky I.A's avatar
Muzalevsky I.A committed
75

76
		c1->Update();
Muzalevsky I.A's avatar
Muzalevsky I.A committed
77
		//c1->Print(Form("../macros/picsDRS4/%s/deltaT%s", foldername, ext));
78 79 80 81
	}

	if (can2) {
		TCanvas *c2 = new TCanvas("c2", "Correlation pictures: Integrals and amplitudes");
82
		c2->Divide(2,2);
83

Muzalevsky I.A's avatar
Muzalevsky I.A committed
84
		TH2F *h5 = new TH2F("h5", "maxapl of the first channel vs maxamp of the second channel", 300, 0 ,0.1, 300, 0, 0.2);
85
		c2->cd(1);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
86
		t1->Draw("Ach0.fAmpMax : Ach1.fAmpMax >> h5","","col");
87
		//x
Muzalevsky I.A's avatar
Muzalevsky I.A committed
88
		h5->GetXaxis()->SetTitle("Max_ampl_{1} [V]");
89 90
		h5->GetXaxis()->CenterTitle();
		//y
Muzalevsky I.A's avatar
Muzalevsky I.A committed
91
		h5->GetYaxis()->SetTitle("Max_ampl_{0} [V]");
92
		h5->GetYaxis()->CenterTitle();
Muzalevsky I.A's avatar
Muzalevsky I.A committed
93

94
		c2->Update();
95

Muzalevsky I.A's avatar
Muzalevsky I.A committed
96 97 98
		TH2F *h6 = new TH2F("h6", "tau(fTimeLed0-fTimeLed1) vs amplitude of the trigered channel", 200, 0 ,0.5, 200, 5, 15);
		c2->cd(2);
		t1->Draw("Ach0.fTimeLED - Ach1.fTimeLED  : Ach0.fAmpMax >> h6","","col");
99
		//x
Muzalevsky I.A's avatar
Muzalevsky I.A committed
100
		h6->GetXaxis()->SetTitle("Max_ampl_{0} [V]");
101 102
		h6->GetXaxis()->CenterTitle();
		//y
Muzalevsky I.A's avatar
Muzalevsky I.A committed
103
		h6->GetYaxis()->SetTitle("tau_LED [V]");
104
		h6->GetYaxis()->CenterTitle();
Muzalevsky I.A's avatar
Muzalevsky I.A committed
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130

		c2->Update();

		TH2F *h7 = new TH2F("h7", "tau(fTimeLed0-fTimeLed1) vs summ of amplitudes", 200, 0 ,0.5, 200, 5, 15);
		c2->cd(3);
		t1->Draw("Ach0.fTimeLED - Ach1.fTimeLED  : Ach0.fAmpMax + Ach1.fAmpMax >> h7","","col");
		//x
		h7->GetXaxis()->SetTitle("summ_Amps [V]");
		h7->GetXaxis()->CenterTitle();
		//y
		h7->GetYaxis()->SetTitle("tau_LED [V]");
		h7->GetYaxis()->CenterTitle();

		c2->Update();


		TH2F *h8 = new TH2F("h8", "tau(fTimeCFD0-fTimeCFD1) vs summ of amplitudes", 200, 0 ,0.5, 200, -150, 150);
		c2->cd(4);
		t1->Draw("Ach0.fTimeCFD - Ach1.fTimeCFD  : Ach0.fAmpMax + Ach1.fAmpMax >> h8","","col");
		//x
		h8->GetXaxis()->SetTitle("summ_Amps [V]");
		h8->GetXaxis()->CenterTitle();
		//y
		h8->GetYaxis()->SetTitle("tau_CFD [V]");
		h8->GetYaxis()->CenterTitle();

131
		c2->Update();
Muzalevsky I.A's avatar
Muzalevsky I.A committed
132 133 134


		//c2->Print(Form("../macros/picsDRS4/%s/tauVSAmpl%s", foldername, ext));
135
	}
136

137
	if (can3) {
Muzalevsky I.A's avatar
Muzalevsky I.A committed
138
		TCanvas *c3 = new TCanvas("c3", "Correlation pictures: Integrals and amplitudes");
139
		c3->Divide(2,2);
140

Muzalevsky I.A's avatar
Muzalevsky I.A committed
141
		TH2F *h9 = new TH2F("h9", "tau_led vs chargeLed KOLLIMATED", 200, 0 ,5e-10, 200, 5, 15);
142
		c3->cd(1);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
143
		t1->Draw("Ach0.fTimeLED - Ach1.fTimeLED : Ach0.fChargeLED >> h9","","col");
144
		//x
Muzalevsky I.A's avatar
Muzalevsky I.A committed
145 146 147 148 149
		h9->GetXaxis()->SetTitle("Charge [kl]");
		h9->GetXaxis()->CenterTitle();
		//y
		h9->GetYaxis()->SetTitle("tauLED [ns]");
		h9->GetYaxis()->CenterTitle();
150

Muzalevsky I.A's avatar
Muzalevsky I.A committed
151
		TH2F *h10 = new TH2F("h10", "tau_led vs chargeLed NONKOLLIMATED", 200, 0 ,8e-10, 200, -10, 5);
152
		c3->cd(3);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
153
		t->Draw("Ach0.fTimeLED - Ach3.fTimeLED : Ach0.fChargeLED >> h10","","col");
154
		//x
Muzalevsky I.A's avatar
Muzalevsky I.A committed
155 156
		h10->GetXaxis()->SetTitle("Charge [kl]");
		h10->GetXaxis()->CenterTitle();
157
		//y
Muzalevsky I.A's avatar
Muzalevsky I.A committed
158 159 160
		h10->GetYaxis()->SetTitle("tauLED [ns]");
		h10->GetYaxis()->CenterTitle();

161
		c3->Update();
Muzalevsky I.A's avatar
Muzalevsky I.A committed
162 163

		TH2F *h11 = new TH2F("h11", "tauLED vs summCharge COLLIMATED", 200, 0 ,1e-9, 200, 5, 15);
164
		c3->cd(2);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
165
		t1->Draw("Ach0.fTimeLED - Ach1.fTimeLED  : Ach0.fChargeLED + Ach1.fChargeLED >> h11","","col");
166
		//x
Muzalevsky I.A's avatar
Muzalevsky I.A committed
167 168 169 170 171
		h11->GetXaxis()->SetTitle("Summ_Charge [kl]");
		h11->GetXaxis()->CenterTitle();
		//y
		h11->GetYaxis()->SetTitle("tau_LED [V]");
		h11->GetYaxis()->CenterTitle();
172

Muzalevsky I.A's avatar
Muzalevsky I.A committed
173 174
		c3->Update();
		TH2F *h12 = new TH2F("h12", "tau_led vs summCharge NONKOLLIMATED", 200, 0 ,8e-10, 200, -10, 5);
175
		c3->cd(4);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
176 177 178 179 180 181 182
		t->Draw("Ach0.fTimeLED - Ach3.fTimeLED : Ach0.fChargeLED + Ach3.fChargeLED >> h12","","col");
		//x
		h12->GetXaxis()->SetTitle("Summ_Charge [kl]");
		h12->GetXaxis()->CenterTitle();
		//y
		h12->GetYaxis()->SetTitle("tauLED [ns]");
		h12->GetYaxis()->CenterTitle();
183 184
		c3->Update();

Muzalevsky I.A's avatar
Muzalevsky I.A committed
185 186

		c3->Print(Form("../macros/picsDRS4/%s/tauVSCHARGE%s", foldername, ext));
187 188
	}

189 190
	if (can4) {
		TCanvas *c4 = new TCanvas("c4", "Correlation pictures: XiSquares");
191

192
		TH2F *h11 = new TH2F("h11", "Time difference between two channels vs XiSquare of edge",100, -0., 5., 100, 0., 0.005);
193
		t->Draw("Ach0.fEdgeXi : (Ach0.fTime90 - Ach0.fTime10) >> h11","","col");
194
		//t->Draw("Ach1.fEdgeXi : (Ach1.fTime90 - Ach1.fTime10) >> h11","(Ach1.fTime90 - Ach1.fTime10)>0","col");
195
		//x
196 197
		h11->GetXaxis()->SetTitle("\\Delta \\tau_{1}^{(rise)} [ns]");
		h11->GetXaxis()->CenterTitle();
198
		//y
199 200
		h11->GetYaxis()->SetTitle("fEdgeXi");
		h11->GetYaxis()->CenterTitle();
201
		c4->Update();
202
		//c4->Print(Form("../macros/picsDRS4/file%s/XiSquares%s", foldername, ext));
203 204

	}
205

206 207
	if (can5) {
		TCanvas *c5 = new TCanvas("c5", "Changing CFD parameters");
Muzalevsky I.A's avatar
Muzalevsky I.A committed
208
		c5->Divide(2,2);
209
		c5->cd(1);
210

Muzalevsky I.A's avatar
Muzalevsky I.A committed
211 212 213 214 215 216
		TH1F *h12 = new TH1F("h12", "tau_CFD triggered channel for NONcollimated data",1000, 0., 200);

		t->Draw("Ach0.fTimeCFD >> h12","Ach0.fTimeCFD>132 && Ach0.fTimeCFD<142","");
		h12->GetXaxis()->SetRangeUser(120, 150);
		h12->GetXaxis()->SetTitle("tauCFD_{0} [ns]");
		h12->GetXaxis()->CenterTitle();
217

Muzalevsky I.A's avatar
Muzalevsky I.A committed
218 219
		c5->cd(2);
		TH1F *h13 = new TH1F("h13", "tau LED triggered channel for NONcollimated data",1000, 0., 200);
220

Muzalevsky I.A's avatar
Muzalevsky I.A committed
221 222 223 224
		t->Draw("Ach0.fTimeLED >> h13","Ach0.fTimeLED>132 && Ach0.fTimeLED<142","");
		h13->GetXaxis()->SetRangeUser(120, 150);
		h13->GetXaxis()->SetTitle("tauLED_{0} [ns]");
		h13->GetXaxis()->CenterTitle();
225

Muzalevsky I.A's avatar
Muzalevsky I.A committed
226
		c5->cd(3);
227

Muzalevsky I.A's avatar
Muzalevsky I.A committed
228
		TH1F *h14 = new TH1F("h14", "tau_CFD nontriggered channel for NONcollimated data",1000	, 0., 200);
229

Muzalevsky I.A's avatar
Muzalevsky I.A committed
230 231 232 233 234 235 236
		t->Draw("Ach1.fTimeCFD >> h14","Ach1.fTimeCFD > 120 && Ach1.fTimeCFD<180","");
		h14->GetXaxis()->SetRangeUser(120, 150);
		h14->GetXaxis()->SetTitle("tauCFD_{0} [ns]");
		h14->GetXaxis()->CenterTitle();

		c5->cd(4);
		TH1F *h15 = new TH1F("h15", "tau LED nontriggered channel for NONcollimated data",1000	, 0., 200);
237

Muzalevsky I.A's avatar
Muzalevsky I.A committed
238 239 240 241
		t->Draw("Ach1.fTimeLED >> h15","Ach1.fTimeLED>120 && Ach1.fTimeLED<180","");
		h15->GetXaxis()->SetRangeUser(120, 	150);
		h15->GetXaxis()->SetTitle("tauLED_{0} [ns]");
		h15->GetXaxis()->CenterTitle();
242

243
		c5->Update();
Muzalevsky I.A's avatar
Muzalevsky I.A committed
244
		c5->Print(Form("../macros/picsDRS4/%s/NONcollimatedT%s", foldername, ext));
245
	}
246

247
	if (can6) {
Muzalevsky I.A's avatar
Muzalevsky I.A committed
248
		TCanvas *c6 = new TCanvas("c6", "Changing CFD parameters");
249 250
		c6->Divide(2,2);
		c6->cd(1);
251

Muzalevsky I.A's avatar
Muzalevsky I.A committed
252
		TH1F *h16 = new TH1F("h16", "tau_CFD triggered channel for collimated data",1000, 0., 200);
253

Muzalevsky I.A's avatar
Muzalevsky I.A committed
254 255 256 257
		t1->Draw("Ach0.fTimeCFD >> h16","Ach0.fTimeCFD>132 && Ach0.fTimeCFD<142","");
		h16->GetXaxis()->SetRangeUser(120, 150);
		h16->GetXaxis()->SetTitle("tauCFD_{0} [ns]");
		h16->GetXaxis()->CenterTitle();
258

Muzalevsky I.A's avatar
Muzalevsky I.A committed
259 260
		c6->cd(2);
		TH1F *h17 = new TH1F("h17", "tau LED triggered channel for collimated data",1000, 0., 200);
261

Muzalevsky I.A's avatar
Muzalevsky I.A committed
262 263 264 265
		t1->Draw("Ach0.fTimeLED >> h17","Ach0.fTimeLED>132 && Ach0.fTimeLED<142","");
		h17->GetXaxis()->SetRangeUser(120, 150);
		h17->GetXaxis()->SetTitle("tauLED_{0} [ns]");
		h17->GetXaxis()->CenterTitle();
266

Muzalevsky I.A's avatar
Muzalevsky I.A committed
267
		c6->cd(3);
268

Muzalevsky I.A's avatar
Muzalevsky I.A committed
269
		TH1F *h18 = new TH1F("h18", "tau_CFD nontriggered channel for collimated data",1000	, 0., 200);
270

Muzalevsky I.A's avatar
Muzalevsky I.A committed
271 272 273 274
		t1->Draw("Ach1.fTimeCFD >> h18","Ach1.fTimeCFD > 120 && Ach1.fTimeCFD<180","");
		h18->GetXaxis()->SetRangeUser(120, 150);
		h18->GetXaxis()->SetTitle("tauCFD_{0} [ns]");
		h18->GetXaxis()->CenterTitle();
275

276
		c6->cd(4);
Muzalevsky I.A's avatar
Muzalevsky I.A committed
277 278 279 280 281 282 283
		TH1F *h19 = new TH1F("h19", "tau LED nontriggered channel for collimated data",1000	, 0., 200);

		t1->Draw("Ach1.fTimeLED >> h19","Ach1.fTimeLED>120 && Ach1.fTimeLED<180","");
		h19->GetXaxis()->SetRangeUser(120, 	150);
		h19->GetXaxis()->SetTitle("tauLED_{0} [ns]");
		h19->GetXaxis()->CenterTitle();

284
		c6->Update();
Muzalevsky I.A's avatar
Muzalevsky I.A committed
285
		c6->Print(Form("../macros/picsDRS4/%s/collimatedT%s", foldername, ext));
Muzalevsky I.A's avatar
Muzalevsky I.A committed
286 287
	}

288

289
}