#include <PlexPixelToRawChannel.h>
Public Member Functions | |
PlexPixelToRawChannel () | |
PlexPixelToRawChannel (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 crate, Int_t chadd) | |
virtual | ~PlexPixelToRawChannel () |
virtual Int_t | GetAggregateNo () const |
PlexPixelSpotId | GetPlexPixelSpotId () const |
RawChannelId | GetRawChannelId () const |
virtual DbiTableRow * | CreateTableRow () 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 | |
PlexPixelToRawChannel (const PlexPixelToRawChannel &from) | |
Private Attributes | |
Int_t | fAggregate |
PlexPixelSpotId | fPlexPixelSpotId |
RawChannelId | fRawChannelId |
Static Private Attributes | |
static Bool_t | fgDefensiveUnpkg = kFALSE |
Definition at line 25 of file PlexPixelToRawChannel.h.
PlexPixelToRawChannel::PlexPixelToRawChannel | ( | ) | [inline] |
PlexPixelToRawChannel::PlexPixelToRawChannel | ( | 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 | crate, | |||
Int_t | chadd | |||
) | [inline] |
Definition at line 33 of file PlexPixelToRawChannel.h.
References LEA_CTOR.
00038 : 00039 fPlexPixelSpotId(det,elec,eastwest,racklevel,rackbay,inrack,tube,pixel,0), 00040 fRawChannelId(det,elec,crate,chadd) { LEA_CTOR; } virtual ~PlexPixelToRawChannel(){ LEA_DTOR; };
virtual PlexPixelToRawChannel::~PlexPixelToRawChannel | ( | ) | [inline, virtual] |
PlexPixelToRawChannel::PlexPixelToRawChannel | ( | const PlexPixelToRawChannel & | from | ) | [inline, private] |
Definition at line 66 of file PlexPixelToRawChannel.h.
References LEA_CTOR.
00067 : DbiTableRow(from) { LEA_CTOR; *this = from; }
virtual DbiTableRow* PlexPixelToRawChannel::CreateTableRow | ( | ) | const [inline, virtual] |
Implements DbiTableRow.
Definition at line 49 of file PlexPixelToRawChannel.h.
00049 { return new PlexPixelToRawChannel; }
void PlexPixelToRawChannel::Fill | ( | DbiResultSet & | rs, | |
const DbiValidityRec * | vrec | |||
) | [virtual] |
Implements DbiTableRow.
Definition at line 45 of file PlexPixelToRawChannel.cxx.
References ClusterType::CharToEnum(), DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fAggregate, fgDefensiveUnpkg, fPlexPixelSpotId, fRawChannelId, VldRange::GetDetectorMask(), PlexMuxBoxId::GetNumericMuxBox(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), Msg::kInfo, 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 muxbox=0, tube, pixel; 00079 int crate=0, chadd=0; 00080 int varc, vmm, adcsel, vachip, vachan; 00081 int geoaddr, master, minder; 00082 00083 if (fgDefensiveUnpkg) { 00084 00085 // unpack allowing for various column names and ordering 00086 00087 Int_t numCol = rs.NumCols(); 00088 // The first column (SeqNo) has already been processed. 00089 for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) { 00090 string colName = rs.CurColName(); 00091 if ( colName == "AGGREGATENO" ) rs >> fAggregate; 00092 else if ( colName == "ELECTYPE" ) rs >> elecType; 00093 else if ( colName == "ELECNAME" ) rs >> elecName; 00094 else if ( colName == "CRATE" ) rs >> crate; 00095 else if ( colName == "CHADD" ) rs >> chadd; 00096 else if ( colName == "VARC" ) rs >> varc; 00097 else if ( colName == "VMM" ) rs >> vmm; 00098 else if ( colName == "VFB" ) rs >> adcsel; 00099 else if ( colName == "VAADCSEL" ) rs >> adcsel; 00100 else if ( colName == "VACHIP" ) rs >> vachip; 00101 else if ( colName == "VACHAN" ) rs >> vachan; 00102 else if ( colName == "GEOADDR" ) rs >> geoaddr; 00103 else if ( colName == "MASTER" ) rs >> master; 00104 else if ( colName == "MINDER" ) rs >> minder; 00105 else if ( colName == "MUXBOX" ) rs >> muxbox; 00106 else if ( colName == "RACKEASTWEST") rs >> rackEastWest; 00107 else if ( colName == "RACKLEVEL" ) rs >> rackLevel; 00108 else if ( colName == "RACKBAY" ) rs >> rackBay; 00109 else if ( colName == "MUXBOXINRACK") rs >> muxboxInRack; 00110 else if ( colName == "TUBE" ) rs >> tube; 00111 else if ( colName == "PIXEL" ) rs >> pixel; 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 // RackEastWest char(1), 00130 // RackLevel char(1), 00131 // RackBay tinyint, 00132 // MuxBoxInRack tinyint, 00133 // Tube tinyint, 00134 // Pixel tinyint, 00135 // Crate tinyint, 00136 // VARC tinyint, 00137 // VMM tinyint, 00138 // VaAdcSel tinyint, 00139 // VaChip tinyint, 00140 // VaChan tinyint, 00141 // GeoAddr tinyint, 00142 // Master tinyint, 00143 // Minder tinyint 00144 00145 rs >> fAggregate 00146 >> elecName 00147 >> rackEastWest 00148 >> rackLevel 00149 >> rackBay 00150 >> muxboxInRack 00151 >> tube 00152 >> pixel 00153 >> crate 00154 >> varc 00155 >> vmm 00156 >> adcsel 00157 >> vachip 00158 >> vachan 00159 >> geoaddr 00160 >> master 00161 >> minder; 00162 } 00163 00164 const Int_t spot = 0; 00165 00166 ElecType::Elec_t elec = ElecType::CharToEnum(elecName); 00167 if (ElecType::kUnknown == elec) elec = (ElecType::Elec_t) elecType; 00168 00169 if (chadd) { 00170 fRawChannelId = RawChannelId(det,elec,crate,chadd); 00171 } 00172 else if (ElecType::kVA == elec) { 00173 fRawChannelId = RawChannelId(det,elec,crate,varc,vmm,adcsel,vachip,vachan); 00174 00175 } 00176 else if (ElecType::kQIE == elec) { 00177 fRawChannelId = RawChannelId(det,elec,crate,geoaddr,master,minder); 00178 } else { 00179 MSG("Plex",Msg::kWarning) 00180 << " bad electronics type \"" << elecName << "\"" << endl; 00181 } 00182 00183 fPlexPixelSpotId = PlexPixelSpotId(det,elec,rackEastWest,rackLevel, 00184 rackBay,muxboxInRack,tube,pixel,spot); 00185 00186 #ifdef AGGREGATE_TEST 00187 int numeric = fPlexPixelSpotId.GetNumericMuxBox(); 00188 MSG("Plex",Msg::kInfo) 00189 << "PlexPixelToRawChannel " 00190 << " aggrno " << fAggregate 00191 << " 0x" << hex << setw(8) << fAggregate << dec 00192 << " numeric " << numeric 00193 << " 0x" << hex << setw(8) << numeric << dec 00194 << endl; 00195 00196 // AggregateNo = MuxBoxInRack + 8*(RackBay-1) 00197 // + (if "top")128 00198 // + (if "west")256 00199 #endif 00200 00201 //_____________________________________________________________________________ 00202 00203 }
virtual Int_t PlexPixelToRawChannel::GetAggregateNo | ( | ) | const [inline, virtual] |
Reimplemented from DbiTableRow.
Definition at line 45 of file PlexPixelToRawChannel.h.
References fAggregate.
00045 { return fAggregate; }
static Bool_t PlexPixelToRawChannel::GetDefensiveUnpkg | ( | ) | [inline, static] |
Definition at line 60 of file PlexPixelToRawChannel.h.
References fgDefensiveUnpkg.
00060 { return fgDefensiveUnpkg; }
PlexPixelSpotId PlexPixelToRawChannel::GetPlexPixelSpotId | ( | ) | const [inline] |
Definition at line 46 of file PlexPixelToRawChannel.h.
References fPlexPixelSpotId.
Referenced by Plexus::BuildPixelMaps().
00046 { return fPlexPixelSpotId; }
RawChannelId PlexPixelToRawChannel::GetRawChannelId | ( | void | ) | const [inline] |
Definition at line 47 of file PlexPixelToRawChannel.h.
References fRawChannelId.
Referenced by Plexus::BuildPixelMaps().
00047 { return fRawChannelId; }
static void PlexPixelToRawChannel::SetDefensiveUnpkg | ( | Bool_t | defensive | ) | [inline, static] |
Definition at line 58 of file PlexPixelToRawChannel.h.
References fgDefensiveUnpkg.
00059 { fgDefensiveUnpkg = defensive; }
void PlexPixelToRawChannel::Store | ( | DbiOutRowStream & | ors, | |
const DbiValidityRec * | vrec | |||
) | const [virtual] |
Reimplemented from DbiTableRow.
Definition at line 206 of file PlexPixelToRawChannel.cxx.
References fAggregate, fPlexPixelSpotId, fRawChannelId, RawChannelId::GetChAdd(), RawChannelId::GetCrate(), PlexMuxBoxId::GetEastWest(), PlexMuxBoxId::GetElecType(), PlexMuxBoxId::GetInRack(), PlexPixelSpotId::GetPixel(), PlexMuxBoxId::GetRackBay(), PlexMuxBoxId::GetRackLevel(), and PlexPixelSpotId::GetTube().
00207 { 00208 // 00209 // 00210 // Purpose: Stream object to output row stream 00211 // 00212 // Arguments: 00213 // ors in Output row stream. 00214 // vrec in Associated validity record (or 0 if filling 00215 // DbiValidityRec) 00216 // 00217 // Return: 00218 // 00219 // Contact: R. Hatcher 00220 // 00221 // Specification:- 00222 // ============= 00223 // 00224 // o Stream object to output row stream. 00225 00226 // Program Notes:- 00227 // ============= 00228 00229 // None. 00230 00231 int elect = (int)fPlexPixelSpotId.GetElecType(); 00232 char rackEastWest = fPlexPixelSpotId.GetEastWest(); 00233 char rackLevel = fPlexPixelSpotId.GetRackLevel(); 00234 int rackBay = fPlexPixelSpotId.GetRackBay(); 00235 int muxInRack = fPlexPixelSpotId.GetInRack(); 00236 00237 ors << fAggregate 00238 << elect 00239 << rackEastWest 00240 << rackLevel 00241 << rackBay 00242 << muxInRack 00243 << fPlexPixelSpotId.GetTube() 00244 << fPlexPixelSpotId.GetPixel() 00245 << fRawChannelId.GetCrate() 00246 << fRawChannelId.GetChAdd(); 00247 00248 }
Int_t PlexPixelToRawChannel::fAggregate [private] |
Definition at line 71 of file PlexPixelToRawChannel.h.
Referenced by Fill(), GetAggregateNo(), and Store().
Bool_t PlexPixelToRawChannel::fgDefensiveUnpkg = kFALSE [static, private] |
Definition at line 77 of file PlexPixelToRawChannel.h.
Referenced by Fill(), GetDefensiveUnpkg(), and SetDefensiveUnpkg().
Definition at line 72 of file PlexPixelToRawChannel.h.
Referenced by Fill(), GetPlexPixelSpotId(), and Store().
Definition at line 73 of file PlexPixelToRawChannel.h.
Referenced by Fill(), GetRawChannelId(), and Store().