StripEnd Namespace Reference

Typedefs

typedef enum StripEnd::EStripEnd StripEnd_t

Enumerations

enum  EStripEnd {
  kUnknown = 0x00, kNegative = 0x01, kPositive = 0x02, kEast = kNegative,
  kWest = kPositive, kUp = kNegative, kDown = kPositive, kNorth = kNegative,
  kSouth = kPositive, kWhole = 0x03
}

Functions

const Char_t * AsString (StripEnd_t direction)
const Char_t * AsString (StripEnd_t dir, Detector::Detector_t det, PlaneView::PlaneView_t view)
StripEnd_t CharToEnum (Char_t c)

Typedef Documentation


Enumeration Type Documentation

Enumerator:
kUnknown 
kNegative 
kPositive 
kEast 
kWest 
kUp 
kDown 
kNorth 
kSouth 
kWhole 

Definition at line 34 of file StripEnd.h.

00034                           {
00035       kUnknown   = 0x00,
00036       kNegative  = 0x01,
00037       kPositive  = 0x02,
00038       kEast      = kNegative,
00039       kWest      = kPositive, 
00040       kUp        = kNegative,
00041       kDown      = kPositive,
00042       kNorth     = kNegative,
00043       kSouth     = kPositive,
00044       kWhole     = 0x03
00045    } StripEnd_t;


Function Documentation

const char * StripEnd::AsString ( StripEnd::StripEnd_t  dir,
Detector::Detector_t  det,
PlaneView::PlaneView_t  view 
)

Definition at line 24 of file StripEnd.cxx.

References AsString(), PlaneView::kA, PlaneView::kB, Detector::kCalDet, kDown, kEast, Detector::kFar, Detector::kNear, kNorth, kSouth, PlaneView::kU, kUp, PlaneView::kV, PlaneView::kVSTopEastSlant, PlaneView::kVSTopFlat, PlaneView::kVSTopWestSlant, PlaneView::kVSWallEastSlant, PlaneView::kVSWallOnEdge, PlaneView::kVSWallWestSlant, and kWest.

00027 {
00028 
00029   // Convert StripEnd enum into a reasonable name that might
00030   // depend on the detector and plane view (rather than just +/-)
00031 
00032   switch (det) {
00033   case Detector::kNear:
00034     {
00035       switch (view) {
00036       case PlaneView::kU:
00037       case PlaneView::kV:
00038         if      (StripEnd::kEast == dir) return "East";
00039         else if (StripEnd::kWest == dir) return "West";
00040         break;
00041       default:
00042         return AsString(dir);
00043       }
00044     }
00045     break;
00046   case Detector::kFar:
00047     {
00048       switch (view) {
00049       case PlaneView::kU:
00050       case PlaneView::kV:
00051         if      (StripEnd::kEast == dir) return "East";
00052         else if (StripEnd::kWest == dir) return "West";
00053         break;
00054       case PlaneView::kVSTopFlat:
00055       case PlaneView::kVSTopEastSlant:
00056       case PlaneView::kVSTopWestSlant:
00057       case PlaneView::kVSWallOnEdge:
00058       case PlaneView::kVSWallEastSlant:
00059       case PlaneView::kVSWallWestSlant:
00060         if      (StripEnd::kNorth == dir) return "North";
00061         else if (StripEnd::kSouth == dir) return "South";
00062         break;
00063       default:
00064         return AsString(dir);
00065       }
00066     }
00067     break;
00068   case Detector::kCalDet:
00069     {
00070       switch (view) {
00071       case PlaneView::kU:  // U has Up/Down
00072         if      (StripEnd::kUp   == dir) return "Up";
00073         else if (StripEnd::kDown == dir) return "Down";
00074         break;
00075       case PlaneView::kV:  // V and A use East/West
00076       case PlaneView::kA:
00077         if      (StripEnd::kEast == dir) return "East";
00078         else if (StripEnd::kWest == dir) return "West";
00079         break;
00080       case PlaneView::kB:  // B should have North/South
00081         if      (StripEnd::kNorth == dir) return "North";
00082         else if (StripEnd::kSouth == dir) return "South";
00083         break;
00084       default:
00085         return AsString(dir);
00086       }
00087     }
00088     break;
00089   default:
00090     return AsString(dir);
00091   }
00092   
00093   return AsString(dir);
00094 
00095 }

const char * StripEnd::AsString ( StripEnd_t  direction  ) 

Definition at line 11 of file StripEnd.cxx.

References kNegative, kPositive, kUnknown, and kWhole.

Referenced by DigitText::AddStripIdText(), AsString(), PlexStripEndId::AsString(), Plotter::Plot(), TridModelStrip::Print(), and PlexSEIdAltL::Print().

00012 {
00013   switch (direction) {
00014   case kUnknown:   return "?";       break;
00015   case kNegative:  return "-";       break;
00016   case kPositive:  return "+";       break;
00017   case kWhole:     return "*";       break;
00018   default:         return "?";    break;
00019   }
00020 }

StripEnd::StripEnd_t StripEnd::CharToEnum ( Char_t  c  ) 

Definition at line 99 of file StripEnd.cxx.

References kNegative, kPositive, kUnknown, Msg::kWarning, kWhole, and MSG.

Referenced by LightInjector::Config().

00100 {
00101    switch (c) {
00102    case '-':  // negative
00103    case 'n':  // negative, north
00104    case 'N':
00105    case 'e':  // east
00106    case 'E':
00107    case 'u':  // up
00108    case 'U':
00109    case '1':
00110    case 0x01:
00111       return kNegative;
00112       break;
00113    case '+':  // positive
00114    case 'p':  // postive
00115    case 'P':
00116    case 's':  // south
00117    case 'S':
00118    case 'w':  // west
00119    case 'W':
00120    case 'd':  // down
00121    case 'D':
00122    case '2':
00123    case 0x02:
00124       return kPositive;
00125       break;
00126    case '?':  // can't use 'u' (unknown), already used for (up)
00127    case '0':
00128    case 0x00:
00129       return kUnknown; 
00130       break;
00131    case '*':  // can't use 'w' (whole), already used for (west)
00132    case '3':
00133    case 0x03:
00134       return kWhole;
00135       break;
00136    }
00137 
00138    MSG("Conv",Msg::kWarning) 
00139       << " unhandled input return kUnknown" << endl;
00140    return kUnknown;
00141 }


Generated on 14 Dec 2017 for loon by  doxygen 1.6.1