1 /*----------------------
2 GATE version name: gate_v...
4 Copyright (C): OpenGATE Collaboration
6 This software is distributed under the terms
7 of the GNU Lesser General Public Licence (LGPL)
8 See GATE/LICENSE.txt for further details
9 ----------------------*/
12 #ifndef GateMergeManager_h
13 #define GateMergeManager_h 1
23 typedef list<string> Strings;
25 class GateMergeManager
29 GateMergeManager(bool fastMerge,int verboseLevel,bool forced,Long64_t maxRoot,string outDir){
30 m_verboseLevel = verboseLevel;
35 m_fastMerge = fastMerge;
39 for (std::vector<TFile*>::const_iterator iter=filearr.begin(); iter!=filearr.end(); iter++)
47 void StartMerging(string splitfileName);
48 void StartMergingFromFilenames(Strings filenames, string outputfile);
49 void ReadSplitFile(string splitfileName);
50 bool MergeTree(string name);
51 bool MergeGate(TChain* chain);
52 bool MergeSing(TChain* chain);
53 bool MergeCoin(TChain* chain);
55 // the cleanup after succesful merging
56 void StartCleaning(string splitfileName,bool test);
58 // the merging methods
63 bool FastMergeGate(string name);
64 bool FastMergeSing(string name);
65 bool FastMergeCoin(string name);
66 bool m_forced; // if to overwrite existing files
68 std::vector<TFile*> filearr;
69 Long64_t m_maxRoot; // maximum size of root output file
70 int m_CompLevel; // compression level for root output
71 string m_outDir; // where to save the output files
72 int m_Nfiles; // number of files to mergw
73 vector<int> m_lastEvents; // latestevent from al files
74 vector<string> m_vRootFileNames; // names of root files to merge
75 TFile* m_RootTarget; // root output file
76 string m_RootTargetName; // name of target i.e. root output file
77 bool m_fastMerge; // fast merge option, corrects the eventIDs locally