PlexStripEndToLed Class Reference

#include <PlexStripEndToLed.h>

Inheritance diagram for PlexStripEndToLed:
DbiTableRow

List of all members.

Public Member Functions

 PlexStripEndToLed ()
 PlexStripEndToLed (Detector::Detector_t det, Int_t plane, Int_t strip, StripEnd::StripEnd_t end, Int_t pulserBox, Int_t ledInBox)
virtual ~PlexStripEndToLed ()
virtual Int_t GetAggregateNo () const
PlexStripEndId GetPlexStripEndId () const
PlexLedId GetPlexLedId () const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const

Static Public Member Functions

static void SetDefensiveUnpkg (Bool_t defensive)
static Bool_t GetDefensiveUnpkg ()

Private Member Functions

 PlexStripEndToLed (const PlexStripEndToLed &from)

Private Attributes

Int_t fAggregate
PlexStripEndId fPlexStripEndId
PlexLedId fPlexLedId

Static Private Attributes

static Bool_t fgDefensiveUnpkg = kFALSE

Detailed Description

Definition at line 25 of file PlexStripEndToLed.h.


Constructor & Destructor Documentation

PlexStripEndToLed::PlexStripEndToLed (  )  [inline]

Definition at line 32 of file PlexStripEndToLed.h.

References LEA_CTOR.

00032 { LEA_CTOR; }

PlexStripEndToLed::PlexStripEndToLed ( Detector::Detector_t  det,
Int_t  plane,
Int_t  strip,
StripEnd::StripEnd_t  end,
Int_t  pulserBox,
Int_t  ledInBox 
) [inline]

Definition at line 33 of file PlexStripEndToLed.h.

References LEA_CTOR.

00036                                                             :
00037       fPlexStripEndId(det,plane,strip,end),
00038       fPlexLedId(det,pulserBox,ledInBox) { LEA_CTOR; };
   virtual ~PlexStripEndToLed(){ LEA_DTOR; };

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

Definition at line 39 of file PlexStripEndToLed.h.

References LEA_DTOR.

00039 { LEA_DTOR; };

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

Definition at line 64 of file PlexStripEndToLed.h.

References LEA_CTOR.

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


Member Function Documentation

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

Implements DbiTableRow.

Definition at line 47 of file PlexStripEndToLed.h.

00047 { return new PlexStripEndToLed; }

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

Implements DbiTableRow.

Definition at line 43 of file PlexStripEndToLed.cxx.

References ClusterType::CharToEnum(), DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fAggregate, fgDefensiveUnpkg, fPlexLedId, fPlexStripEndId, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), Msg::kWarning, MSG, and DbiRowStream::NumCols().

00044                                                                {
00045 //
00046 //
00047 //  Purpose:  Fill object from Result Set
00048 //
00049 //  Arguments: 
00050 //    rs           in    Result Set used to fill object
00051 //    vrec         in    Associated validity record (or 0 if filling
00052 //                                                    DbiValidityRec)
00053 //
00054 //  Return:    
00055 //
00056 //  Contact:   R. Hatcher
00057 //
00058 //  Specification:-
00059 //  =============
00060 //
00061 //  o Fill object from current row of Result Set.
00062 
00063 //  Program Notes:-
00064 //  =============
00065 
00066 //  None.
00067 
00068    Detector::Detector_t det =
00069       (Detector::Detector_t) 
00070       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00071    
00072    int    plane, strip, pulserBox, ledInBox;
00073    char   endchar;
00074 
00075    if (fgDefensiveUnpkg) {
00076 
00077       // unpack allowing for various column names and ordering
00078 
00079       Int_t numCol = rs.NumCols();
00080       //  The first column (SeqNo) has already been processed.
00081       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00082          string colName = rs.CurColName();
00083          if (      colName == "AGGREGATENO" ) rs >> fAggregate;
00084          else if ( colName == "PLANE"       ) rs >> plane;
00085          else if ( colName == "STRIP"       ) rs >> strip;
00086          else if ( colName == "STRIPEND"    ) rs >> endchar;
00087          else if ( colName == "PULSERBOX"   ) rs >> pulserBox;
00088          else if ( colName == "LEDINBOX"    ) rs >> ledInBox;
00089          else {
00090             static int nmsg = 25;
00091             if (nmsg-- > 0) {
00092               MSG("Plex",Msg::kWarning) 
00093                 << "Ignoring column " << rs.CurColNum() 
00094                 << " (of " << rs.NumCols() << ")"
00095                 << " \""<< colName << "\"; not part of "
00096                 << ClassName() << endl;
00097             }
00098             rs.IncrementCurCol();
00099          }
00100       }
00101    } // end defensive unpacking
00102    else {
00103 //       SeqNo         int,
00104 //       AggregateNo   int,
00105 //       Plane         smallint,
00106 //       Strip         smallint,
00107 //       StripEnd      char(1)
00108 //       PulserBox     tinyint,
00109 //       LedInBox      tinyint
00110 
00111       rs >> fAggregate
00112          >> plane
00113          >> strip
00114          >> endchar
00115          >> pulserBox
00116          >> ledInBox;
00117       
00118    }
00119    
00120    StripEnd::StripEnd_t end  = StripEnd::CharToEnum(endchar);
00121 
00122    fPlexStripEndId = PlexStripEndId(det,plane,strip,end);
00123    fPlexLedId      = PlexLedId(det,pulserBox,ledInBox);
00124 
00125 }

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

Reimplemented from DbiTableRow.

Definition at line 43 of file PlexStripEndToLed.h.

References fAggregate.

00043 { return fAggregate; }

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

Definition at line 58 of file PlexStripEndToLed.h.

References fgDefensiveUnpkg.

00058 { return fgDefensiveUnpkg; }

PlexLedId PlexStripEndToLed::GetPlexLedId (  )  const [inline]

Definition at line 45 of file PlexStripEndToLed.h.

References fPlexLedId.

Referenced by Plexus::BuildLedMaps(), and LIPatternFinderFancy::BuildPlexMaps().

00045 { return fPlexLedId; }

PlexStripEndId PlexStripEndToLed::GetPlexStripEndId (  )  const [inline]

Definition at line 44 of file PlexStripEndToLed.h.

References fPlexStripEndId.

Referenced by Plexus::BuildLedMaps(), and LIPatternFinderFancy::BuildPlexMaps().

00044 { return fPlexStripEndId; }

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

Definition at line 56 of file PlexStripEndToLed.h.

References fgDefensiveUnpkg.

00057       { fgDefensiveUnpkg = defensive; }

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

Reimplemented from DbiTableRow.

Definition at line 128 of file PlexStripEndToLed.cxx.

References bfld::AsString(), fAggregate, fPlexLedId, fPlexStripEndId, PlexStripEndId::GetEnd(), PlexLedId::GetLedInBox(), PlexPlaneId::GetPlane(), PlexLedId::GetPulserBox(), and PlexStripEndId::GetStrip().

00129                                                                       {
00130 //
00131 //
00132 //  Purpose:  Stream object to output row stream
00133 //
00134 //  Arguments: 
00135 //    ors          in     Output row stream.
00136 //    vrec         in     Associated validity record (or 0 if filling
00137 //                                                    DbiValidityRec)
00138 //
00139 //  Return:    
00140 //
00141 //  Contact:   R. Hatcher
00142 //
00143 //  Specification:-
00144 //  =============
00145 //
00146 //  o  Stream object to output row stream.
00147 
00148 //  Program Notes:-
00149 //  =============
00150 
00151 //  None.
00152 
00153    ors << fAggregate 
00154        << fPlexStripEndId.GetPlane()
00155        << fPlexStripEndId.GetStrip()
00156        << StripEnd::AsString(fPlexStripEndId.GetEnd())[0]
00157        << fPlexLedId.GetPulserBox()
00158        << fPlexLedId.GetLedInBox();
00159    
00160 }


Member Data Documentation

Definition at line 69 of file PlexStripEndToLed.h.

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

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

Definition at line 75 of file PlexStripEndToLed.h.

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

Definition at line 71 of file PlexStripEndToLed.h.

Referenced by Fill(), GetPlexLedId(), and Store().

Definition at line 70 of file PlexStripEndToLed.h.

Referenced by Fill(), GetPlexStripEndId(), and Store().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1