Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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

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

Static Public Attributes

const unsigned int npts = 37

Private Member Functions

 FabNDThickness (const FabNDThickness &from)

Private Attributes

int fPlane
float fTK [37]

Static Private Attributes

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

Constructor & Destructor Documentation

FabNDThickness::FabNDThickness  )  [inline]
 

Definition at line 38 of file FabNDThickness.h.

References fPlane, and fTK.

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.

00041 { LEA_DTOR; };

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

Definition at line 80 of file FabNDThickness.h.

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(), Form(), fTK, DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), MSG, 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") ) {
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) MSG("Fab",Msg::kWarning) 
00137                << "Ignoring column " << rs.CurColNum() 
00138                << " (of " << rs.NumCols() << ")"
00139                << " \""<< colName << "\"; not part of "
00140                << ClassName() << endl;
00141             rs.IncrementCurCol();
00142           } // not found as TKxx
00143         }   // not PLANE
00144       } // loop over columns
00145    } // end defensive unpacking
00146    else {
00147      rs >> fPlane;
00148      for (unsigned int i=0; i<npts; ++i) rs >> fTK[i];
00149    }
00150 }

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

Definition at line 193 of file FabNDThickness.cxx.

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

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

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

Int_t FabNDThickness::GetAggregateNo  )  const [virtual]
 

Reimplemented from DbiTableRow.

Definition at line 66 of file FabNDThickness.cxx.

00067 { return (UInt_t)fPlane; }

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

Definition at line 48 of file FabNDThickness.h.

00048 { return fTK; }     

Bool_t FabNDThickness::GetDefensiveUnpkg  )  [inline, static]
 

Definition at line 74 of file FabNDThickness.h.

00074 { return fgDefensiveUnpkg; }

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

Reimplemented from DbiTableRow.

Definition at line 70 of file FabNDThickness.cxx.

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.

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 206 of file FabNDThickness.cxx.

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

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

Definition at line 46 of file FabNDThickness.h.

References fTK.

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 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 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 189 of file FabNDThickness.cxx.

References FormatToOStream(), and option.

00190 { FormatToOStream(cout,option); }

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 154 of file FabNDThickness.cxx.

References fTK.

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


Member Data Documentation

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

Definition at line 31 of file FabNDThickness.cxx.

Referenced by SetDefensiveUnpkg().

int FabNDThickness::fPlane [private]
 

Definition at line 85 of file FabNDThickness.h.

Referenced by FabNDThickness().

float FabNDThickness::fTK[37] [private]
 

Definition at line 86 of file FabNDThickness.h.

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

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

Definition at line 45 of file FabNDThickness.cxx.

Referenced by GetMean(), and GetRMS().

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 47 of file FabNDThickness.cxx.

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 55 of file FabNDThickness.cxx.

Referenced by GetYPos().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:09 2010 for loon by  doxygen 1.3.9.1