UgliDbiSteelPln Class Reference

#include <UgliDbiSteelPln.h>

Inheritance diagram for UgliDbiSteelPln:
DbiTableRow

List of all members.

Public Member Functions

 UgliDbiSteelPln ()
 UgliDbiSteelPln (PlexPlaneId plnid, Int_t melt, Float_t thick, Float_t totalz, Float_t x0, Float_t y0, Float_t zback, Float_t theta_x, Float_t phi_x, Float_t theta_y, Float_t phi_y, Float_t theta_z, Float_t phi_z)
virtual ~UgliDbiSteelPln ()
virtual Int_t GetAggregateNo () const
virtual UInt_t GetIndex (UInt_t) const
PlexPlaneId GetPlaneId () const
Int_t GetPlane () const
Int_t GetMeltCode () const
Float_t GetThickness () const
Float_t GetTotalZ () const
Float_t GetX0 () const
Float_t GetY0 () const
Float_t GetZBack () const
Float_t GetThetaRad (Int_t indx) const
Float_t GetPhiRad (Int_t indx) const
Float_t GetThetaDeg (Int_t indx) const
Float_t GetPhiDeg (Int_t indx) const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="", const DbiValidityRec *vrec=0) const
virtual void Print (Option_t *option="") const

Static Public Member Functions

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

Private Member Functions

 UgliDbiSteelPln (const UgliDbiSteelPln &from)

Private Attributes

PlexPlaneId fPlaneId
Int_t fMeltCode
Float_t fThickness
Float_t fTotalZ
Float_t fX0
Float_t fY0
Float_t fZBack
Float_t fThetaXYZRad [3]
Float_t fPhiXYZRad [3]

Static Private Attributes

static Bool_t fgDefensiveUnpkg = kFALSE

Detailed Description

Definition at line 30 of file UgliDbiSteelPln.h.


Constructor & Destructor Documentation

UgliDbiSteelPln::UgliDbiSteelPln (  )  [inline]

Definition at line 37 of file UgliDbiSteelPln.h.

References fPhiXYZRad, fThetaXYZRad, and LEA_CTOR.

00038       : fPlaneId(), fMeltCode(-1), fThickness(-1), fTotalZ(-1),
00039         fX0(0), fY0(0), fZBack(0)
00040       { LEA_CTOR; 
00041         for (int i=0; i<3; i++) {
00042            fThetaXYZRad[i] = 0;
00043            fPhiXYZRad[i] = 0;
00044         }
00045       }

UgliDbiSteelPln::UgliDbiSteelPln ( PlexPlaneId  plnid,
Int_t  melt,
Float_t  thick,
Float_t  totalz,
Float_t  x0,
Float_t  y0,
Float_t  zback,
Float_t  theta_x,
Float_t  phi_x,
Float_t  theta_y,
Float_t  phi_y,
Float_t  theta_z,
Float_t  phi_z 
) [inline]

Definition at line 47 of file UgliDbiSteelPln.h.

References fPhiXYZRad, fThetaXYZRad, and LEA_CTOR.

00051       : fPlaneId(plnid), fMeltCode(melt), fThickness(thick), fTotalZ(totalz),
00052         fX0(x0), fY0(y0), fZBack(zback)
00053       { LEA_CTOR;
00054         fThetaXYZRad[0] = theta_x; fPhiXYZRad[0] = phi_x;
00055         fThetaXYZRad[1] = theta_y; fPhiXYZRad[1] = phi_y;
00056         fThetaXYZRad[2] = theta_z; fPhiXYZRad[2] = phi_z;
00057       }

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

Definition at line 59 of file UgliDbiSteelPln.h.

References LEA_DTOR.

00059 { LEA_DTOR; };

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

Definition at line 104 of file UgliDbiSteelPln.h.

References LEA_CTOR.

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


Member Function Documentation

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

Implements DbiTableRow.

Definition at line 81 of file UgliDbiSteelPln.h.

00081 { return new UgliDbiSteelPln; }

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

Implements DbiTableRow.

Definition at line 56 of file UgliDbiSteelPln.cxx.

References DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fgDefensiveUnpkg, fMeltCode, fPhiXYZRad, fPlaneId, fThetaXYZRad, fThickness, fTotalZ, fX0, fY0, fZBack, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), PlaneCoverage::kUnknown, PlaneView::kUnknown, Msg::kWarning, MSG, and DbiRowStream::NumCols().

00057                                                                   {
00058 //
00059 //
00060 //  Purpose:  Fill object from Result Set
00061 //
00062 //  Arguments: 
00063 //    rs           in    Result Set used to fill object
00064 //    vrec         in    Associated validity record (or 0 if filling
00065 //                                                    DbiValidityRec)
00066 //
00067 //  Return:    
00068 //
00069 //  Contact:   R. Hatcher
00070 //
00071 //  Specification:-
00072 //  =============
00073 //
00074 //  o Fill object from current row of Result Set.
00075 
00076 //  Program Notes:-
00077 //  =============
00078 
00079 //  None.
00080 
00081    Detector::Detector_t det =
00082       (Detector::Detector_t) 
00083       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00084    
00085    Int_t plane                             = -1;
00086    PlaneView::PlaneView_t view             = PlaneView::kUnknown;
00087    PlaneCoverage::PlaneCoverage_t coverage = PlaneCoverage::kUnknown;
00088    Int_t tmp;
00089 
00090    if (fgDefensiveUnpkg) {
00091 
00092       // unpack allowing for various column names and ordering
00093 
00094       Int_t numCol = rs.NumCols();
00095       //  The first column (SeqNo) has already been processed.
00096       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00097          string colName = rs.CurColName();
00098          if      ( colName == "HASHVAL"   ) rs.IncrementCurCol();
00099          // "HASH" is obsolete
00100          else if ( colName == "HASH"      ) rs.IncrementCurCol();
00101          else if ( colName == "PLANE"     ) rs >> plane;
00102          else if ( colName == "PLNVIEW"   ) { 
00103             rs >> tmp; view = (PlaneView::PlaneView_t)tmp;
00104          }
00105          // "VIEW" is obsolete
00106          else if ( colName == "VIEW"      ) { 
00107             rs >> tmp; view = (PlaneView::PlaneView_t)tmp;
00108          }
00109          else if ( colName == "COVERAGE"  ) {
00110             rs >> tmp; coverage = (PlaneCoverage::PlaneCoverage_t)tmp;
00111          }
00112          else if ( colName == "MELTCODE"  )  rs >> fMeltCode;
00113          else if ( colName == "THICKNESS" )  rs >> fThickness;
00114          else if ( colName == "TOTALZ"    )  rs >> fTotalZ;
00115          else if ( colName == "X0"        )  rs >> fX0;
00116          else if ( colName == "Y0"        )  rs >> fY0;
00117          else if ( colName == "ZBACK"     )  rs >> fZBack;
00118          else if ( colName == "THETAXRAD" )  rs >> fThetaXYZRad[0];
00119          else if ( colName == "THETAYRAD" )  rs >> fThetaXYZRad[1];
00120          else if ( colName == "THETAZRAD" )  rs >> fThetaXYZRad[2];
00121          else if ( colName == "PHIYRAD"   )  rs >> fPhiXYZRad[1];
00122          else if ( colName == "PHIXRAD"   )  rs >> fPhiXYZRad[0];
00123          else if ( colName == "PHIZRAD"   )  rs >> fPhiXYZRad[2];
00124          else {
00125             static int nmsg = 25;
00126             if (nmsg-- > 0) {
00127               MSG("Ugli",Msg::kWarning) 
00128                 << "Ignoring column " << rs.CurColNum() 
00129                 << " (of " << rs.NumCols() << ")"
00130                 << " \""<< colName << "\"; not part of "
00131                 << ClassName() << endl;
00132             }
00133             rs.IncrementCurCol();
00134          }
00135       }
00136    } // end defensive unpacking
00137    else {
00138       Int_t hashv, tmpview, tmpcoverage;
00139       rs >> hashv
00140          >> plane
00141          >> tmpview
00142          >> tmpcoverage
00143          >> fMeltCode
00144          >> fThickness
00145          >> fTotalZ
00146          >> fX0
00147          >> fY0
00148          >> fZBack
00149          >> fThetaXYZRad[0]
00150          >> fPhiXYZRad[0] 
00151          >> fThetaXYZRad[1]
00152          >> fPhiXYZRad[1]
00153          >> fThetaXYZRad[2]
00154          >> fPhiXYZRad[2];
00155 
00156       view = (PlaneView::PlaneView_t)tmpview;
00157       coverage = (PlaneCoverage::PlaneCoverage_t)tmpcoverage;
00158 
00159    }      
00160    fPlaneId = PlexPlaneId(det,plane,kTRUE,view,coverage);
00161 
00162 }

std::ostream & UgliDbiSteelPln::FormatToOStream ( std::ostream &  os,
Option_t *  option = "",
const DbiValidityRec vrec = 0 
) const [virtual]

Definition at line 239 of file UgliDbiSteelPln.cxx.

References fMeltCode, fPhiXYZRad, fPlaneId, fThetaXYZRad, fThickness, fTotalZ, fX0, fY0, fZBack, GetPlane(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), DbiValidityRec::GetSeqNo(), GetTableDescr(), UgliDbiTableDescr::ParseTableDescr(), and UgliDbiTableDescr::TextTableDescrLine().

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

00242 {
00243 //
00244 //
00245 //  Purpose:  Print the current row to an ostream
00246 //
00247 //  Return:   nothing
00248 //
00249 //  Contact:   R. Hatcher
00250 //
00251 //  Specification:-
00252 //  =============
00253 //
00254 
00255 //  Program Notes:-
00256 //  =============
00257 
00258 //  None.
00259 
00260   string opt = option;
00261 
00262   if ( opt.find("H") != string::npos ) {
00263      string tabledescr = GetTableDescr();
00264      tabledescr = UgliDbiTableDescr::TextTableDescrLine(tabledescr);
00265      os << tabledescr << endl;
00266   }
00267   else if ( opt.find("h") != string::npos ) {
00268     string tabledescr = GetTableDescr();
00269     vector< pair<string,string> > components = 
00270         UgliDbiTableDescr::ParseTableDescr(tabledescr);
00271     for (unsigned int ic = 0; ic < components.size(); ++ic) 
00272         os << components[ic].first << '\t';
00273     os << endl;
00274   }
00275 
00276   char sep = '\t';
00277   if ( opt.find(",") != string::npos ) sep = ',';
00278 
00279   if ( ! dvr ) {
00280       os << "SeqNo"         << sep;  // no way of knowing the SEQNO?
00281   }
00282   else {
00283       os << dvr->GetSeqNo() << sep;
00284   }
00285 
00286   os   <<  0  << sep  // only ever one row for an agg (AggregateNo=plane#)
00287        << -1  << sep  // Hashval is obsolete
00288        << GetPlane()       << sep 
00289        << (int)fPlaneId.GetPlaneView()     << sep 
00290        << (int)fPlaneId.GetPlaneCoverage() << sep 
00291        << fMeltCode        << sep 
00292        << fThickness       << sep 
00293        << fTotalZ          << sep 
00294        << fX0              << sep 
00295        << fY0              << sep 
00296        << fZBack           << sep 
00297        << fThetaXYZRad[0]  << sep 
00298        << fPhiXYZRad[0]    << sep 
00299        << fThetaXYZRad[1]  << sep
00300        << fPhiXYZRad[1]    << sep 
00301        << fThetaXYZRad[2]  << sep
00302        << fPhiXYZRad[2]    << endl;
00303   
00304   return os;
00305 }

virtual Int_t UgliDbiSteelPln::GetAggregateNo (  )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 63 of file UgliDbiSteelPln.h.

References fPlaneId, and PlexPlaneId::GetPlane().

00063 { return fPlaneId.GetPlane(); }

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

Definition at line 98 of file UgliDbiSteelPln.h.

References fgDefensiveUnpkg.

00098 { return fgDefensiveUnpkg; }

virtual UInt_t UgliDbiSteelPln::GetIndex ( UInt_t   )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 64 of file UgliDbiSteelPln.h.

References fPlaneId, and PlexPlaneId::GetPlane().

Referenced by Store().

00064 { return fPlaneId.GetPlane(); }

Int_t UgliDbiSteelPln::GetMeltCode (  )  const [inline]

Definition at line 68 of file UgliDbiSteelPln.h.

References fMeltCode.

00068 { return fMeltCode; }

Float_t UgliDbiSteelPln::GetPhiDeg ( Int_t  indx  )  const [inline]
Float_t UgliDbiSteelPln::GetPhiRad ( Int_t  indx  )  const [inline]

Definition at line 75 of file UgliDbiSteelPln.h.

References fPhiXYZRad.

00075 { return fPhiXYZRad[indx]; }

Int_t UgliDbiSteelPln::GetPlane (  )  const [inline]

Definition at line 67 of file UgliDbiSteelPln.h.

References fPlaneId, and PlexPlaneId::GetPlane().

Referenced by FormatToOStream().

00067 { return fPlaneId.GetPlane(); }

PlexPlaneId UgliDbiSteelPln::GetPlaneId (  )  const [inline]

Definition at line 66 of file UgliDbiSteelPln.h.

References fPlaneId.

Referenced by UgliGeometry::BuildNodes().

00066 { return fPlaneId; }

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

Definition at line 309 of file UgliDbiSteelPln.cxx.

Referenced by FormatToOStream(), UgliGeometryReroot::MakeTempDbiPosInfo(), and Store().

00310 {
00311 //
00312 //
00313 //  Purpose:  Return a string describing rows in the table
00314 //            Used in creating temporary tables
00315 //
00316 //  Return:   const char* to parenthesized comma separated list
00317 //            of column name and type pairs
00318 //
00319 //  Contact:   R. Hatcher
00320 //
00321 //  Specification:-
00322 //  =============
00323 //
00324 
00325 //  Program Notes:-
00326 //  =============
00327 
00328 //  None.
00329 
00330    const char* const_tabledescr = "(\
00331        SEQNO         int,      \
00332        ROW_COUNTER   int,      \
00333        HASHVAL       int,      \
00334        PLANE         smallint, \
00335        PLNVIEW       tinyint,  \
00336        COVERAGE      tinyint,  \
00337        MELTCODE      int,      \
00338        THICKNESS     float,    \
00339        TOTALZ        float,    \
00340        X0            float,    \
00341        Y0            float,    \
00342        ZBACK         float,    \
00343        THETAXRAD     float,    \
00344        PHIXRAD       float,    \
00345        THETAYRAD     float,    \
00346        PHIYRAD       float,    \
00347        THETAZRAD     float,    \
00348        PHIZRAD       float,    \
00349        primary key (SEQNO,ROW_COUNTER) \
00350        )";
00351 
00352    return const_tabledescr;
00353 }

Float_t UgliDbiSteelPln::GetThetaDeg ( Int_t  indx  )  const [inline]
Float_t UgliDbiSteelPln::GetThetaRad ( Int_t  indx  )  const [inline]

Definition at line 74 of file UgliDbiSteelPln.h.

References fThetaXYZRad.

00074 { return fThetaXYZRad[indx]; }

Float_t UgliDbiSteelPln::GetThickness (  )  const [inline]
Float_t UgliDbiSteelPln::GetTotalZ (  )  const [inline]
Float_t UgliDbiSteelPln::GetX0 (  )  const [inline]
Float_t UgliDbiSteelPln::GetY0 (  )  const [inline]

Definition at line 72 of file UgliDbiSteelPln.h.

References fY0.

Referenced by GeoShieldGroup::AddVolume(), GeoGeometry::BuildDetector(), and UgliSteelPlnNode::UgliSteelPlnNode().

00072 { return fY0; }

Float_t UgliDbiSteelPln::GetZBack (  )  const [inline]
void UgliDbiSteelPln::Print ( Option_t *  option = ""  )  const [virtual]

Definition at line 232 of file UgliDbiSteelPln.cxx.

References FormatToOStream().

00233 {
00234     FormatToOStream(cout,option);
00235 }

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

Definition at line 96 of file UgliDbiSteelPln.h.

References fgDefensiveUnpkg.

00097       { fgDefensiveUnpkg = defensive; }

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

Reimplemented from DbiTableRow.

Definition at line 166 of file UgliDbiSteelPln.cxx.

References fMeltCode, fPhiXYZRad, fPlaneId, fThetaXYZRad, fThickness, fTotalZ, fX0, fY0, fZBack, GetIndex(), PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), GetTableDescr(), Msg::kFatal, MSG, n, and UgliDbiTableDescr::ParseTableDescr().

00167                                                                     {
00168 //
00169 //
00170 //  Purpose:  Stream object to output row stream
00171 //
00172 //  Arguments: 
00173 //    ors          in     Output row stream.
00174 //    vrec         in     Associated validity record (or 0 if filling
00175 //                                                    DbiValidityRec)
00176 //
00177 //  Return:    
00178 //
00179 //  Contact:   R. Hatcher
00180 //
00181 //  Specification:-
00182 //  =============
00183 //
00184 //  o  Stream object to output row stream.
00185 
00186 //  Program Notes:-
00187 //  =============
00188 
00189 //  None.
00190 
00191    const char* tabledescr = GetTableDescr();
00192    vector< pair<string,string> > components = 
00193       UgliDbiTableDescr::ParseTableDescr(tabledescr);
00194    int n = components.size();
00195 
00196    for (int i=0; i<n; i++) {
00197       pair<string,string> colPair = components[i];
00198       string colName = colPair.first;
00199       if      ( colName == "HASHVAL"   )  ors << (int)GetIndex(0);
00200       // "HASH" is obsolete
00201       else if ( colName == "HASH"      )  ors << (int)GetIndex(0);
00202       else if ( colName == "PLANE"     )  ors << fPlaneId.GetPlane();
00203       else if ( colName == "PLNVIEW"   )  ors << (int)fPlaneId.GetPlaneView();
00204       // "VIEW" is obsolete
00205       else if ( colName == "VIEW"      )  ors << (int)fPlaneId.GetPlaneView();
00206       else if ( colName == "COVERAGE"  )  ors << (int)fPlaneId.GetPlaneCoverage();
00207       else if ( colName == "MELTCODE"  )  ors << fMeltCode;
00208       else if ( colName == "THICKNESS" )  ors << fThickness;
00209       else if ( colName == "TOTALZ"    )  ors << fTotalZ;
00210       else if ( colName == "X0"        )  ors << fX0;
00211       else if ( colName == "Y0"        )  ors << fY0;
00212       else if ( colName == "ZBACK"     )  ors << fZBack;
00213       else if ( colName == "THETAXRAD" )  ors << fThetaXYZRad[0];
00214       else if ( colName == "THETAYRAD" )  ors << fThetaXYZRad[1];
00215       else if ( colName == "THETAZRAD" )  ors << fThetaXYZRad[2];
00216       else if ( colName == "PHIYRAD"   )  ors << fPhiXYZRad[1];
00217       else if ( colName == "PHIXRAD"   )  ors << fPhiXYZRad[0];
00218       else if ( colName == "PHIZRAD"   )  ors << fPhiXYZRad[2];
00219 
00220       else if ( colName == "ROW_COUNTER"     ) {;}
00221       else if ( colName == "SEQNO"           ) {;}
00222       else {
00223          MSG("Ugli",Msg::kFatal)
00224             << "Column name '" << colName << "' not correctly handled" << endl;
00225          assert(0);
00226       }
00227    }
00228 }


Member Data Documentation

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

Definition at line 120 of file UgliDbiSteelPln.h.

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

Int_t UgliDbiSteelPln::fMeltCode [private]

Definition at line 110 of file UgliDbiSteelPln.h.

Referenced by Fill(), FormatToOStream(), GetMeltCode(), and Store().

Float_t UgliDbiSteelPln::fPhiXYZRad[3] [private]

Definition at line 116 of file UgliDbiSteelPln.h.

Referenced by Fill(), FormatToOStream(), GetPhiDeg(), GetPhiRad(), Store(), and UgliDbiSteelPln().

Float_t UgliDbiSteelPln::fThetaXYZRad[3] [private]
Float_t UgliDbiSteelPln::fThickness [private]

Definition at line 111 of file UgliDbiSteelPln.h.

Referenced by Fill(), FormatToOStream(), GetThickness(), and Store().

Float_t UgliDbiSteelPln::fTotalZ [private]

Definition at line 112 of file UgliDbiSteelPln.h.

Referenced by Fill(), FormatToOStream(), GetTotalZ(), and Store().

Float_t UgliDbiSteelPln::fX0 [private]

Definition at line 113 of file UgliDbiSteelPln.h.

Referenced by Fill(), FormatToOStream(), GetX0(), and Store().

Float_t UgliDbiSteelPln::fY0 [private]

Definition at line 113 of file UgliDbiSteelPln.h.

Referenced by Fill(), FormatToOStream(), GetY0(), and Store().

Float_t UgliDbiSteelPln::fZBack [private]

Definition at line 114 of file UgliDbiSteelPln.h.

Referenced by Fill(), FormatToOStream(), GetZBack(), and Store().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1