histCorr.C 6.15 KB
Newer Older
1 2
//#include "TCanvas.h"

3 4 5 6 7 8 9 10
void histCorr(
//		const char *filename = "analysis_07_8.root",
		const char *filename = "analysis_08_2.root",
//		const char *foldername = "7_8",
		const char *foldername = "8_2",
//		const char *ext = ".eps",
		const char *ext = ".gif",
		const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 = 1, const Bool_t can4 = 0)
11 12
{
	gSystem->Load("../libData.so");
13 14
	TFile *f = new TFile(Form("../data/dataDSR4/%s", filename));
//	TFile *f = new TFile("../data/dataDSR4/analysis_08_2.root");
15
	TTree *t = (TTree*)f->Get("atree");
16 17 18 19 20

	if (can1) {
		TCanvas *c1 = new TCanvas("c1", "Correlation pictures: delta t from CFD vs something");
		c1->Divide(2,2);

21 22 23
//		TH2F *h1 = new TH2F("h1", "Time difference between two channels vs an integral of the first channel",125, -50., 50., 125, 0., 5e-9);
		TH2F *h1 = new TH2F("h1", "Time difference between two channels vs an integral of the first channel",125, -20., 30., 125, 0., 5e-9);
		TH2F *h2 = new TH2F("h2", "Time difference between two channels vs an integral of the second channel",125, -10., 30.,125, 0e-9, 5e-9);
24 25 26 27
		TH2F *h3 = new TH2F("h3", "Time difference between two channels vs amplitude of the first channel",125, -100., 100., 125, 0., 0.5);
		TH2F *h4 = new TH2F("h4", "Time difference between two channels vs amplitude of the second channel",125, -100., 100., 125, 0., 0.5);

		c1->cd(1);
28
		t->Draw("Ach0.fChargeCFD : ( Ach0.fTimeCFD - Ach1.fTimeCFD ) >> h1","","col");
29
		//x
30
		h1->GetXaxis()->SetTitle("\\Delta \\tau_{0-1}  [ns]");
31 32 33 34
		h1->GetXaxis()->CenterTitle();
		//y
		h1->GetYaxis()->SetTitle("Q_{0} [C]");
		h1->GetYaxis()->CenterTitle();
35
		c1->Update();
36 37

		c1->cd(2);
38 39
		t->Draw("Ach1.fChargeCFD : ( Ach0.fTimeCFD - Ach1.fTimeCFD ) >> h2","Ach1.fChargeCFD>0.05e-9","col");
		h2->GetXaxis()->SetTitle("\\Delta \\tau_{0-1}  [ns]");
40 41
		h2->GetXaxis()->CenterTitle();
		//y
42
		h2->GetYaxis()->SetTitle("Q_{1} [C]");
43
		h2->GetYaxis()->CenterTitle();
44
		c1->Update();
45 46

		c1->cd(3);
47
		t->Draw("Ach0.fAmpMax: ( Ach0.fTimeCFD - Ach1.fTimeCFD ) >> h3","","col");
48
		//x
49
		h3->GetXaxis()->SetTitle("\\Delta \\tau_{0-1}  [ns]");
50 51 52 53
		h3->GetXaxis()->CenterTitle();
		//y
		h3->GetYaxis()->SetTitle("Max_ampl_{0} [V]");
		h3->GetYaxis()->CenterTitle();
54
		c1->Update();
55 56

		c1->cd(4);
57
		t->Draw("Ach1.fAmpMax: ( Ach0.fTimeCFD - Ach1.fTimeCFD ) >> h4","","col");
58
		//x
59
		h4->GetXaxis()->SetTitle("\\Delta \\tau_{0-1}  [ns]");
60 61
		h4->GetXaxis()->CenterTitle();
		//y
62
		h4->GetYaxis()->SetTitle("Max_ampl_{1} [V]");
63 64 65 66
		h4->GetYaxis()->CenterTitle();
		
		c1->Show();
		c1->Update();
67
		c1->Print(Form("../macros/picsDRS4/file%s/TimeDiffCFD%s", foldername, ext));
68 69 70 71
	}

	if (can2) {
		TCanvas *c2 = new TCanvas("c2", "Correlation pictures: Integrals and amplitudes");
72
		c2->Divide(2,2);
73 74 75 76 77

		TH2F *h5 = new TH2F("h5", "Integral of the first channel vs integral of the second channel", 300, 0., 2e-9, 300, 0., 2e-9);
		TH2F *h6 = new TH2F("h6", "Amplitude of the first channel vs amplitude of the second channel", 300, 10, 1e-10, 300, 10, 1e-10);

		c2->cd(1);
78
		t->Draw("Ach0.fChargeCFD : Ach1.fChargeCFD >> h5","","col1");
79
		//x
80
		h5->GetXaxis()->SetTitle("Q_{1} [C]");
81 82 83 84
		h5->GetXaxis()->CenterTitle();
		//y
		h5->GetYaxis()->SetTitle("Q_{0} [C]");
		h5->GetYaxis()->CenterTitle();
85
		c2->Update();
86

87 88
		c2->cd(3);
		t->Draw("Ach0.fAmpMax : Ach1.fAmpMax >> h6","","col");
89
		//x
90
		h6->GetXaxis()->SetTitle("Max_ampl_{1} [V]");
91 92 93 94 95 96
		h6->GetXaxis()->CenterTitle();
		//y
		h6->GetYaxis()->SetTitle("Max_ampl_{0} [V]");
		h6->GetYaxis()->CenterTitle();
	
		c2->Update();
97 98
		c2->Print(Form("../macros/picsDRS4/file%s/IntergAmpl%s", foldername, ext));
	//	c2->Print("../macros/picsDRS4/file7_8/IntergAmpl.eps");
99
	}
100

101 102
	if (can3) {
		TCanvas *c3 = new TCanvas("c3", "Correlation pictures: rising edge times");
103
		c3->Divide(2,2);
104 105

		TH1F *h7 = new TH1F("h7", "Time difference between 90 and 10 percent of the rising edge ampl", 100, 0, 5);
106
		TH2F *h8 = new TH2F("h8", "Time difference between 90 and 10 percent vs integral", 100, 0., 5., 100, 0., 3e-9);
107 108
//		TH2F *h9 = new TH2F("h9", "Time difference between 90 and 10: ch0 vs ch1", 100, 0., 5., 100, 0., 5.);
		TH1F *h9 = new TH1F("h9", "Delta tau", 100, -10., 30.);
109 110

		c3->cd(1);
111
//		t->Draw("Ach1.fTime90 - Ach1.fTime10 >> h7","((Ach1.fTime90-Ach1.fTime10)>=0)","col");
112
		t->Draw("Ach1.fTime90 - Ach1.fTime10 >> h7","((Ach1.fTime90-Ach1.fTime10)>=0) && (Ach1.fEdgeXi < 0.0015)","col");
113
//		t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h7","","col");
114
		//x
115
		h7->GetXaxis()->SetTitle("\\Delta \\tau_{0}^{(rise)} [ns]");
116
		h7->GetXaxis()->CenterTitle();
117
		c3->Update();
118

119
		c3->cd(3);
120
		t->Draw("  Ach1.fChargeCFD : (Ach1.fTime90 - Ach1.fTime10) >> h8","(Ach1.fTime90 - Ach1.fTime10)>0","col");
121
		//x
122
		h8->GetXaxis()->SetTitle("\\Delta \\tau_{0}^{(rise)} [ns]");
123 124 125 126
		h8->GetXaxis()->CenterTitle();
		//y
		h8->GetYaxis()->SetTitle("Q_{0} [C]");
		h8->GetYaxis()->CenterTitle();
127
		c3->Update();
128
	
129
		c3->cd(2);
130 131
//		t->Draw("  (Ach1.fTime90 - Ach1.fTime10) : (Ach1.fTime90 - Ach1.fTime10) >> h9","(Ach1.fTime90 - Ach1.fTime10)>0","col");
		t->Draw("Ach0.fTimeCFD - Ach1.fTimeCFD >> h9","Ach1.fChargeCFD>0.05e-9 && Ach1.fChargeCFD<0.5e-9","");
132
		//x
133
		h9->GetXaxis()->SetTitle("\\Delta \\tau_{0-1}  [ns]");
134
		h9->GetXaxis()->CenterTitle();
135 136
		TF1 *fGaus = new TF1("f1", "gaus", 8.5, 13.);
		h9->Fit(fGaus, "R");
137
		c3->Update();
138 139 140 141 142 143

		c3->cd(4);
		t->Draw("Ach1.fTime90 - Ach1.fTime10","((Ach1.fTime90-Ach1.fTime10)>=0)","col");
		t->SetLineColor(kRed);
		t->Draw("Ach1.fTime90 - Ach1.fTime10","((Ach1.fTime90-Ach1.fTime10)>=0) && (Ach1.fEdgeXi < 0.0005)","same");
		c3->Update();
144 145
		c3->Print(Form("../macros/picsDRS4/file%s/RisingEdge%s", foldername, ext));
	//	c3->Print("../macros/picsDRS4/file7_8/RisingEdge.eps");
146

147 148
	}

149 150
	if (can4) {
		TCanvas *c4 = new TCanvas("c4", "Correlation pictures: XiSquares");
151 152 153 154 155

		TH2F *h10 = new TH2F("h10", "Time difference between two channels vs XiSquare of edge",100, -0., 5., 100, 0., 0.005);

		t->Draw("Ach1.fEdgeXi : (Ach1.fTime90 - Ach1.fTime10) >> h10","(Ach1.fTime90 - Ach1.fTime10)>0","col");
		//x
156
		h10->GetXaxis()->SetTitle("\\Delta \\tau_{1}^{(rise)} [ns]");
157 158 159 160 161
		h10->GetXaxis()->CenterTitle();
		//y
		h10->GetYaxis()->SetTitle("fEdgeXi");
		h10->GetYaxis()->CenterTitle();
		c4->Update();
162 163 164
		c4->Print(Form("../macros/picsDRS4/file%s/XiSquares%s", foldername, ext));

	}
165

166
}