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 class GateMergeManager
27 GateMergeManager(bool fastMerge,int verboseLevel,bool forced,Long64_t maxRoot,string outDir){
28 m_verboseLevel = verboseLevel;
33 m_fastMerge = fastMerge;
37 for (std::vector<TFile*>::const_iterator iter=filearr.begin(); iter!=filearr.end(); iter++)
45 void StartMerging(string splitfileName);
46 void ReadSplitFile(string splitfileName);
47 bool MergeTree(string name);
48 bool MergeGate(TChain* chain);
49 bool MergeSing(TChain* chain);
50 bool MergeCoin(TChain* chain);
52 // the cleanup after succesful merging
53 void StartCleaning(string splitfileName,bool test);
55 // the merging methods
60 bool FastMergeGate(string name);
61 bool FastMergeSing(string name);
62 bool FastMergeCoin(string name);
63 bool m_forced; // if to overwrite existing files
65 std::vector<TFile*> filearr;
66 Long64_t m_maxRoot; // maximum size of root output file
67 int m_CompLevel; // compression level for root output
68 string m_outDir; // where to save the output files
69 int m_Nfiles; // number of files to mergw
70 vector<int> m_lastEvents; // latestevent from al files
71 vector<string> m_vRootFileNames; // names of root files to merge
72 TFile* m_RootTarget; // root output file
73 string m_RootTargetName; // name of target i.e. root output file
74 bool m_fastMerge; // fast merge option, corrects the eventIDs locally