Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 9312)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 9313)
@@ -18,4 +18,44 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2009/02/11 Thomas Bretz
+
+   * mcalib/MCalibColorSet.[h,cc]:
+     - removed some obsolete break statements
+     - removed obsolete gkMCRunLimit
+     - fixed setting of signal strength for extremely old
+       runs (I think we don't have them anyway)
+
+   * mcalib/MCalibrateData.cc:
+     - improved output
+
+   * mcalib/MCalibrationChargeCalc.cc:
+     - stop if no valid pulser colors have been found
+
+   * mcorsika/MCorsikaRunHeader.h:
+     - some cosmetics
+     - added some getter
+
+   * mhist/MHEvent.cc:
+     - some improvements to output
+
+   * mmc/MMcEvtBasic.[h,cc]:
+     - moved the getter returning a TString to the source file
+     - replaced Form by MString::Format
+
+   * mraw/MRawRunHeader.cc:
+     - initialize fSourceEpochChar[1]
+     - initialize fNumEventsRead
+     - suppress more output which has not been initialized
+     - removed run-type from SetRunInfo
+     - added new function SetRunType
+     - use strncpy instead of memcpy
+     - replaced const char[] arguments by TString
+
+   * msimreflector/MReflector.[h,cc]:
+     - added Print
+     - added a circle around the mirror showing fMaxR
+
+
+
  2009/02/10 Thomas Bretz
 
Index: /trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc	(revision 9312)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc	(revision 9313)
@@ -57,5 +57,4 @@
 
 const Int_t  MCalibColorSet::gkIFAEBoxInaugurationRun = 20113;
-const Int_t  MCalibColorSet::gkMCRunLimit             = 1000;
 const UInt_t MCalibColorSet::gkFirstRunWithFinalBits  = 45626;
 
@@ -193,7 +192,7 @@
       *fLog << inf << "Run taken before inauguration of IFAE-box... using CT1 pulser." << endl;
       fColor    = MCalibrationCam::kCT1;
+      fStrength = 10.;
       fPattern->SetPulserColor(fColor);
       fPattern->SetPulserStrength(fStrength);
-      fStrength = 10.;
       fIsValid  = kTRUE;
       return kTRUE;
@@ -341,5 +340,4 @@
       *fLog << err << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! " << endl;
       return kFALSE;
-      break;
 
     case 40493:
@@ -351,5 +349,4 @@
       *fLog << err << "the camera. It cannot be used for the standard calibration " << endl;
       return kFALSE;
-      break;
       
     case 45605:
@@ -357,5 +354,4 @@
       *fLog << err << "It cannot be used for calibration. Try to run a pedestal extraction on it." << endl;
       return kFALSE;
-      break;
 
     case 45606:
@@ -363,5 +359,4 @@
       *fLog << err << "It cannot be used for calibration. Try to run a pedestal extraction on it." << endl;
       return kFALSE;
-      break;
 
     }
Index: /trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h	(revision 9312)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h	(revision 9313)
@@ -19,5 +19,4 @@
 
   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 
   
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 9312)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 9313)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.72 2008-07-22 18:55:08 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.73 2009-02-11 10:48:24 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -683,5 +683,5 @@
     {
         *fLog << err << GetDescriptor() << ": ERROR - ";
-        *fLog << "GetConversionFactor has skipped more than 90% of the pixels... abort." << endl;
+        *fLog << "GetConversionFactor has skipped more than 90% of the " << fGeomCam->GetNumPixels() <<  " pixels... abort." << endl;
         return kFALSE;
     }
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 9312)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 9313)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.184 2008-06-02 08:46:44 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.185 2009-02-11 10:48:24 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -665,6 +665,6 @@
   if (fPulserColor == MCalibrationCam::kNONE)
   {
-      *fLog << warn << "WARNING - No Pulse colour has been set or used at all..." << endl;
-      return kTRUE;
+      *fLog << err << "ERROR - No event was flagged with a pulser color... no calibration possible." << endl;
+      return kFALSE;
   }
 
Index: /trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h
===================================================================
--- /trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h	(revision 9312)
+++ /trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h	(revision 9313)
@@ -45,8 +45,10 @@
     MCorsikaRunHeader(const char *name=NULL, const char *title=NULL);
 
+    // Getter
+    UInt_t GetRunNumber() const { return fRunNumber; }
+    UInt_t GetParticleID() const { return fParticleID; }
+    UInt_t GetNumEvents() const { return fNumEvents; }
+
     UInt_t GetFormatVersion() const { return (UInt_t)fProgramVersion; }
-    Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
-
-    UInt_t GetParticleID() const { return fParticleID; }
 
     Float_t GetZdMin() const { return fZdMin; }
@@ -66,13 +68,14 @@
 
     Float_t GetViewConeOuterAngle() const { return fViewConeOuterAngle; }
+    Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
 
-    UInt_t GetNumEvents() const { return fNumEvents; }
-
-    void Print(Option_t *t=NULL) const;
-
+    // I/O
     Bool_t ReadEvt(istream& fin);
     Bool_t ReadEvtEnd(istream& fin);
     Bool_t SeekEvtEnd(istream &fin);
 
+    // TObject
+    void Print(Option_t *t=NULL) const;
+
     ClassDef(MCorsikaRunHeader, 2)	// storage container for general info
 };
Index: /trunk/MagicSoft/Mars/mhist/MHEvent.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHEvent.cc	(revision 9312)
+++ /trunk/MagicSoft/Mars/mhist/MHEvent.cc	(revision 9313)
@@ -291,7 +291,7 @@
 
     if (fRawEvtHeader && fRawRunHeader)
-        s += " of ";
-
-    if (fRawRunHeader)
+        s += " FileId #";
+
+    if (fRawEvtHeader)
         s += fRawRunHeader->GetStringID();
 
Index: /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 9312)
+++ /trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 9313)
@@ -193,4 +193,5 @@
     memset(fObservationMode, 0,  61);
     fSourceEpochChar[0]=0;
+    fSourceEpochChar[1]=0;
     fSourceEpochDate=0;
     fNumCrates=0;
@@ -199,4 +200,5 @@
     fNumSamplesHiGain=0;
     fNumEvents=0;
+    fNumEventsRead=0;
     fNumBytesPerSample=1;
     fSamplingFrequency=300;
@@ -931,6 +933,13 @@
     if (fFormatVersion>10)
         *fLog << "Header sizes: " << fHeaderSizeRun << "b (run), " << fHeaderSizeEvt << "b (evt), " << fHeaderSizeCrate << "b (crate)" << endl;
-    if (fFormatVersion>5)
-        *fLog << "Telescope:    " << fTelescopeNumber << endl;
+    if (fRunNumber>0)
+    {
+        if (fFormatVersion>5)
+            *fLog << "Telescope:    " << fTelescopeNumber << endl;
+        *fLog << "RunNumber:    " << fRunNumber;
+        if (fFormatVersion>10)
+            *fLog << "/" << fFileNumber << " (id=" << GetFileID() << ")";
+        *fLog << " (Type=" << GetRunTypeStr() << ")" << endl;
+    }
     if (fFormatVersion>7)
     {
@@ -945,8 +954,4 @@
         *fLog << ")" << endl;
     }
-    *fLog << "RunNumber:    " << fRunNumber;
-    if (fFormatVersion>10)
-        *fLog << "/" << fFileNumber << " (id=" << GetFileID() << ")";
-    *fLog << " (Type=" << GetRunTypeStr() << ")" << endl;
     *fLog << "ProjectName: '" << fProjectName << "'" << endl;
     if (fFormatVersion>5)
@@ -1196,9 +1201,8 @@
 // Monte Carlo Interface
 //
-//  Set run-type, telescope number, run-number and file-number
-//
-void MRawRunHeader::SetRunInfo(UShort_t type, UShort_t tel, UInt_t run, UInt_t file)
-{
-    fRunType         = type;
+//  Set telescope number, run-number and file-number
+//
+void MRawRunHeader::SetRunInfo(UShort_t tel, UInt_t run, UInt_t file)
+{
     fTelescopeNumber = tel;
     fRunNumber       = run;
@@ -1212,12 +1216,10 @@
 //  Set source-name, epoch (default J) and date (default 2000)
 //
-void MRawRunHeader::SetSourceInfo(const char src[80], char epoch, UShort_t date)
-{
-    memcpy(fSourceName, src, 80);
+void MRawRunHeader::SetSourceInfo(const TString src, char epoch, UShort_t date)
+{
+    strncpy(fSourceName, src.Data(), 80);
 
     fSourceEpochChar[0] = epoch;     // epoch char of the source
-    fSourceEpochChar[1] = 0;         // epoch char of the source
-
-    fSourceEpochDate = date;         // epoch date of the source
+    fSourceEpochDate    = date;      // epoch date of the source
 }
 
@@ -1240,8 +1242,8 @@
 //  Set project name and observation mode
 //
-void MRawRunHeader::SetObservation(const char mode[60], const char proj[100])
-{
-    memcpy(fProjectName,     proj, 100);
-    memcpy(fObservationMode, mode,  60);
+void MRawRunHeader::SetObservation(const TString mode, const TString proj)
+{
+    strncpy(fProjectName,     proj.Data(), 100);
+    strncpy(fObservationMode, mode.Data(),  60);
 }
 
Index: /trunk/MagicSoft/Mars/msimreflector/MReflector.cc
===================================================================
--- /trunk/MagicSoft/Mars/msimreflector/MReflector.cc	(revision 9312)
+++ /trunk/MagicSoft/Mars/msimreflector/MReflector.cc	(revision 9313)
@@ -37,4 +37,5 @@
 #include <TClass.h>
 #include <TSystem.h>
+#include <TEllipse.h>
 
 #include "MQuaternion.h"
@@ -43,4 +44,6 @@
 #include "MLog.h"
 #include "MLogManip.h"
+
+#include "MH.h"
 
 ClassImp(MReflector);
@@ -254,15 +257,28 @@
 // --------------------------------------------------------------------------
 //
+// Print the collection of mirrors
+//
+void MReflector::Print(Option_t *o) const
+{
+    *fLog << all << GetDescriptor() << " (" << GetNumMirrors() << "): " << endl;
+
+    fMirrors.Print(o);
+}
+
+// --------------------------------------------------------------------------
+//
 // Paint the collection of mirrors
 //
 void MReflector::Paint(Option_t *o)
 {
+    if (!TString(o).Contains("same", TString::kIgnoreCase))
+        MH::SetPadRange(-fMaxR*1.01, -fMaxR*1.01, fMaxR*1.01, fMaxR*1.01);
+
     fMirrors.Paint(o);
-    /*
-    TIter Next(&fMirrors);
-    MMirror *m = 0;
-
-    while ((m=static_cast<MMirror*>(Next())))
-        m->Paint(o);*/
+
+    TEllipse e;
+    e.SetFillStyle(0);
+    e.SetLineColor(17);
+    e.PaintEllipse(0, 0, fMaxR, fMaxR, 0, 360, 0);
 }
 
Index: /trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc
===================================================================
--- /trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc	(revision 9312)
+++ /trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc	(revision 9313)
@@ -52,4 +52,6 @@
 #include "MMcEvtBasic.h"
 
+#include "MString.h"
+
 #include "MLog.h"
 #include "MLogManip.h"
@@ -124,4 +126,64 @@
     fTelescopeTheta = fTThet;
 }
+
+TString MMcEvtBasic::GetParticleName(Int_t id)
+{
+    switch (id)
+    {
+    case kUNDEFINED:  return "Undefined";
+    case kGAMMA:      return "Gamma";
+    case kPOSITRON:   return "Positron";
+    case kELECTRON:   return "Electron";
+    case kANTIMUON:   return "Anti-Muon";
+    case kMUON:       return "Muon";
+    case kPI0:        return "Pi-0";
+    case kNEUTRON:    return "Neutron";
+    case kPROTON:     return "Proton";
+    case kHELIUM:     return "Helium";
+    case kOXYGEN:     return "Oxygen";
+    case kIRON:       return "Iron";
+    case kArtificial: return "Artificial";
+    case kNightSky:   return "NightSky";
+    }
+
+    return MString::Format("Id:%d", id);
+}
+
+TString MMcEvtBasic::GetParticleSymbol(Int_t id)
+{
+    switch (id)
+    {
+    case kUNDEFINED:return "N/A";
+    case kGAMMA:    return "\\gamma";
+    case kPOSITRON: return "e^{+}";
+    case kELECTRON: return "e^{-}";
+    case kANTIMUON: return "\\mu^{+}";
+    case kMUON:     return "\\mu^{-}";
+    case kPI0:      return "\\pi^{0}";
+    case kNEUTRON:  return "n";
+    case kPROTON:   return "p";
+    case kHELIUM:   return "He";
+    case kOXYGEN:   return "O";
+    case kIRON:     return "Fe";
+    case kNightSky: return "\\gamma_{NSB}";
+    }
+
+    return MString::Format("Id:%d", id);
+}
+
+TString MMcEvtBasic::GetEnergyStr(Float_t e)
+{
+    if (e>=1000)
+        return MString::Format("%.1fTeV", e/1000);
+
+    if (e>=10)
+        return MString::Format("%dGeV", (Int_t)(e+.5));
+
+    if (e>=1)
+        return MString::Format("%.1fGeV", e);
+
+    return MString::Format("%dMeV", (Int_t)(e*1000+.5));
+}
+
 
 // --------------------------------------------------------------------------
Index: /trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
===================================================================
--- /trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 9312)
+++ /trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 9313)
@@ -51,62 +51,7 @@
   Float_t GetTelescopeTheta() const { return fTelescopeTheta; }
 
-  static TString GetParticleName(Int_t id)
-  {
-      switch (id)
-      {
-      case kUNDEFINED:  return "Undefined";
-      case kGAMMA:      return "Gamma";
-      case kPOSITRON:   return "Positron";
-      case kELECTRON:   return "Electron";
-      case kANTIMUON:   return "Anti-Muon";
-      case kMUON:       return "Muon";
-      case kPI0:        return "Pi-0";
-      case kNEUTRON:    return "Neutron";
-      case kPROTON:     return "Proton";
-      case kHELIUM:     return "Helium";
-      case kOXYGEN:     return "Oxygen";
-      case kIRON:       return "Iron";
-      case kArtificial: return "Artificial";
-      case kNightSky:   return "NightSky";
-      }
-
-      return Form("Id:%d", id);
-  }
-
-  static TString GetParticleSymbol(Int_t id)
-  {
-      switch (id)
-      {
-      case kUNDEFINED:return "N/A";
-      case kGAMMA:    return "\\gamma";
-      case kPOSITRON: return "e^{+}";
-      case kELECTRON: return "e^{-}";
-      case kANTIMUON: return "\\mu^{+}";
-      case kMUON:     return "\\mu^{-}";
-      case kPI0:      return "\\pi^{0}";
-      case kNEUTRON:  return "n";
-      case kPROTON:   return "p";
-      case kHELIUM:   return "He";
-      case kOXYGEN:   return "O";
-      case kIRON:     return "Fe";
-      case kNightSky: return "\\gamma_{NSB}";
-      }
-
-      return Form("Id:%d", id);
-  }
-
-  static TString GetEnergyStr(Float_t e)
-  {
-      if (e>=1000)
-          return Form("%.1fTeV", e/1000);
-
-      if (e>=10)
-          return Form("%dGeV", (Int_t)(e+.5));
-
-      if (e>=1)
-          return Form("%.1fGeV", e);
-
-      return Form("%dMeV", (Int_t)(e*1000+.5));
-  }
+  static TString GetParticleName(Int_t id);
+  static TString GetParticleSymbol(Int_t id);
+  static TString GetEnergyStr(Float_t e);
 
   TString GetParticleSymbol() const
