8 TChain *ch =
new TChain(
"Bhabha");
10 int runNO, evtNO, trkNO;
12 int trackId_em, trackId_ep;
13 ch->SetBranchAddress(
"p_cms_ep",&p_ep);
14 ch->SetBranchAddress(
"p_cms_em",&p_em);
15 ch->SetBranchAddress(
"run",&runNO);
16 ch->SetBranchAddress(
"rec",&evtNO);
17 ch->SetBranchAddress(
"trackId_em",&trackId_em);
18 ch->SetBranchAddress(
"trackId_ep",&trackId_ep);
19 long int len_entry = ch->GetEntries();
20 cout <<
"len_entry: " << len_entry << endl;
22 ofstream outfile(
"test.txt", ios::out);
24 cerr <<
"open error" << endl;
29 for(
long int j=0; j<len_entry; j++){
30 if(j%10000 == 0) cout <<
"j " << j << endl;
32 low_trkId = (p_ep>p_em) ? trackId_em : trackId_ep;
33 outfile << setiosflags(ios_base::left) << setw(10) << runNO
34 << setiosflags(ios_base::left) << setw(10) << evtNO
35 << setiosflags(ios_base::left) << setw(10) << low_trkId << endl;
void convert_root_to_txt()