2 int rBin, phiBin, zBin;
6 float eff, x[400], y[400];
8 TFile*
f =
new TFile(
"effTree.root",
"read" );
9 TTree*
t = (TTree*)
f->Get(
"effTree" );
11 t->SetBranchAddress(
"rBin", &rBin );
12 t->SetBranchAddress(
"phiBin", &phiBin );
13 t->SetBranchAddress(
"zBin", &zBin );
14 t->SetBranchAddress(
"eff", &eff );
15 t->SetBranchAddress(
"x", x );
16 t->SetBranchAddress(
"y", y );
19 float efficiency[43][6][6];
20 float propTime[43][6][6][400];
21 float prob[43][6][6][400];
23 for ( Int_t i = 0; i <
nR *
nPhi *
nZ; i++ )
29 efficiency[r][phi][z] = eff;
30 for ( Int_t j = 0; j < 400; j++ )
32 propTime[r][phi][z][j] = x[j];
33 prob[r][phi][z][j] = y[j];
41 Float_t x0[400], y0[400];
44 int rPos = 400 + r0 * 10;
45 float x1[400], y1[400];
47 sprintf(
file,
"/ihepbatch/besd12/liuy/EndcapTof/OpInETof2/results/%d/timeSta_%d_%d_%d.root",
48 rPos, rPos, phi0, z0 );
50 TH1F* h1 =
new TH1F(
"h1",
"time distr.(ns)", 400, 0, 20 );
51 TFile*
f1 = TFile::Open(
file );
52 TNtuple*
n1 = (TNtuple*)
f1->Get(
"timeTuple" );
53 n1->SetBranchAddress(
"inTimePre", &t1 );
54 int nEntries = (Int_t)
n1->GetEntries();
55 cout <<
"nEntries:" << nEntries <<
"\n" << endl;
57 for (
int m = 0; m < nEntries; m++ )
62 double norm = h1->Integral();
63 eff = norm / 2000000.;
64 if ( norm != 0 ) h1->Scale( 1. / norm );
67 cout <<
"The eff is null!" << endl;
70 TAxis* xaxis = h1->GetXaxis();
71 for (
int m = 0; m < 400; m++ )
73 x1[m] = xaxis->GetBinCenter( m );
74 y1[m] = h1->GetBinContent( m );
78 for ( Int_t i = 0; i < 400; i++ )
80 x0[i] = propTime[r0][phi0][z0][i] - x1[i];
81 y0[i] = prob[r0][phi0][z0][i] - y1[i];
84 TGraph* g =
new TGraph( 400, x0, y0 );
sprintf(cut, "kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_" "pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)