15int main(
int argc,
char *argv[]){
17 cout <<
"please append a root file name and threshod numbers" << endl;
18 cout <<
"Ex. check_hist_ent.exe test.root 1000" << endl;
22 TString str_root_file(argv[1]);
23 TFile
f(str_root_file);
24 TList *l =
f.GetListOfKeys();
25 double m_min(99999), m_max(0), m_total(0), m_ave(0), m_size(0);
29 sscanf(argv[2],
"%d", &m_thres);
32 while ((obj = (TKey*)next())){
33 TString str_temp(obj->GetClassName());
34 if(str_temp.Contains(
"TTree"))
continue;
36 h = (TH1F*)
f.Get(obj->GetName());
37 m_temp = h->GetEntries();
39 if(m_temp<m_min) m_min = m_temp;
40 if(m_temp>m_max) m_max = m_temp;
41 if(m_temp<m_thres) cout << h->GetName() <<
" has entries " << m_temp <<
" less than threshod" << endl;
43 m_ave = m_total/m_size;
44 cout <<
"min: " << m_min <<
" max: " << m_max <<
" ave: " << m_ave <<
" size: " << m_size << endl;
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")