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

static void SetDefensiveUnpkg (Bool_t defensive)
static Bool_t GetDefensiveUnpkg ()

Private Member Functions

 PlexPixelSpotToStripEnd (const PlexPixelSpotToStripEnd &from)

Private Attributes

Int_t fAggregate
PlexPixelSpotId fPlexPixelSpotId
PlexStripEndId fPlexStripEndId

Static Private Attributes

static Bool_t fgDefensiveUnpkg = kFALSE

Detailed Description

Definition at line 25 of file PlexPixelSpotToStripEnd.h.


Constructor & Destructor Documentation

PlexPixelSpotToStripEnd::PlexPixelSpotToStripEnd (  )  [inline]

Definition at line 32 of file PlexPixelSpotToStripEnd.h.

References LEA_CTOR.

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 LEA_CTOR.

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.

References LEA_DTOR.

00042 { LEA_DTOR; };

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

Definition at line 67 of file PlexPixelSpotToStripEnd.h.

References LEA_CTOR.

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(), ClusterType::CharToEnum(), DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fAggregate, fgDefensiveUnpkg, fPlexPixelSpotId, fPlexStripEndId, PlexVetoShieldHack::GetDefaultContext(), VldRange::GetDetectorMask(), PlexPlaneId::GetPlane(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), Detector::kFar, ElecType::kUnknown, Msg::kWarning, MSG, DbiRowStream::NumCols(), 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) {
00106               MSG("Plex",Msg::kWarning) 
00107                 << "Ignoring column " << rs.CurColNum() 
00108                 << " (of " << rs.NumCols() << ")"
00109                 << " \""<< colName << "\"; not part of "
00110                 << ClassName() << endl;
00111             }
00112             rs.IncrementCurCol();
00113          }
00114       }
00115    } // end defensive unpacking
00116    else {
00117 //       SeqNo         int,
00118 //       AggregateNo   int,
00119 //       ElecName      tinytext,
00120 //       RackEastWest  char(1),
00121 //       RackLevel     char(1),
00122 //       RackBay       tinyint,
00123 //       MuxBoxInRack  tinyint,
00124 //       Tube          tinyint,
00125 //       Pixel         tinyint,
00126 //       Spot          tinyint,
00127 //       Plane         smallint,
00128 //       Strip         smallint,
00129 //       StripEnd      char(1)
00130 
00131       rs >> fAggregate
00132          >> elecName
00133          >> rackEastWest
00134          >> rackLevel
00135          >> rackBay
00136          >> muxboxInRack
00137          >> tube
00138          >> pixel
00139          >> spot
00140          >> plane
00141          >> strip
00142          >> endchar;
00143       
00144    }
00145 
00146    ElecType::Elec_t elec = ElecType::CharToEnum(elecName);
00147    if (ElecType::kUnknown == elec)  elec = (ElecType::Elec_t) elecType;
00148 
00149    StripEnd::StripEnd_t end  = StripEnd::CharToEnum(endchar);
00150 
00151    fPlexPixelSpotId = PlexPixelSpotId(det,elec,rackEastWest,rackLevel,
00152                                       rackBay,muxboxInRack,tube,pixel,spot);
00153 
00154    fPlexStripEndId = PlexStripEndId(det,plane,strip,end);
00155 
00156    // completely ugly hack for the veto shield
00157    if (Detector::kFar == det && plane >= 512) {
00158      VldContext vldc = PlexVetoShieldHack::GetDefaultContext();
00159      fPlexStripEndId = 
00160        PlexVetoShieldHack::RenumberMuxToMdl(vldc,fPlexStripEndId);
00161      if (fPlexStripEndId.GetPlane() < 528) {
00162        MSG("Plex",Msg::kWarning)
00163          << "still mux scheme " 
00164          << endl 
00165          << " translated to " << fPlexStripEndId.AsString("C")
00166          << " from (" << plane << "," << strip << "," << endchar << ")"
00167          << endl
00168          << " from spot " << fPlexPixelSpotId
00169          << " (" << elecName << "," << rackEastWest << "," << rackLevel
00170          << "," << rackBay << "," << muxboxInRack 
00171          << "," << tube << "," << pixel << "," << spot << ")"
00172          << endl;
00173        //assert(0);
00174      }
00175    }
00176 
00177 }

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

Reimplemented from DbiTableRow.

Definition at line 46 of file PlexPixelSpotToStripEnd.h.

References fAggregate.

00046 { return fAggregate; }

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

Definition at line 61 of file PlexPixelSpotToStripEnd.h.

References fgDefensiveUnpkg.

00061 { return fgDefensiveUnpkg; }

PlexPixelSpotId PlexPixelSpotToStripEnd::GetPlexPixelSpotId (  )  const [inline]

Definition at line 47 of file PlexPixelSpotToStripEnd.h.

References fPlexPixelSpotId.

Referenced by Plexus::BuildPixelMaps().

00047 { return fPlexPixelSpotId; }

PlexStripEndId PlexPixelSpotToStripEnd::GetPlexStripEndId (  )  const [inline]

Definition at line 48 of file PlexPixelSpotToStripEnd.h.

References fPlexStripEndId.

Referenced by Plexus::BuildPixelMaps().

00048 { return fPlexStripEndId; }

static 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 180 of file PlexPixelSpotToStripEnd.cxx.

References bfld::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().

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


Member Data Documentation

Definition at line 72 of file PlexPixelSpotToStripEnd.h.

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

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

Definition at line 78 of file PlexPixelSpotToStripEnd.h.

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

Definition at line 73 of file PlexPixelSpotToStripEnd.h.

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

Definition at line 74 of file PlexPixelSpotToStripEnd.h.

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


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1