Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7938)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7939)
@@ -62,4 +62,7 @@
      - changed fgLoGainOffset from 1.39 to 1.3 according to an extensive
        test in the test-database
+
+   * resources/sequences.rc:
+     - resource file how to build sequences... added.
 
 
Index: trunk/MagicSoft/Mars/resources/sequences.rc
===================================================================
--- trunk/MagicSoft/Mars/resources/sequences.rc	(revision 7939)
+++ trunk/MagicSoft/Mars/resources/sequences.rc	(revision 7939)
@@ -0,0 +1,101 @@
+##########################################################################
+#
+# Rules to build blocks which will later be broken into sequences
+#
+# Syntax:
+#
+# [keyname]
+# rule1
+# rule2
+# rule3
+#
+#
+# Colums of rule:
+# 1 2 3 4 [5 [6]]
+# 
+# 1: Run type of previous run
+# 2: Run type of run to be accepted
+# 3: Key for previous run
+# 4: key for run to be accepted
+# 5: first run to apply this rule <default=0>
+# 6: last run to apply this rule <default=max>
+#
+# Run Types:
+#  D  2
+#  P  3
+#  C  4
+#
+# The columns 1-4 can be expressed as regular expressions (ala TRegexp)
+# a ^ is prepended and a $ is appended automatically.
+#
+# A single "*" is an abbreviation for the regexp ".*" .
+#
+# A "-" is an abbreviation for "to be ignored". For example:
+#     [Test]
+#     - 4 * 1200 1300
+# would mean:
+#     ignore all keys (*) of column test for all current runs
+#     with run-type 4 if its run-number is between 1200 and 1300.
+#     The (former) third column in this case is obsolete.
+#
+# Ignore project name for calibration runs between 20100 and 45100
+
+[Transition]
+
+Project                      -  4     *    20100 45100
+L1TriggerTable               -  [^2]  *
+L2TriggerTable               -  [^2]  *
+CalibrationScript            -  [^2]  *
+DiscriminatorThresholdTable  -  [^2]  *
+HvSettings                   -  2     *    86094 86094
+TriggerDelayTable
+ObservationMode
+DiscriminatorThresholdTable
+TriggerDelayTable
+ObservationMode
+
+#########################################################################
+# The regexp section MUST be the last section. This allows
+# regular expressions to start with a [
+
+[Regexp]
+
+# Explanation:
+#
+# To build sequences a string with the run-types is evaluated.
+# A capital case D or P means: The nearest C-Run is the last C-Run
+# A lower case   d or p means: The nearest C-Run is the next C-Run
+#
+# The first expression is evaluated first. The last one last.
+# If one regexp matches the others are not evaluated anymore and
+# the sequence is build from the match.
+#
+# For details on regular expressions check 
+#     http://perldoc.perl.org/perlre.html
+#
+# The syntax is
+#   regexp [firstrun [lastrun]]
+#
+
+# Allow almost everything but require at least one run of each run-type
+[dp]*C+[PD]*(PD|DP)[DP]*                  0 32734
+[dp]*dp*C+[PD]*P[DP]*                     0 32734
+[dp]*p[dp]*C+P*D[PD]*                     0 32734
+[dp]*(dp|pd)[dp]*C+[PD]*                  0 32734
+
+# This is the "allow as much as possible" solution
+[dp]*(pC+|C+P)[PD]*D                  32735 45624
+d[dp]*(pC+|C+P)[PD]*                  32735 45624
+
+# Allow intermediate calibration and pedestal runs:
+# Since now we have  interleaved calibration events.
+[dD]*[pP]C+((([pP]|C)+[dD])|[dD])+    45625  46477
+
+# Allow intermediate pedestal runs
+#[dD]*[pP]C+(([pP]+[dD])|[dD])+       46478 53943
+[dD]*[pP]C+[pPdD]+[dD]                46478 53943
+
+# Use the minimum solution for newest date
+# Do not allow intermediate non-data runs
+[dD]*[pP]C+[dD]+                      53944
+
