37 TString path( (
char*)strstr( target->GetPath(),
":" ) );
40 TFile *first_source = (TFile*)sourcelist->First();
41 first_source->cd( path );
42 TDirectory *current_sourcedir = gDirectory;
44 Bool_t status = TH1::AddDirectoryStatus();
45 TH1::AddDirectory(kFALSE);
48 TChain *globChain = 0;
49 TIter nextkey( current_sourcedir->GetListOfKeys() );
51 while ( (
key = (TKey*)nextkey())) {
54 if (oldkey && !strcmp(oldkey->GetName(),
key->GetName()))
continue;
57 first_source->cd( path );
58 TObject *obj =
key->ReadObj();
60 TFolder* add =
dynamic_cast<TFolder*
>(obj);
61 TCollection *hh = add->GetListOfFolders();
62 TFolder* add1=
new TFolder(
key->GetName(),
key->GetTitle());
65 TFile *nextsource = (TFile*)sourcelist->After( first_source );
66 while ( nextsource ) {
68 nextsource->cd( path );
69 std::cout<<
"nextsource->Name()=="<<std::endl;
71 std::cout<<
"firstsource->Name()=="<<std::endl;
72 first_source->Print();
73 TFolder* kk=(TFolder *)nextsource->Get(
key->GetName());
74 std::cout<<
"key->GetName()=="<<
key->GetName()<<std::endl;
75 first_source->cd( path );
76 while ((obj = next())){
78 std::cout<<
"obj->getName()=="<<obj->GetName()<<std::endl;
80 nextsource->cd( path );
81 TH1 *h2 = (TH1*)kk->FindObjectAny(h1->GetName());
84 std::cout<<
"h1->GetEntries()"<<h1->GetEntries()<<std::endl;
87 nextsource = (TFile*)sourcelist->After( nextsource );
95 target->SaveSelf(kTRUE);