PlexPinDiodeToLed Class Reference

#include <PlexPinDiodeToLed.h>

Inheritance diagram for PlexPinDiodeToLed:
DbiTableRow

List of all members.

Public Member Functions

 PlexPinDiodeToLed ()
 PlexPinDiodeToLed (Detector::Detector_t det, ElecType::Elec_t elec, Char_t eastwest, Char_t racklevel, Int_t rackbay, Int_t inrack, Int_t inbox, Int_t gain, Int_t pulserBox, Int_t ledInBox)
virtual ~PlexPinDiodeToLed ()
virtual Int_t GetAggregateNo () const
PlexPinDiodeId GetPlexPinDiodeId () 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

 PlexPinDiodeToLed (const PlexPinDiodeToLed &from)

Private Attributes

Int_t fAggregate
PlexPinDiodeId fPlexPinDiodeId
PlexLedId fPlexLedId

Static Private Attributes

static Bool_t fgDefensiveUnpkg = kFALSE

Detailed Description

Definition at line 25 of file PlexPinDiodeToLed.h.


Constructor & Destructor Documentation

PlexPinDiodeToLed::PlexPinDiodeToLed (  )  [inline]

Definition at line 32 of file PlexPinDiodeToLed.h.

References LEA_CTOR.

00032 { LEA_CTOR; }

PlexPinDiodeToLed::PlexPinDiodeToLed ( Detector::Detector_t  det,
ElecType::Elec_t  elec,
Char_t  eastwest,
Char_t  racklevel,
Int_t  rackbay,
Int_t  inrack,
Int_t  inbox,
Int_t  gain,
Int_t  pulserBox,
Int_t  ledInBox 
) [inline]

Definition at line 33 of file PlexPinDiodeToLed.h.

References LEA_CTOR.

00038                                                       :
00039      fPlexPinDiodeId(det,elec,eastwest,racklevel,rackbay,inrack,inbox,gain),
00040      fPlexLedId(det,pulserBox,ledInBox) { LEA_CTOR; };
   virtual ~PlexPinDiodeToLed(){ LEA_DTOR; };

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

Definition at line 41 of file PlexPinDiodeToLed.h.

References LEA_DTOR.

00041 { LEA_DTOR; };

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

Definition at line 66 of file PlexPinDiodeToLed.h.

References LEA_CTOR.

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


Member Function Documentation

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

Implements DbiTableRow.

Definition at line 49 of file PlexPinDiodeToLed.h.

00049 { return new PlexPinDiodeToLed; }

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

Implements DbiTableRow.

Definition at line 45 of file PlexPinDiodeToLed.cxx.

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

00046                                                                   {
00047 //
00048 //
00049 //  Purpose:  Fill object from Result Set
00050 //
00051 //  Arguments: 
00052 //    rs           in    Result Set used to fill object
00053 //    vrec         in    Associated validity record (or 0 if filling
00054 //                                                    DbiValidityRec)
00055 //
00056 //  Return:    
00057 //
00058 //  Contact:   R. Hatcher
00059 //
00060 //  Specification:-
00061 //  =============
00062 //
00063 //  o Fill object from current row of Result Set.
00064 
00065 //  Program Notes:-
00066 //  =============
00067 
00068 //  None.
00069 
00070    Detector::Detector_t det =
00071       (Detector::Detector_t) 
00072       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00073 
00074    char   elecName = '?';
00075    char   elecType = ElecType::kUnknown;
00076    char   rackEastWest='?', rackLevel='?';
00077    int    rackBay=0, muxboxInRack=0;
00078    int    diodeinbox=0, gain=0;
00079    int    pulserbox=0, ledinbox=0;
00080 
00081    if (fgDefensiveUnpkg) {
00082 
00083       // unpack allowing for various column names and ordering
00084 
00085       Int_t numCol = rs.NumCols();
00086       //  The first column (SeqNo) has already been processed.
00087       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00088          string colName = rs.CurColName();
00089          if (      colName == "AGGREGATENO" ) rs >> fAggregate;
00090          else if ( colName == "ELECNAME"    ) rs >> elecName;
00091          else if ( colName == "RACKEASTWEST") rs >> rackEastWest;
00092          else if ( colName == "RACKLEVEL"   ) rs >> rackLevel;
00093          else if ( colName == "RACKBAY"     ) rs >> rackBay;
00094          else if ( colName == "MUXBOXINRACK") rs >> muxboxInRack;
00095          else if ( colName == "DIODEINBOX"  ) rs >> diodeinbox;
00096          else if ( colName == "GAIN"        ) rs >> gain;
00097          else if ( colName == "PULSERBOX"   ) rs >> pulserbox;
00098          else if ( colName == "LEDINBOX"    ) rs >> ledinbox;
00099          else {
00100             static int nmsg = 25;
00101             if (nmsg-- > 0) {
00102               MSG("Plex",Msg::kWarning) 
00103                 << "Ignoring column " << rs.CurColNum() 
00104                 << " (of " << rs.NumCols() << ")"
00105                 << " \""<< colName << "\"; not part of "
00106                 << ClassName() << endl;
00107             }
00108             rs.IncrementCurCol();
00109          }
00110       }
00111    } // end defensive unpacking
00112    else {
00113 //       SeqNo         int,
00114 //       AggregateNo   int,
00115 //       ElecName      tinytext,
00116 //       RackEastWest  char(1),
00117 //       RackLevel     char(1),
00118 //       RackBay       tinyint,
00119 //       MuxBoxInRack  tinyint,
00120 //       DiodeInBox    tinyint,
00121 //       Gain          tinyint,
00122 //       PulserBox     tinyint,
00123 //       LedInBox      tinyint
00124 
00125       rs >> fAggregate
00126          >> elecName
00127          >> rackEastWest
00128          >> rackLevel
00129          >> rackBay
00130          >> muxboxInRack
00131          >> diodeinbox
00132          >> gain
00133          >> pulserbox
00134          >> ledinbox;
00135 
00136    }
00137 
00138    ElecType::Elec_t elec = ElecType::CharToEnum(elecName);
00139    if (ElecType::kUnknown == elec)  elec = (ElecType::Elec_t) elecType;
00140 
00141    fPlexPinDiodeId = PlexPinDiodeId(det,elec,rackEastWest,rackLevel,
00142                                     rackBay,muxboxInRack,diodeinbox,gain);
00143    fPlexLedId      = PlexLedId(det,pulserbox,ledinbox);
00144 
00145 }

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

Reimplemented from DbiTableRow.

Definition at line 45 of file PlexPinDiodeToLed.h.

References fAggregate.

00045 { return fAggregate; }

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

Definition at line 60 of file PlexPinDiodeToLed.h.

References fgDefensiveUnpkg.

00060 { return fgDefensiveUnpkg; }

PlexLedId PlexPinDiodeToLed::GetPlexLedId (  )  const [inline]

Definition at line 47 of file PlexPinDiodeToLed.h.

References fPlexLedId.

Referenced by Plexus::BuildLedMaps(), and LedIdList::Reset().

00047 { return fPlexLedId; }

PlexPinDiodeId PlexPinDiodeToLed::GetPlexPinDiodeId (  )  const [inline]

Definition at line 46 of file PlexPinDiodeToLed.h.

References fPlexPinDiodeId.

Referenced by Plexus::BuildLedMaps().

00046 { return fPlexPinDiodeId; }

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

Definition at line 58 of file PlexPinDiodeToLed.h.

References fgDefensiveUnpkg.

00059       { fgDefensiveUnpkg = defensive; }

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

Reimplemented from DbiTableRow.

Definition at line 148 of file PlexPinDiodeToLed.cxx.

References bfld::AsString(), fAggregate, fPlexLedId, fPlexPinDiodeId, PlexMuxBoxId::GetEastWest(), PlexMuxBoxId::GetElecType(), PlexPinDiodeId::GetGain(), PlexPinDiodeId::GetInBox(), PlexMuxBoxId::GetInRack(), PlexLedId::GetLedInBox(), PlexLedId::GetPulserBox(), PlexMuxBoxId::GetRackBay(), and PlexMuxBoxId::GetRackLevel().

00149                                                                       {
00150 //
00151 //
00152 //  Purpose:  Stream object to output row stream
00153 //
00154 //  Arguments: 
00155 //    ors          in     Output row stream.
00156 //    vrec         in     Associated validity record (or 0 if filling
00157 //                                                    DbiValidityRec)
00158 //
00159 //  Return:    
00160 //
00161 //  Contact:   R. Hatcher
00162 //
00163 //  Specification:-
00164 //  =============
00165 //
00166 //  o  Stream object to output row stream.
00167 
00168 //  Program Notes:-
00169 //  =============
00170 
00171 //  None.
00172 
00173    ElecType::Elec_t elec = fPlexPinDiodeId.GetElecType();
00174    //   int  numeric      = fPlexPinDiodeId.GetNumericMuxBox();
00175    char rackEastWest = fPlexPinDiodeId.GetEastWest();
00176    char rackLevel    = fPlexPinDiodeId.GetRackLevel();
00177    int  rackBay      = fPlexPinDiodeId.GetRackBay();
00178    int  muxInRack    = fPlexPinDiodeId.GetInRack();
00179 
00180 
00181    ors << fAggregate
00182        << ElecType::AsString(elec)
00183        << rackEastWest
00184        << rackLevel
00185        << rackBay
00186        << muxInRack
00187        << fPlexPinDiodeId.GetInBox()
00188        << fPlexPinDiodeId.GetGain()
00189        << fPlexLedId.GetPulserBox()
00190        << fPlexLedId.GetLedInBox();
00191 }


Member Data Documentation

Definition at line 71 of file PlexPinDiodeToLed.h.

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

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

Definition at line 77 of file PlexPinDiodeToLed.h.

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

Definition at line 73 of file PlexPinDiodeToLed.h.

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

Definition at line 72 of file PlexPinDiodeToLed.h.

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