#include <UgliDbiScintMdlStruct.h>
Inheritance diagram for UgliDbiScintMdlStruct:

Public Member Functions | |
| UgliDbiScintMdlStruct () | |
| UgliDbiScintMdlStruct (PlexScintMdlId scintmdlid, std::string type, Short_t first, Short_t last) | |
| UgliDbiScintMdlStruct (Detector::Detector_t detector, PlaneView::PlaneView_t view, PlaneCoverage::PlaneCoverage_t coverage, UShort_t module, std::string type, Short_t first, Short_t last) | |
| virtual | ~UgliDbiScintMdlStruct () |
| UInt_t | GetIndex (UInt_t defIndex) const |
| Detector::Detector_t | GetDetector () const |
| PlaneView::PlaneView_t | GetPlaneView () const |
| PlaneCoverage::PlaneCoverage_t | GetPlaneCoverage () const |
| UShort_t | GetModule () const |
| std::string | GetTypeName () const |
| Short_t | GetFirstStrip () const |
| Short_t | GetLastStrip () const |
| virtual DbiTableRow * | CreateTableRow () const |
| virtual void | Fill (DbiResultSet &rs, const DbiValidityRec *vrec) |
| virtual void | Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const |
| virtual std::ostream & | FormatToOStream (std::ostream &os, Option_t *option="", const DbiValidityRec *vrec=0) const |
| virtual void | Print (Option_t *option="") const |
Static Public Member Functions | |
| const char * | GetTableDescr () |
| void | SetDefensiveUnpkg (Bool_t defensive) |
| Bool_t | GetDefensiveUnpkg () |
Private Member Functions | |
| UgliDbiScintMdlStruct (const UgliDbiScintMdlStruct &from) | |
Private Attributes | |
| UgliDbiStructHash | fDetViewCoverMdl |
| std::string | fTypeName |
| Int_t | fFirstStrip |
| Int_t | fLastStrip |
Static Private Attributes | |
| Bool_t | fgDefensiveUnpkg = kFALSE |
|
|
Definition at line 35 of file UgliDbiScintMdlStruct.h. References fDetViewCoverMdl, fFirstStrip, fLastStrip, and fTypeName. 00036 : fDetViewCoverMdl(), fTypeName("unknown"), 00037 fFirstStrip(-1), fLastStrip(-1) { LEA_CTOR; };
|
|
||||||||||||||||||||
|
Definition at line 39 of file UgliDbiScintMdlStruct.h. References fDetViewCoverMdl, fFirstStrip, fLastStrip, and fTypeName. 00041 : fDetViewCoverMdl(scintmdlid), fTypeName(type), 00042 fFirstStrip(first), fLastStrip(last) { LEA_CTOR; };
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 44 of file UgliDbiScintMdlStruct.h. References fDetViewCoverMdl, fFirstStrip, fLastStrip, and fTypeName. 00049 : fDetViewCoverMdl(detector,view,coverage,module), fTypeName(type), 00050 fFirstStrip(first), fLastStrip(last) { LEA_CTOR; };
|
|
|
Definition at line 52 of file UgliDbiScintMdlStruct.h. 00052 { LEA_DTOR; };
|
|
|
Definition at line 91 of file UgliDbiScintMdlStruct.h. 00092 : DbiTableRow(from) { LEA_CTOR; *this = from; }
|
|
|
Implements DbiTableRow. Definition at line 68 of file UgliDbiScintMdlStruct.h. 00068 { return new UgliDbiScintMdlStruct; }
|
|
||||||||||||
|
Implements DbiTableRow. Definition at line 58 of file UgliDbiScintMdlStruct.cxx. References DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fDetViewCoverMdl, fFirstStrip, fTypeName, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), MSG, and DbiRowStream::NumCols(). 00059 {
00060 //
00061 //
00062 // Purpose: Fill object from Result Set
00063 //
00064 // Arguments:
00065 // rs in Result Set used to fill object
00066 // vrec in Associated validity record (or 0 if filling
00067 // DbiValidityRec)
00068 //
00069 // Return:
00070 //
00071 // Contact: R. Hatcher
00072 //
00073 // Specification:-
00074 // =============
00075 //
00076 // o Fill object from current row of Result Set.
00077
00078 // Program Notes:-
00079 // =============
00080
00081 // None.
00082
00083 Detector::Detector_t det =
00084 (Detector::Detector_t)
00085 ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00086
00087 UInt_t hashv = 0;
00088 UInt_t tmpdet = det;
00089 UInt_t tmpview = PlaneView::kUnknown;
00090 Int_t tmpcoverage = PlaneCoverage::kUnknown;
00091 UShort_t mdlinpln = 0xffff;
00092
00093 if (fgDefensiveUnpkg) {
00094
00095 // unpack allowing for various column names and ordering
00096
00097 Int_t numCol = rs.NumCols();
00098 // The first column (SeqNo) has already been processed.
00099 for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00100 string colName = rs.CurColName();
00101 if ( colName == "HASHVAL" ) rs.IncrementCurCol();
00102 else if ( colName == "DETECTOR" ) rs >> tmpdet;
00103 else if ( colName == "PLNVIEW" ) rs >> tmpview;
00104 else if ( colName == "COVERAGE" ) rs >> tmpcoverage;
00105 else if ( colName == "MDLINPLANE") rs >> mdlinpln;
00106 else if ( colName == "TYPENAME" ) rs >> fTypeName;
00107 else if ( colName == "FIRSTSTRIP") rs >> fFirstStrip;
00108 else if ( colName == "LASTSTRIP" ) rs >> fLastStrip;
00109 else {
00110 static int nmsg = 25;
00111 if (nmsg-- > 0) MSG("Ugli",Msg::kWarning)
00112 << "Ignoring column " << rs.CurColNum()
00113 << " (of " << rs.NumCols() << ")"
00114 << " \""<< colName << "\"; not part of "
00115 << ClassName() << endl;
00116 rs.IncrementCurCol();
00117 }
00118 }
00119 } // end defensive unpacking
00120 else {
00121 rs >> hashv
00122 >> tmpdet
00123 >> tmpview
00124 >> tmpcoverage
00125 >> mdlinpln
00126 >> fTypeName
00127 >> fFirstStrip
00128 >> fLastStrip;
00129 }
00130
00131 fDetViewCoverMdl =
00132 UgliDbiStructHash( (Detector::Detector_t)tmpdet,
00133 (PlaneView::PlaneView_t)tmpview,
00134 (PlaneCoverage::PlaneCoverage_t)tmpcoverage,
00135 mdlinpln );
00136
00137 }
|
|
||||||||||||||||
|
Definition at line 206 of file UgliDbiScintMdlStruct.cxx. References fFirstStrip, fLastStrip, fTypeName, GetDetector(), GetModule(), GetPlaneCoverage(), GetPlaneView(), DbiValidityRec::GetSeqNo(), GetTableDescr(), UgliDbiTableDescr::ParseTableDescr(), and UgliDbiTableDescr::TextTableDescrLine(). Referenced by Print(). 00209 {
00210 //
00211 //
00212 // Purpose: Print the current row
00213 //
00214 // Return: nothing
00215 //
00216 // Contact: R. Hatcher
00217 //
00218 // Specification:-
00219 // =============
00220 //
00221
00222 // Program Notes:-
00223 // =============
00224
00225 // None.
00226
00227 string opt = option;
00228
00229 if ( opt.find("H") != string::npos ) {
00230 string tabledescr = GetTableDescr();
00231 tabledescr = UgliDbiTableDescr::TextTableDescrLine(tabledescr);
00232 os << tabledescr << endl;
00233 }
00234 else if ( opt.find("h") != string::npos ) {
00235 string tabledescr = GetTableDescr();
00236 vector< pair<string,string> > components =
00237 UgliDbiTableDescr::ParseTableDescr(tabledescr);
00238 for (unsigned int ic = 0; ic < components.size(); ++ic)
00239 os << components[ic].first << '\t';
00240 os << endl;
00241 }
00242
00243 char sep = '\t';
00244 if ( opt.find(",") != string::npos ) sep = ',';
00245
00246 if ( ! dvr ) {
00247 os << "SeqNo" << sep; // no way of knowing the SEQNO?
00248 }
00249 else {
00250 os << dvr->GetSeqNo() << sep;
00251 }
00252
00253 os << "ROW_COUNTER" << sep // ???
00254 << -1 << sep // Hashval is obsolete
00255 << (int)GetDetector() << sep
00256 << (int)GetPlaneView() << sep
00257 << (int)GetPlaneCoverage() << sep
00258 << GetModule() << sep
00259 << "'" << fTypeName << "'" << sep
00260 << fFirstStrip << sep
00261 << fLastStrip << endl;
00262
00263 return os;
00264 }
|
|
|
Definition at line 85 of file UgliDbiScintMdlStruct.h. 00085 { return fgDefensiveUnpkg; }
|
|
|
Definition at line 109 of file UgliDbiScintMdlStruct.h. References fDetViewCoverMdl, and UgliDbiStructHash::GetDetector(). Referenced by FormatToOStream(). 00110 { return fDetViewCoverMdl.GetDetector(); }
|
|
|
Definition at line 64 of file UgliDbiScintMdlStruct.h. Referenced by UgliScintPlnNode::BuildStrips(), and UgliGeometryReroot::MakeTempDbiPosInfo(). 00064 { return fFirstStrip; }
|
|
|
Reimplemented from DbiTableRow. Definition at line 121 of file UgliDbiScintMdlStruct.h. References fDetViewCoverMdl, and UgliDbiStructHash::HashAsScintMdl(). Referenced by UgliGeometryReroot::MakeTempDbiScintStruct(), and Store(). 00122 { return fDetViewCoverMdl.HashAsScintMdl(); }
|
|
|
Definition at line 65 of file UgliDbiScintMdlStruct.h. Referenced by UgliScintPlnNode::BuildStrips(), and UgliGeometryReroot::MakeTempDbiPosInfo(). 00065 { return fLastStrip; }
|
|
|
Definition at line 118 of file UgliDbiScintMdlStruct.h. References fDetViewCoverMdl, and UgliDbiStructHash::GetPart(). Referenced by FormatToOStream(). 00119 { return fDetViewCoverMdl.GetPart(); }
|
|
|
Definition at line 115 of file UgliDbiScintMdlStruct.h. References fDetViewCoverMdl, and UgliDbiStructHash::GetPlaneCoverage(). Referenced by FormatToOStream(). 00116 { return fDetViewCoverMdl.GetPlaneCoverage(); }
|
|
|
Definition at line 112 of file UgliDbiScintMdlStruct.h. References fDetViewCoverMdl, and UgliDbiStructHash::GetPlaneView(). Referenced by FormatToOStream(). 00113 { return fDetViewCoverMdl.GetPlaneView(); }
|
|
|
Definition at line 268 of file UgliDbiScintMdlStruct.cxx. Referenced by FormatToOStream(), UgliGeometryReroot::MakeTempDbiScintStruct(), and Store(). 00269 {
00270 //
00271 //
00272 // Purpose: Return a string describing rows in the table
00273 // Used in creating temporary tables
00274 //
00275 // Return: const char* to parenthesized comma separated list
00276 // of column name and type pairs
00277 //
00278 // Contact: R. Hatcher
00279 //
00280 // Specification:-
00281 // =============
00282 //
00283
00284 // Program Notes:-
00285 // =============
00286
00287 // None.
00288
00289 const char* const_tabledescr = "(\
00290 SEQNO int, \
00291 ROW_COUNTER int, \
00292 HASHVAL int, \
00293 DETECTOR tinyint, \
00294 PLNVIEW tinyint, \
00295 COVERAGE tinyint, \
00296 MDLINPLANE tinyint, \
00297 TYPENAME text, \
00298 FIRSTSTRIP smallint, \
00299 LASTSTRIP smallint, \
00300 primary key (SEQNO,ROW_COUNTER) \
00301 )";
00302
00303 return const_tabledescr;
00304 }
|
|
|
Definition at line 63 of file UgliDbiScintMdlStruct.h. Referenced by UgliScintMdlNode::UgliScintMdlNode(). 00063 { return fTypeName; }
|
|
|
Definition at line 199 of file UgliDbiScintMdlStruct.cxx. References FormatToOStream(), and option. 00200 {
00201 FormatToOStream(cout,option);
00202 }
|
|
|
Definition at line 83 of file UgliDbiScintMdlStruct.h. References fgDefensiveUnpkg. 00084 { fgDefensiveUnpkg = defensive; }
|
|
||||||||||||
|
Reimplemented from DbiTableRow. Definition at line 141 of file UgliDbiScintMdlStruct.cxx. References fDetViewCoverMdl, UgliDbiStructHash::GetDetector(), GetIndex(), UgliDbiStructHash::GetPart(), UgliDbiStructHash::GetPlaneCoverage(), UgliDbiStructHash::GetPlaneView(), GetTableDescr(), MSG, and UgliDbiTableDescr::ParseTableDescr(). 00142 {
00143 //
00144 //
00145 // Purpose: Stream object to output row stream
00146 //
00147 // Arguments:
00148 // ors in Output row stream.
00149 // vrec in Associated validity record (or 0 if filling
00150 // DbiValidityRec)
00151 //
00152 // Return:
00153 //
00154 // Contact: R. Hatcher
00155 //
00156 // Specification:-
00157 // =============
00158 //
00159 // o Stream object to output row stream.
00160
00161 // Program Notes:-
00162 // =============
00163
00164 // None.
00165
00166 const char* tabledescr = GetTableDescr();
00167 vector< pair<string,string> > components =
00168 UgliDbiTableDescr::ParseTableDescr(tabledescr);
00169 int n = components.size();
00170
00171 for (int i=0; i<n; i++) {
00172 pair<string,string> colPair = components[i];
00173 string colName = colPair.first;
00174 if ( colName == "HASHVAL" ) ors << (int)GetIndex(0);
00175 // "HASH" is obsolete
00176 else if ( colName == "HASH" ) ors << (int)GetIndex(0);
00177 else if ( colName == "DETECTOR" ) ors << (int)fDetViewCoverMdl.GetDetector();
00178 else if ( colName == "PLNVIEW" ) ors << (int)fDetViewCoverMdl.GetPlaneView();
00179 // "VIEW" is obsolete
00180 else if ( colName == "VIEW" ) ors << (int)fDetViewCoverMdl.GetPlaneView();
00181 else if ( colName == "COVERAGE" ) ors << (int)fDetViewCoverMdl.GetPlaneCoverage();
00182 else if ( colName == "MDLINPLANE") ors << fDetViewCoverMdl.GetPart();
00183 else if ( colName == "TYPENAME" ) ors << fTypeName;
00184 else if ( colName == "FIRSTSTRIP") ors << fFirstStrip;
00185 else if ( colName == "LASTSTRIP" ) ors << fLastStrip;
00186
00187 else if ( colName == "ROW_COUNTER" ) {;}
00188 else if ( colName == "SEQNO" ) {;}
00189 else {
00190 MSG("Ugli",Msg::kFatal)
00191 << "Column name '" << colName << "' not correctly handled" << endl;
00192 assert(0);
00193 }
00194 }
00195 }
|
|
|
Definition at line 96 of file UgliDbiScintMdlStruct.h. Referenced by Fill(), GetDetector(), GetIndex(), GetModule(), GetPlaneCoverage(), GetPlaneView(), Store(), and UgliDbiScintMdlStruct(). |
|
|
Definition at line 98 of file UgliDbiScintMdlStruct.h. Referenced by Fill(), FormatToOStream(), and UgliDbiScintMdlStruct(). |
|
|
Definition at line 32 of file UgliDbiScintMdlStruct.cxx. Referenced by SetDefensiveUnpkg(). |
|
|
Definition at line 99 of file UgliDbiScintMdlStruct.h. Referenced by FormatToOStream(), and UgliDbiScintMdlStruct(). |
|
|
Definition at line 97 of file UgliDbiScintMdlStruct.h. Referenced by Fill(), FormatToOStream(), and UgliDbiScintMdlStruct(). |
1.3.9.1