testShowGraphs.cxx 2.04 KB
Newer Older
1 2 3 4 5
void testShowGraphs()
{

	gSystem->Load("../libData.so");

6
	const Long64_t kFirstEvent = 128;
7

Muzalevsky I.A's avatar
Muzalevsky I.A committed
8

9
//	TFile fr("../data/dataDSR4/Neurad_7_08_NEW.root");
10
//	TFile fr("../data/dataDSR4/analysis_07_8.root");
11
<<<<<<< HEAD
12
<<<<<<< HEAD
Kostyleva D.A's avatar
Kostyleva D.A committed
13 14 15

//	TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root");

16
//	TFile fr("../data/dataTektronix/exp18.root");
Kostyleva D.A's avatar
Kostyleva D.A committed
17

18
=======
19
=======
20
	TFile fr("../data/dataDSR4/analysis_08_2.root");
21
>>>>>>> 58f61cb195c6b08755455386b15990ce4c27b599
Muzalevsky I.A's avatar
Muzalevsky I.A committed
22
//	TFile fr("../data/dataDSR4/Neurad_081216_2NEW.root");
23
//	TFile fr("../data/dataTektronix/exp18.root");
24
>>>>>>> 09d9ad17f40ac0af9d228137f715f25ee9ea15ae
25
//	TFile fr("../data/dataTektronix/analysisExp7.root");
26
	TTree *tr = (TTree*)fr.Get("atree");
27

28
	AEvent *revent = new AEvent();
29
	cout << tr->SetBranchAddress("Ach0.",&revent) << endl;
30

31 32 33
	TGraph *gr[13];
	Double_t t10[13];
	Double_t t90[13];
34

35
//	cout << "warning" << endl;
36 37 38

	cout << tr->GetEntries() << endl;

39
	//loop over events
40
	for (Long64_t i = 0; i < 13; i++) {
41
		gr[i] = 0;
42 43
		t10[i] = 0;
		t90[i] = 0;
44
//	cout << "warning 1" << endl;
45
//		cout << i+kFirstEvent << endl;
46 47 48
		tr->GetEntry(i+kFirstEvent);
//		tr->GetEntry(i);
//	cout << "warning 2" << endl;
49
		gr[i] = new TGraph(*revent->GetGraphSignal());
50 51 52 53 54 55 56
		t10[i] = revent->GetT_10();
		t90[i] = revent->GetT_90();

//		cout << t10[i] << "\t" << t90[i] << endl;
//		cout << revent->GetEdgeSlope() << endl;


57
	}//for over events
58

59
//	cout << "warning 3" << endl;
60

61
	TCanvas *c1 = new TCanvas("c1","test",10,10,1000,600);
62
<<<<<<< HEAD
Kostyleva D.A's avatar
Kostyleva D.A committed
63

Muzalevsky I.A's avatar
Muzalevsky I.A committed
64
	//c1->Divide(3,2);
Kostyleva D.A's avatar
Kostyleva D.A committed
65

66
	c1->Divide(3,4);
Kostyleva D.A's avatar
Kostyleva D.A committed
67

68
=======
Muzalevsky I.A's avatar
Muzalevsky I.A committed
69
	//c1->Divide(3,2);
70
	c1->Divide(3,4);
71
>>>>>>> 09d9ad17f40ac0af9d228137f715f25ee9ea15ae
72

73 74 75
	TF1 *f1 = new TF1("f1name", "[0]+x*[1]");
//	TF1 *f1 = new TF1("pol1", );

76
<<<<<<< HEAD
Kostyleva D.A's avatar
Kostyleva D.A committed
77 78 79 80

	for (Int_t k = 0; k < 6; k++) {

//	for (Int_t k = 0; k < 12; k++) {
81
=======
82
	for (Int_t k = 0; k < 12; k++) {
83
>>>>>>> 09d9ad17f40ac0af9d228137f715f25ee9ea15ae
Kostyleva D.A's avatar
Kostyleva D.A committed
84

85
		c1->cd(k+1);
86 87
		gr[k]->Draw("AL*");

Muzalevsky I.A's avatar
Muzalevsky I.A committed
88 89 90
		//cout << t10[k] << "\t" << t90[k] << endl;
		//f1->SetRange(t10[k], t90[k]);
		//gr[k]->Fit(f1, "RQ");
Kostyleva D.A's avatar
Kostyleva D.A committed
91
	}
92 93 94 95

//	c1->cd(2);
//	tr->Draw("gAmp.Draw()","","goff",1,124);
}