Index: trunk/FACT++/src/DataWriteFits2.cc
===================================================================
--- trunk/FACT++/src/DataWriteFits2.cc	(revision 13007)
+++ trunk/FACT++/src/DataWriteFits2.cc	(revision 13030)
@@ -12,14 +12,14 @@
     fFile.AddColumnInt("EventNum", "uint32", "FAD board event counter");
     fFile.AddColumnInt("TriggerNum", "uint32", "FTM board trigger counter");
-    fFile.AddColumnShort("TriggerType", "uint16");
-    fFile.AddColumnInt("NumBoards", "uint32");
-    fFile.AddColumnByte(4, "Errors");
-    fFile.AddColumnInt("SoftTrig");
+    fFile.AddColumnShort("TriggerType", "uint16", "FTM board trigger type");
+    fFile.AddColumnInt("NumBoards", "uint32", "Number of connected boards");
+    fFile.AddColumnByte(4, "Errors", "Communication error counters");
+    fFile.AddColumnInt("SoftTrig", "(not yet implemented)");
     fFile.AddColumnInt(2, "UnixTimeUTC", "uint32", "Unix time seconds and microseconds");
-    fFile.AddColumnInt(NBOARDS, "BoardTime", "uint32");
+    fFile.AddColumnInt(NBOARDS, "BoardTime", "uint32", "Board internal time counter");
     fFile.AddColumnShort(NPIX, "StartCellData", "uint32", "DRS4 start cell of readout");
     fFile.AddColumnShort(NTMARK, "StartCellTimeMarker", "uint32", "DRS4 start cell of readout time marker");
-    fFile.AddColumnShort(h->NPix*h->Nroi, "Data", "int16");
-    fFile.AddColumnShort(h->NTm*realRoiTM, "TimeMarker", "int16");
+    fFile.AddColumnShort(h->NPix*h->Nroi, "Data", "int16", "Digitized data");
+    fFile.AddColumnShort(h->NTm*realRoiTM, "TimeMarker", "int16", "Digitized time marker - if available");
 
     const size_t sz = (h->NPix*h->Nroi + h->NTm*realRoiTM)*2;
@@ -46,5 +46,5 @@
     fFile.SetStr(  "TIMESYS",  "UTC",                "Time system");
     fFile.SetStr(  "TIMEUNIT", "d",                  "Time given in days w.r.t. to MJDREF");
-    fFile.SetInt(  "MJDREF",   40587,                "Store times in UNIX time (for convenience, seconds since 1970/1/1)");
+    fFile.SetInt(  "MJDREF",   40587,                "MJD to UNIX time (seconds since 1970/1/1)");
     //WriteKey("CONTACT",   PACKAGE_BUGREPORT, "Current package maintainer");
     //WriteKey("URL",       PACKAGE_URL, "Current repositiory location");
@@ -61,10 +61,10 @@
 
     const uint16_t realOffset = (h->NroiTM > h->Nroi) ?  h->NroiTM - 2*h->Nroi : 0;
-    fFile.SetInt("TMSHIFT",  realOffset,  "Shift of the start of the time marker readout wrt to data");
+    fFile.SetInt("TMSHIFT",  realOffset,  "Shift of marker readout w.r.t. to data");
 
     //FIXME should we also put the start and stop time of the received data ?
     //now the events header related variables
-    fFile.SetStr("CAMERA",   "MGeomCamFACT", "");
-    fFile.SetStr("DAQ",      "DRS4",         "");
+    fFile.SetStr("CAMERA",   "MGeomCamFACT", "MARS camera geometry class");
+    fFile.SetStr("DAQ",      "DRS4",         "Data acquisition type");
     fFile.SetInt("ADCRANGE", 2000,        "Dynamic range in mV");
     fFile.SetInt("ADC",      12,          "Resolution in bits");
@@ -242,9 +242,13 @@
     }
 
-    ostringstream str;
-    str << "fstream::write() failed for '" << fFileName << "': " << strerror(errno) << " [errno=" << errno << "]";
-    Error(str);
-
-    return false;
+    if (!fFile)
+    {
+        ostringstream str;
+        str << "fstream::write() failed for '" << fFileName << "': " << strerror(errno) << " [errno=" << errno << "]";
+        Error(str);
+        return false;
+    }
+
+    return true;
 }
 
@@ -258,11 +262,11 @@
 
     fFile.SetInt("TSTARTI",  uint32_t(floor(start.UnixDate())),
-                 "Time when first event received (integral part)");
+                 "Time when first evt received (integral part)");
     fFile.SetFloat("TSTARTF",  fmod(start.UnixDate(), 1),
-                   "Time when first event received (fractional part)");
+                   "Time when first evt received (fractional part)");
     fFile.SetInt("TSTOPI",   uint32_t(floor(stop.UnixDate())),
-                 "Time when last event received (integral part)");
+                 "Time when last evt received (integral part)");
     fFile.SetFloat("TSTOPF",   fmod(stop.UnixDate(), 1),
-                   "Time when last event received (fractional part)");
+                   "Time when last evt received (fractional part)");
     fFile.SetStr("DATE-OBS", start.Iso(),
                  "Time when first event received");
@@ -270,12 +274,12 @@
                  "Time when last event received");
 
-    fFile.SetInt("NTRG",     fTriggerCounter[0], "Number of physics triggers written");
-    fFile.SetInt("NTRGPED",  fTriggerCounter[1], "Number of pure pedestal triggers written");
-    fFile.SetInt("NTRGLPE",  fTriggerCounter[2], "Number of external light pulser triggers written");
-    fFile.SetInt("NTRGTIM",  fTriggerCounter[3], "Number of time calibration triggers written");
-    fFile.SetInt("NTRGLPI",  fTriggerCounter[4], "Number of internal light pulser triggers written");
-    fFile.SetInt("NTRGEXT1", fTriggerCounter[5], "Number of triggers from ext1 written");
-    fFile.SetInt("NTRGEXT2", fTriggerCounter[6], "Number of triggers from ext2 written");
-    fFile.SetInt("NTRGMISC", fTriggerCounter[7], "Number of triggers belonging to no other category written");
+    fFile.SetInt("NTRG",     fTriggerCounter[0], "No of physics triggers written");
+    fFile.SetInt("NTRGPED",  fTriggerCounter[1], "No of pure pedestal triggers written");
+    fFile.SetInt("NTRGLPE",  fTriggerCounter[2], "No of external light pulser triggers written");
+    fFile.SetInt("NTRGTIM",  fTriggerCounter[3], "No of time calibration triggers written");
+    fFile.SetInt("NTRGLPI",  fTriggerCounter[4], "No of internal light pulser triggers written");
+    fFile.SetInt("NTRGEXT1", fTriggerCounter[5], "No of triggers from ext1 written");
+    fFile.SetInt("NTRGEXT2", fTriggerCounter[6], "No of triggers from ext2 written");
+    fFile.SetInt("NTRGMISC", fTriggerCounter[7], "No of all other triggers");
 }
 
