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

PlexPixelSpotToStripEnd Class Reference

#include <PlexPixelSpotToStripEnd.h>

Inheritance diagram for PlexPixelSpotToStripEnd:

DbiTableRow List of all members.

Public Member Functions

 PlexPixelSpotToStripEnd ()
 PlexPixelSpotToStripEnd (Detector::Detector_t det, ElecType::Elec_t elec, Char_t eastwest, Char_t racklevel, Int_t rackbay, Int_t inrack, Int_t tube, Int_t pixel, Int_t spot, Int_t plane, Int_t strip, StripEnd::StripEnd_t end)
virtual ~PlexPixelSpotToStripEnd ()
virtual Int_t GetAggregateNo () const
PlexPixelSpotId GetPlexPixelSpotId () const
PlexStripEndId GetPlexStripEndId () 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

 PlexPixelSpotToStripEnd (const PlexPixelSpotToStripEnd &from)

Private Attributes

Int_t fAggregate
PlexPixelSpotId fPlexPixelSpotId
PlexStripEndId fPlexStripEndId

Static Private Attributes

Bool_t fgDefensiveUnpkg = kFALSE

Constructor & Destructor Documentation

PlexPixelSpotToStripEnd::PlexPixelSpotToStripEnd  )  [inline]
 

Definition at line 32 of file PlexPixelSpotToStripEnd.h.

00032 { LEA_CTOR; }

PlexPixelSpotToStripEnd::PlexPixelSpotToStripEnd Detector::Detector_t  det,
ElecType::Elec_t  elec,
Char_t  eastwest,
Char_t  racklevel,
Int_t  rackbay,
Int_t  inrack,
Int_t  tube,
Int_t  pixel,
Int_t  spot,
Int_t  plane,
Int_t  strip,
StripEnd::StripEnd_t  end
[inline]
 

Definition at line 33 of file PlexPixelSpotToStripEnd.h.

References det, fPlexPixelSpotId, and fPlexStripEndId.

00039                                                    :
00040       fPlexPixelSpotId(det,elec,eastwest,racklevel,rackbay,inrack,tube,pixel,spot),
00041       fPlexStripEndId(det,plane,strip,end) { LEA_CTOR; };
   virtual ~PlexPixelSpotToStripEnd(){ LEA_DTOR; };

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

Definition at line 42 of file PlexPixelSpotToStripEnd.h.

00042 { LEA_DTOR; };

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

Definition at line 67 of file PlexPixelSpotToStripEnd.h.

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


Member Function Documentation

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

Implements DbiTableRow.

Definition at line 50 of file PlexPixelSpotToStripEnd.h.

00050 { return new PlexPixelSpotToStripEnd; }

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

Implements DbiTableRow.

Definition at line 44 of file PlexPixelSpotToStripEnd.cxx.

References PlexStripEndId::AsString(), StripEnd::CharToEnum(), ElecType::CharToEnum(), det, PlexVetoShieldHack::GetDefaultContext(), MSG, and PlexVetoShieldHack::RenumberMuxToMdl().

00045                                                                {
00046 //
00047 //
00048 //  Purpose:  Fill object from Result Set
00049 //
00050 //  Arguments: 
00051 //    rs           in    Result Set used to fill object
00052 //    vrec         in    Associated validity record (or 0 if filling
00053 //                                                    DbiValidityRec)
00054 //
00055 //  Return:    
00056 //
00057 //  Contact:   R. Hatcher
00058 //
00059 //  Specification:-
00060 //  =============
00061 //
00062 //  o Fill object from current row of Result Set.
00063 
00064 //  Program Notes:-
00065 //  =============
00066 
00067 //  None.
00068 
00069    Detector::Detector_t det =
00070       (Detector::Detector_t) 
00071       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00072    
00073             char elecName = '?';
00074             char elecType = ElecType::kUnknown;
00075             char rackEastWest='?', rackLevel='?', endchar='?';
00076    unsigned int  rackBay=0, muxboxInRack=0;
00077    unsigned int  tube, pixel, spot;
00078    unsigned int  plane, strip;
00079 
00080    if (fgDefensiveUnpkg) {
00081 
00082       // unpack allowing for various column names and ordering
00083 
00084       Int_t numCol = rs.NumCols();
00085       //  The first column (SeqNo) has already been processed.
00086       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00087          string colName = rs.CurColName();
00088          if (      colName == "AGGREGATENO" ) rs >> fAggregate;
00089          else if ( colName == "ELECTYPE"    ) rs >> elecType;
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 == "TUBE"        ) rs >> tube;
00096          else if ( colName == "PIXEL"       ) rs >> pixel;
00097          else if ( colName == "SPOT"        ) rs >> spot;
00098          else if ( colName == "PLANE"       ) rs >> plane;
00099          else if ( colName == "STRIP"       ) rs >> strip;
00100          else if ( colName == "STRIPEND"    ) rs >> endchar;
00101          // "END" is obsolete
00102          else if ( colName == "END"         ) rs >> endchar;
00103          else {
00104             static int nmsg = 25;
00105             if (nmsg-- > 0) MSG("Plex",Msg::kWarning) 
00106                << "Ignoring column " << rs.CurColNum() 
00107                << " (of " << rs.NumCols() << ")"
00108                << " \""<< colName << "\"; not part of "
00109                << ClassName() << endl;
00110             rs.IncrementCurCol();
00111          }
00112       }
00113    } // end defensive unpacking
00114    else {
00115 //       SeqNo         int,
00116 //       AggregateNo   int,
00117 //       ElecName      tinytext,
00118 //       RackEastWest  char(1),
00119 //       RackLevel     char(1),
00120 //       RackBay       tinyint,
00121 //       MuxBoxInRack  tinyint,
00122 //       Tube          tinyint,
00123 //       Pixel         tinyint,
00124 //       Spot          tinyint,
00125 //       Plane         smallint,
00126 //       Strip         smallint,
00127 //       StripEnd      char(1)
00128 
00129       rs >> fAggregate
00130          >> elecName
00131          >> rackEastWest
00132          >> rackLevel
00133          >> rackBay
00134          >> muxboxInRack
00135          >> tube
00136          >> pixel
00137          >> spot
00138          >> plane
00139          >> strip
00140          >> endchar;
00141       
00142    }
00143 
00144    ElecType::Elec_t elec = ElecType::CharToEnum(elecName);
00145    if (ElecType::kUnknown == elec)  elec = (ElecType::Elec_t) elecType;
00146 
00147    StripEnd::StripEnd_t end  = StripEnd::CharToEnum(endchar);
00148 
00149    fPlexPixelSpotId = PlexPixelSpotId(det,elec,rackEastWest,rackLevel,
00150                                       rackBay,muxboxInRack,tube,pixel,spot);
00151 
00152    fPlexStripEndId = PlexStripEndId(det,plane,strip,end);
00153 
00154    // completely ugly hack for the veto shield
00155    if (Detector::kFar == det && plane >= 512) {
00156      VldContext vldc = PlexVetoShieldHack::GetDefaultContext();
00157      fPlexStripEndId = 
00158        PlexVetoShieldHack::RenumberMuxToMdl(vldc,fPlexStripEndId);
00159      if (fPlexStripEndId.GetPlane() < 528) {
00160        MSG("Plex",Msg::kWarning)
00161          << "still mux scheme " 
00162          << endl 
00163          << " translated to " << fPlexStripEndId.AsString("C")
00164          << " from (" << plane << "," << strip << "," << endchar << ")"
00165          << endl
00166          << " from spot " << fPlexPixelSpotId
00167          << " (" << elecName << "," << rackEastWest << "," << rackLevel
00168          << "," << rackBay << "," << muxboxInRack 
00169          << "," << tube << "," << pixel << "," << spot << ")"
00170          << endl;
00171        //assert(0);
00172      }
00173    }
00174 
00175 }

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

Reimplemented from DbiTableRow.

Definition at line 46 of file PlexPixelSpotToStripEnd.h.

00046 { return fAggregate; }

Bool_t PlexPixelSpotToStripEnd::GetDefensiveUnpkg  )  [inline, static]
 

Definition at line 61 of file PlexPixelSpotToStripEnd.h.

00061 { return fgDefensiveUnpkg; }

PlexPixelSpotId PlexPixelSpotToStripEnd::GetPlexPixelSpotId  )  const [inline]
 

Definition at line 47 of file PlexPixelSpotToStripEnd.h.

Referenced by Plexus::BuildPixelMaps().

00047 { return fPlexPixelSpotId; }

PlexStripEndId PlexPixelSpotToStripEnd::GetPlexStripEndId  )  const [inline]
 

Definition at line 48 of file PlexPixelSpotToStripEnd.h.

Referenced by Plexus::BuildPixelMaps().

00048 { return fPlexStripEndId; }

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

Definition at line 59 of file PlexPixelSpotToStripEnd.h.

References fgDefensiveUnpkg.

00060       { fgDefensiveUnpkg = defensive; }

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

Reimplemented from DbiTableRow.

Definition at line 178 of file PlexPixelSpotToStripEnd.cxx.

References StripEnd::AsString(), ElecType::AsString(), fAggregate, fPlexPixelSpotId, fPlexStripEndId, PlexMuxBoxId::GetEastWest(), PlexMuxBoxId::GetElecType(), PlexStripEndId::GetEnd(), PlexMuxBoxId::GetInRack(), PlexPixelSpotId::GetPixel(), PlexPlaneId::GetPlane(), PlexMuxBoxId::GetRackBay(), PlexMuxBoxId::GetRackLevel(), PlexPixelSpotId::GetSpot(), PlexStripEndId::GetStrip(), and PlexPixelSpotId::GetTube().

00179                                                                             {
00180 //
00181 //
00182 //  Purpose:  Stream object to output row stream
00183 //
00184 //  Arguments: 
00185 //    ors          in     Output row stream.
00186 //    vrec         in     Associated validity record (or 0 if filling
00187 //                                                    DbiValidityRec)
00188 //
00189 //  Return:    
00190 //
00191 //  Contact:   R. Hatcher
00192 //
00193 //  Specification:-
00194 //  =============
00195 //
00196 //  o  Stream object to output row stream.
00197 
00198 //  Program Notes:-
00199 //  =============
00200 
00201 //  None.
00202 
00203    ElecType::Elec_t elec = fPlexPixelSpotId.GetElecType();
00204    //   int  numeric      = fPlexPixelSpotId.GetNumericMuxBox();
00205    char rackEastWest = fPlexPixelSpotId.GetEastWest();
00206    char rackLevel    = fPlexPixelSpotId.GetRackLevel();
00207    int  rackBay      = fPlexPixelSpotId.GetRackBay();
00208    int  muxInRack    = fPlexPixelSpotId.GetInRack();
00209 
00210    ors << fAggregate 
00211        << ElecType::AsString(elec)
00212        << rackEastWest
00213        << rackLevel
00214        << rackBay
00215        << muxInRack
00216        << fPlexPixelSpotId.GetTube()
00217        << fPlexPixelSpotId.GetPixel()
00218        << fPlexPixelSpotId.GetSpot()
00219        << fPlexStripEndId.GetPlane()
00220        << fPlexStripEndId.GetStrip()
00221        << StripEnd::AsString(fPlexStripEndId.GetEnd())[0];
00222    
00223 }


Member Data Documentation

Int_t PlexPixelSpotToStripEnd::fAggregate [private]
 

Definition at line 72 of file PlexPixelSpotToStripEnd.h.

Referenced by Store().

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

Definition at line 30 of file PlexPixelSpotToStripEnd.cxx.

Referenced by SetDefensiveUnpkg().

PlexPixelSpotId PlexPixelSpotToStripEnd::fPlexPixelSpotId [private]
 

Definition at line 73 of file PlexPixelSpotToStripEnd.h.

Referenced by PlexPixelSpotToStripEnd(), and Store().

PlexStripEndId PlexPixelSpotToStripEnd::fPlexStripEndId [private]
 

Definition at line 74 of file PlexPixelSpotToStripEnd.h.

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