35 TString path( (
char*)strstr( target->GetPath(),
":" ) );
38 TFile *first_source = (TFile*)sourcelist->First();
39 first_source->cd( path );
40 TDirectory *current_sourcedir = gDirectory;
42 Bool_t status = TH1::AddDirectoryStatus();
43 TH1::AddDirectory(kFALSE);
46 TChain *globChain = 0;
47 TIter nextkey( current_sourcedir->GetListOfKeys() );
49 while ( (
key = (TKey*)nextkey())) {
52 if (oldkey && !strcmp(oldkey->GetName(),
key->GetName()))
continue;
55 first_source->cd( path );
56 TObject *obj =
key->ReadObj();
58 TFolder* add =
dynamic_cast<TFolder*
>(obj);
59 TCollection *hh = add->GetListOfFolders();
60 TFolder* add1=
new TFolder(
key->GetName(),
key->GetTitle());
63 TFile *nextsource = (TFile*)sourcelist->After( first_source );
64 while ( nextsource ) {
66 nextsource->cd( path );
67 std::cout<<
"nextsource->Name()=="<<std::endl;
69 std::cout<<
"firstsource->Name()=="<<std::endl;
70 first_source->Print();
71 TFolder* kk=(TFolder *)nextsource->Get(
key->GetName());
72 std::cout<<
"key->GetName()=="<<
key->GetName()<<std::endl;
73 first_source->cd( path );
74 while ((obj = next())){
76 std::cout<<
"obj->getName()=="<<obj->GetName()<<std::endl;
78 nextsource->cd( path );
79 TH1 *h2 = (TH1*)kk->FindObjectAny(h1->GetName());
82 std::cout<<
"h1->GetEntries()"<<h1->GetEntries()<<std::endl;
85 nextsource = (TFile*)sourcelist->After( nextsource );
93 target->SaveSelf(kTRUE);