gAlice now only read by AliRunDigitizer. Therefore it is just deleted in AliTRDmerge.C
[u/mrichter/AliRoot.git] / TRD / AliTRDmerge.C
index 2daa903009c39124992df007a8eda0eebe9a5e21..b1755b557c469276ad534c528feb938cdb02c03b 100644 (file)
@@ -6,9 +6,18 @@ void AliTRDmerge()
   //
   /////////////////////////////////////////////////////////////////////////
 
+  Char_t *fileSignal     = "galice_signal.root";
+  Char_t *fileBackground = "galice_background.root";
+
+  if (gAlice) {
+    printf("<AliTRDmerge> Delete the AliRun object from memory.\n");
+    delete gAlice;
+    gAlice = 0;
+  }
+
   AliRunDigitizer *manager = new AliRunDigitizer(2,1);
-  manager->SetInputStream(0,"galice_signal.root");
-  manager->SetInputStream(1,"galice_background.root");
+  manager->SetInputStream(0,fileSignal);
+  manager->SetInputStream(1,fileBackground);
 
   AliTRDdigitizer *digitizer = new AliTRDdigitizer(manager
                                                   ,"TRDdigitizer"