Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5620)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5621)
@@ -20,4 +20,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/12/17: Markus Gaug
+
+   * mcalib/MCalibColorSet.cc:
+     - added missing runs where run number does not appear any more in 
+       project-name and is not yet set in the digital modules.
+
 
  2004/12/17: Thomas Bretz
Index: trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc	(revision 5620)
+++ trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc	(revision 5621)
@@ -56,4 +56,5 @@
 const Int_t MCalibColorSet::gkIFAEBoxInaugurationRun = 20113;
 const Int_t MCalibColorSet::gkMCRunLimit             = 1000;
+const UInt_t MCalibColorSet::gkFirstRunWithFinalBits = 45626;
 // --------------------------------------------------------------------------
 //
@@ -123,8 +124,13 @@
     }
   
+  if (header->GetRunNumber() > gkFirstRunWithFinalBits)
+    return kTRUE;
+
   //
   // Consider the case that a pedestal run is interleaved in the calibration run sequence ... prepare
   // to skip this run.
   //
+  const UShort_t runtype = header->GetRunType();
+
   if (header->GetRunType() == MRawRunHeader::kRTPedestal)
     {
@@ -208,5 +214,24 @@
     case 44768:
     case 44976:
+    case 45249:
+    case 45253:
+    case 45262:
+    case 45274:
+    case 45275:
+    case 45276:
+    case 45365:
+    case 45366:
+    case 45367:
     case 45368:
+    case 45369:
+    case 45370:
+    case 45371:
+    case 45382:
+    case 45401:
+    case 45419:
+    case 45432:
+    case 45471:
+    case 45485:
+    case 45489:
       //    case 31756:
       color = kBLUE;
@@ -214,4 +239,8 @@
       
     case 30090:
+    case 31745:
+    case 31746:
+    case 31747:
+    case 31748:
     case 20660:
     case 20661:
@@ -221,5 +250,35 @@
     case 26568:
     case 26924:
+    case 45227:
+    case 45241:
+    case 45250:
+    case 45254:
+    case 45263:
+    case 45372:
+    case 45373:
       color = kGREEN;
+      break;
+      
+    case 45216:
+    case 45218:
+    case 45226:
+    case 45240:
+    case 45251:
+    case 45278:
+    case 45336:
+    case 45341:
+    case 45358:
+    case 45374:
+    case 45375:
+    case 45376:
+    case 45377:
+    case 45381:
+    case 45400:
+    case 45418:
+    case 45431:
+    case 45470:
+    case 45484:
+    case 45490:
+      color = kUV;
       break;
       
@@ -227,4 +286,11 @@
       *fLog << err << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! " << endl;
       return kFALSE;
+      break;
+      
+    case 45219:
+      *fLog << err << "Sorry, run 45219 was taken with a combination of colours used to flat-field ";
+      *fLog << err << "the camera. It cannot be used for the standard calibration " << endl;
+      return kFALSE;
+      break;
     }
   
@@ -252,111 +318,138 @@
     {
 
-      const TString proj = header->GetProjectName();
-      
+      TString proj = header->GetProjectName();
+      proj.ToLower();
+
       // Possible green combinations
-      TRegexp gre0("0.1[lL]?[eE]?[dD]?[sS]?[gG][rR][eE][eE]");
+      TRegexp gre0("0.1led[sS]?[gG][rR][eE][eE]");
       if (proj.Contains(gre0))
         { fPattern |= k01LedGreen; color = kGREEN;    }
-      TRegexp gre1("1[lL]?[eE]?[dD]?[sS]?[gG][rR][eE][eE]");
+      TRegexp gre1("1led[sS]?[gG][rR][eE][eE]");
       if (proj.Contains(gre1))
         { fPattern |= k1LedGreen; color = kGREEN;    }
-      TRegexp gre2("[2][lL]?[eE]?[dD]?[sS]?[gG][rR][eE][eE]");
+      TRegexp gre2("2led[sS]?[gG][rR][eE][eE]");
       if (proj.Contains(gre2))
         { fPattern |= k2LedGreen; color = kGREEN;    }
-      TRegexp gre3("[3][lL]?[eE]?[dD]?[sS]?[gG][rR][eE][eE]");
+      TRegexp gre3("3led[sS]?[gG][rR][eE][eE]");
       if (proj.Contains(gre3))
         { fPattern |= k3LedGreen; color = kGREEN;    }
-      TRegexp gre5("[5][lL]?[eE]?[dD]?[sS]?[gG][rR][eE][eE]");
+      TRegexp gre5("5led[sS]?[gG][rR][eE][eE]");
       if (proj.Contains(gre5))
         { fPattern |= k5LedGreen; color = kGREEN;    }
-      TRegexp gre6("[6][lL]?[eE]?[dD]?[sS]?[gG][rR][eE][eE]");
+      TRegexp gre6("6led[sS]?[gG][rR][eE][eE]");
       if (proj.Contains(gre6))
         { fPattern |= k6LedGreen; color = kGREEN;    }
-      TRegexp gre7("[7][lL]?[eE]?[dD]?[sS]?[gG][rR][eE][eE]");
+      TRegexp gre7("7led[sS]?[gG][rR][eE][eE]");
       if (proj.Contains(gre7))
         { fPattern |= k7LedGreen; color = kGREEN;    }
-      TRegexp gre8("[8][lL]?[eE]?[dD]?[sS]?[gG][rR][eE][eE]");
+      TRegexp gre8("8led[sS]?[gG][rR][eE][eE]");
       if (proj.Contains(gre8))
         { fPattern |= k8LedGreen; color = kGREEN;    }
 
-      // Possible green combinations
-      TRegexp blu0("0.1[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      // Possible blue combinations
+      TRegexp blu0("0.1led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu0))
         { fPattern |= k01LedBlue; color = kBLUE;    }
-      TRegexp blu1("1[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu1("1led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu1))
         { fPattern |= k1LedBlue; color = kBLUE;    }
-      TRegexp blu2("2[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu2("2led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu2))
         { fPattern |= k2LedBlue; color = kBLUE;    }
-      TRegexp blu3("3[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu3("3led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu3))
         { fPattern |= k3LedBlue; color = kBLUE;    }
-      TRegexp blu5("5[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu5("5led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu5))
         { fPattern |= k5LedBlue1; color = kBLUE;    }
-      TRegexp blu6("6[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu6("6led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu6))
         { fPattern |= k6LedBlue; color = kBLUE;    }
-      TRegexp blu7("7[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu7("7led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu7))
         { fPattern |= k7LedBlue; color = kBLUE;    }
-      TRegexp blu8("8[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu8("8led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu8))
         { fPattern |= k8LedBlue; color = kBLUE;    }
-      TRegexp blu10("10[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu10("10led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu10))
         { fPattern |= k10LedBlue; color = kBLUE;    }
-      TRegexp blu15("15[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu15("15led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu15))
         { fPattern |= k15LedBlue; color = kBLUE;    }
-      TRegexp blu20("20[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu20("20led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu20))
         { fPattern |= k20LedBlue; color = kBLUE;    }
-      TRegexp blu21("21[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu21("21led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu21))
         { fPattern |= k21LedBlue; color = kBLUE;    }
-      TRegexp blu22("22[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu22("22led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu22))
         { fPattern |= k22LedBlue; color = kBLUE;    }
-      TRegexp blu23("23[lL]?[eE]?[dD]?[sS]?[bB][lL][uU][eE]");
+      TRegexp blu23("23led[sS]?[bB][lL][uU][eE]");
       if (proj.Contains(blu23))
         { fPattern |= k23LedBlue; color = kBLUE;    }
 
       // Possible UV combinations
-      TRegexp uv1("[1][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv1("1led[sS]?[U][vV]");
       if (proj.Contains(uv1))
         { fPattern |= k1LedUV; color = kUV;    }
-      TRegexp uv2("[2][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv2("2led[sS]?[U][vV]");
       if (proj.Contains(uv2))
         { fPattern |= k2LedUV; color = kUV;    }
-      TRegexp uv3("[3][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv3("3led[sS]?[U][vV]");
       if (proj.Contains(uv3))
         { fPattern |= k3LedUV; color = kUV;    }
-      TRegexp uv5("[5][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv5("5led[sS]?[U][vV]");
       if (proj.Contains(uv5))
         { fPattern |= k5LedUV1; color = kUV;    }
-      TRegexp uv6("[6][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv6("6led[sS]?[U][vV]");
       if (proj.Contains(uv6))
         { fPattern |= k6LedUV; color = kUV;    }
-      TRegexp uv7("[7][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv7("7led[sS]?[U][vV]");
       if (proj.Contains(uv7))
         { fPattern |= k7LedUV; color = kUV;    }
-      TRegexp uv8("[8][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv8("8led[sS]?[U][vV]");
       if (proj.Contains(uv8))
         { fPattern |= k8LedUV; color = kUV;    }
-      TRegexp uv10("[10][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv10("10led[sS]?[U][vV]");
       if (proj.Contains(uv10))
         { fPattern |= k10LedUV; color = kUV;    }
-      TRegexp uv11("[11][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv11("11led[sS]?[U][vV]");
       if (proj.Contains(uv11))
         { fPattern |= k11LedUV; color = kUV;    }
-      TRegexp uv12("[12][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv12("12led[sS]?[U][vV]");
       if (proj.Contains(uv12))
         { fPattern |= k12LedUV; color = kUV;    }
-      TRegexp uv13("[13][lL]?[eE]?[dD]?[sS]?[U][vV]");
+      TRegexp uv13("13led[sS]?[U][vV]");
       if (proj.Contains(uv13))
         { fPattern |= k13LedUV; color = kUV;    }
 
+      // Possible slot combinations
+      TRegexp slot("slot");
+      if (proj.Contains(slot))
+        {
+          proj.ReplaceAll("slot","");
+          UInt_t nr = 0;
+          TRegexp slotnr("^[0-9]");
+          
+          if (proj.Contains(slotnr))
+            { fPattern = 0; proj.Replace(2,99,""); 
+            proj.ReplaceAll("u","");
+            proj.ReplaceAll("v","");
+            proj.ReplaceAll("g","");
+            nr = atoi(proj.Data())-1; 
+            fPattern |= BIT(nr);
+            color = nr < 2 ? kGREEN : 
+              ( nr < 3 ) ? kBLUE : 
+              ( nr < 5 ) ? kUV : 
+              ( nr < 11 ) ? kBLUE : 
+              ( nr < 13 ) ? kUV : 
+              ( nr < 14 ) ? kBLUE : 
+              ( nr < 16 ) ? kGREEN : 
+              kCT1;    
+            }
+        }
+      
       if (color != kNONE)
         *fLog << inf << "Color and Intensity determined from project-name (" << proj << ")... ";          
@@ -375,8 +468,10 @@
           else if (proj.Contains("cl",TString::kIgnoreCase))
             {
-              *fLog << err << "This run has been taken with the continuous light source." << endl;
-              *fLog << err 
+              *fLog << warn << "This run has been taken with the continuous light source." << endl;
+              *fLog << warn 
                     << "It cannot be used for calibration. Try to run a pedestal extraction on it." << endl;
-              return kFALSE;
+              fPattern = 0;
+              fIsValid = kTRUE;
+              return kTRUE;
             }
         }
@@ -415,8 +510,6 @@
     {
       if (fPattern == 0)
-        {
-          *fLog << err << "CONTINUE " << endl;
-          return kCONTINUE;
-        }
+        return kCONTINUE;
+
       fHeader->SetCalibrationPattern(fPattern);
     }
Index: trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h	(revision 5620)
+++ trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h	(revision 5621)
@@ -15,5 +15,6 @@
   static const Int_t gkIFAEBoxInaugurationRun; //! Run number of first IFAE box calibration (set to: 20113)
   static const Int_t gkMCRunLimit;             //! Maximum MC run number (now set to: 1000)
-
+  static const UInt_t gkFirstRunWithFinalBits; //! Run number of first functionning digital modules 
+  
   MRawEvtHeader *fHeader;                     //! Event header with the pulse pattern information
   
