1 #ifndef ALIFILEMERGER_H
2 #define ALIFILEMERGER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 //////////////////////////////////////////////////////////////////////////
11 // Utilities for file merging
13 //////////////////////////////////////////////////////////////////////////
19 class AliFileMerger : public TNamed
24 AliFileMerger(const char* name);
25 void Merge(TFile* fileIn, TObjArray * array);
27 void IterTXT( const char * fileList, const char* outputFileName,Bool_t dontOverwrite=kFALSE);
28 void IterAlien(const char* outputDir, const char* outputFileName = "CalibObjects.root" , const char* pattern = "AliESDfriends_v1.root", Bool_t dontOverwrite=kFALSE);
29 void IterList(const TList* namesList, const char* outputFileName, Bool_t dontOverwrite=kFALSE);
31 void StoreResults(TObjArray * array, const char* outputFileName);
32 void StoreSeparateResults(TObjArray * array, const char* outputFileName);
34 Bool_t IsAccepted(TString name);
35 void AddReject(const char *reject);
36 void AddAccept(const char *accept);
37 void SetNoTrees(Bool_t v=kTRUE) {fNoTrees = v;}
38 Bool_t IsNoTrees() const {return fNoTrees;}
39 void SetMaxFilesOpen(Int_t n) {fMaxFilesOpen = n<3 ? 3 : n;}
40 Int_t GetMaxFilesOpen() const {return fMaxFilesOpen;}
42 int AddFile(TList* sourcelist, std::string entry);
43 int MergeRootfile( TDirectory *target, TList *sourceNames);
44 int OpenNextChunks(const TList* namesList, TList* filesList, Int_t from, Int_t to);
46 TObjArray * fRejectMask; // mask of the objects to be rejected
47 TObjArray * fAcceptMask; // mask of the objects to be accepted
48 Int_t fMaxFilesOpen; // max number of open files
49 Bool_t fNoTrees; // do we merge trees
51 AliFileMerger(const AliFileMerger&);
52 AliFileMerger& operator=(const AliFileMerger& other);
54 ClassDef(AliFileMerger, 2); // File merger utilities for AliRoot