PlexRawChannelToPinDiode Class Reference

#include <PlexRawChannelToPinDiode.h>

Inheritance diagram for PlexRawChannelToPinDiode:
DbiTableRow

List of all members.

Public Member Functions

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

 PlexRawChannelToPinDiode (const PlexRawChannelToPinDiode &from)

Private Attributes

Int_t fAggregate
RawChannelId fRawChannelId
PlexPinDiodeId fPlexPinDiodeId

Static Private Attributes

static Bool_t fgDefensiveUnpkg = kFALSE

Detailed Description

Definition at line 25 of file PlexRawChannelToPinDiode.h.


Constructor & Destructor Documentation

PlexRawChannelToPinDiode::PlexRawChannelToPinDiode (  )  [inline]

Definition at line 32 of file PlexRawChannelToPinDiode.h.

References LEA_CTOR.

00032 { LEA_CTOR; }

PlexRawChannelToPinDiode::PlexRawChannelToPinDiode ( Detector::Detector_t  det,
ElecType::Elec_t  elec,
Int_t  crate,
Int_t  chadd,
Char_t  eastwest,
Char_t  racklevel,
Int_t  rackbay,
Int_t  inrack,
Int_t  inbox,
Int_t  gain 
) [inline]

Definition at line 33 of file PlexRawChannelToPinDiode.h.

References LEA_CTOR.

00038                                                      :
00039      fRawChannelId(det,elec,crate,chadd),
00040      fPlexPinDiodeId(det,elec,eastwest,racklevel,rackbay,inrack,inbox,gain) 
00041      { LEA_CTOR; };
   virtual ~PlexRawChannelToPinDiode(){ LEA_DTOR; };

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

Definition at line 42 of file PlexRawChannelToPinDiode.h.

References LEA_DTOR.

00042 { LEA_DTOR; };

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

Definition at line 68 of file PlexRawChannelToPinDiode.h.

References LEA_CTOR.

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


Member Function Documentation

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

Implements DbiTableRow.

Definition at line 51 of file PlexRawChannelToPinDiode.h.

00051 { return new PlexRawChannelToPinDiode; }

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

Implements DbiTableRow.

Definition at line 45 of file PlexRawChannelToPinDiode.cxx.

References ClusterType::CharToEnum(), DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fAggregate, fgDefensiveUnpkg, fPlexPinDiodeId, fRawChannelId, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), ElecType::kQIE, ElecType::kUnknown, ElecType::kVA, 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    crate=0, chadd=0, muxbox=0, inbox=0, gain=0;
00079    int    varc, vmm, adcsel, vachip, vachan;
00080    int    geoaddr, master, minder;
00081 
00082    if (fgDefensiveUnpkg) {
00083 
00084       // unpack allowing for various column names and ordering
00085 
00086       Int_t numCol = rs.NumCols();
00087       //  The first column (SeqNo) has already been processed.
00088       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00089          string colName = rs.CurColName();
00090          if (      colName == "AGGREGATENO" ) rs >> fAggregate;
00091          else if ( colName == "ELECTYPE"    ) rs >> elecType;
00092          else if ( colName == "ELECNAME"    ) rs >> elecName;
00093          else if ( colName == "CRATE"       ) rs >> crate;
00094          else if ( colName == "CHADD"       ) rs >> chadd;
00095          else if ( colName == "VARC"        ) rs >> varc;
00096          else if ( colName == "VMM"         ) rs >> vmm;
00097          else if ( colName == "VFB"         ) rs >> adcsel;
00098          else if ( colName == "VAADCSEL"    ) rs >> adcsel;
00099          else if ( colName == "VACHIP"      ) rs >> vachip;
00100          else if ( colName == "VACHAN"      ) rs >> vachan;
00101          else if ( colName == "GEOADDR"     ) rs >> geoaddr;
00102          else if ( colName == "MASTER"      ) rs >> master;
00103          else if ( colName == "MINDER"      ) rs >> minder;
00104          else if ( colName == "MUXBOX"      ) rs >> muxbox;
00105          else if ( colName == "RACKEASTWEST") rs >> rackEastWest;
00106          else if ( colName == "RACKLEVEL"   ) rs >> rackLevel;
00107          else if ( colName == "RACKBAY"     ) rs >> rackBay;
00108          else if ( colName == "MUXBOXINRACK") rs >> muxboxInRack;
00109          else if ( colName == "INBOX"       ) rs >> inbox;
00110          else if ( colName == "DIODEINBOX"  ) rs >> inbox;
00111          else if ( colName == "GAIN"        ) rs >> gain;
00112          else {
00113             static int nmsg = 25;
00114             if (nmsg-- > 0) {
00115               MSG("Plex",Msg::kWarning) 
00116                 << "Ignoring column " << rs.CurColNum() 
00117                 << " (of " << rs.NumCols() << ")"
00118                 << " \""<< colName << "\"; not part of "
00119                 << ClassName() << endl;
00120             }
00121             rs.IncrementCurCol();
00122          }
00123       }
00124    } // end defensive unpacking
00125    else {
00126 //       SeqNo         int,
00127 //       AggregateNo   int,
00128 //       ElecName      tinytext,
00129 //       Crate         tinyint,
00130 //       VARC          tinyint,
00131 //       VMM           tinyint,
00132 //       VaAdcSel      tinyint,
00133 //       VaChip        tinyint,
00134 //       VaChan        tinyint,
00135 //       GeoAddr       tinyint,
00136 //       Master        tinyint,
00137 //       Minder        tinyint,
00138 //       RackEastWest  char(1),
00139 //       RackLevel     char(1),
00140 //       RackBay       tinyint,
00141 //       MuxBoxInRack  tinyint,
00142 //       DiodeInBox    tinyint,
00143 //       Gain          tinyint
00144 
00145       rs >> fAggregate
00146          >> elecName
00147          >> crate
00148          >> varc
00149          >> vmm
00150          >> adcsel
00151          >> vachip
00152          >> vachan
00153          >> geoaddr
00154          >> master
00155          >> minder
00156          >> rackEastWest
00157          >> rackLevel
00158          >> rackBay
00159          >> muxboxInRack
00160          >> inbox
00161          >> gain;
00162 
00163    }
00164 
00165    ElecType::Elec_t elec = ElecType::CharToEnum(elecName);
00166    if (ElecType::kUnknown == elec)  elec = (ElecType::Elec_t) elecType;
00167 
00168    if (chadd) {
00169      fRawChannelId = RawChannelId(det,elec,crate,chadd);
00170    } 
00171    else if (ElecType::kVA == elec) {
00172      fRawChannelId = RawChannelId(det,elec,crate,varc,vmm,adcsel,vachip,vachan);
00173    }
00174    else if (ElecType::kQIE == elec) {
00175      fRawChannelId = RawChannelId(det,elec,crate,geoaddr,master,minder);
00176    } else {
00177       MSG("Plex",Msg::kWarning) 
00178          << " bad electronics type \"" << elecName << "\"" << endl;
00179    }
00180 
00181    fPlexPinDiodeId = PlexPinDiodeId(det,elec,rackEastWest,rackLevel,
00182                                     rackBay,muxboxInRack,inbox,gain);
00183 
00184 }

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

Reimplemented from DbiTableRow.

Definition at line 46 of file PlexRawChannelToPinDiode.h.

References fAggregate.

00046 { return fAggregate; }

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

Definition at line 62 of file PlexRawChannelToPinDiode.h.

References fgDefensiveUnpkg.

00062 { return fgDefensiveUnpkg; }

PlexPinDiodeId PlexRawChannelToPinDiode::GetPlexPinDiodeId (  )  const [inline]

Definition at line 48 of file PlexRawChannelToPinDiode.h.

References fPlexPinDiodeId.

Referenced by Plexus::BuildPinDiodeMap(), and LIPlexMaps::PrintDbPinDiodeInfo().

00048 { return fPlexPinDiodeId; }

RawChannelId PlexRawChannelToPinDiode::GetRawChannelId ( void   )  const [inline]

Definition at line 47 of file PlexRawChannelToPinDiode.h.

References fRawChannelId.

Referenced by Plexus::BuildPinDiodeMap(), and LIPlexMaps::PrintDbPinDiodeInfo().

00047 { return fRawChannelId; }

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

Definition at line 60 of file PlexRawChannelToPinDiode.h.

References fgDefensiveUnpkg.

00061       { fgDefensiveUnpkg = defensive; }

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

Reimplemented from DbiTableRow.

Definition at line 187 of file PlexRawChannelToPinDiode.cxx.

References bfld::AsString(), fAggregate, fPlexPinDiodeId, fRawChannelId, RawChannelId::GetCrate(), PlexMuxBoxId::GetEastWest(), RawChannelId::GetElecType(), PlexPinDiodeId::GetGain(), RawChannelId::GetGeographicAddress(), PlexPinDiodeId::GetInBox(), PlexMuxBoxId::GetInRack(), RawChannelId::GetMasterChannel(), RawChannelId::GetMinderChannel(), PlexMuxBoxId::GetRackBay(), PlexMuxBoxId::GetRackLevel(), RawChannelId::GetVaAdcSel(), RawChannelId::GetVaChannel(), RawChannelId::GetVaChip(), RawChannelId::GetVarcId(), RawChannelId::GetVmm(), ElecType::kQIE, ElecType::kVA, Msg::kWarning, and MSG.

00188                                                                              {
00189 //
00190 //
00191 //  Purpose:  Stream object to output row stream
00192 //
00193 //  Arguments: 
00194 //    ors          in     Output row stream.
00195 //    vrec         in     Associated validity record (or 0 if filling
00196 //                                                    DbiValidityRec)
00197 //
00198 //  Return:    
00199 //
00200 //  Contact:   R. Hatcher
00201 //
00202 //  Specification:-
00203 //  =============
00204 //
00205 //  o  Stream object to output row stream.
00206 
00207 //  Program Notes:-
00208 //  =============
00209 
00210 //  None.
00211 
00212    Short_t varc=0, vmm=0, vaadcsel=0, vachip=0, vachan=0;
00213    Short_t geoaddr=0, master=0, minder=0;
00214 
00215    ElecType::Elec_t elec = fRawChannelId.GetElecType();
00216    switch (elec) {
00217    case ElecType::kVA:
00218       varc     = fRawChannelId.GetVarcId();
00219       vmm      = fRawChannelId.GetVmm();
00220       vaadcsel = fRawChannelId.GetVaAdcSel();
00221       vachip   = fRawChannelId.GetVaChip();
00222       vachan   = fRawChannelId.GetVaChannel();
00223       break;
00224    case ElecType::kQIE:
00225       geoaddr  = fRawChannelId.GetGeographicAddress();
00226       master   = fRawChannelId.GetMasterChannel();
00227       minder   = fRawChannelId.GetMinderChannel();
00228       break;
00229    default:
00230       MSG("Plex",Msg::kWarning)
00231          << "Store had badd electronics type "
00232          << ElecType::AsString(elec) << " (" << (int)elec << ")" << endl;
00233       break;
00234    }
00235 
00236    //   int  numeric      = fPlexPinDiodeId.GetNumericMuxBox();
00237    char rackEastWest = fPlexPinDiodeId.GetEastWest();
00238    char rackLevel    = fPlexPinDiodeId.GetRackLevel();
00239    int  rackBay      = fPlexPinDiodeId.GetRackBay();
00240    int  muxInRack    = fPlexPinDiodeId.GetInRack();
00241 
00242    ors << fAggregate
00243        << ElecType::AsString(elec)
00244        << fRawChannelId.GetCrate()
00245        << varc
00246        << vmm
00247        << vaadcsel
00248        << vachip
00249        << vachan
00250        << geoaddr
00251        << master
00252        << minder
00253        << rackEastWest
00254        << rackLevel
00255        << rackBay
00256        << muxInRack
00257        << fPlexPinDiodeId.GetInBox()
00258        << fPlexPinDiodeId.GetGain();
00259 }


Member Data Documentation

Definition at line 73 of file PlexRawChannelToPinDiode.h.

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

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

Definition at line 79 of file PlexRawChannelToPinDiode.h.

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

Definition at line 75 of file PlexRawChannelToPinDiode.h.

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

Definition at line 74 of file PlexRawChannelToPinDiode.h.

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