Ignore:
Timestamp:
02/03/05 11:55:25 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc

    r6185 r6231  
    6565//
    6666MCalibColorSet::MCalibColorSet(const char *name, const char *title)
    67   : fPattern(0), fHeader(0)
     67    : fPattern(0), fHeader(0), fIsExplicitColor(kFALSE)
    6868{
    6969  fName  = name  ? name  : "MCalibColorSet";
     
    7676{
    7777 
    78   fColor    = MCalibrationCam::kNONE;
    79   fStrength = -1.;
    80   fIsValid  = kFALSE;
    81 
     78  fIsValid         = kFALSE;
     79
     80  if (fIsExplicitColor)
     81    return;
     82
     83  fColor           = MCalibrationCam::kNONE;
     84  fStrength        = -1.;
    8285}
    8386
     
    169172    }
    170173 
     174  if (fIsExplicitColor)
     175    {
     176      fIsValid = kTRUE;
     177      return kTRUE;
     178    }
     179
    171180  const Int_t num = header->GetRunNumber();
    172181
     
    535544  return kTRUE;
    536545}
     546
     547Int_t MCalibColorSet::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     548{
     549
     550  Bool_t rc = kFALSE;
     551
     552  if (IsEnvDefined(env, prefix, "ExplicitColor", print))
     553    {
     554      TString dat = GetEnvValue(env, prefix, "ExplicitColor", "");
     555      if (dat.BeginsWith("green", TString::kIgnoreCase))
     556        SetExplicitColor(MCalibrationCam::kGREEN);
     557      if (dat.BeginsWith("blue", TString::kIgnoreCase))
     558        SetExplicitColor(MCalibrationCam::kBLUE);
     559      if (dat.BeginsWith("uv", TString::kIgnoreCase))
     560        SetExplicitColor(MCalibrationCam::kUV);
     561      if (dat.BeginsWith("ct1", TString::kIgnoreCase))
     562        SetExplicitColor(MCalibrationCam::kCT1);
     563      rc = kTRUE;
     564    }
     565
     566  return rc;
     567}
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h

    r6013 r6231  
    2929
    3030  Bool_t fIsValid;                             //  Have to set the pulse pattern?
    31 
     31  Bool_t fIsExplicitColor;                     //  Is colour set explicitely from outside (for MC)?
     32 
    3233  void CheckAndSet(const TString &str, const char *regexp, MCalibrationCam::PulserColor_t col, Float_t strength);
    3334
     
    3536  Int_t  PreProcess(MParList *pList);
    3637  Int_t  Process();
     38
     39  Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    3740 
    3841public:
     
    4144 
    4245  void Clear(const Option_t *o="");
     46
     47  void SetExplicitColor( const MCalibrationCam::PulserColor_t col, const Float_t strength=10.)
     48    {
     49      fIsExplicitColor = kTRUE;
     50      fColor    = col;
     51      fStrength = 10.;
     52    }
    4353 
    4454  ClassDef(MCalibColorSet, 0) // Task to workaround missing colors
Note: See TracChangeset for help on using the changeset viewer.