Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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

void SetDefensiveUnpkg (Bool_t defensive)
Bool_t GetDefensiveUnpkg ()

Private Member Functions

 PlexRawChannelToPinDiode (const PlexRawChannelToPinDiode &from)

Private Attributes

Int_t fAggregate
RawChannelId fRawChannelId
PlexPinDiodeId fPlexPinDiodeId

Static Private Attributes

Bool_t fgDefensiveUnpkg = kFALSE

Constructor & Destructor Documentation

PlexRawChannelToPinDiode::PlexRawChannelToPinDiode  )  [inline]
 

Definition at line 32 of file PlexRawChannelToPinDiode.h.

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 det, fPlexPinDiodeId, and fRawChannelId.

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.

00042 { LEA_DTOR; };

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

Definition at line 68 of file PlexRawChannelToPinDiode.h.

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 ElecType::CharToEnum(), det, and MSG.

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) MSG("Plex",Msg::kWarning) 
00115                << "Ignoring column " << rs.CurColNum() 
00116                << " (of " << rs.NumCols() << ")"
00117                << " \""<< colName << "\"; not part of "
00118                << ClassName() << endl;
00119             rs.IncrementCurCol();
00120          }
00121       }
00122    } // end defensive unpacking
00123    else {
00124 //       SeqNo         int,
00125 //       AggregateNo   int,
00126 //       ElecName      tinytext,
00127 //       Crate         tinyint,
00128 //       VARC          tinyint,
00129 //       VMM           tinyint,
00130 //       VaAdcSel      tinyint,
00131 //       VaChip        tinyint,
00132 //       VaChan        tinyint,
00133 //       GeoAddr       tinyint,
00134 //       Master        tinyint,
00135 //       Minder        tinyint,
00136 //       RackEastWest  char(1),
00137 //       RackLevel     char(1),
00138 //       RackBay       tinyint,
00139 //       MuxBoxInRack  tinyint,
00140 //       DiodeInBox    tinyint,
00141 //       Gain          tinyint
00142 
00143       rs >> fAggregate
00144          >> elecName
00145          >> crate
00146          >> varc
00147          >> vmm
00148          >> adcsel
00149          >> vachip
00150          >> vachan
00151          >> geoaddr
00152          >> master
00153          >> minder
00154          >> rackEastWest
00155          >> rackLevel
00156          >> rackBay
00157          >> muxboxInRack
00158          >> inbox
00159          >> gain;
00160 
00161    }
00162 
00163    ElecType::Elec_t elec = ElecType::CharToEnum(elecName);
00164    if (ElecType::kUnknown == elec)  elec = (ElecType::Elec_t) elecType;
00165 
00166    if (chadd) {
00167      fRawChannelId = RawChannelId(det,elec,crate,chadd);
00168    } 
00169    else if (ElecType::kVA == elec) {
00170      fRawChannelId = RawChannelId(det,elec,crate,varc,vmm,adcsel,vachip,vachan);
00171    }
00172    else if (ElecType::kQIE == elec) {
00173      fRawChannelId = RawChannelId(det,elec,crate,geoaddr,master,minder);
00174    } else {
00175       MSG("Plex",Msg::kWarning) 
00176          << " bad electronics type \"" << elecName << "\"" << endl;
00177    }
00178 
00179    fPlexPinDiodeId = PlexPinDiodeId(det,elec,rackEastWest,rackLevel,
00180                                     rackBay,muxboxInRack,inbox,gain);
00181 
00182 }

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

Reimplemented from DbiTableRow.

Definition at line 46 of file PlexRawChannelToPinDiode.h.

00046 { return fAggregate; }

Bool_t PlexRawChannelToPinDiode::GetDefensiveUnpkg  )  [inline, static]
 

Definition at line 62 of file PlexRawChannelToPinDiode.h.

00062 { return fgDefensiveUnpkg; }

PlexPinDiodeId PlexRawChannelToPinDiode::GetPlexPinDiodeId  )  const [inline]
 

Definition at line 48 of file PlexRawChannelToPinDiode.h.

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

00048 { return fPlexPinDiodeId; }

RawChannelId PlexRawChannelToPinDiode::GetRawChannelId void   )  const [inline]
 

Definition at line 47 of file PlexRawChannelToPinDiode.h.

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

00047 { return fRawChannelId; }

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 185 of file PlexRawChannelToPinDiode.cxx.

References ElecType::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(), and MSG.

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


Member Data Documentation

Int_t PlexRawChannelToPinDiode::fAggregate [private]
 

Definition at line 73 of file PlexRawChannelToPinDiode.h.

Referenced by Store().

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

Definition at line 28 of file PlexRawChannelToPinDiode.cxx.

Referenced by SetDefensiveUnpkg().

PlexPinDiodeId PlexRawChannelToPinDiode::fPlexPinDiodeId [private]
 

Definition at line 75 of file PlexRawChannelToPinDiode.h.

Referenced by PlexRawChannelToPinDiode(), and Store().

RawChannelId PlexRawChannelToPinDiode::fRawChannelId [private]
 

Definition at line 74 of file PlexRawChannelToPinDiode.h.

Referenced by PlexRawChannelToPinDiode(), and Store().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:04 2010 for loon by  doxygen 1.3.9.1