26int main(
int argc,
char *argv[]){
28 cout <<
"please append two root files' names you want to compare " << endl;
39 TH1F *h1 =
new TH1F(
"h1",
"h1",100000,-100000,100000);
40 TH1F *h2 =
new TH1F(
"h2",
"h2",100000,-100000,100000);
46 TObjArray *l_b1 = t1->GetListOfBranches();
47 TObjArray *l_b2 = t1->GetListOfBranches();
48 if(l_b1->GetSize() != l_b2->GetSize()){
49 cout <<
"tree " <<
str_name_list[i] <<
" is different" << endl;
53 for(
int j=0; j<l_b1->GetEntries(); j++){
55 t1->Project(
"h1", l_b1->At(j)->GetName());
56 t2->Project(
"h2", l_b2->At(j)->GetName());
57 if(h1->GetMean() - h2->GetMean()){
58 cout <<
"tree " <<
str_name_list[i] <<
" is different" << endl;
64 else cout <<
"tree " <<
str_name_list[i] <<
" is same" << endl;