Ignore:
Timestamp:
04/26/04 16:44:20 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r3797 r3832  
    141141using namespace std;
    142142
     143const Int_t MJCalibration::gkIFAEBoxInaugurationRun = 20113;
    143144// --------------------------------------------------------------------------
    144145//
     
    863864// --------------------------------------------------------------------------
    864865//
     866// Find the colour of the pulsing LED:
     867// - If the run number is smaller than gkIFAEBoxInaugurationRun, take MCalibrationCam::kCT1
     868// - Otherwise find the colour out of the run name
     869// - If no colour is found, return kFALSE
     870//
     871Bool_t MJCalibration::FindColor()
     872{
     873
     874  const UInt_t nruns = fRuns->GetNumRuns();
     875
     876  if (nruns == 0)
     877    return kFALSE;
     878 
     879  TArrayI arr = fRuns->GetRuns();
     880
     881  if (arr[nruns-1] < gkIFAEBoxInaugurationRun)
     882    {
     883      *fLog << "Found colour kCT1 in runs: " << fRuns->GetRunsAsString() << endl;
     884      fColor = MCalibrationCam::kCT1;
     885      return kTRUE;
     886    }
     887 
     888  TString filenames;
     889
     890  while (!(filenames=((MDirIter*)fRuns)->Next()).IsNull())
     891    {
     892
     893      filenames.ToLower();
     894
     895      if (filenames.Contains("green"))
     896        if (fColor == MCalibrationCam::kNONE)
     897          {
     898            *fLog << "Found colour: kGREEN  in " << filenames << endl;
     899            fColor = MCalibrationCam::kGREEN;
     900          }
     901        else if (fColor != MCalibrationCam::kGREEN)
     902          {
     903            *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
     904            return kFALSE;
     905          }
     906
     907      if (filenames.Contains("blue"))
     908        if (fColor == MCalibrationCam::kNONE)
     909          {
     910            *fLog << "Found colour: kBLUE  in " << filenames << endl;
     911            fColor = MCalibrationCam::kBLUE;
     912          }
     913        else if (fColor != MCalibrationCam::kBLUE)
     914          {
     915            *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
     916            return kFALSE;
     917          }
     918
     919      if (filenames.Contains("uv"))
     920        if (fColor == MCalibrationCam::kNONE)
     921          {
     922            *fLog << "Found colour: kUV in " << filenames << endl;
     923            fColor = MCalibrationCam::kUV;
     924          }
     925        else if (fColor != MCalibrationCam::kUV)
     926          {
     927            *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
     928            return kFALSE;
     929          }
     930
     931      if (filenames.Contains("ct1"))
     932        if (fColor == MCalibrationCam::kNONE)
     933          {
     934            *fLog << "Found colour: kCT1  in " << filenames << endl;
     935            fColor = MCalibrationCam::kCT1;
     936          }
     937        else if (fColor != MCalibrationCam::kCT1)
     938          {
     939            *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
     940            return kFALSE;
     941          }
     942     
     943    }
     944 
     945  if (fColor == MCalibrationCam::kNONE)
     946    {
     947      *fLog <<  "No colour found in filenames of runs: " << fRuns->GetRunsAsString()
     948           << "... abort" << endl;
     949      return kFALSE;     
     950    }
     951
     952  return kTRUE;
     953}
     954
     955
     956
     957
     958// --------------------------------------------------------------------------
     959//
    865960// Retrieve the output file written by WriteResult()
    866961//
     
    891986//
    892987// - Check if there are fRuns, otherwise return
     988// - Check the colour of the files in fRuns (FindColor()), otherwise return
    893989// - Check for consistency between run numbers and number of files
    894990// - Add fRuns to MReadMarsFile
     
    9301026  if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
    9311027    {
    932       *fLog << err << "Number of files found doesn't match number of runs... abort." << endl;
     1028      *fLog << err << "Number of files found doesn't match number of runs... abort."
     1029            << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl;
    9331030      return kFALSE;
    9341031    }
    935  
     1032
    9361033  *fLog << inf;
    9371034  fLog->Separator(GetDescriptor());
     1035
     1036  if (!FindColor())
     1037    return kFALSE;
     1038 
    9381039  *fLog << "Calculate MCalibrationCam from Runs " << fRuns->GetRunsAsString() << endl;
    9391040  *fLog << endl;
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.h

    r3797 r3832  
    2424{
    2525private:
     26
     27  static const Int_t gkIFAEBoxInaugurationRun;              // Run number of first IFAE box calibration
    2628
    2729  TString fOutputPath;                                     // Path to the output files
     
    5254  void   DisplayResult(MParList &plist);
    5355  Bool_t WriteResult();
    54 
     56  Bool_t FindColor();
     57 
    5558public:
    5659
Note: See TracChangeset for help on using the changeset viewer.