36 if(
gSystem->AccessPathName(
"hsimple1.root")) {
37 gSystem->CopyFile(
"hsimple.root",
"hsimple1.root");
38 gSystem->CopyFile(
"hsimple.root",
"hsimple2.root");
48 FileList =
new TList();
52 MergeRootfile( Target, FileList );
63 first_source->
cd( path );
73 while ( (key = (
TKey*)nextkey())) {
79 first_source->
cd( path );
91 while ( nextsource ) {
94 nextsource->
cd( path );
102 nextsource = (
TFile*)sourcelist->
After( nextsource );
108 const char* obj_name= obj->
GetName();
110 globChain =
new TChain(obj_name);
115 while ( nextsource ) {
118 nextsource = (
TFile*)sourcelist->
After( nextsource );
124 cout <<
"Found subdirectory " << obj->
GetName() << endl;
133 MergeRootfile( newdir, sourcelist );
138 cout <<
"Unknown object type, name: "
bool Bool_t
Boolean (0=false, 1=true) (bool).
A chain is a collection of files containing TTree objects.
virtual Long64_t Merge(const char *name, Option_t *option="")
Merge all the entries in the chain into a new tree in a new file.
virtual Int_t Add(TChain *chain)
Add all files referenced by the passed chain to this chain.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Bool_t cd() override
Change current directory to "this" directory.
Describe directory structure in memory.
virtual const char * GetPath() const
Returns the full path of the directory.
virtual TFile * GetFile() const
virtual Bool_t cd()
Change current directory to "this" directory.
virtual void SaveSelf(Bool_t=kFALSE)
virtual TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE)
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
virtual TList * GetListOfKeys() const
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
TH1 is the base class of all histogram classes in ROOT.
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
static Bool_t AddDirectoryStatus()
Check whether TH1-derived classes should register themselves to the current gDirectory.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual TObject * ReadObj()
To read a TObject* from the file.
TObject * After(const TObject *obj) const override
Returns the object after object obj.
void Add(TObject *obj) override
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual const char * GetTitle() const
Returns title of object.
virtual TClass * IsA() const