14 TFile *
f=
new TFile(
"eangle.root");
17 TTree *tree =
f->Get(strout.str().c_str());
18 double dedx[100],eangle[100], fitmean[100], fitmeanerr[100];
19 double pos_fitmean[100], pos_fitmeanerr[100], neg_fitmean[100], neg_fitmeanerr[100];
21 if(
b_trunc) tree->SetBranchAddress(
"truncgain",dedx);
22 else tree->SetBranchAddress(
"gain",dedx);
23 tree->SetBranchAddress(
"eangle",eangle);
24 tree->SetBranchAddress(
"fitmean",fitmean);
25 tree->SetBranchAddress(
"fitmeanerr",fitmeanerr);
26 tree->SetBranchAddress(
"pos_fitmean",pos_fitmean);
27 tree->SetBranchAddress(
"pos_fitmeanerr",pos_fitmeanerr);
28 tree->SetBranchAddress(
"neg_fitmean",neg_fitmean);
29 tree->SetBranchAddress(
"neg_fitmeanerr",neg_fitmeanerr);
31 cout<<
"Entries: "<<tree->GetEntries()<<endl;
38 for(
int i=0; i<100; i++){
39 if(fabs(eangle[i])<=0.04) denangle[i] = (dedx[i])*(
k_high*(eangle[i])+
b);
41 else denangle[i] = (dedx[i])*(
k_low*(eangle[i])+
b);
43 TFile *f_save =
new TFile(
"eangle_new.root",
"recreate");
44 TTree* entra =
new TTree(
"entracalib",
"entracalib");
45 entra->Branch(
"1denangle_entry", entry,
"entry[1]/I");
46 entra->Branch(
"1denangle", denangle,
"denangle[100]/D");