Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1644)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1645)
@@ -1,3 +1,7 @@
                                                                   -*-*- END -*-*-
+ 2002/11/19: Abelardo Moralejo
+   * macros/collarea.C:
+     - Added 2nd argument to write an output file containing the 
+       collection area histogram.
 
  2002/11/18: Abelardo Moralejo
Index: /trunk/MagicSoft/Mars/macros/collarea.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/collarea.C	(revision 1644)
+++ /trunk/MagicSoft/Mars/macros/collarea.C	(revision 1645)
@@ -23,5 +23,6 @@
 \* ======================================================================== */
 
-void collarea(char *filename = "data/camera.root")
+
+void collarea(char *filename = "data/camera.root", char *outname = "")
 { 
     //
@@ -62,6 +63,17 @@
     //
     // Now the histogram we wanted to get out of the data is
-    // filled and can be displayd
+    // filled and can be displayed
     //
     parlist.FindObject("MHMcCollectionArea")->DrawClone();
+
+
+    // Write histogram to a file in case an output filename has been supplied:
+
+    TFile* f = new TFile(outname,"recreate");
+    if (f)
+      {
+	TH1D* hc = ((MHMcCollectionArea*)parlist.FindObject("MHMcCollectionArea"))->GetHist();
+	hc->Write();
+	f.Close();
+      }
 }
