3 void draw_survey_sim(
int opt=0){
4 TFile * infile =
new TFile(
"geotr.root",
"READ");
5 TTree * tr = (TTree*) infile->Get(
"geotr");
7 tr->SetBranchAddress(
"nstb",&nstb);
8 tr->SetBranchAddress(
"row",&row);
9 tr->SetBranchAddress(
"col",&col);
11 const double xoff[4]={-0.3, 0.3, -0.93, 0.93};
12 const double yoff[4]={98.8, 98.8, 46.5, 46.5};
13 const double xwid[4]={5.812,5.812,3.822, 3.822};
14 const double ywid[4]={5.812,5.812,3.875, 3.875};
15 const int color[4]={2,4,6,7};
17 Double_t x,y,z,x1,y1,x2,y2;
19 TLine * cell[4][1264];
21 for(Int_t i=0; i<tr->GetEntries(); i++){
26 case 1:
case 3: x = xoff[det] - xwid[det]*(col+0.5);
break;
27 case 2:
case 4: x = xoff[det] + xwid[det]*(col+0.5);
break;
29 y = yoff[det] - ywid[det]*(row+0.5);
30 x1 = x - xwid[det]/2.0;
31 x2 = x + xwid[det]/2.0;
32 y1 = y - ywid[det]/2.0;
33 y2 = y + ywid[det]/2.0;
35 cell[0][it] =
new TLine(x1,y1,x2,y1);
36 cell[1][it] =
new TLine(x1,y2,x2,y2);
37 cell[2][it] =
new TLine(x1,y1,x1,y2);
38 cell[3][it] =
new TLine(x2,y1,x2,y2);
39 for(Int_t j=0; j<4; j++) cell[j][it]->SetLineColor(color[det]);
47 TH2D * bg =
new TH2D(
"survey",
"FMS cells survey [mm]",factor*md,-1*md,md,factor*md,-1*md,md);
48 TCanvas * survey =
new TCanvas(
"survey",
"survey",700,700);
49 gStyle->SetOptStat(0);
52 for(Int_t i=0; i<1264; i++)
for(Int_t j=0; j<4; j++) cell[j][i]->Draw();