write only the complement in the case of hybrid tracks
[u/mrichter/AliRoot.git] / ANALYSIS / AliFileMerger.cxx
index d46e4e8..041400f 100644 (file)
@@ -78,7 +78,7 @@ AliFileMerger::AliFileMerger():
   TNamed(),
   fRejectMask(0),
   fAcceptMask(0),
-  fMaxFilesOpen(500),
+  fMaxFilesOpen(800),
   fNoTrees(kFALSE)
 {
   //
@@ -92,7 +92,7 @@ AliFileMerger::AliFileMerger(const char* name):
   TNamed(name,name),
   fRejectMask(0),
   fAcceptMask(0),
-  fMaxFilesOpen(500),
+  fMaxFilesOpen(800),
   fNoTrees(kFALSE)
 {
   //
@@ -436,7 +436,11 @@ int AliFileMerger::MergeRootfile( TDirectory *target, TList *sourcelist)
       //current_sourcedir->cd();
 
       TObject *obj = key->ReadObj();
-      
+      if (!obj) {
+       AliError(Form("Failed to get the object with key %s from %s",key->GetName(),current_sourcedir->GetFile()->GetName()));
+       continue;
+      }
+
       if ( obj->IsA()->InheritsFrom( TTree::Class() ) ) {
        
        // loop over all source files create a chain of Trees "globChain"
@@ -499,6 +503,13 @@ int AliFileMerger::MergeRootfile( TDirectory *target, TList *sourcelist)
            TKey *key2 = (TKey*)gDirectory->GetListOfKeys()->FindObject(key->GetName());
            if (key2) {
              TObject *hobj = key2->ReadObj();
+             if (!hobj) {
+               cout << "Failed to get the object with key " << key2->GetName() << " from " << 
+                 ndir->GetFile()->GetName() << "/" << ndir->GetName() << endl;
+               nextsource = (TFile*)sourcelist->After( nextsource );
+               continue;
+             }
+             //
              hobj->ResetBit(kMustCleanup);
              listH.Add(hobj);
              Int_t error = 0;