Changeset 3832 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 04/26/04 16:44:20 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r3797 r3832 141 141 using namespace std; 142 142 143 const Int_t MJCalibration::gkIFAEBoxInaugurationRun = 20113; 143 144 // -------------------------------------------------------------------------- 144 145 // … … 863 864 // -------------------------------------------------------------------------- 864 865 // 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 // 871 Bool_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 // 865 960 // Retrieve the output file written by WriteResult() 866 961 // … … 891 986 // 892 987 // - Check if there are fRuns, otherwise return 988 // - Check the colour of the files in fRuns (FindColor()), otherwise return 893 989 // - Check for consistency between run numbers and number of files 894 990 // - Add fRuns to MReadMarsFile … … 930 1026 if (fRuns->GetNumRuns() != fRuns->GetNumEntries()) 931 1027 { 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; 933 1030 return kFALSE; 934 1031 } 935 1032 936 1033 *fLog << inf; 937 1034 fLog->Separator(GetDescriptor()); 1035 1036 if (!FindColor()) 1037 return kFALSE; 1038 938 1039 *fLog << "Calculate MCalibrationCam from Runs " << fRuns->GetRunsAsString() << endl; 939 1040 *fLog << endl; -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r3797 r3832 24 24 { 25 25 private: 26 27 static const Int_t gkIFAEBoxInaugurationRun; // Run number of first IFAE box calibration 26 28 27 29 TString fOutputPath; // Path to the output files … … 52 54 void DisplayResult(MParList &plist); 53 55 Bool_t WriteResult(); 54 56 Bool_t FindColor(); 57 55 58 public: 56 59
Note:
See TracChangeset
for help on using the changeset viewer.