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

PlexRawChannelReadoutType Class Reference

#include <PlexRawChannelReadoutType.h>

Inheritance diagram for PlexRawChannelReadoutType:

DbiTableRow List of all members.

Public Member Functions

 PlexRawChannelReadoutType ()
 PlexRawChannelReadoutType (Detector::Detector_t det, ElecType::Elec_t elec, Int_t crate, Int_t chadd, ReadoutType::Readout_t rtype, std::string add_descript="")
virtual ~PlexRawChannelReadoutType ()
RawChannelId GetRawChannelId () const
ReadoutType::Readout_t GetReadoutType () const
std::string GetDescript () 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

 PlexRawChannelReadoutType (const PlexRawChannelReadoutType &from)

Private Attributes

RawChannelId fRawChannelId
ReadoutType::Readout_t fReadoutType
std::string fDescript

Static Private Attributes

Bool_t fgDefensiveUnpkg = kFALSE

Constructor & Destructor Documentation

PlexRawChannelReadoutType::PlexRawChannelReadoutType  )  [inline]
 

Definition at line 33 of file PlexRawChannelReadoutType.h.

References fDescript, fRawChannelId, and fReadoutType.

00033                                :
00034      fRawChannelId(), fReadoutType(ReadoutType::kUnknown),
00035      fDescript("Unknown") { LEA_CTOR; }
   PlexRawChannelReadoutType(Detector::Detector_t det,

PlexRawChannelReadoutType::PlexRawChannelReadoutType Detector::Detector_t  det,
ElecType::Elec_t  elec,
Int_t  crate,
Int_t  chadd,
ReadoutType::Readout_t  rtype,
std::string  add_descript = ""
[inline]
 

Definition at line 36 of file PlexRawChannelReadoutType.h.

References det, fDescript, fRawChannelId, and fReadoutType.

00040                                                          :
00041       fRawChannelId(det,elec,crate,chadd),
00042       fReadoutType(rtype), 
00043       fDescript(ReadoutType::AsString(rtype)+add_descript) { LEA_CTOR; };
   virtual ~PlexRawChannelReadoutType(){ LEA_DTOR; };

virtual PlexRawChannelReadoutType::~PlexRawChannelReadoutType  )  [inline, virtual]
 

Definition at line 44 of file PlexRawChannelReadoutType.h.

00044 { LEA_DTOR; };

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

Definition at line 69 of file PlexRawChannelReadoutType.h.

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


Member Function Documentation

virtual DbiTableRow* PlexRawChannelReadoutType::CreateTableRow  )  const [inline, virtual]
 

Implements DbiTableRow.

Definition at line 52 of file PlexRawChannelReadoutType.h.

00052 { return new PlexRawChannelReadoutType; }

void PlexRawChannelReadoutType::Fill DbiResultSet rs,
const DbiValidityRec vrec
[virtual]
 

Implements DbiTableRow.

Definition at line 45 of file PlexRawChannelReadoutType.cxx.

References ReadoutType::AsString(), ElecType::CharToEnum(), det, MSG, and ReadoutType::StringToEnum().

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    int    crate=0, chadd=0;
00077    int    varc, vmm, adcsel, vachip, vachan;
00078    int    geoaddr, master, minder;
00079 
00080    fDescript = "Unknown";
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 == "ELECNAME"    ) rs >> elecName;
00091          else if ( colName == "CRATE"       ) rs >> crate;
00092          else if ( colName == "CHADD"       ) rs >> chadd;
00093          else if ( colName == "VARC"        ) rs >> varc;
00094          else if ( colName == "VMM"         ) rs >> vmm;
00095          else if ( colName == "VAADCSEL"    ) rs >> adcsel;
00096          else if ( colName == "VACHIP"      ) rs >> vachip;
00097          else if ( colName == "VACHAN"      ) rs >> vachan;
00098          else if ( colName == "GEOADDR"     ) rs >> geoaddr;
00099          else if ( colName == "MASTER"      ) rs >> master;
00100          else if ( colName == "MINDER"      ) rs >> minder;
00101          else if ( colName == "READOUTNAME" ) rs >> fDescript;
00102          else {
00103             static int nmsg = 25;
00104             if (nmsg-- > 0) MSG("Plex",Msg::kWarning) 
00105                << "Ignoring column " << rs.CurColNum()
00106                << " (of " << rs.NumCols() << ")"
00107                << " \""<< colName << "\"; not part of "
00108                << ClassName() << endl;
00109             rs.IncrementCurCol();
00110          }
00111       }
00112    } // end defensive unpacking
00113    else {
00114 //       SeqNo         int,
00115 //       ElecName      tinytext,
00116 //       Crate         tinyint,
00117 //       VARC          tinyint,
00118 //       VMM           tinyint,
00119 //       VaAdcSel      tinyint,
00120 //       VaChip        tinyint,
00121 //       VaChan        tinyint,
00122 //       GeoAddr       tinyint,
00123 //       Master        tinyint,
00124 //       Minder        tinyint,
00125 //       ReadoutName   tinytext
00126 
00127       rs >> elecName
00128          >> crate
00129          >> varc
00130          >> vmm
00131          >> adcsel
00132          >> vachip
00133          >> vachan
00134          >> geoaddr
00135          >> master
00136          >> minder
00137          >> fDescript;
00138    }
00139 
00140    ElecType::Elec_t elec = ElecType::CharToEnum(elecName);
00141    if (ElecType::kUnknown == elec)  elec = (ElecType::Elec_t) elecType;
00142 
00143    fReadoutType = ReadoutType::StringToEnum(fDescript.c_str());
00144 
00145    if (chadd) {
00146      fRawChannelId = RawChannelId(det,elec,crate,chadd);
00147    } 
00148    else if (ElecType::kVA == elec) {
00149      fRawChannelId = RawChannelId(det,elec,crate,varc,vmm,adcsel,vachip,vachan);
00150    }
00151    else if (ElecType::kQIE == elec) {
00152      fRawChannelId = RawChannelId(det,elec,crate,geoaddr,master,minder);
00153    } else {
00154       MSG("Plex",Msg::kWarning) 
00155          << " bad electronics type \"" << elecName << "\"" << endl;
00156    }
00157 
00158    MSG("Plex",Msg::kDebug)
00159      << "PlexRawChannelReadoutType::Fill "
00160      << fRawChannelId << " is " << ReadoutType::AsString(fReadoutType)
00161      << " '" << fDescript << "'"
00162      << endl;
00163 
00164 }

Bool_t PlexRawChannelReadoutType::GetDefensiveUnpkg  )  [inline, static]
 

Definition at line 63 of file PlexRawChannelReadoutType.h.

00063 { return fgDefensiveUnpkg; }

std::string PlexRawChannelReadoutType::GetDescript  )  const [inline]
 

Definition at line 50 of file PlexRawChannelReadoutType.h.

Referenced by Plexus::BuildReadoutMap().

00050 { return fDescript; }

RawChannelId PlexRawChannelReadoutType::GetRawChannelId void   )  const [inline]
 

Definition at line 48 of file PlexRawChannelReadoutType.h.

Referenced by Plexus::BuildReadoutMap().

00048 { return fRawChannelId; }

ReadoutType::Readout_t PlexRawChannelReadoutType::GetReadoutType  )  const [inline]
 

Definition at line 49 of file PlexRawChannelReadoutType.h.

Referenced by Plexus::BuildReadoutMap().

00049 { return fReadoutType; } 

void PlexRawChannelReadoutType::SetDefensiveUnpkg Bool_t  defensive  )  [inline, static]
 

Definition at line 61 of file PlexRawChannelReadoutType.h.

References fgDefensiveUnpkg.

00062       { fgDefensiveUnpkg = defensive; }

void PlexRawChannelReadoutType::Store DbiOutRowStream ors,
const DbiValidityRec vrec
const [virtual]
 

Reimplemented from DbiTableRow.

Definition at line 167 of file PlexRawChannelReadoutType.cxx.

References ElecType::AsString(), RawChannelId::DecompChAdd(), fRawChannelId, RawChannelId::GetChAdd(), RawChannelId::GetCrate(), and RawChannelId::GetElecType().

00168                                                                               {
00169 //
00170 //
00171 //  Purpose:  Stream object to output row stream
00172 //
00173 //  Arguments: 
00174 //    ors          in     Output row stream.
00175 //    vrec         in     Associated validity record (or 0 if filling
00176 //                                                    DbiValidityRec)
00177 //
00178 //  Return:    
00179 //
00180 //  Contact:   R. Hatcher
00181 //
00182 //  Specification:-
00183 //  =============
00184 //
00185 //  o  Stream object to output row stream.
00186 
00187 //  Program Notes:-
00188 //  =============
00189 
00190 //  None.
00191 
00192    ElecType::Elec_t etype = fRawChannelId.GetElecType();
00193    unsigned int chadd = fRawChannelId.GetChAdd();
00194    unsigned int varc=0, vmm=0, adcsel=0, vachip=0, vachan=0;
00195    unsigned int geoaddr=0, master=0, minder=0;
00196 
00197    if (ElecType::kVA == etype) {
00198      RawChannelId::DecompChAdd(chadd,varc,vmm,adcsel,vachip,vachan);
00199    }
00200    else if (ElecType::kQIE == etype) {
00201      RawChannelId::DecompChAdd(chadd,geoaddr,master,minder);
00202    }
00203 
00204    ors << ElecType::AsString(etype)
00205        << fRawChannelId.GetCrate()
00206        << varc << vmm << adcsel << vachip << vachan
00207        << geoaddr << master << minder
00208        << fDescript;   
00209 }


Member Data Documentation

std::string PlexRawChannelReadoutType::fDescript [private]
 

Definition at line 76 of file PlexRawChannelReadoutType.h.

Referenced by PlexRawChannelReadoutType().

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

Definition at line 28 of file PlexRawChannelReadoutType.cxx.

Referenced by SetDefensiveUnpkg().

RawChannelId PlexRawChannelReadoutType::fRawChannelId [private]
 

Definition at line 74 of file PlexRawChannelReadoutType.h.

Referenced by PlexRawChannelReadoutType(), and Store().

ReadoutType::Readout_t PlexRawChannelReadoutType::fReadoutType [private]
 

Definition at line 75 of file PlexRawChannelReadoutType.h.

Referenced by PlexRawChannelReadoutType().


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