BfldDbiPlaneMap Class Reference

#include <BfldDbiPlaneMap.h>

Inheritance diagram for BfldDbiPlaneMap:

DbiTableRow List of all members.

Public Types

typedef enum BfldDbiPlaneMap::EMapIndex MapIndex_t
typedef enum BfldDbiPlaneMap::EMapShape MapShape_t
 kFullSteelA
 kFullSteelB
 kPowerOffA
 kPowerOffB
 kDetailSteelA
 kDetailSteelB
 kDetailGapA
 kDetailGapB
 kFullGapA
 kFullGapB
 kEndOfList
 kCircle
 kSquare
 kDiamond
enum  EMapIndex {
  kFullSteelA, kFullSteelB, kPowerOffA, kPowerOffB,
  kDetailSteelA, kDetailSteelB, kDetailGapA, kDetailGapB,
  kFullGapA, kFullGapB, kEndOfList
}
enum  EMapShape { kCircle, kSquare, kDiamond }

Public Member Functions

 BfldDbiPlaneMap ()
virtual ~BfldDbiPlaneMap ()
PlexPlaneId GetPlaneId () const
Int_t GetMapVariant (UInt_t indx=0) const
Double_t GetScale (UInt_t indx=0) const
Double_t GetDetailSize () const
MapShape_t GetDetailShape () const
Int_t GetBHCurveIndex () const
Double_t GetBHFactor () const
Double_t GetBHCutoff () const
Double_t GetSlotFactor () const
Double_t GetSlotCutoff () const
Double_t GetBdotScale () const
Bool_t IsInDetail (Double_t x, Double_t y) const
Bool_t IsNull (UInt_t indx) const
Bool_t IsPairNull (UInt_t indx) const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const
virtual void Print (Option_t *option="") const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
virtual Int_t GetAggregateNo () const
virtual UInt_t GetIndex (UInt_t defIndex) const
void SetPlaneId (PlexPlaneId plnid)
void SetMapVariant (UInt_t indx, Int_t imap)
void SetScale (UInt_t indx, Double_t scale)
void SetDetailSize (Double_t rinscribed)
void SetDetailShape (Int_t ishape)
void SetBHCurveIndex (UInt_t bhcurve)
void SetBHFactor (Double_t bhfactor)
void SetBHCutoff (Double_t bhcutoff)
void SetSlotFactor (Double_t slotfactor)
void SetSlotCutoff (Double_t slotcutoff)
void SetBdotScale (Double_t bdotscale)

Static Public Member Functions

static const char * GetTableDescr ()
static void SetDefensiveUnpkg (Bool_t defensive)
static Bool_t GetDefensiveUnpkg ()

Private Member Functions

 BfldDbiPlaneMap (const BfldDbiPlaneMap &from)

Private Attributes

PlexPlaneId fPlaneId
Int_t fMapVariant [kEndOfList]
Double_t fScale [kEndOfList]
Double_t fDetailSize
MapShape_t fDetailShape
Int_t fBHCurve
Double_t fBHFactor
Double_t fBHCutoff
Double_t fSlotFactor
Double_t fSlotCutoff
Double_t fBdotScale

Static Private Attributes

static Bool_t fgDefensiveUnpkg = kTRUE

Detailed Description

Definition at line 30 of file BfldDbiPlaneMap.h.


Member Typedef Documentation

typedef enum BfldDbiPlaneMap::EMapIndex BfldDbiPlaneMap::MapIndex_t

typedef enum BfldDbiPlaneMap::EMapShape BfldDbiPlaneMap::MapShape_t


Member Enumeration Documentation

enum BfldDbiPlaneMap::EMapIndex

Enumerator:
kFullSteelA 
kFullSteelB 
kPowerOffA 
kPowerOffB 
kDetailSteelA 
kDetailSteelB 
kDetailGapA 
kDetailGapB 
kFullGapA 
kFullGapB 
kEndOfList 

Definition at line 41 of file BfldDbiPlaneMap.h.

00041                           {
00042      kFullSteelA,    // full map in the steel
00043      kFullSteelB,
00044      kPowerOffA,     // full map with power off
00045      kPowerOffB,
00046      kDetailSteelA,  // detail of the steel
00047      kDetailSteelB,
00048      kDetailGapA,    // detail of gap region (inter-steel plane)
00049      kDetailGapB,
00050      kFullGapA,      // full map of gap region
00051      kFullGapB,
00052      kEndOfList
00053    } MapIndex_t;

enum BfldDbiPlaneMap::EMapShape

Enumerator:
kCircle 
kSquare 
kDiamond 

Definition at line 55 of file BfldDbiPlaneMap.h.

00055                           {
00056      kCircle,
00057      kSquare,
00058      kDiamond  // square in UV space
00059    } MapShape_t;


Constructor & Destructor Documentation

BfldDbiPlaneMap::BfldDbiPlaneMap (  ) 

Definition at line 54 of file BfldDbiPlaneMap.cxx.

References fMapVariant, fScale, kEndOfList, and LEA_CTOR.

00055   : fPlaneId(), 
00056     fDetailSize(0), fDetailShape(kCircle), fBHCurve(0), 
00057     fBHFactor(0), fBHCutoff(0), 
00058     fSlotFactor(0), fSlotCutoff(0), fBdotScale(1.0)
00059 {
00060   for ( int indx = 0; indx < kEndOfList; ++indx ) {
00061     fMapVariant[indx] = 0;
00062     fScale[indx]      = 0.0;
00063   }
00064   LEA_CTOR;
00065 }

virtual BfldDbiPlaneMap::~BfldDbiPlaneMap (  )  [inline, virtual]

Definition at line 38 of file BfldDbiPlaneMap.h.

References LEA_DTOR.

00038 { LEA_DTOR; };

BfldDbiPlaneMap::BfldDbiPlaneMap ( const BfldDbiPlaneMap from  )  [inline, private]

Definition at line 118 of file BfldDbiPlaneMap.h.

References LEA_CTOR.

00119      : DbiTableRow(from) { LEA_CTOR; *this = from; }


Member Function Documentation

virtual DbiTableRow* BfldDbiPlaneMap::CreateTableRow (  )  const [inline, virtual]

Implements DbiTableRow.

Definition at line 80 of file BfldDbiPlaneMap.h.

00080 { return new BfldDbiPlaneMap; }

void BfldDbiPlaneMap::Fill ( DbiResultSet rs,
const DbiValidityRec vrec 
) [virtual]

Implements DbiTableRow.

Definition at line 69 of file BfldDbiPlaneMap.cxx.

References DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fBdotScale, fBHCurve, fBHCutoff, fBHFactor, fDetailShape, fDetailSize, fgDefensiveUnpkg, fMapVariant, fPlaneId, fScale, fSlotCutoff, fSlotFactor, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), Msg::kDebug, Msg::kWarning, MSG, and DbiRowStream::NumCols().

00070                                                                   {
00071 //
00072 //
00073 //  Purpose:  Fill object from Result Set
00074 //
00075 //  Arguments: 
00076 //    rs           in    Result Set used to fill object
00077 //    vrec         in    Associated validity record (or 0 if filling
00078 //                                                    DbiValidityRec)
00079 //
00080 //  Return:    
00081 //
00082 //  Contact:   R. Hatcher
00083 //
00084 //  Specification:-
00085 //  =============
00086 //
00087 //  o Fill object from current row of Result Set.
00088 
00089 //  Program Notes:-
00090 //  =============
00091 
00092 //  None.
00093 
00094 
00095    UShort_t ipln = 1023;
00096 
00097    if (fgDefensiveUnpkg) {
00098 
00099       // unpack allowing for various column names and ordering
00100 
00101       Int_t tmpshape = fDetailShape;
00102 
00103       Int_t numCol = rs.NumCols();
00104       //  The first column (SeqNo) has already been processed.
00105       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00106          string colName = rs.CurColName();
00107 
00108          if (      colName == "PLANENUM")      rs >> ipln;
00109 
00110          // old column names
00111          else if ( colName == "MAPVAR")        rs >> fMapVariant[0];
00112          else if ( colName == "SCALE")         rs >> fScale[0];
00113          else if ( colName == "MAPVAR_2ND")    rs >> fMapVariant[1];
00114          else if ( colName == "SCALE_2ND")     rs >> fScale[1];
00115 
00116          // new column names
00117          else if ( colName == "MAPVAR1ON")     rs >> fMapVariant[0];
00118          else if ( colName == "SCALE1ON")      rs >> fScale[0];
00119          else if ( colName == "MAPVAR2ON")     rs >> fMapVariant[1];
00120          else if ( colName == "SCALE2ON")      rs >> fScale[1];
00121          else if ( colName == "MAPVAR1OFF")    rs >> fMapVariant[2];
00122          else if ( colName == "SCALE1OFF")     rs >> fScale[2];
00123          else if ( colName == "MAPVAR2OFF")    rs >> fMapVariant[3];
00124          else if ( colName == "SCALE2OFF")     rs >> fScale[3];
00125          // yet newer names
00126          else if ( colName == "MAPON1")         rs >> fMapVariant[0];
00127          else if ( colName == "SCALEON1")       rs >> fScale[0];
00128          else if ( colName == "MAPON2")         rs >> fMapVariant[1];
00129          else if ( colName == "SCALEON2")       rs >> fScale[1];
00130          else if ( colName == "MAPOFF1")        rs >> fMapVariant[2];
00131          else if ( colName == "SCALEOFF1")      rs >> fScale[2];
00132          else if ( colName == "MAPOFF2")        rs >> fMapVariant[3];
00133          else if ( colName == "SCALEOFF2")      rs >> fScale[3];
00134 
00135          // new columns
00136          else if ( colName == "MAPDETAIL1")     rs >> fMapVariant[4];
00137          else if ( colName == "SCALEDETAIL1")   rs >> fScale[4];
00138          else if ( colName == "MAPDETAIL2")     rs >> fMapVariant[5];
00139          else if ( colName == "SCALEDETAIL2")   rs >> fScale[5];
00140          else if ( colName == "MAPPLNGAP1")     rs >> fMapVariant[6];
00141          else if ( colName == "SCALEPLNGAP1")   rs >> fScale[6];
00142          else if ( colName == "MAPPLNGAP2")     rs >> fMapVariant[7];
00143          else if ( colName == "SCALEPLNGAP2")   rs >> fScale[7];
00144 
00145          // new (more descriptive) names
00146          else if ( colName == "MAPDETAILGAP1")    rs >> fMapVariant[6];
00147          else if ( colName == "SCALEDETAILGAP1")  rs >> fScale[6];
00148          else if ( colName == "MAPDETAILGAP2")    rs >> fMapVariant[7];
00149          else if ( colName == "SCALEDETAILGAP2")  rs >> fScale[7];
00150 
00151          // newest columns
00152          else if ( colName == "MAPFULLGAP1")    rs >> fMapVariant[8];
00153          else if ( colName == "SCALEFULLGAP1")  rs >> fScale[8];
00154          else if ( colName == "MAPFULLGAP2")    rs >> fMapVariant[9];
00155          else if ( colName == "SCALEFULLGAP2")  rs >> fScale[9];
00156 
00157          else if ( colName == "DETAILSIZE")     rs >> fDetailSize;
00158          else if ( colName == "DETAILSHAPE")    rs >> tmpshape;
00159 
00160          else if ( colName == "BDOTSCALE")      rs >> fBdotScale;
00161 
00162          else if ( colName == "BHCURVEINDEX")   rs >> fBHCurve;
00163          else if ( colName == "BHFACTOR")       rs >> fBHFactor;
00164          else if ( colName == "BHCUTOFF")       rs >> fBHCutoff;
00165          else if ( colName == "SLOTFACTOR")     rs >> fSlotFactor;
00166          else if ( colName == "SLOTCUTOFF")     rs >> fSlotCutoff;
00167 
00168          else {
00169             static int nmsg = 25;
00170             if (nmsg-- > 0) MSG("Bfld",Msg::kWarning) 
00171                << "Ignoring column " << rs.CurColNum() 
00172                << " (of " << rs.NumCols() << ")"
00173                << " \""<< colName << "\"; not part of "
00174                << ClassName() << endl;
00175             rs.IncrementCurCol();
00176          } // end of conditional if/elseif/else/
00177       } // end of loop
00178       fDetailShape = (MapShape_t)tmpshape;
00179    } // end defensive unpacking
00180    else {
00181       Int_t numCol = rs.NumCols() - (rs.HasRowCounter() ? 1 : 0);
00182       if ( 4 == numCol ) {
00183         rs >> ipln
00184            >> fMapVariant[0]
00185            >> fScale[0];
00186       }
00187       else if ( 6 == numCol ) {
00188         rs >> ipln
00189            >> fMapVariant[0]
00190            >> fScale[0]
00191            >> fMapVariant[1]
00192            >> fScale[1];
00193       }
00194       else if ( 7 == numCol ) {
00195         rs >> ipln
00196            >> fMapVariant[0]
00197            >> fScale[0]
00198            >> fMapVariant[1]
00199            >> fScale[1]
00200            >> fBHCurve;
00201       }
00202       else if ( 11 == numCol ) {
00203         rs >> ipln
00204            >> fMapVariant[0]
00205            >> fScale[0]
00206            >> fMapVariant[1]
00207            >> fScale[1]
00208            >> fBHCurve
00209            >> fBHFactor
00210            >> fBHCutoff
00211            >> fSlotFactor
00212            >> fSlotCutoff;
00213       }
00214       else if ( 15 == numCol ) {
00215         rs >> ipln
00216            >> fMapVariant[0]
00217            >> fScale[0]
00218            >> fMapVariant[1]
00219            >> fScale[1]
00220            >> fMapVariant[2]
00221            >> fScale[2]
00222            >> fMapVariant[3]
00223            >> fScale[3]
00224            >> fBHCurve
00225            >> fBHFactor
00226            >> fBHCutoff
00227            >> fSlotFactor
00228            >> fSlotCutoff;
00229       }
00230       else if ( 25 == numCol ) {
00231         int tmpshape;
00232         rs >> ipln
00233            >> fMapVariant[0]
00234            >> fScale[0]
00235            >> fMapVariant[1]
00236            >> fScale[1]
00237            >> fMapVariant[2]
00238            >> fScale[2]
00239            >> fMapVariant[3]
00240            >> fScale[3]
00241            >> fMapVariant[4]
00242            >> fScale[4]
00243            >> fMapVariant[5]
00244            >> fScale[5]
00245            >> fMapVariant[6]
00246            >> fScale[6]
00247            >> fMapVariant[7]
00248            >> fScale[7]
00249            >> fDetailSize
00250            >> tmpshape
00251            >> fBHCurve
00252            >> fBHFactor
00253            >> fBHCutoff
00254            >> fSlotFactor
00255            >> fSlotCutoff;
00256         fDetailShape = (MapShape_t)tmpshape;
00257       }
00258       else if ( 30 == numCol ) {
00259         int tmpshape;
00260         rs >> ipln
00261            >> fMapVariant[0]
00262            >> fScale[0]
00263            >> fMapVariant[1]
00264            >> fScale[1]
00265            >> fMapVariant[2]
00266            >> fScale[2]
00267            >> fMapVariant[3]
00268            >> fScale[3]
00269            >> fMapVariant[4]
00270            >> fScale[4]
00271            >> fMapVariant[5]
00272            >> fScale[5]
00273            >> fMapVariant[6]
00274            >> fScale[6]
00275            >> fMapVariant[7]
00276            >> fScale[7]
00277            >> fMapVariant[8]
00278            >> fScale[8]
00279            >> fMapVariant[9]
00280            >> fScale[9]
00281            >> fDetailSize
00282            >> tmpshape
00283            >> fBdotScale
00284            >> fBHCurve
00285            >> fBHFactor
00286            >> fBHCutoff
00287            >> fSlotFactor
00288            >> fSlotCutoff;
00289         fDetailShape = (MapShape_t)tmpshape;
00290       }
00291       else {
00292         static int nmsg = 25;
00293         if (nmsg-- > 0) MSG("Bfld",Msg::kWarning) 
00294           << "Table has " << numCol << " columns, but in non-Defensive unpacking "
00295           << "we only know how to deal with 4, 6, 7, 11, 15, 25 or 30."
00296           << endl;                          
00297       }
00298     }
00299 
00300     Detector::Detector_t det =
00301       (Detector::Detector_t) 
00302       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00303 
00304     fPlaneId = PlexPlaneId(det,ipln,kTRUE);
00305 
00306 #ifdef RWH_DEBUG
00307     if ( ipln == 0 )
00308       MSG("Bfld",Msg::kDebug) 
00309            << " BfldDbiPlaneMap plane " 
00310            << ipln << " vrec = " << *vrec
00311            << endl
00312            << *this
00313            << endl;
00314 #endif
00315 
00316 }

std::ostream & BfldDbiPlaneMap::FormatToOStream ( std::ostream &  os,
Option_t *  option = "" 
) const [virtual]

Definition at line 485 of file BfldDbiPlaneMap.cxx.

References PlexPlaneId::AsString(), fBdotScale, fBHCurve, fBHCutoff, fBHFactor, fDetailShape, fDetailSize, fMapVariant, fPlaneId, fScale, fSlotCutoff, fSlotFactor, Nav::GetName(), and kEndOfList.

Referenced by operator<<(), and Print().

00487 {
00488   os << GetName() << " " 
00489      << fPlaneId.AsString("c"); 
00490 
00491   const char* shapename = "unknown";
00492   const char* shapelist[] = { "circle", "square", "diamond" };
00493   if ( fDetailShape >= 0 && fDetailShape <= 2 ) shapename = shapelist[fDetailShape];
00494   os << ", Detail size=" << fDetailSize
00495      << " shape=" << shapename;
00496   os << endl;
00497 
00498   int indxlabel = 0;
00499   const char* unknownlabel = "Unknown Map Pair: ";
00500   const char* labels[]   = { "Current On:       ",
00501                              "Current Off:      ",
00502                              "Steel Detail:     ",
00503                              "Gap Detail:       ",
00504                              "Gap Full Plane:   " };
00505   int nlabels = sizeof(labels)/sizeof(const char*);
00506 
00507   int indx = 0;
00508   while ( indx < kEndOfList-1 ) {  // -1 because we're doing A+B pairs
00509     const char* thislabel = unknownlabel;
00510     if ( indxlabel < nlabels ) thislabel = labels[indxlabel];
00511     os << "   " << thislabel;
00512     bool do1st = (fMapVariant[indx  ]!=0 && fScale[indx  ]!=0);
00513     bool do2nd = (fMapVariant[indx+1]!=0 && fScale[indx+1]!=0);
00514     if ( ! do1st && ! do2nd ) os << "no field maps ";
00515     if ( do1st ) os << fScale[indx  ] << "*Map_" << fMapVariant[indx  ];
00516     if ( do1st && do2nd ) os << " + ";
00517     if ( do2nd ) os << fScale[indx+1] << "*Map_" << fMapVariant[indx+1];
00518     os << endl;
00519     indx += 2;   // do in pairs
00520     indxlabel++; // move pair label index onward
00521   }
00522 
00523   os << "   BdotScale " << fBdotScale;
00524   os << " BHCurveIndex " << fBHCurve;
00525   os << " BHFactor " << fBHFactor << "/" << fBHCutoff;
00526   os << " SlotFactor " << fSlotFactor << "/" << fSlotCutoff;
00527   os << endl;
00528 
00529   return os;
00530 }

Int_t BfldDbiPlaneMap::GetAggregateNo (  )  const [virtual]

Reimplemented from DbiTableRow.

Definition at line 465 of file BfldDbiPlaneMap.cxx.

References fPlaneId, PlexPlaneId::GetDetector(), and PlexPlaneId::GetPlane().

00466 { 
00467   return (int)fPlaneId.GetDetector()*100000000 + fPlaneId.GetPlane();
00468 }

Double_t BfldDbiPlaneMap::GetBdotScale (  )  const [inline]

Definition at line 73 of file BfldDbiPlaneMap.h.

References fBdotScale.

Referenced by BField::GetBField().

00073 { return fBdotScale; }

Int_t BfldDbiPlaneMap::GetBHCurveIndex (  )  const [inline]

Definition at line 68 of file BfldDbiPlaneMap.h.

References fBHCurve.

00068 { return fBHCurve; }

Double_t BfldDbiPlaneMap::GetBHCutoff (  )  const [inline]

Definition at line 70 of file BfldDbiPlaneMap.h.

References fBHCutoff.

Referenced by BField::ApplyBHFactorCorr().

00070 { return fBHCutoff; }

Double_t BfldDbiPlaneMap::GetBHFactor (  )  const [inline]

Definition at line 69 of file BfldDbiPlaneMap.h.

References fBHFactor.

Referenced by BField::ApplyBHFactorCorr().

00069 { return fBHFactor; }

static Bool_t BfldDbiPlaneMap::GetDefensiveUnpkg (  )  [inline, static]

Definition at line 112 of file BfldDbiPlaneMap.h.

References fgDefensiveUnpkg.

00112 { return fgDefensiveUnpkg; }

MapShape_t BfldDbiPlaneMap::GetDetailShape (  )  const [inline]

Definition at line 67 of file BfldDbiPlaneMap.h.

References fDetailShape.

Referenced by BfldCanvasSlice::Draw().

00067 { return fDetailShape; }

Double_t BfldDbiPlaneMap::GetDetailSize (  )  const [inline]

Definition at line 66 of file BfldDbiPlaneMap.h.

References fDetailSize.

Referenced by BfldCanvasSlice::Draw().

00066 { return fDetailSize; }

UInt_t BfldDbiPlaneMap::GetIndex ( UInt_t  defIndex  )  const [virtual]

Reimplemented from DbiTableRow.

Definition at line 471 of file BfldDbiPlaneMap.cxx.

References fPlaneId, and PlexPlaneId::GetPlane().

00472 { 
00473   return fPlaneId.GetPlane();
00474 }

Int_t BfldDbiPlaneMap::GetMapVariant ( UInt_t  indx = 0  )  const [inline]

Definition at line 143 of file BfldDbiPlaneMap.h.

References fMapVariant, and kEndOfList.

Referenced by BfldCanvasSlice::GetAdmixtureString(), and BField::GetBField().

00143                                                              {
00144   if ( indx < kEndOfList ) return fMapVariant[indx];
00145   // MSGMAX("Bfld",Msg::kWarning,10)
00146   //  << "GetMapVariant indx=" << indx << " must be [0,1]." << endl;
00147   return 0;
00148 }

PlexPlaneId BfldDbiPlaneMap::GetPlaneId (  )  const [inline]

Definition at line 63 of file BfldDbiPlaneMap.h.

References fPlaneId.

Referenced by BField::GetBField(), and BfldCache::SetPlaneMapCache().

00063 { return fPlaneId; }

Double_t BfldDbiPlaneMap::GetScale ( UInt_t  indx = 0  )  const [inline]

Definition at line 149 of file BfldDbiPlaneMap.h.

References fScale, and kEndOfList.

Referenced by BfldCanvasSlice::GetAdmixtureString(), and BField::GetBField().

00149                                                            {
00150   if ( indx < kEndOfList ) return fScale[indx];
00151   // MSGMAX("Bfld",Msg::kWarning,10)
00152   //  << "GetScale indx=" << indx << " must be [0,1]." << endl;
00153   return 0.0;
00154 }

Double_t BfldDbiPlaneMap::GetSlotCutoff (  )  const [inline]

Definition at line 72 of file BfldDbiPlaneMap.h.

References fSlotCutoff.

Referenced by BField::ApplySlotFactorCorr().

00072 { return fSlotCutoff; }

Double_t BfldDbiPlaneMap::GetSlotFactor (  )  const [inline]

Definition at line 71 of file BfldDbiPlaneMap.h.

References fSlotFactor.

Referenced by BField::ApplySlotFactorCorr().

00071 { return fSlotFactor; }

const char * BfldDbiPlaneMap::GetTableDescr (  )  [static]

Definition at line 534 of file BfldDbiPlaneMap.cxx.

00535 {
00536 //
00537 //
00538 //  Purpose:  Return a string describing rows in the table
00539 //            Used in creating temporary tables
00540 //
00541 //  Return:   const char* to parenthesized comma separated list
00542 //            of column name and type pairs
00543 //
00544 //  Contact:   R. Hatcher
00545 //
00546 //  Specification:-
00547 //  =============
00548 //
00549 
00550 //  Program Notes:-
00551 //  =============
00552 
00553 //  None.
00554 
00555    const char* const_tabledescr = "(\
00556        SEQNO             int,      \
00557        ROW_COUNTER       int,      \
00558        PLANENUM          int,      \
00559        MAPON1            int,      \
00560        SCALEON1          float,    \
00561        MAPON2            int,      \
00562        SCALEON2          float,    \
00563        MAPOFF1           int,      \
00564        SCALEOFF1         float,    \
00565        MAPOFF2           int,      \
00566        SCALEOFF2         float,    \
00567        MAPDETAIL1        int,      \
00568        SCALEDETAIL1      float,    \
00569        MAPDETAIL2        int,      \
00570        SCALEDETAIL2      float,    \
00571        MAPPLNGAP1        int,      \
00572        SCALEPLNGAP1      float,    \
00573        MAPPLNGAP2        int,      \
00574        SCALEPLNGAP2      float,    \
00575        MAPFULLGAP1       int,      \
00576        SCALEFULLGAP1     float,    \
00577        MAPFULLGAP2       int,      \
00578        SCALEFULLGAP2     float,    \
00579        DETAILSIZE        float,    \
00580        DETAILSHAPE       int,      \
00581        BHCURVEINDEX      int,      \
00582        BDOTSCALE         float,    \
00583        BHFACTOR          float,    \
00584        BHCUTOFF          float,    \
00585        SLOTFACTOR        float,    \
00586        SLOTCUTOFF        float,    \
00587        primary key (SEQNO,ROW_COUNTER) \
00588        )";
00589 
00590    return const_tabledescr;
00591 }

Bool_t BfldDbiPlaneMap::IsInDetail ( Double_t  x,
Double_t  y 
) const

Definition at line 431 of file BfldDbiPlaneMap.cxx.

References fDetailShape, fDetailSize, kCircle, kDiamond, kSquare, and FidVol::r_sqrt2.

Referenced by BField::GetBField().

00432 {
00433   switch ( fDetailShape ) {
00434   case kCircle:
00435     {
00436       Double_t r2     = x*x + y*y;
00437       Double_t r2max  = fDetailSize * fDetailSize;
00438       if ( r2 >= r2max ) return false;
00439       return true;
00440       break;
00441     }
00442   case kDiamond:
00443     {
00444       // translate into U,V space and make same test as kSquare
00445       static const Double_t r_sqrt2 = 1.0 / TMath::Sqrt(2.0);
00446       Double_t u = ( x + y ) * r_sqrt2;
00447       Double_t v = (-x + y ) * r_sqrt2;
00448       x = u; y = v;  // fall through so we don't need to repeat the test
00449     }
00450   case kSquare:
00451     {
00452       if ( x <= -fDetailSize || x >= fDetailSize ) return false;
00453       if ( y <= -fDetailSize || y >= fDetailSize ) return false;
00454       return true;
00455       break;
00456     }
00457   default:
00458     return false;  // not legal
00459     break;
00460   }
00461   return false;  // not legal
00462 }

Bool_t BfldDbiPlaneMap::IsNull ( UInt_t  indx  )  const [inline]

Definition at line 156 of file BfldDbiPlaneMap.h.

References fMapVariant, fScale, and kEndOfList.

Referenced by BfldCanvasSlice::GetAdmixtureString(), and BField::GetBField().

00157 {
00158   // no info  non-zero map/scale combination
00159   if ( indx >= kEndOfList ) return true;
00160   return ( ( fMapVariant[indx] * fScale[indx] ) == 0 );
00161 }

Bool_t BfldDbiPlaneMap::IsPairNull ( UInt_t  indx  )  const [inline]

Definition at line 163 of file BfldDbiPlaneMap.h.

References fMapVariant, fScale, and kEndOfList.

Referenced by BField::GetBField().

00164 {
00165   // no info  non-zero map/scale combination for A+B pair
00166   if ( indx >= kEndOfList-1 ) return true;
00167   return ( ( fMapVariant[indx]   * fScale[indx]   ) == 0 &&
00168            ( fMapVariant[indx+1] * fScale[indx+1] ) == 0    );
00169 }

void BfldDbiPlaneMap::Print ( Option_t *  option = ""  )  const [virtual]

Definition at line 481 of file BfldDbiPlaneMap.cxx.

References FormatToOStream().

00482 { FormatToOStream(cout,option); }

void BfldDbiPlaneMap::SetBdotScale ( Double_t  bdotscale  )  [inline]

Definition at line 107 of file BfldDbiPlaneMap.h.

References fBdotScale.

00107 { fBdotScale   = bdotscale; }

void BfldDbiPlaneMap::SetBHCurveIndex ( UInt_t  bhcurve  )  [inline]

Definition at line 102 of file BfldDbiPlaneMap.h.

References fBHCurve.

00102 { fBHCurve     = bhcurve; }

void BfldDbiPlaneMap::SetBHCutoff ( Double_t  bhcutoff  )  [inline]

Definition at line 104 of file BfldDbiPlaneMap.h.

References fBHCutoff.

00104 { fBHCutoff    = bhcutoff; }

void BfldDbiPlaneMap::SetBHFactor ( Double_t  bhfactor  )  [inline]

Definition at line 103 of file BfldDbiPlaneMap.h.

References fBHFactor.

00103 { fBHFactor    = bhfactor; }

static void BfldDbiPlaneMap::SetDefensiveUnpkg ( Bool_t  defensive  )  [inline, static]

Definition at line 110 of file BfldDbiPlaneMap.h.

References fgDefensiveUnpkg.

00111      { fgDefensiveUnpkg = defensive; }

void BfldDbiPlaneMap::SetDetailShape ( Int_t  ishape  ) 

Definition at line 425 of file BfldDbiPlaneMap.cxx.

References fDetailShape.

00426 { 
00427   fDetailShape = (MapShape_t)ishape; 
00428 }

void BfldDbiPlaneMap::SetDetailSize ( Double_t  rinscribed  )  [inline]

Definition at line 100 of file BfldDbiPlaneMap.h.

References fDetailSize.

00100 { fDetailSize  = rinscribed; }

void BfldDbiPlaneMap::SetMapVariant ( UInt_t  indx,
Int_t  imap 
) [inline]

Definition at line 171 of file BfldDbiPlaneMap.h.

References fMapVariant, and kEndOfList.

Referenced by BField::BField(), and BField::GetBField().

00171                                                                   {
00172   if ( indx < kEndOfList ) { fMapVariant[indx] = imap; return; }
00173   // MSGMAX("Bfld",Msg::kWarning,10)
00174   //  << "SetMapVariant indx=" << indx 
00175   //  << " must be [0," << kEndOfList << "]." << endl;
00176 }

void BfldDbiPlaneMap::SetPlaneId ( PlexPlaneId  plnid  )  [inline]

Definition at line 97 of file BfldDbiPlaneMap.h.

References fPlaneId.

00097 { fPlaneId     = plnid; }

void BfldDbiPlaneMap::SetScale ( UInt_t  indx,
Double_t  scale 
) [inline]

Definition at line 177 of file BfldDbiPlaneMap.h.

References fScale, and kEndOfList.

Referenced by BField::BField(), and BField::GetBField().

00177                                                                  {
00178   if ( indx < kEndOfList ) { fScale[indx] = scale; return; }
00179   // MSGMAX("Bfld",Msg::kWarning,10)
00180   //  << "SetScale indx=" << indx 
00181   //  << " must be [0," << kEndOfList << "]." << endl;
00182 }

void BfldDbiPlaneMap::SetSlotCutoff ( Double_t  slotcutoff  )  [inline]

Definition at line 106 of file BfldDbiPlaneMap.h.

References fSlotCutoff.

00106 { fSlotCutoff  = slotcutoff; }

void BfldDbiPlaneMap::SetSlotFactor ( Double_t  slotfactor  )  [inline]

Definition at line 105 of file BfldDbiPlaneMap.h.

References fSlotFactor.

00105 { fSlotFactor  = slotfactor; }

void BfldDbiPlaneMap::Store ( DbiOutRowStream ors,
const DbiValidityRec vrec 
) const [virtual]

Reimplemented from DbiTableRow.

Definition at line 320 of file BfldDbiPlaneMap.cxx.

References fBdotScale, fBHCurve, fBHCutoff, fBHFactor, fDetailShape, fDetailSize, fMapVariant, fPlaneId, fScale, fSlotCutoff, fSlotFactor, PlexPlaneId::GetPlane(), DbiRowStream::HasRowCounter(), Msg::kWarning, MSG, and DbiRowStream::NumCols().

00321                                                                   {
00322 //
00323 //
00324 //  Purpose:  Stream object to output row stream
00325 //
00326 //  Arguments: 
00327 //    ors          in     Output row stream.
00328 //    vrec         in     Associated validity record (or 0 if filling
00329 //                                                    DbiValidityRec)
00330 //
00331 //  Return:    
00332 //
00333 //  Contact:   R. Hatcher
00334 //
00335 //  Specification:-
00336 //  =============
00337 //
00338 //  o  Stream object to output row stream.
00339 
00340 //  Program Notes:-
00341 //  =============
00342 
00343 //  None.
00344 
00345   Int_t numCol = ors.NumCols() - (ors.HasRowCounter() ? 1 : 0);
00346   if ( 4 == numCol ) {
00347     ors << fPlaneId.GetPlane() << fMapVariant[0] << fScale[0];
00348   }
00349   else if ( 6 == numCol ) {
00350     ors << fPlaneId.GetPlane() 
00351         << fMapVariant[0] << fScale [0]
00352         << fMapVariant[1] << fScale [1];
00353   }
00354   else if ( 8 == numCol ) {
00355     ors << fPlaneId.GetPlane() 
00356         << fMapVariant[0] << fScale [0]
00357         << fMapVariant[1] << fScale [1]
00358         << fBHCurve;
00359   }
00360   else if ( 11 == numCol ) {
00361     ors << fPlaneId.GetPlane() 
00362         << fMapVariant[0] << fScale [0]
00363         << fMapVariant[1] << fScale [1]
00364         << fBHCurve
00365         << fBHFactor      << fBHCutoff
00366         << fSlotFactor    << fSlotCutoff;
00367   }
00368   else if ( 15 == numCol ) {
00369     ors << fPlaneId.GetPlane() 
00370         << fMapVariant[0] << fScale [0]
00371         << fMapVariant[1] << fScale [1]
00372         << fMapVariant[2] << fScale [2]
00373         << fMapVariant[3] << fScale [3]
00374         << fBHCurve
00375         << fBHFactor      << fBHCutoff
00376         << fSlotFactor    << fSlotCutoff;
00377   }
00378   else if ( 25 == numCol ) {
00379     ors << fPlaneId.GetPlane()
00380         << fMapVariant[0] << fScale[0]
00381         << fMapVariant[1] << fScale[1]
00382         << fMapVariant[2] << fScale[2]
00383         << fMapVariant[3] << fScale[3]
00384         << fMapVariant[4] << fScale[4]
00385         << fMapVariant[5] << fScale[5]
00386         << fMapVariant[6] << fScale[6]
00387         << fMapVariant[7] << fScale[7]
00388         << fDetailSize    << (int)fDetailShape
00389         << fBHCurve
00390         << fBHFactor
00391         << fBHCutoff
00392         << fSlotFactor
00393         << fSlotCutoff;
00394   }
00395   else if ( 25 == numCol ) {
00396     ors << fPlaneId.GetPlane()
00397         << fMapVariant[0] << fScale[0]
00398         << fMapVariant[1] << fScale[1]
00399         << fMapVariant[2] << fScale[2]
00400         << fMapVariant[3] << fScale[3]
00401         << fMapVariant[4] << fScale[4]
00402         << fMapVariant[5] << fScale[5]
00403         << fMapVariant[6] << fScale[6]
00404         << fMapVariant[7] << fScale[7]
00405         << fMapVariant[8] << fScale[8]
00406         << fMapVariant[9] << fScale[9]
00407         << fDetailSize    << (int)fDetailShape
00408         << fBdotScale
00409         << fBHCurve
00410         << fBHFactor
00411         << fBHCutoff
00412         << fSlotFactor
00413         << fSlotCutoff;
00414   }
00415   else {
00416     static int nmsg = 25;
00417     if (nmsg-- > 0) MSG("Bfld",Msg::kWarning) 
00418       << "Table has " << numCol << " columns, but Store() "
00419       << "we only know how to deal with 4, 6, 7, 11, 15, 25 or 30."
00420       << endl;                          
00421   }
00422 }


Member Data Documentation

Double_t BfldDbiPlaneMap::fBdotScale [private]

Definition at line 133 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetBdotScale(), SetBdotScale(), and Store().

Int_t BfldDbiPlaneMap::fBHCurve [private]

Definition at line 128 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetBHCurveIndex(), SetBHCurveIndex(), and Store().

Double_t BfldDbiPlaneMap::fBHCutoff [private]

Definition at line 130 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetBHCutoff(), SetBHCutoff(), and Store().

Double_t BfldDbiPlaneMap::fBHFactor [private]

Definition at line 129 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetBHFactor(), SetBHFactor(), and Store().

MapShape_t BfldDbiPlaneMap::fDetailShape [private]

Definition at line 127 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetDetailShape(), IsInDetail(), SetDetailShape(), and Store().

Double_t BfldDbiPlaneMap::fDetailSize [private]

Definition at line 126 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetDetailSize(), IsInDetail(), SetDetailSize(), and Store().

Bool_t BfldDbiPlaneMap::fgDefensiveUnpkg = kTRUE [static, private]

Definition at line 137 of file BfldDbiPlaneMap.h.

Referenced by Fill(), GetDefensiveUnpkg(), and SetDefensiveUnpkg().

Int_t BfldDbiPlaneMap::fMapVariant[kEndOfList] [private]

Definition at line 124 of file BfldDbiPlaneMap.h.

Referenced by BfldDbiPlaneMap(), Fill(), FormatToOStream(), GetMapVariant(), IsNull(), IsPairNull(), SetMapVariant(), and Store().

PlexPlaneId BfldDbiPlaneMap::fPlaneId [private]

Definition at line 123 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetAggregateNo(), GetIndex(), GetPlaneId(), SetPlaneId(), and Store().

Double_t BfldDbiPlaneMap::fScale[kEndOfList] [private]

Definition at line 125 of file BfldDbiPlaneMap.h.

Referenced by BfldDbiPlaneMap(), Fill(), FormatToOStream(), GetScale(), IsNull(), IsPairNull(), SetScale(), and Store().

Double_t BfldDbiPlaneMap::fSlotCutoff [private]

Definition at line 132 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetSlotCutoff(), SetSlotCutoff(), and Store().

Double_t BfldDbiPlaneMap::fSlotFactor [private]

Definition at line 131 of file BfldDbiPlaneMap.h.

Referenced by Fill(), FormatToOStream(), GetSlotFactor(), SetSlotFactor(), and Store().


The documentation for this class was generated from the following files:
Generated on Fri May 24 22:03:10 2013 for loon by  doxygen 1.4.7