#include <DetectorType.h>
Public Types | |
| typedef enum DetectorType::EDetectorType | Detector_t |
| enum | EDetectorType { kUnknown = 0x00, kNear = 0x01, kFar = 0x02, kCalDet = 0x04, kCalib = 0x04, kTestStand = 0x08, kMapper = 0x10 } |
Static Public Member Functions | |
| Int_t | FullMask () |
| const Char_t * | AsString (Detector_t detector) |
| DetectorType::Detector_t | CharToEnum (Char_t c) |
| Char_t * | MaskToString (Int_t mask) |
| DetectorType::Detector_t | StringToEnum (const Char_t *chars, Int_t maxChar=0) |
| Int_t | StringToMask (const Char_t *chars, Int_t maxChar=0) |
|
|
Referenced by CharToEnum(), MaskToString(), and StringToEnum(). |
|
|
Definition at line 24 of file DetectorType.h. Referenced by RerootToRawDataModule::RerootToRawDataModule(). 00024 {
00025 kUnknown = 0x00,
00026 kNear = 0x01,
00027 kFar = 0x02,
00028 kCalDet = 0x04,
00029 kCalib = 0x04,
00030 kTestStand = 0x08,
00031 kMapper = 0x10
00032 } Detector_t;
|
|
|
|
Definition at line 29 of file DetectorType.cxx. References Detector_t. Referenced by UgliLoanPool::Config(), DbuSubRunSummary::Fill(), DbuRunSummary::Fill(), and DbuDaqFileSummary::Fill(). 00030 {
00031 switch(c) {
00032 case 'N':
00033 case 'n':
00034 case '1':
00035 case 0x01:
00036 return kNear;
00037 case 'F':
00038 case 'f':
00039 case '2':
00040 case 0x02:
00041 return kFar;
00042 case 'C':
00043 case 'c':
00044 case '4':
00045 case 0x04:
00046 return kCalDet;
00047 case 'T':
00048 case 't':
00049 case '8':
00050 case 0x08:
00051 return kTestStand;
00052 case 'M':
00053 case 'm':
00054 case 0x10:
00055 return kMapper;
00056 default:
00057 return kUnknown;
00058 }
00059 }
|
|
|
Definition at line 10 of file DetectorType.cxx. Referenced by MaskToString(), and DbiLogEntry::Recreate(). 00011 {
00012 return kNear|kFar|kCalib|kTestStand|kMapper;
00013 }
|
|
|
Definition at line 62 of file DetectorType.cxx. References AsString(), Detector_t, FullMask(), and strlen(). Referenced by VldRange::AsString(). 00063 {
00064 // Return a mask of DetectorTypes as a string
00065 //
00066 // Result is a pointer to a statically allocated string.
00067 // User should copy this into their own buffer before calling
00068 // this method again.
00069
00070 static Char_t newstring[255] = "";
00071
00072 Char_t* ptr = newstring; // start at the beginning
00073
00074 *ptr = 0; // start with nothing
00075 Int_t fullmask = DetectorType::FullMask();
00076
00077 for (Int_t i=0; i<32; i++) {
00078 DetectorType::Detector_t adet = (DetectorType::Detector_t)(1<<i);
00079 if (mask & adet & fullmask) {
00080 const Char_t* toadd = DetectorType::AsString(adet);
00081 if (ptr != newstring) *ptr++ = ',';
00082 strcpy(ptr,toadd);
00083 ptr += strlen(toadd);
00084 }
00085 }
00086 *ptr++ = 0; // ensure trailing 0
00087
00088 return newstring;
00089 }
|
|
||||||||||||
|
Definition at line 92 of file DetectorType.cxx. References Detector_t, kCalib, kFar, kMapper, kNear, kTestStand, kUnknown, and StringToMask(). 00093 {
00094 // convert a set of chars to a valid enum
00095
00096 Int_t mask = DetectorType::StringToMask(chars,maxChar);
00097
00098 switch (mask) {
00099 case kUnknown: return kUnknown; break;
00100 case kNear: return kNear; break;
00101 case kFar: return kFar; break;
00102 case kCalib: return kCalib; break;
00103 case kTestStand: return kTestStand; break;
00104 case kMapper: return kMapper; break;
00105 default: return kUnknown; break;
00106 }
00107
00108 }
|
|
||||||||||||
|
Definition at line 111 of file DetectorType.cxx. Referenced by StringToEnum(). 00112 {
00113 // convert a set of chars to a mask of enum's
00114 // simple tests for unique characters: {n,f,c,t,m}
00115
00116 Int_t mask = 0;
00117
00118 TString thestring(chars);
00119 if (maxChar>0 && maxChar<thestring.Length()) thestring.Resize(maxChar);
00120
00121 thestring.ToLower();
00122 if (thestring.Contains("n")) mask |= kNear;
00123 if (thestring.Contains("f")) mask |= kFar;
00124 if (thestring.Contains("c")) mask |= kCalib;
00125 if (thestring.Contains("t")) mask |= kTestStand;
00126 if (thestring.Contains("m")) mask |= kMapper;
00127
00128 return mask;
00129 }
|
1.3.9.1