- // Detect Pet output
- bool all_pet_output = true;
- for (uint i=0; i<args_info.input_given; i++)
- {
- const char* filename = args_info.input_arg[i];
- TFile* handle = TFile::Open(filename,"READ");
- TTree* hits = dynamic_cast<TTree*>(handle->Get("Hits"));
- TTree* singles = dynamic_cast<TTree*>(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<args_info.input_given; i++)
+ {
+ const char* filename = args_info.input_arg[i];
+ input_filenames.push_back(filename);
+ TFile* handle = TFile::Open(filename,"READ");
+ assert(handle);
+ TTree* hits = dynamic_cast<TTree*>(handle->Get("Hits"));
+ TTree* singles = dynamic_cast<TTree*>(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;
+ }