34 {
35
36
37 TString path( (char*)strstr( target->GetPath(), ":" ) );
38 path.Remove( 0, 2 );
39
40 TFile *first_source = (TFile*)sourcelist->First();
41 first_source->cd( path );
42 TDirectory *current_sourcedir = gDirectory;
43
44 Bool_t status = TH1::AddDirectoryStatus();
45 TH1::AddDirectory(kFALSE);
46
47
48 TChain *globChain = 0;
49 TIter nextkey( current_sourcedir->GetListOfKeys() );
51 while ( (
key = (TKey*)nextkey())) {
52
53
54 if (oldkey && !strcmp(oldkey->GetName(),
key->GetName()))
continue;
55
56
57 first_source->cd( path );
58 TObject *obj =
key->ReadObj();
59
60 TFolder* add = dynamic_cast<TFolder*>(obj);
61 TCollection *hh = add->GetListOfFolders();
62 TFolder* add1=
new TFolder(
key->GetName(),
key->GetTitle());
63
64
65 TFile *nextsource = (TFile*)sourcelist->After( first_source );
66 while ( nextsource ) {
68 nextsource->cd( path );
69 std::cout<<"nextsource->Name()=="<<std::endl;
70 nextsource->Print();
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())){
77 TH1 *h1 = (TH1*)obj;
78 std::cout<<"obj->getName()=="<<obj->GetName()<<std::endl;
79 add1->Add(h1);
80 nextsource->cd( path );
81 TH1 *h2 = (TH1*)kk->FindObjectAny(h1->GetName());
82 if(h2){
83 h1->Add( h2 );
84 std::cout<<"h1->GetEntries()"<<h1->GetEntries()<<std::endl;
85 }
86 }
87 nextsource = (TFile*)sourcelist->After( nextsource );
88 }
89 target->cd();
90
91 add1->Write();
92 delete add1;
93 delete hh;
94}
95 target->SaveSelf(kTRUE);
96}
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key