BfldGrid Namespace Reference

Typedefs

typedef enum BfldGrid::EGrid Grid_t

Enumerations

enum  EGrid {
  kUndefined = 0, kRect2dGrid = 2, kNearCoarseV = 10, kNearStdV = 11,
  kNearFineV = 12, kFarCoarseV = 20, kFarStdV = 21, kFarFineV = 22
}

Functions

const char * AsString (BfldGrid::Grid_t grid)
BfldGrid::Grid_t GetGrid (Detector::Detector_t, Int_t coarseness)
Int_t GetCoarseness (Grid_t grid)

Typedef Documentation


Enumeration Type Documentation

Enumerator:
kUndefined 
kRect2dGrid 
kNearCoarseV 
kNearStdV 
kNearFineV 
kFarCoarseV 
kFarStdV 
kFarFineV 

Definition at line 25 of file BfldGrid.h.

00025                      {
00026      kUndefined   =  0,
00027      kRect2dGrid  =  2,     // rectangular grid
00028      kNearCoarseV = 10,     // Voronoi - Near with   3000 nodes
00029      kNearStdV    = 11,     //           Near with  50000 nodes
00030      kNearFineV   = 12,     //           Near with 200000 nodes
00031      kFarCoarseV  = 20,     //           Far  with   3000 nodes
00032      kFarStdV     = 21,     //           Far  with  50000 nodes
00033      kFarFineV    = 22      //           Far  with 200000 nodes
00034   } Grid_t; 


Function Documentation

const char * BfldGrid::AsString ( BfldGrid::Grid_t  grid  ) 

Definition at line 8 of file BfldGrid.cxx.

References kFarCoarseV, kFarFineV, kFarStdV, kNearCoarseV, kNearFineV, kNearStdV, kRect2dGrid, and kUndefined.

Referenced by BfldLoanPool::GetMap(), and BfldLoanPool::Print().

00008                                            {
00009   switch (grid) {
00010   case kUndefined:    return "Undefined";           break;
00011   case kRect2dGrid:   return "Rect2dGrid";          break;
00012   case kNearCoarseV:  return "Near Coarse Voronoi"; break;
00013   case kNearStdV:     return "Near Std Voronoi";    break;
00014   case kNearFineV:    return "Near Fine Voronoi";   break;
00015   case kFarCoarseV:   return "Far Coarse Voronoi";  break;
00016   case kFarStdV:      return "Far Std Voronoi";     break;
00017   case kFarFineV:     return "Far Fine Voronoi";    break;
00018   default:            return "Unknown Grid_t";      break;
00019   }
00020   return "Unknown Grid_t";
00021 }

Int_t BfldGrid::GetCoarseness ( BfldGrid::Grid_t  grid  ) 

Definition at line 66 of file BfldGrid.cxx.

References kFarCoarseV, kFarFineV, kFarStdV, kNearCoarseV, kNearFineV, kNearStdV, and kRect2dGrid.

Referenced by BField::operator=().

00066                                                  {
00067 
00068   // translate grid type back to coarseness
00069 
00070   switch (grid) {
00071   case BfldGrid::kRect2dGrid:  return -1;
00072   case BfldGrid::kNearCoarseV: return  0;
00073   case BfldGrid::kNearStdV:    return  1;
00074   case BfldGrid::kNearFineV:   return  2;
00075   case BfldGrid::kFarCoarseV:  return  0;
00076   case BfldGrid::kFarStdV:     return  1;
00077   case BfldGrid::kFarFineV:    return  2;
00078   default:
00079     // bad things happen here!
00080     printf("BfldGrid::GetCoarseness Grid_t %#x\n",(int)grid);
00081     assert(0);
00082     return -1;
00083     break;
00084   }
00085 }

BfldGrid::Grid_t BfldGrid::GetGrid ( Detector::Detector_t  detector,
Int_t  coarseness 
)

Definition at line 24 of file BfldGrid.cxx.

References Detector::kCalDet, Detector::kFar, kFarCoarseV, kFarFineV, kFarStdV, Detector::kNear, kNearCoarseV, kNearFineV, kNearStdV, kRect2dGrid, and kUndefined.

Referenced by BField::SetGridHandler().

00026 {
00027   // translate detector+coarseness in to grid type
00028 
00029   switch (detector) {
00030   case Detector::kNear:
00031     switch (coarseness) {
00032     case -1:  return BfldGrid::kRect2dGrid;   break;
00033     case  0:  return BfldGrid::kNearCoarseV;  break;
00034     case  1:  return BfldGrid::kNearStdV;     break;
00035     case  2:  return BfldGrid::kNearFineV;    break;
00036     default: 
00037       // should inform the user that the value was bogus
00038               return BfldGrid::kNearStdV;
00039                break;
00040     }
00041     break;
00042   case Detector::kFar:
00043     switch (coarseness) {
00044     case -1:  return BfldGrid::kRect2dGrid;   break;
00045     case  0:  return BfldGrid::kFarCoarseV;   break;
00046     case  1:  return BfldGrid::kFarStdV;      break;
00047     case  2:  return BfldGrid::kFarFineV;     break;
00048     default: 
00049       // should inform the user that the value was bogus
00050               return BfldGrid::kFarStdV;
00051               break;
00052     }
00053     break;
00054   case Detector::kCalDet:
00055     return BfldGrid::kUndefined;
00056     break;
00057   default:    // bad things happen here!
00058     printf("BfldGrid::GetGrid Detector_t %#x\n",detector);
00059     assert(0);
00060     return BfldGrid::kUndefined;
00061     break;
00062   }
00063 }


Generated on 17 Jun 2018 for loon by  doxygen 1.6.1