4 TChain *chain =
new TChain(
"infmom");
5 chain->Add(
"temp/*.root");
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);
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;
21 out << m_run <<
" " << m_event <<
" " << m_trk << endl;
23 cout <<
"the scale is: " << m_scale << endl;