9 TFile *fin_0 =
new TFile(
"data_amatrix/G4EICIR_DSTReader_p250_vx0_vy0_theta22mrad.root",
"OPEN" );
10 TFile *fin_a11 =
new TFile(
"data_amatrix/G4EICIR_DSTReader_p250_vx0_vy1_theta0mrad.root",
"OPEN" );
11 TFile *fin_a21 =
new TFile(
"data_amatrix/G4EICIR_DSTReader_p250_vx0_vy0_theta10mrad.root",
"OPEN" );
12 TFile *fin_a12 =
new TFile(
"data_amatrix/G4EICIR_DSTReader_p250_vx0_vy1_theta0mrad.root",
"OPEN" );
13 TFile *fin_a22 =
new TFile(
"data_amatrix/G4EICIR_DSTReader_p250_vx0_vy0_theta10mrad.root",
"OPEN" );
16 TTree *tin_0 = (TTree*)fin_0->Get(
"T");
17 TTree *tin_a11 = (TTree*)fin_a11->Get(
"T");
18 TTree *tin_a21 = (TTree*)fin_a21->Get(
"T");
19 TTree *tin_a12 = (TTree*)fin_a12->Get(
"T");
20 TTree *tin_a22 = (TTree*)fin_a22->Get(
"T");
23 float tin_a11_vy = 1.0;
24 float tin_a21_theta = 10.0;
25 float tin_a12_vy = 1.0;
26 float tin_a22_theta = 10.0;
30 tin_a11->SetBranchAddress(
"n_G4HIT_FWDDISC",&nhits);
32 cout <<
"hits: " << nhits << endl;
35 tin_0->Draw(
"0.5*(G4HIT_FWDDISC.y[][0]+G4HIT_FWDDISC.y[][1]) : 0.5*(G4HIT_FWDDISC.z[][0]+G4HIT_FWDDISC.z[][1])",
"Entry$==0",
"");
36 TGraph* g_0 =
new TGraph(nhits, &(tin_0->GetV2()[0]), &(tin_0->GetV1()[0]));
42 tin_a11->Draw(
"0.5*(G4HIT_FWDDISC.y[][0]+G4HIT_FWDDISC.y[][1]) / 1 : 0.5*(G4HIT_FWDDISC.z[][0]+G4HIT_FWDDISC.z[][1])",
"Entry$==0",
"" );
43 TGraph* g_a11 =
new TGraph(nhits, &(tin_a11->GetV2()[0]), &(tin_a11->GetV1()[0]));
44 g_a11->SetMarkerStyle(7);
45 g_a11->SetMarkerSize(1);
46 g_a11->SetMarkerColor(kRed);
52 tin_a21->Draw(
"0.5*(G4HIT_FWDDISC.y[][0]+G4HIT_FWDDISC.y[][1]) / 10 : 0.5*(G4HIT_FWDDISC.z[][0]+G4HIT_FWDDISC.z[][1])",
"Entry$==0",
"");
53 TGraph* g_a21 =
new TGraph(nhits, &(tin_a21->GetV2()[0]), &(tin_a21->GetV1()[0]));
54 g_a21->SetMarkerStyle(7);
55 g_a21->SetMarkerSize(1);
56 g_a21->SetMarkerColor(kBlue);
62 tin_a12->Draw(
"atan( abs(G4HIT_FWDDISC.y[][0]-G4HIT_FWDDISC.y[][1]) ) / 1 : 0.5*(G4HIT_FWDDISC.z[][0]+G4HIT_FWDDISC.z[][1])",
"Entry$==0",
"");
63 TGraph* g_a12 =
new TGraph(nhits, &(tin_a12->GetV2()[0]), &(tin_a12->GetV1()[0]));
64 g_a12->SetMarkerStyle(7);
65 g_a12->SetMarkerSize(1);
66 g_a12->SetMarkerColor(kGreen);
72 tin_a22->Draw(
"atan( abs(G4HIT_FWDDISC.y[][0]-G4HIT_FWDDISC.y[][1]) ) / 10 : 0.5*(G4HIT_FWDDISC.z[][0]+G4HIT_FWDDISC.z[][1])",
"Entry$==0",
"");
73 TGraph* g_a22 =
new TGraph(nhits, &(tin_a22->GetV2()[0]), &(tin_a22->GetV1()[0]));
74 g_a22->SetMarkerStyle(7);
75 g_a22->SetMarkerSize(1);
76 g_a22->SetMarkerColor(kBlue);
77 g_a22->SetMarkerColor(kOrange);
80 TLegend*
leg =
new TLegend(0.3,0.7,0.6,0.9);
81 leg->AddEntry(g_0,
"Nominal beam",
"l");
82 leg->AddEntry(g_a11,
"a11",
"p");
83 leg->AddEntry(g_a21,
"a21",
"p");
84 leg->AddEntry(g_a12,
"a12",
"p");
85 leg->AddEntry(g_a22,
"a22",
"p");
88 TH1F *
h1 =
new TH1F(
"h1",
"",10,0,15000);
89 h1->GetXaxis()->SetRangeUser(0,12000);
90 h1->GetYaxis()->SetRangeUser(-50,200);
91 h1->GetXaxis()->SetTitle(
"Z(cm)");
92 h1->GetYaxis()->SetTitle(
"a_{xx}");
95 TCanvas *c1 =
new TCanvas();
101 g_a11->Draw(
"Psame");
102 g_a21->Draw(
"Psame");
103 g_a12->Draw(
"Psame");
104 g_a22->Draw(
"Psame");
106 c1->Print(
"amatrix_new.eps");