]> Creatis software - clitk.git/commitdiff
pet output detection
authorPierre Gueth <pierre.gueth@creatis.insa-lyon.fr>
Fri, 1 Feb 2013 15:39:35 +0000 (16:39 +0100)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Fri, 26 Jul 2013 06:32:31 +0000 (08:32 +0200)
tests_dav/clitkMergeRootFiles.cxx

index 4c86c57068185856f6d83fa4eecc5419e2044646..86887f0322526f58c9d12ad5561d52cccebc6efb 100644 (file)
@@ -36,18 +36,20 @@ int main(int argc, char * argv[]) {
   }
 
   // Detect Pet output
-  bool is_pet_output = true;
+  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"));
-         cout << "testing " << filename << " " << hits << endl;
+         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;
-         is_pet_output &= (hits==NULL);
+         all_pet_output &= is_pet_output;
   }
-  cout << "is_pet_output " << is_pet_output << endl;
+  cout << "all_pet_output " << all_pet_output << endl;
 
   // Merge
   TFileMerger * merger = new TFileMerger;