2 void histCopy(
const char *nameIn,
const char *nameOut)
5 TFile* fileIn =
new TFile(nameIn,
"READ");
6 if (!fileIn->IsOpen()) {
7 cout <<
"### Can't find file" << nameIn << endl;
10 TFile* fileOut =
new TFile(nameOut,
"RECREATE");
11 if (!fileOut->IsOpen()){
12 cout <<
"### Can't open file" << nameOut << endl;
18 TIter nextkey(fileIn->GetListOfKeys());
20 while (key = (TKey*)nextkey()) {
22 char* objName = key->GetName();
23 char* clsName = key->GetClassName();
25 if (strcmp(
"TNtuple",clsName)==0) ignore =
" IGNORED";
26 if (strcmp(
"TTree" ,clsName)==0) ignore =
" IGNORED";
28 if (*ignore==0) obj = key->ReadObj();
31 cout << num <<
" obj name= " << clsName <<
"::" << objName << ignore << endl;