14 cout <<
"cannot read input file correctly!" << endl;
17 TString rootfilename(
"begin");
20 for(
int j=0; j<1000; j++){
21 h[j] =
new TH1F(Form(
"h%d",j),
"h", 3000, 0, 1000);
22 hx[j] =
new TH1F(Form(
"hx%d",j),
"hx", 100000, 0, 100000);
25 while(rootfilename!=
""){
26 input_file >> rootfilename;
27 if(
m_debug) cout << rootfilename << endl;
29 cout << rootfilename << endl;
32 if(rootfilename==
"")
continue;
33 TFile *
f =
new TFile(rootfilename);
35 TTree *
t =
f->Get(
"n103");
38 t->SetBranchAddress(
"runNO", &runno);
39 t->SetBranchAddress(
"dEdx_meas", &dedx);
40 t->SetBranchAddress(
"costheta", &
costheta);
41 for(
int i=0; i<
t->GetEntries(); i++){
52 x[k] = hx[k]->GetMean();
53 xerr[k] = hx[k]->GetRMS();
54 y[k] = h[k]->GetMean();
55 yerr[k] = h[k]->GetMeanError();
56 m_ave_err +=
yerr[k]/
y[k];