Index: trunk/MagicSoft/Mars/macros/collarea.C
===================================================================
--- trunk/MagicSoft/Mars/macros/collarea.C	(revision 1640)
+++ 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();
+      }
 }
