BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
extract_trkindex.cxx
Go to the documentation of this file.
1#include <iostream>
2
4 TChain *chain = new TChain("infmom");
5 chain->Add("temp/*.root");
6 ofstream out;
7 TString para_file_name("dimu.txt");
8 out.open(para_file_name,ios::out);
9 long m_run, m_event, m_trk;
10 chain->SetBranchAddress("run", &m_run);
11 chain->SetBranchAddress("event", &m_event);
12 chain->SetBranchAddress("trkindex", &m_trk);
13
14 long m_num_evt = chain->GetEntries();
15 long m_scale = m_num_evt/100000;
16 if(!(m_scale%2)) m_scale --;
17 for(long i=0; i<m_num_evt; i++){
18 if(i%10000==0) cout << "i=" << i << endl;
19 if(i%m_scale!=0) continue;
20 chain->GetEntry(i);
21 out << m_run << " " << m_event << " " << m_trk << endl;
22 }
23 cout << "the scale is: " << m_scale << endl;
24 out.close();
25}
26
void extract_trkindex()