Index: trunk/MagicSoft/Mars/datacenter/db/magicdefs.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/magicdefs.php	(revision 9192)
+++ trunk/MagicSoft/Mars/datacenter/db/magicdefs.php	(revision 9194)
@@ -74,4 +74,5 @@
      "fManuallyChangedName"              => CheckWhere("fManuallyChangedKEY",              $_GET),
      "fObservationModeName"              => CheckWhere("fObservationModeKEY",              $_GET),
+     "fSumTriggerFlagName"               => CheckWhere("fSumTriggerFlagKEY",               $_GET),
      "fDiscriminatorThresholdTableName"  => CheckWhere("fDiscriminatorThresholdTableKEY",  $_GET),
      "fTriggerDelayTableName"            => CheckWhere("fTriggerDelayTableKEY",            $_GET),
@@ -100,4 +101,5 @@
      "fManuallyChangedName"              => CheckGroup("fManuallyChangedKEY",              $_GET),
      "fObservationModeName"              => CheckGroup("fObservationModeKEY",              $_GET),
+     "fSumTriggerFlagName"               => CheckGroup("fSumTriggerFlagKEY",              $_GET),
      "fDiscriminatorThresholdTableName"  => CheckGroup("fDiscriminatorThresholdTableKEY",  $_GET),
      "fTriggerDelayTableName"            => CheckGroup("fTriggerDelayTableKEY",            $_GET),
@@ -167,4 +169,5 @@
      "fManuallyChangedName"             => "Manually<br>Changed",
      "fObservationModeName"             => "Obs.<br>Mode",
+     "fSumTriggerFlagName"              => "SumTrigger<br>Flag",
      "fLastUpdate"                      => "LastUpd",
      "fSequenceFirst"                   => "Sequ",
@@ -483,4 +486,5 @@
          "fManuallyChangedName"              => $fromtable . ".fManuallyChangedKEY",
          "fObservationModeName"              => $fromtable . ".fObservationModeKEY",
+         "fSumTriggerFlagName"               => $fromtable . ".fSumTriggerFlagKEY",
          "fDiscriminatorThresholdTableName"  => $fromtable . ".fDiscriminatorThresholdTableKEY",
          "fTriggerDelayTableName"            => $fromtable . ".fTriggerDelayTableKEY",
@@ -538,4 +542,5 @@
          "fManuallyChangedName"              => "ManuallyChanged.fManuallyChangedName",
          "fObservationModeName"              => "ObservationMode.fObservationModeName",
+         "fSumTriggerFlagName"               => "SumTriggerFlag.fSumTriggerFlagName",
          "fTriggerDelayTableName"            => "TriggerDelayTable.fTriggerDelayTableName",
          "fDiscriminatorThresholdTableName"  => "DiscriminatorThresholdTable.fDiscriminatorThesholdTableName",
@@ -703,4 +708,5 @@
          "fManuallyChangedName"             => " LEFT JOIN ManuallyChanged             USING(fManuallyChangedKEY) ",
          "fObservationModeName"             => " LEFT JOIN ObservationMode             USING(fObservationModeKEY) ",
+         "fSumTriggerFlagName"              => " LEFT JOIN SumTriggerFlag              USING(fSumTriggerFlagKEY) ",
          "fDiscriminatorThresholdTableName" => " LEFT JOIN DiscriminatorThresholdTable USING(fDiscriminatorThresholdTableKEY) ",
          "fTriggerDelayTableName"           => " LEFT JOIN TriggerDelayTable           USING(fTriggerDelayTableKEY) ",
Index: trunk/MagicSoft/Mars/datacenter/db/menu.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/menu.php	(revision 9192)
+++ trunk/MagicSoft/Mars/datacenter/db/menu.php	(revision 9194)
@@ -93,4 +93,7 @@
     printf("  </td><td>\n");
     PrintPullDown($host, $user, $pw, $db, "ObservationMode",   "fObservationModeName", "fObservationModeKEY", "Obs. Mode");
+    printf("  </td><td>\n");
+    printf("  </td><td>\n");
+    PrintPullDown($host, $user, $pw, $db, "SumTriggerFlag",   "fSumTriggerFlagName", "fSumTriggerFlagKEY", "SumTrigger Flag");
     printf(" </td></tr></table>\n");
     printf(" </div><p>\n");
@@ -155,4 +158,8 @@
     printf("  </td><td>\n");
     PrintPullDown($host, $user, $pw, $db, "TriggerDelayTable",           "fTriggerDelayTableName",           "fTriggerDelayTableKEY",           "Trigger Delay Table");
+    printf("  </td></tr><tr><td>\n");
+    printf("  </td><td>\n");
+    printf("  </td><td>\n");
+    PrintPullDown($host, $user, $pw, $db, "SumTriggerFlag",              "fSumTriggerFlag",                  "fSumTriggerFlagKEY",              "SumTrigger Flag");
 //    printf("  </td><td>\n");
 //    PrintPullDown($host, $user, $pw, $db, "ManuallyChanged",             "fManuallyChangedName",             "fManuallyChangedKEY",             "Manually changed");
@@ -731,4 +738,7 @@
         $_GET["fObservationModeName"]="Off";
 
+    if (empty($_GET["fSumTriggerFlagName"]))
+        $_GET["fSumTriggerFlagName"]="Off";
+
     if (empty($_GET["fMeanTriggerRate"]))
         $_GET["fMeanTriggerRate"]="Off";
@@ -995,4 +1005,7 @@
         $_GET["fObservationModeName"]="Off";
 
+    if (empty($_GET["fSumTriggerFlagName"]))
+        $_GET["fSumTriggerFlagName"]="Off";
+
 //    if (empty($_GET["fManuallyChangedName"]))
 //        $_GET["fManuallyChangedName"]="Off";
Index: trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C	(revision 9192)
+++ trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C	(revision 9194)
@@ -41,5 +41,5 @@
 //   060330-0, 060401-0, 060808-0
 //   070416-0,
-//   080220-0, 080519-0, 080912-0
+//   080220-0, 080519-0, 080912-0, 081204-0
 //
 // Usage:
@@ -123,5 +123,6 @@
         version!=200603300 && version!=200604010 && version!=200608080 &&
         version!=200704160 &&
-        version!=200802200 && version!=200805190 && version!=200809120)
+        version!=200802200 && version!=200805190 && version!=200809120 &&
+        version!=200812040)
     {
         cout << filename << ": File Version unknown - please update the macro!" << endl;
@@ -537,5 +538,25 @@
                 strng.ReadToDelim(fin, ' ');
             }
+            if (version<=200809120)
+                strng.ReadToDelim(fin, '\n');
+            else
+                strng.ReadToDelim(fin, ' ');
+        }
+
+        Int_t sumtriggerflagkey=1;
+        if (version>=200812040)
+        {
+            // ========= Col 52: SumTrigger flag =========
             strng.ReadToDelim(fin, '\n');
+            if (strng.Contains("???"))
+                strng="n/a";
+
+            sumtriggerflagkey = serv.QueryKeyOfName("SumTriggerFlag", strng);
+            if (sumtriggerflagkey<0)
+            {
+                strng.ReadLine(fin);
+                continue;
+            }
+
         }
 
@@ -545,5 +566,5 @@
         // ================================================================
 
-        //assemlbe the query that is needed to insert the values of this run
+        //assemble the query that is needed to insert the values of this run
         TString query;
         query += Form("fTelescopeNumber=%d, ", telnumber);
@@ -555,14 +576,15 @@
         query += Form("fNumEvents=%d, ",       evtno);
         query += Form("fRunStart=\"%s %s\", ", startdate.Data(), starttime.Data());
-        query += Form("fRunStop=\"%s %s\", ", stopdate.Data(), stoptime.Data());
-        query += Form("fL1TriggerTableKEY=%d, ", l1triggerkey);
-        query += Form("fL2TriggerTableKEY=%d, ", l2triggerkey);
-        query += Form("fTestFlagKEY=%d, ", testflagkey);
+        query += Form("fRunStop=\"%s %s\", ",  stopdate.Data(),  stoptime.Data());
+        query += Form("fL1TriggerTableKEY=%d, ",    l1triggerkey);
+        query += Form("fL2TriggerTableKEY=%d, ",    l2triggerkey);
+        query += Form("fTestFlagKEY=%d, ",          testflagkey);
         query += Form("fCalibrationScriptKEY=%d, ", calibrationscriptkey);
         query += Form("fTriggerDelayTableKEY=%d, ", triggerdelaytablekey);
         query += Form("fDiscriminatorThresholdTableKEY=%d, ", dttablekey);
-        query += Form("fLightConditionsKEY=%d, ", lightcondkey);
-        query += Form("fHvSettingsKEY=%d, ", hvkey);
-        query += Form("fObservationModeKEY=%d, ", observationmodekey);
+        query += Form("fLightConditionsKEY=%d, ",   lightcondkey);
+        query += Form("fHvSettingsKEY=%d, ",        hvkey);
+        query += Form("fObservationModeKEY=%d, ",   observationmodekey);
+        query += Form("fSumTriggerFlagKEY=%d, ",    sumtriggerflagkey);
         if (!TMath::IsNaN(zd) && TMath::Finite(zd))
             query += Form("fZenithDistance=%d, ", TMath::Nint(zd));
