X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tests_dav%2FclitkMergeRootFiles.cxx;h=ac1158087fdb45b8a831d356a23eed7ffc362e49;hb=3816dd0b131a30c38733aa6db654baa008a529f6;hp=86887f0322526f58c9d12ad5561d52cccebc6efb;hpb=ffb90644ff5cdb6153e38a7499587977fc559547;p=clitk.git diff --git a/tests_dav/clitkMergeRootFiles.cxx b/tests_dav/clitkMergeRootFiles.cxx index 86887f0..ac11580 100644 --- a/tests_dav/clitkMergeRootFiles.cxx +++ b/tests_dav/clitkMergeRootFiles.cxx @@ -10,17 +10,25 @@ #include "clitkMergeRootFiles_ggo.h" #include "clitkCommon.h" +#include "GateMergeManager.hh" #include #include #include #include +#include #include #include +#include +#include +#include #include using std::endl; using std::cout; +typedef std::list Strings; + + //----------------------------------------------------------------------------- int main(int argc, char * argv[]) { @@ -35,21 +43,33 @@ int main(int argc, char * argv[]) { FATAL("Error, please provide at least two inputs files"); } - // Detect Pet output - bool all_pet_output = true; - for (uint i=0; i(handle->Get("Hits")); - TTree* singles = dynamic_cast(handle->Get("Singles")); - const bool is_pet_output = (hits!=NULL) && (singles!=NULL); - cout << "testing " << filename << " is_pet_output " << is_pet_output << endl; - handle->Close(); - delete handle; - all_pet_output &= is_pet_output; + { // Detect Pet output + bool all_pet_output = true; + Strings input_filenames; + for (uint i=0; i(handle->Get("Hits")); + TTree* singles = dynamic_cast(handle->Get("Singles")); + const bool is_pet_output = (hits!=NULL) && (singles!=NULL); + cout << "testing " << filename << " is_pet_output " << is_pet_output << endl; + handle->Close(); + delete handle; + all_pet_output &= is_pet_output; + } + cout << "all_pet_output " << all_pet_output << endl; + + if (all_pet_output) + { + GateMergeManager* manager = new GateMergeManager(args_info.fastmerge_given,args_info.verbose_arg,true,0,"."); + delete manager; + return 0; + } } - cout << "all_pet_output " << all_pet_output << endl; + // Merge TFileMerger * merger = new TFileMerger;