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) {
00171               MSG("Bfld",Msg::kWarning) 
00172                 << "Ignoring column " << rs.CurColNum() 
00173                 << " (of " << rs.NumCols() << ")"
00174                 << " \""<< colName << "\"; not part of "
00175                 << ClassName() << endl;
00176             }
00177             rs.IncrementCurCol();
00178          } // end of conditional if/elseif/else/
00179       } // end of loop
00180       fDetailShape = (MapShape_t)tmpshape;
00181    } // end defensive unpacking
00182    else {
00183       Int_t numCol = rs.NumCols() - (rs.HasRowCounter() ? 1 : 0);
00184       if ( 4 == numCol ) {
00185         rs >> ipln
00186            >> fMapVariant[0]
00187            >> fScale[0];
00188       }
00189       else if ( 6 == numCol ) {
00190         rs >> ipln
00191            >> fMapVariant[0]
00192            >> fScale[0]
00193            >> fMapVariant[1]
00194            >> fScale[1];
00195       }
00196       else if ( 7 == numCol ) {
00197         rs >> ipln
00198            >> fMapVariant[0]
00199            >> fScale[0]
00200            >> fMapVariant[1]
00201            >> fScale[1]
00202            >> fBHCurve;
00203       }
00204       else if ( 11 == numCol ) {
00205         rs >> ipln
00206            >> fMapVariant[0]
00207            >> fScale[0]
00208            >> fMapVariant[1]
00209            >> fScale[1]
00210            >> fBHCurve
00211            >> fBHFactor
00212            >> fBHCutoff
00213            >> fSlotFactor
00214            >> fSlotCutoff;
00215       }
00216       else if ( 15 == numCol ) {
00217         rs >> ipln
00218            >> fMapVariant[0]
00219            >> fScale[0]
00220            >> fMapVariant[1]
00221            >> fScale[1]
00222            >> fMapVariant[2]
00223            >> fScale[2]
00224            >> fMapVariant[3]
00225            >> fScale[3]
00226            >> fBHCurve
00227            >> fBHFactor
00228            >> fBHCutoff
00229            >> fSlotFactor
00230            >> fSlotCutoff;
00231       }
00232       else if ( 25 == numCol ) {
00233         int tmpshape;
00234         rs >> ipln
00235            >> fMapVariant[0]
00236            >> fScale[0]
00237            >> fMapVariant[1]
00238            >> fScale[1]
00239            >> fMapVariant[2]
00240            >> fScale[2]
00241            >> fMapVariant[3]
00242            >> fScale[3]
00243            >> fMapVariant[4]
00244            >> fScale[4]
00245            >> fMapVariant[5]
00246            >> fScale[5]
00247            >> fMapVariant[6]
00248            >> fScale[6]
00249            >> fMapVariant[7]
00250            >> fScale[7]
00251            >> fDetailSize
00252            >> tmpshape
00253            >> fBHCurve
00254            >> fBHFactor
00255            >> fBHCutoff
00256            >> fSlotFactor
00257            >> fSlotCutoff;
00258         fDetailShape = (MapShape_t)tmpshape;
00259       }
00260       else if ( 30 == numCol ) {
00261         int tmpshape;
00262         rs >> ipln
00263            >> fMapVariant[0]
00264            >> fScale[0]
00265            >> fMapVariant[1]
00266            >> fScale[1]
00267            >> fMapVariant[2]
00268            >> fScale[2]
00269            >> fMapVariant[3]
00270            >> fScale[3]
00271            >> fMapVariant[4]
00272            >> fScale[4]
00273            >> fMapVariant[5]
00274            >> fScale[5]
00275            >> fMapVariant[6]
00276            >> fScale[6]
00277            >> fMapVariant[7]
00278            >> fScale[7]
00279            >> fMapVariant[8]
00280            >> fScale[8]
00281            >> fMapVariant[9]
00282            >> fScale[9]
00283            >> fDetailSize
00284            >> tmpshape
00285            >> fBdotScale
00286            >> fBHCurve
00287            >> fBHFactor
00288            >> fBHCutoff
00289            >> fSlotFactor
00290            >> fSlotCutoff;
00291         fDetailShape = (MapShape_t)tmpshape;
00292       }
00293       else {
00294         static int nmsg = 25;
00295         if (nmsg-- > 0) {
00296           MSG("Bfld",Msg::kWarning) 
00297             << "Table has " << numCol << " columns, but in non-Defensive unpacking "
00298             << "we only know how to deal with 4, 6, 7, 11, 15, 25 or 30."
00299             << endl;
00300         }
00301       }
00302     }
00303 
00304     Detector::Detector_t det =
00305       (Detector::Detector_t) 
00306       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00307 
00308     fPlaneId = PlexPlaneId(det,ipln,kTRUE);
00309 
00310 #ifdef RWH_DEBUG
00311     if ( ipln == 0 )
00312       MSG("Bfld",Msg::kDebug) 
00313            << " BfldDbiPlaneMap plane " 
00314            << ipln << " vrec = " << *vrec
00315            << endl
00316            << *this
00317            << endl;
00318 #endif
00319 
00320 }

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

Definition at line 491 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().

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

Int_t BfldDbiPlaneMap::GetAggregateNo (  )  const [virtual]

Reimplemented from DbiTableRow.

Definition at line 471 of file BfldDbiPlaneMap.cxx.

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

00472 { 
00473   return (int)fPlaneId.GetDetector()*100000000 + fPlaneId.GetPlane();
00474 }

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 477 of file BfldDbiPlaneMap.cxx.

References fPlaneId, and PlexPlaneId::GetPlane().

00478 { 
00479   return fPlaneId.GetPlane();
00480 }

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 540 of file BfldDbiPlaneMap.cxx.

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

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

Definition at line 437 of file BfldDbiPlaneMap.cxx.

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

Referenced by BField::GetBField().

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

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 487 of file BfldDbiPlaneMap.cxx.

References FormatToOStream().

00488 { 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 431 of file BfldDbiPlaneMap.cxx.

References fDetailShape.

00432 { 
00433   fDetailShape = (MapShape_t)ishape; 
00434 }

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 324 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().

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


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 Thu Apr 10 23:02:15 2014 for loon by  doxygen 1.4.7