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

3
void histCorr(const Bool_t can1 = 1, const Bool_t can2 = 1, const Bool_t can3 = 1)
4 5
{
	gSystem->Load("../libData.so");
6 7
//	TFile *f = new TFile("../data/dataDSR4/analysis_07_8.root");
	TFile *f = new TFile("../data/dataDSR4/analysis_08_2.root");
8
	TTree *t = (TTree*)f->Get("atree");
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

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

		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 *h2 = new TH2F("h2", "Time difference between two channels vs an integral of the second channel",125, -50., 50.,125, 0e-9, 5e-9);
		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);
		t->Draw("Ach0.fChargeCFD : ( Ach0.fTimeCFD - Ach2.fTimeCFD ) >> h1","","col");
		//x
		h1->GetXaxis()->SetTitle("\\Delta \\tau_{0-2}  [ns]");
		h1->GetXaxis()->CenterTitle();
		//y
		h1->GetYaxis()->SetTitle("Q_{0} [C]");
		h1->GetYaxis()->CenterTitle();
27
		c1->Update();
28 29 30 31 32 33 34 35

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

		c1->cd(3);
		t->Draw("Ach0.fAmpMax: ( Ach0.fTimeCFD - Ach2.fTimeCFD ) >> h3","","col");
		//x
		h3->GetXaxis()->SetTitle("\\Delta \\tau_{0-2}  [ns]");
		h3->GetXaxis()->CenterTitle();
		//y
		h3->GetYaxis()->SetTitle("Max_ampl_{0} [V]");
		h3->GetYaxis()->CenterTitle();
46
		c1->Update();
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75

		c1->cd(4);
		t->Draw("Ach2.fAmpMax: ( Ach0.fTimeCFD - Ach2.fTimeCFD ) >> h4","","col");
		//x
		h4->GetXaxis()->SetTitle("\\Delta \\tau_{0-2}  [ns]");
		h4->GetXaxis()->CenterTitle();
		//y
		h4->GetYaxis()->SetTitle("Max_ampl_{2} [V]");
		h4->GetYaxis()->CenterTitle();
		
		c1->Show();
		c1->Update();
	}

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

		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);
		t->Draw("Ach0.fChargeCFD : Ach2.fChargeCFD >> h5","","col");
		//x
		h5->GetXaxis()->SetTitle("Q_{2} [C]");
		h5->GetXaxis()->CenterTitle();
		//y
		h5->GetYaxis()->SetTitle("Q_{0} [C]");
		h5->GetYaxis()->CenterTitle();
76
		c2->Update();
77 78 79 80 81 82 83 84 85 86 87 88

		c2->cd(2);
		t->Draw("Ach0.fAmpMax : Ach2.fAmpMax >> h6","","col");
		//x
		h6->GetXaxis()->SetTitle("Max_ampl_{2} [V]");
		h6->GetXaxis()->CenterTitle();
		//y
		h6->GetYaxis()->SetTitle("Max_ampl_{0} [V]");
		h6->GetYaxis()->CenterTitle();
	
		c2->Update();
	}
89

90 91
	if (can3) {
		TCanvas *c3 = new TCanvas("c3", "Correlation pictures: rising edge times");
92
		c3->Divide(2,2);
93 94

		TH1F *h7 = new TH1F("h7", "Time difference between 90 and 10 percent of the rising edge ampl", 100, 0, 5);
95
		TH2F *h8 = new TH2F("h8", "Time difference between 90 and 10 percent vs integral", 100, 0., 5., 100, 0., 3e-9);
96
		TH2F *h9 = new TH2F("h9", "Time difference between 90 and 10: ch0 vs ch1", 100, 0., 5., 100, 0., 5.);
97 98

		c3->cd(1);
99
		t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h7","(Ach0.fTime90-Ach0.fTime10)>=0","col");
100
//		t->Draw("Ach0.fTime90 - Ach0.fTime10 >> h7","","col");
101
		//x
102
		h7->GetXaxis()->SetTitle("\\Delta \\tau_{0}^{(rise)} [ns]");
103
		h7->GetXaxis()->CenterTitle();
104
		c3->Update();
105

106 107
		c3->cd(3);
		t->Draw("  Ach0.fChargeCFD : (Ach0.fTime90 - Ach0.fTime10) >> h8","(Ach0.fTime90 - Ach0.fTime10)>0","col");
108
		//x
109
		h8->GetXaxis()->SetTitle("\\Delta \\tau_{0}^{(rise)} [ns]");
110 111 112 113
		h8->GetXaxis()->CenterTitle();
		//y
		h8->GetYaxis()->SetTitle("Q_{0} [C]");
		h8->GetYaxis()->CenterTitle();
114
		c3->Update();
115
	
116 117 118 119 120 121 122 123
		c3->cd(2);
		t->Draw("  (Ach1.fTime90 - Ach1.fTime10) : (Ach0.fTime90 - Ach0.fTime10) >> h9","(Ach0.fTime90 - Ach0.fTime10)>0","col");
		//x
		h9->GetXaxis()->SetTitle("\\Delta \\tau_{0}^{(rise)} [ns]");
		h9->GetXaxis()->CenterTitle();
		//y
		h9->GetYaxis()->SetTitle("\\Delta \\tau_{1}^{(rise)} [ns]");
		h9->GetYaxis()->CenterTitle();
124 125 126
		c3->Update();
	}

127
}