UgliDbiScintPln Class Reference

#include <UgliDbiScintPln.h>

Inheritance diagram for UgliDbiScintPln:
DbiTableRow

List of all members.

Public Member Functions

 UgliDbiScintPln ()
 UgliDbiScintPln (PlexPlaneId plnid, Float_t thick, Float_t gap, Float_t x0rel, Float_t y0rel, Float_t zrot)
virtual ~UgliDbiScintPln ()
virtual Int_t GetAggregateNo () const
virtual UInt_t GetIndex (UInt_t) const
PlexPlaneId GetPlaneId () const
Int_t GetPlane () const
Float_t GetThickness () const
Float_t GetGap () const
Float_t GetX0RelSteel () const
Float_t GetY0RelSteel () const
Float_t GetZRotRelSteelRad () const
Float_t GetZRotRelSteelDeg () 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

 UgliDbiScintPln (const UgliDbiScintPln &from)

Private Attributes

PlexPlaneId fPlaneId
Float_t fThickness
Float_t fGap
Float_t fX0RelSteel
Float_t fY0RelSteel
Float_t fZRotRelSteelRad

Static Private Attributes

static Bool_t fgDefensiveUnpkg = kFALSE

Detailed Description

Definition at line 30 of file UgliDbiScintPln.h.


Constructor & Destructor Documentation

UgliDbiScintPln::UgliDbiScintPln (  )  [inline]

Definition at line 37 of file UgliDbiScintPln.h.

References LEA_CTOR.

00038       : fPlaneId(), fThickness(-1), fGap(-1),
00039         fX0RelSteel(0), fY0RelSteel(0), fZRotRelSteelRad(0) { LEA_CTOR; };

UgliDbiScintPln::UgliDbiScintPln ( PlexPlaneId  plnid,
Float_t  thick,
Float_t  gap,
Float_t  x0rel,
Float_t  y0rel,
Float_t  zrot 
) [inline]

Definition at line 41 of file UgliDbiScintPln.h.

References LEA_CTOR.

00043       : fPlaneId(plnid), fThickness(thick), fGap(gap),
00044         fX0RelSteel(x0rel), fY0RelSteel(y0rel), fZRotRelSteelRad(zrot)
00045       { LEA_CTOR; };

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

Definition at line 47 of file UgliDbiScintPln.h.

References LEA_DTOR.

00047 { LEA_DTOR; };

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

Definition at line 86 of file UgliDbiScintPln.h.

References LEA_CTOR.

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


Member Function Documentation

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

Implements DbiTableRow.

Definition at line 63 of file UgliDbiScintPln.h.

00063 { return new UgliDbiScintPln; }

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

Implements DbiTableRow.

Definition at line 54 of file UgliDbiScintPln.cxx.

References DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fGap, fgDefensiveUnpkg, fPlaneId, fThickness, fX0RelSteel, fY0RelSteel, fZRotRelSteelRad, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), PlaneCoverage::kUnknown, PlaneView::kUnknown, Msg::kWarning, MSG, and DbiRowStream::NumCols().

00055                                                        {
00056 //
00057 //
00058 //  Purpose:  Fill object from Result Set
00059 //
00060 //  Arguments: 
00061 //    rs           in    Result Set used to fill object
00062 //    vrec         in    Associated validity record (or 0 if filling
00063 //                                                    DbiValidityRec)
00064 //
00065 //  Return:    
00066 //
00067 //  Contact:   R. Hatcher
00068 //
00069 //  Specification:-
00070 //  =============
00071 //
00072 //  o Fill object from current row of Result Set.
00073 
00074 //  Program Notes:-
00075 //  =============
00076 
00077 //  None.
00078 
00079    Detector::Detector_t det =
00080       (Detector::Detector_t) 
00081       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00082    
00083    Int_t plane                             = -1;
00084    PlaneView::PlaneView_t view             = PlaneView::kUnknown;
00085    PlaneCoverage::PlaneCoverage_t coverage = PlaneCoverage::kUnknown;
00086 
00087    if (fgDefensiveUnpkg) {
00088 
00089       // unpack allowing for various column names and ordering
00090 
00091       Int_t numCol = rs.NumCols();
00092       //  The first column (SeqNo) has already been processed.
00093       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00094          string colName = rs.CurColName();
00095          if      ( colName == "HASHVAL"         )  rs.IncrementCurCol();
00096          // "HASH" is obsolete
00097          else if ( colName == "HASH"            )  rs.IncrementCurCol();
00098          else if ( colName == "PLANE"           )  rs >> plane;
00099          else if ( colName == "THICKNESS"       )  rs >> fThickness;
00100          else if ( colName == "GAP"             )  rs >> fGap;
00101          else if ( colName == "X0RELSTEEL"      )  rs >> fX0RelSteel;
00102          else if ( colName == "Y0RELSTEEL"      )  rs >> fY0RelSteel;
00103          else if ( colName == "ZROTRELSTEELRAD" )  rs >> fZRotRelSteelRad;
00104          else {
00105             static int nmsg = 25;
00106             if (nmsg-- > 0) {
00107               MSG("Ugli",Msg::kWarning) 
00108                 << "Ignoring column " << rs.CurColNum() 
00109                 << " (of " << rs.NumCols() << ")"
00110                 << " \""<< colName << "\"; not part of "
00111                 << ClassName() << endl;
00112             }
00113             rs.IncrementCurCol();
00114          }
00115       }
00116    } // end defensive unpacking
00117    else {
00118       Int_t hashv;
00119       rs >> hashv
00120          >> plane
00121          >> fThickness
00122          >> fGap
00123          >> fX0RelSteel
00124          >> fY0RelSteel
00125          >> fZRotRelSteelRad;
00126    }
00127    fPlaneId = PlexPlaneId(det,plane,kFALSE,view,coverage);
00128 }

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

Definition at line 194 of file UgliDbiScintPln.cxx.

References fGap, fThickness, fX0RelSteel, fY0RelSteel, fZRotRelSteelRad, GetPlane(), DbiValidityRec::GetSeqNo(), GetTableDescr(), UgliDbiTableDescr::ParseTableDescr(), and UgliDbiTableDescr::TextTableDescrLine().

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

00197 {
00198 //
00199 //
00200 //  Purpose:  Print the current row
00201 //
00202 //  Return:   nothing
00203 //
00204 //  Contact:   R. Hatcher
00205 //
00206 //  Specification:-
00207 //  =============
00208 //
00209 
00210 //  Program Notes:-
00211 //  =============
00212 
00213 //  None.
00214 
00215   string opt = option;
00216 
00217   if ( opt.find("H") != string::npos ) {
00218      string tabledescr = GetTableDescr();
00219      tabledescr = UgliDbiTableDescr::TextTableDescrLine(tabledescr);
00220      os << tabledescr << endl;
00221   }
00222   else if ( opt.find("h") != string::npos ) {
00223     string tabledescr = GetTableDescr();
00224     vector< pair<string,string> > components = 
00225         UgliDbiTableDescr::ParseTableDescr(tabledescr);
00226     for (unsigned int ic = 0; ic < components.size(); ++ic) 
00227         os << components[ic].first << '\t';
00228     os << endl;
00229   }
00230 
00231   char sep = '\t';
00232   if ( opt.find(",") != string::npos ) sep = ',';
00233 
00234   if ( ! dvr ) {
00235       os << "SeqNo"         << sep;  // no way of knowing the SEQNO?
00236   }
00237   else {
00238       os << dvr->GetSeqNo() << sep;
00239   }
00240 
00241   os   <<  0  << sep  // only ever one row for an agg (AggregateNo=plane#)
00242        << -1  << sep  // Hashval is obsolete
00243        << GetPlane()       << sep
00244        << fThickness       << sep
00245        << fGap             << sep
00246        << fX0RelSteel      << sep
00247        << fY0RelSteel      << sep
00248        << fZRotRelSteelRad << endl;
00249 
00250   return os;
00251 }

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

Reimplemented from DbiTableRow.

Definition at line 51 of file UgliDbiScintPln.h.

References fPlaneId, and PlexPlaneId::GetPlane().

00051 { return fPlaneId.GetPlane(); }

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

Definition at line 80 of file UgliDbiScintPln.h.

References fgDefensiveUnpkg.

00080 { return fgDefensiveUnpkg; }

Float_t UgliDbiScintPln::GetGap (  )  const [inline]

Definition at line 57 of file UgliDbiScintPln.h.

References fGap.

00057 { return fGap; }

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

Reimplemented from DbiTableRow.

Definition at line 52 of file UgliDbiScintPln.h.

References fPlaneId, and PlexPlaneId::GetPlane().

Referenced by Store().

00052 { return fPlaneId.GetPlane(); }

Int_t UgliDbiScintPln::GetPlane (  )  const [inline]

Definition at line 55 of file UgliDbiScintPln.h.

References fPlaneId, and PlexPlaneId::GetPlane().

Referenced by FormatToOStream().

00055 { return fPlaneId.GetPlane(); }

PlexPlaneId UgliDbiScintPln::GetPlaneId (  )  const [inline]

Definition at line 54 of file UgliDbiScintPln.h.

References fPlaneId.

00054 { return fPlaneId; }

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

Definition at line 255 of file UgliDbiScintPln.cxx.

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

00256 {
00257 //
00258 //
00259 //  Purpose:  Return a string describing rows in the table
00260 //            Used in creating temporary tables
00261 //
00262 //  Return:   const char* to parenthesized comma separated list
00263 //            of column name and type pairs
00264 //
00265 //  Contact:   R. Hatcher
00266 //
00267 //  Specification:-
00268 //  =============
00269 //
00270 
00271 //  Program Notes:-
00272 //  =============
00273 
00274 //  None.
00275 
00276    const char* const_tabledescr = "(\
00277        SEQNO            int,      \
00278        ROW_COUNTER      int,      \
00279        HASHVAL          int,      \
00280        PLANE            smallint, \
00281        THICKNESS        float,    \
00282        GAP              float,    \
00283        X0RELSTEEL       float,    \
00284        Y0RELSTEEL       float,    \
00285        ZROTRELSTEELRAD  float,    \
00286        primary key (SEQNO,ROW_COUNTER) \
00287        )";
00288 
00289    return const_tabledescr;
00290 }

Float_t UgliDbiScintPln::GetThickness (  )  const [inline]

Definition at line 56 of file UgliDbiScintPln.h.

References fThickness.

Referenced by GeoGeometry::BuildPlanePairVolumes().

00056 { return fThickness; }

Float_t UgliDbiScintPln::GetX0RelSteel (  )  const [inline]

Definition at line 58 of file UgliDbiScintPln.h.

References fX0RelSteel.

Referenced by GeoGeometry::BuildPlanePairVolumes().

00058 { return fX0RelSteel; }

Float_t UgliDbiScintPln::GetY0RelSteel (  )  const [inline]

Definition at line 59 of file UgliDbiScintPln.h.

References fY0RelSteel.

Referenced by GeoGeometry::BuildPlanePairVolumes().

00059 { return fY0RelSteel; }

Float_t UgliDbiScintPln::GetZRotRelSteelDeg (  )  const [inline]

Definition at line 61 of file UgliDbiScintPln.h.

References fZRotRelSteelRad, and Ugli::rad2deg.

Referenced by GeoGeometry::BuildPlanePairVolumes().

00061 { return fZRotRelSteelRad * Ugli::rad2deg; }

Float_t UgliDbiScintPln::GetZRotRelSteelRad (  )  const [inline]

Definition at line 60 of file UgliDbiScintPln.h.

References fZRotRelSteelRad.

00060 { return fZRotRelSteelRad; }

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

Definition at line 187 of file UgliDbiScintPln.cxx.

References FormatToOStream().

00188 {
00189     FormatToOStream(cout,option);
00190 }

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

Definition at line 78 of file UgliDbiScintPln.h.

References fgDefensiveUnpkg.

00079       { fgDefensiveUnpkg = defensive; }

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

Reimplemented from DbiTableRow.

Definition at line 132 of file UgliDbiScintPln.cxx.

References fGap, fPlaneId, fThickness, fX0RelSteel, fY0RelSteel, fZRotRelSteelRad, GetIndex(), PlexPlaneId::GetPlane(), GetTableDescr(), Msg::kFatal, MSG, n, and UgliDbiTableDescr::ParseTableDescr().

00133                                                                     {
00134 //
00135 //
00136 //  Purpose:  Stream object to output row stream
00137 //
00138 //  Arguments: 
00139 //    ors          in     Output row stream.
00140 //    vrec         in     Associated validity record (or 0 if filling
00141 //                                                    DbiValidityRec)
00142 //
00143 //  Return:    
00144 //
00145 //  Contact:   R. Hatcher
00146 //
00147 //  Specification:-
00148 //  =============
00149 //
00150 //  o  Stream object to output row stream.
00151 
00152 //  Program Notes:-
00153 //  =============
00154 
00155 //  None.
00156 
00157    const char* tabledescr = GetTableDescr();
00158    vector< pair<string,string> > components = 
00159       UgliDbiTableDescr::ParseTableDescr(tabledescr);
00160    int n = components.size();
00161 
00162    for (int i=0; i<n; i++) {
00163       pair<string,string> colPair = components[i];
00164       string colName = colPair.first;
00165       if      ( colName == "HASHVAL"         )  ors << (int)GetIndex(0);
00166       // "HASH" is obsolete
00167       else if ( colName == "HASH"            )  ors << (int)GetIndex(0);
00168       else if ( colName == "PLANE"           )  ors << fPlaneId.GetPlane();
00169       else if ( colName == "THICKNESS"       )  ors << fThickness;
00170       else if ( colName == "GAP"             )  ors << fGap;
00171       else if ( colName == "X0RELSTEEL"      )  ors << fX0RelSteel;
00172       else if ( colName == "Y0RELSTEEL"      )  ors << fY0RelSteel;
00173       else if ( colName == "ZROTRELSTEELRAD" )  ors << fZRotRelSteelRad;
00174 
00175       else if ( colName == "ROW_COUNTER"     ) {;}
00176       else if ( colName == "SEQNO"           ) {;}
00177       else {
00178          MSG("Ugli",Msg::kFatal)
00179             << "Column name '" << colName << "' not correctly handled" << endl;
00180          assert(0);
00181       }
00182    }
00183 }


Member Data Documentation

Float_t UgliDbiScintPln::fGap [private]

Definition at line 94 of file UgliDbiScintPln.h.

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

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

Definition at line 102 of file UgliDbiScintPln.h.

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

Definition at line 91 of file UgliDbiScintPln.h.

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

Float_t UgliDbiScintPln::fThickness [private]

Definition at line 93 of file UgliDbiScintPln.h.

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

Float_t UgliDbiScintPln::fX0RelSteel [private]

Definition at line 95 of file UgliDbiScintPln.h.

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

Float_t UgliDbiScintPln::fY0RelSteel [private]

Definition at line 96 of file UgliDbiScintPln.h.

Referenced by Fill(), FormatToOStream(), GetY0RelSteel(), 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