ElecType Namespace Reference

Typedefs

typedef enum ElecType::EElecType Elec_t

Enumerations

enum  EElecType { kVA = 0x00, kQIE = 0x01, kReroot = 0x02, kUnknown = 0x03 }

Functions

const Char_t * AsString (Elec_t etype)
ElecType::Elec_t StringToEnum (const Char_t *chars, Int_t maxChar=0)
ElecType::Elec_t CharToEnum (Char_t c)

Typedef Documentation


Enumeration Type Documentation

Enumerator:
kVA 
kQIE 
kReroot 
kUnknown 

Definition at line 25 of file ElecType.h.

00025                           {
00026       kVA        = 0x00,
00027       kQIE       = 0x01,
00028       kReroot    = 0x02,
00029       kUnknown   = 0x03
00030    } Elec_t;


Function Documentation

const Char_t * ElecType::AsString ( Elec_t  etype  ) 

Definition at line 12 of file ElecType.cxx.

References kQIE, kReroot, kUnknown, and kVA.

Referenced by RawLiTpmtDigitsBlock::FillRawDigits(), RawDigitDataBlock::FillRawDigits(), RawVaTimingMonitorBlock::FillRawDigits(), RawTOFBlock::FillRawTOFDigits(), and RawLIAdcSummary::RawLIAdcSummary().

00013 {
00014    switch (etype) {
00015    case kUnknown:   return "Unknown";    break;
00016    case kVA:        return "VA";         break;
00017    case kQIE:       return "QIE";        break;
00018    case kReroot:    return "Reroot";     break;
00019    default:         return "?Unknown?";  break;
00020    }
00021 }

ElecType::Elec_t ElecType::CharToEnum ( Char_t  c  ) 

Definition at line 49 of file ElecType.cxx.

References kQIE, kReroot, kUnknown, and kVA.

00050 {
00051   switch (c) {
00052   case 'V':
00053   case 'v':
00054   case '0':
00055   case 0x0:
00056     return kVA;
00057   case 'Q':
00058   case 'q':
00059   case '1':
00060   case 0x1:
00061     return kQIE;
00062   case 'R':
00063   case 'r':
00064   case '2':
00065   case 0x2:
00066     return kReroot;
00067   default:
00068     return kUnknown;
00069   }
00070 
00071 }

ElecType::Elec_t ElecType::StringToEnum ( const Char_t *  chars,
Int_t  maxChar = 0 
)

Definition at line 25 of file ElecType.cxx.

References kQIE, kReroot, kUnknown, and kVA.

00026 {
00027    // convert a set of chars to a valid enum 
00028    // based on existence of only one of:
00029    //   VA:      far detector electronics
00030    //   QIE:     near detector electronics
00031    //   Reroot:  pseudo-numbering scheme
00032 
00033    if (maxChar==0) maxChar = strlen(chars);
00034    Char_t* lowchars = new Char_t [maxChar];
00035    for (int i=0; i<maxChar; ++i) lowchars[i] = tolower(chars[i]);
00036 
00037    Elec_t etype = kUnknown;
00038    if      (0==strncmp(lowchars,"va",TMath::Min(maxChar,2))) etype = kVA;
00039    else if (0==strncmp(lowchars,"qie",TMath::Min(maxChar,3))) etype = kQIE;
00040    else if (0==strncmp(lowchars,"reroot",TMath::Min(maxChar,6))) etype = kReroot;
00041 
00042    delete [] lowchars;
00043 
00044    return etype;
00045 }


Generated on 14 Dec 2017 for loon by  doxygen 1.6.1