FabNDThickness Class Reference

#include <FabNDThickness.h>

Inheritance diagram for FabNDThickness:
DbiTableRow

List of all members.

Public Member Functions

 FabNDThickness ()
virtual ~FabNDThickness ()
int GetPlane () const
float GetThickness (int i) const
const float * GetData () const
float GetMean () const
float GetRMS () 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

Static Public Member Functions

static float GetXPos (int i)
static float GetYPos (int i)
static const char * GetTableDescr ()
static void SetDefensiveUnpkg (Bool_t defensive)
static Bool_t GetDefensiveUnpkg ()

Static Public Attributes

static const unsigned int npts = 37

Private Member Functions

 FabNDThickness (const FabNDThickness &from)

Private Attributes

int fPlane
float fTK [37]

Static Private Attributes

static Bool_t fgDefensiveUnpkg = kFALSE
static const float xfeet [37]
static const float yfeet [37]

Detailed Description

Definition at line 29 of file FabNDThickness.h.


Constructor & Destructor Documentation

FabNDThickness::FabNDThickness (  )  [inline]

Definition at line 38 of file FabNDThickness.h.

References fTK, LEA_CTOR, and npts.

00038                   : fPlane(-1)
00039     { LEA_CTOR; for (unsigned int i=0; i<npts; i++) fTK[i] = 0.0; };

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

Definition at line 41 of file FabNDThickness.h.

References LEA_DTOR.

00041 { LEA_DTOR; };

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

Definition at line 80 of file FabNDThickness.h.

References LEA_CTOR.

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


Member Function Documentation

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

Implements DbiTableRow.

Definition at line 55 of file FabNDThickness.h.

00055 { return new FabNDThickness; }

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

Implements DbiTableRow.

Definition at line 90 of file FabNDThickness.cxx.

References DbiRowStream::CurColName(), DbiRowStream::CurColNum(), fgDefensiveUnpkg, Form(), fPlane, fTK, DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), Msg::kWarning, MSG, npts, and DbiRowStream::NumCols().

00091                                                             {
00092 //
00093 //
00094 //  Purpose:  Fill object from Result Set
00095 //
00096 //  Arguments: 
00097 //    rs           in    Result Set used to fill object
00098 //    vrec         in    Associated validity record (or 0 if filling
00099 //                                                    DbiValidityRec)
00100 //
00101 //  Return:    
00102 //
00103 //  Contact:   R. Hatcher
00104 //
00105 //  Specification:-
00106 //  =============
00107 //
00108 //  o Fill object from current row of Result Set.
00109 
00110 //  Program Notes:-
00111 //  =============
00112 
00113 //  None.
00114 
00115 
00116    if (fgDefensiveUnpkg) {
00117 
00118       // unpack allowing for various column names and ordering
00119 
00120       Int_t numCol = rs.NumCols();
00121       //  The first column (SeqNo) has already been processed.
00122       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00123         string colName = rs.CurColName();
00124         if (      colName == "PLANE") rs >> fPlane;
00125         else {
00126           bool found_column = false;
00127           for ( unsigned int indx = 0; indx < npts; ++indx ) {
00128             if ( colName == Form("TK%2.2d",indx) ) {
00129               rs >> fTK[indx];
00130               found_column = true;
00131               break;  // found it, no more looking
00132             }
00133           }
00134           if ( ! found_column ) {
00135             static int nmsg = 25;
00136             if (nmsg-- > 0) {
00137               MSG("Fab",Msg::kWarning) 
00138                 << "Ignoring column " << rs.CurColNum() 
00139                 << " (of " << rs.NumCols() << ")"
00140                 << " \""<< colName << "\"; not part of "
00141                 << ClassName() << endl;
00142             }
00143             rs.IncrementCurCol();
00144           } // not found as TKxx
00145         }   // not PLANE
00146       } // loop over columns
00147    } // end defensive unpacking
00148    else {
00149      rs >> fPlane;
00150      for (unsigned int i=0; i<npts; ++i) rs >> fTK[i];
00151    }
00152 }

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

Definition at line 195 of file FabNDThickness.cxx.

References GetMean(), GetPlane(), and GetRMS().

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

00197 {
00198   os << "Plane " << setw(3) << GetPlane() << " " 
00199      << " mean " << GetMean() << " rms " << GetRMS()
00200      << endl;
00201  
00202   os.setf(ios::right);
00203   return os;
00204 }

Int_t FabNDThickness::GetAggregateNo (  )  const [virtual]

Reimplemented from DbiTableRow.

Definition at line 66 of file FabNDThickness.cxx.

References fPlane.

00067 { return (UInt_t)fPlane; }

const float* FabNDThickness::GetData (  )  const [inline]

Definition at line 48 of file FabNDThickness.h.

References fTK.

00048 { return fTK; }     

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

Definition at line 74 of file FabNDThickness.h.

References fgDefensiveUnpkg.

00074 { return fgDefensiveUnpkg; }

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

Reimplemented from DbiTableRow.

Definition at line 70 of file FabNDThickness.cxx.

References fPlane.

00071 { return (UInt_t)fPlane; }

float FabNDThickness::GetMean (  )  const [inline]

Definition at line 49 of file FabNDThickness.h.

References fTK, and npts.

Referenced by FormatToOStream().

00049 { return TMath::Mean(npts,fTK,0); }

int FabNDThickness::GetPlane (  )  const [inline]

Definition at line 45 of file FabNDThickness.h.

References fPlane.

Referenced by FormatToOStream().

00045 { return fPlane; }

float FabNDThickness::GetRMS (  )  const [inline]

Definition at line 50 of file FabNDThickness.h.

References fTK, and npts.

Referenced by FormatToOStream().

00050 { return TMath::RMS(npts,fTK); }

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

Definition at line 208 of file FabNDThickness.cxx.

00209 {
00210 //
00211 //
00212 //  Purpose:  Return a string describing rows in the table
00213 //            Used in creating temporary tables
00214 //
00215 //  Return:   const char* to parenthesized comma separated list
00216 //            of column name and type pairs
00217 //
00218 //  Contact:   R. Hatcher
00219 //
00220 //  Specification:-
00221 //  =============
00222 //
00223 
00224 //  Program Notes:-
00225 //  =============
00226 
00227 //  None.
00228 
00229    const char* const_tabledescr = "(\
00230        SEQNO        int, \
00231        ROW_COUNTER  int, \
00232        PLANE        int, \
00233        TK00         float, \
00234        TK01         float, \
00235        TK02         float, \
00236        TK03         float, \
00237        TK04         float, \
00238        TK05         float, \
00239        TK06         float, \
00240        TK07         float, \
00241        TK08         float, \
00242        TK09         float, \
00243        TK10         float, \
00244        TK11         float, \
00245        TK12         float, \
00246        TK13         float, \
00247        TK14         float, \
00248        TK15         float, \
00249        TK16         float, \
00250        TK17         float, \
00251        TK18         float, \
00252        TK19         float, \
00253        TK20         float, \
00254        TK21         float, \
00255        TK22         float, \
00256        TK23         float, \
00257        TK24         float, \
00258        TK25         float, \
00259        TK26         float, \
00260        TK27         float, \
00261        TK28         float, \
00262        TK29         float, \
00263        TK30         float, \
00264        TK31         float, \
00265        TK32         float, \
00266        TK33         float, \
00267        TK34         float, \
00268        TK35         float, \
00269        TK36         float, \
00270        primary key (SEQNO,ROW_COUNTER) \
00271        )";
00272 
00273    return const_tabledescr;
00274 }

float FabNDThickness::GetThickness ( int  i  )  const [inline]

Definition at line 46 of file FabNDThickness.h.

References fTK, and npts.

00047    { if ( i<0 || i >= (int)npts ) assert(0); return fTK[i]; }

float FabNDThickness::GetXPos ( int  i  )  [static]

Definition at line 76 of file FabNDThickness.cxx.

References Munits::foot, npts, and xfeet.

00077 { 
00078   if ( i<0 || i>= (int)npts ) assert(0);
00079   return xfeet[i]*Munits::foot;
00080 }

float FabNDThickness::GetYPos ( int  i  )  [static]

Definition at line 82 of file FabNDThickness.cxx.

References Munits::foot, npts, and yfeet.

00083 { 
00084   if ( i<0 || i>= (int)npts ) assert(0);
00085   return yfeet[i]*Munits::foot;
00086 }

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

Definition at line 191 of file FabNDThickness.cxx.

References FormatToOStream().

00192 { FormatToOStream(cout,option); }

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

Definition at line 72 of file FabNDThickness.h.

References fgDefensiveUnpkg.

00073      { fgDefensiveUnpkg = defensive; }

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

Reimplemented from DbiTableRow.

Definition at line 156 of file FabNDThickness.cxx.

References fPlane, fTK, and npts.

00157                                                                   {
00158 //
00159 //
00160 //  Purpose:  Stream object to output row stream
00161 //
00162 //  Arguments: 
00163 //    ors          in     Output row stream.
00164 //    vrec         in     Associated validity record (or 0 if filling
00165 //                                                    DbiValidityRec)
00166 //
00167 //  Return:    
00168 //
00169 //  Contact:   R. Hatcher
00170 //
00171 //  Specification:-
00172 //  =============
00173 //
00174 //  o  Stream object to output row stream.
00175 
00176 //  Program Notes:-
00177 //  =============
00178 
00179 //  None.
00180 
00181    ors << fPlane;
00182    for (unsigned int i=0; i<npts; ++i) ors << fTK[i];
00183 
00184 }


Member Data Documentation

Bool_t FabNDThickness::fgDefensiveUnpkg = kFALSE [static, private]

Definition at line 90 of file FabNDThickness.h.

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

int FabNDThickness::fPlane [private]

Definition at line 85 of file FabNDThickness.h.

Referenced by Fill(), GetAggregateNo(), GetIndex(), GetPlane(), and Store().

float FabNDThickness::fTK[37] [private]

Definition at line 86 of file FabNDThickness.h.

Referenced by FabNDThickness(), Fill(), GetData(), GetMean(), GetRMS(), GetThickness(), and Store().

const unsigned int FabNDThickness::npts = 37 [static]

Definition at line 36 of file FabNDThickness.h.

Referenced by FabNDThickness(), Fill(), GetMean(), GetRMS(), GetThickness(), GetXPos(), GetYPos(), and Store().

const float FabNDThickness::xfeet [static, private]
Initial value:
 {       6, 5, 4,
                                             7, 6, 5, 4, 3,            
                                          8, 7, 6, 5, 4, 3, 2,
                                          8, 7, 6, 5, 4, 3, 2,
                                          8, 7, 6, 5, 4, 3, 2,
                                             7, 6, 5, 4, 3,
                                                6, 5, 4         }

Definition at line 92 of file FabNDThickness.h.

Referenced by GetXPos().

const float FabNDThickness::yfeet [static, private]
Initial value:
 {       3, 3, 3,
                                             2, 2, 2, 2, 2,            
                                          1, 1, 1, 1, 1, 1, 1,
                                          0, 0, 0, 0, 0, 0, 0,
                                         -1,-1,-1,-1,-1,-1,-1,
                                            -2,-2,-2,-2,-2,
                                               -3,-3,-3         }

Definition at line 93 of file FabNDThickness.h.

Referenced by GetYPos().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1