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

Public Member Functions | |
| UgliDbiStrip () | |
| UgliDbiStrip (PlexStripEndId seid, Float_t tpos, Float_t lpos, Float_t zrot, Short_t tcurvForm=-1, const Float_t *tcurvParm=0, Short_t zcurvForm=-1, const Float_t *zcurvParm=0) | |
| virtual | ~UgliDbiStrip () |
| virtual Int_t | GetAggregateNo () const |
| UInt_t | GetIndex (UInt_t defIndex) const |
| Detector::Detector_t | GetDetector () const |
| PlaneView::PlaneView_t | GetView () const |
| PlaneCoverage::PlaneCoverage_t | GetCoverage () const |
| Int_t | GetPlane () const |
| Int_t | GetStrip () const |
| PlexStripEndId | GetStripEndId () const |
| Float_t | GetTPosRelMdl () const |
| Float_t | GetLPosRelMdl () const |
| Float_t | GetZRotRelMdlRad () const |
| Float_t | GetZRotRelMdlDeg () const |
| Short_t | GetTCurvForm () const |
| Short_t | GetZCurvForm () const |
| const Float_t * | GetTCurvParm () const |
| const Float_t * | GetZCurvParm () 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 | |
| UInt_t | HashToIndex (PlexStripEndId seid) |
| const char * | GetTableDescr () |
| void | SetDefensiveUnpkg (Bool_t defensive) |
| Bool_t | GetDefensiveUnpkg () |
Private Member Functions | |
| UgliDbiStrip (const UgliDbiStrip &from) | |
Private Attributes | |
| PlexStripEndId | fStripId |
| Float_t | fTPosRelMdl |
| Float_t | fLPosRelMdl |
| Float_t | fZRotRelMdlRad |
| Short_t | fTCurvForm |
| Short_t | fZCurvForm |
| Float_t | fTCurvParm [4] |
| Float_t | fZCurvParm [4] |
Static Private Attributes | |
| Bool_t | fgDefensiveUnpkg = kFALSE |
|
|
Definition at line 37 of file UgliDbiStrip.h. References fLPosRelMdl, fStripId, fTCurvForm, fTCurvParm, fTPosRelMdl, fZCurvForm, fZCurvParm, and fZRotRelMdlRad. 00038 : fStripId(), fTPosRelMdl(0), fLPosRelMdl(0), 00039 fZRotRelMdlRad(0), fTCurvForm(-1), fZCurvForm(-1) 00040 { LEA_CTOR; 00041 for (int i=0; i<4; i++) { 00042 fTCurvParm[i] = 0; 00043 fZCurvParm[i] = 0; 00044 } 00045 };
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 47 of file UgliDbiStrip.h. References fLPosRelMdl, fStripId, fTCurvForm, fTCurvParm, fTPosRelMdl, fZCurvForm, fZCurvParm, fZRotRelMdlRad, PlexStripEndId::SetEnd(), and PlexStripEndId::SetSubPart(). 00051 : fStripId(seid), 00052 fTPosRelMdl(tpos), fLPosRelMdl(lpos), fZRotRelMdlRad(zrot), 00053 fTCurvForm(tcurvForm), fZCurvForm(zcurvForm) 00054 { LEA_CTOR; 00055 fStripId.SetEnd(StripEnd::kWhole); 00056 fStripId.SetSubPart(StripEnd::kWhole); 00057 for (int i=0; i<4; i++) { 00058 fTCurvParm[i] = ((tcurvParm) ? tcurvParm[i] : 0); 00059 fZCurvParm[i] = ((zcurvParm) ? zcurvParm[i] : 0); 00060 } 00061 };
|
|
|
Definition at line 63 of file UgliDbiStrip.h. 00063 { LEA_DTOR; };
|
|
|
Definition at line 111 of file UgliDbiStrip.h. 00112 : DbiTableRow(from) { LEA_CTOR; *this = from; }
|
|
|
Implements DbiTableRow. Definition at line 88 of file UgliDbiStrip.h. 00088 { return new UgliDbiStrip; }
|
|
||||||||||||
|
Implements DbiTableRow. Definition at line 80 of file UgliDbiStrip.cxx. References DbiRowStream::CurColName(), DbiRowStream::CurColNum(), det, fLPosRelMdl, fStripId, fTCurvForm, fTCurvParm, fTPosRelMdl, fZCurvForm, fZCurvParm, fZRotRelMdlRad, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), MSG, and DbiRowStream::NumCols(). 00081 {
00082 //
00083 //
00084 // Purpose: Fill object from Result Set
00085 //
00086 // Arguments:
00087 // rs in Result Set used to fill object
00088 // vrec in Associated validity record (or 0 if filling
00089 // DbiValidityRec)
00090 //
00091 // Return:
00092 //
00093 // Contact: R. Hatcher
00094 //
00095 // Specification:-
00096 // =============
00097 //
00098 // o Fill object from current row of Result Set.
00099
00100 // Program Notes:-
00101 // =============
00102
00103 // None.
00104
00105 Detector::Detector_t det =
00106 (Detector::Detector_t)
00107 ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00108
00109 Int_t plane = -1;
00110 Int_t strip = -1;
00111 PlaneView::PlaneView_t view = PlaneView::kUnknown;
00112 PlaneCoverage::PlaneCoverage_t coverage = PlaneCoverage::kUnknown;
00113 Int_t tmp;
00114
00115 if (fgDefensiveUnpkg) {
00116
00117 // unpack allowing for various column names and ordering
00118
00119 Int_t numCol = rs.NumCols();
00120 // The first column (SeqNo) has already been processed.
00121 for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00122 string colName = rs.CurColName();
00123 if ( colName == "HASHVAL" ) rs.IncrementCurCol();
00124 // "HASH" is obsolete
00125 else if ( colName == "HASH" ) rs.IncrementCurCol();
00126 else if ( colName == "DETECTOR" ) {
00127 rs >> tmp; det = (Detector::Detector_t)tmp;
00128 }
00129 else if ( colName == "PLANE" ) rs >> plane;
00130 else if ( colName == "PLNVIEW" ) {
00131 rs >> tmp; view = (PlaneView::PlaneView_t)tmp;
00132 }
00133 // "VIEW" is obsolete
00134 else if ( colName == "VIEW" ) {
00135 rs >> tmp; view = (PlaneView::PlaneView_t)tmp;
00136 }
00137 else if ( colName == "COVERAGE" ) {
00138 rs >> tmp; coverage = (PlaneCoverage::PlaneCoverage_t)tmp;
00139 }
00140 else if ( colName == "STRIP" ) rs >> strip;
00141 else if ( colName == "TPOSRELMDL" ) rs >> fTPosRelMdl;
00142 else if ( colName == "LPOSRELMDL" ) rs >> fLPosRelMdl;
00143 else if ( colName == "ZROTRELMDLRAD" ) rs >> fZRotRelMdlRad;
00144 else if ( colName == "TCURVFORM" ) rs >> fTCurvForm;
00145 else if ( colName == "TCURVPARM0" ) rs >> fTCurvParm[0];
00146 else if ( colName == "TCURVPARM1" ) rs >> fTCurvParm[1];
00147 else if ( colName == "TCURVPARM2" ) rs >> fTCurvParm[2];
00148 else if ( colName == "TCURVPARM3" ) rs >> fTCurvParm[3];
00149 else if ( colName == "ZCURVFORM" ) rs >> fZCurvForm;
00150 else if ( colName == "ZCURVPARM0" ) rs >> fZCurvParm[0];
00151 else if ( colName == "ZCURVPARM1" ) rs >> fZCurvParm[1];
00152 else if ( colName == "ZCURVPARM2" ) rs >> fZCurvParm[2];
00153 else if ( colName == "ZCURVPARM3" ) rs >> fZCurvParm[3];
00154 else {
00155 static int nmsg = 25;
00156 if (nmsg-- > 0) MSG("Ugli",Msg::kWarning)
00157 << "Ignoring column " << rs.CurColNum()
00158 << " (of " << rs.NumCols() << ")"
00159 << " \""<< colName << "\"; not part of "
00160 << ClassName() << endl;
00161 rs.IncrementCurCol();
00162 }
00163 }
00164 } // end defensive unpacking
00165 else {
00166 Int_t hashv, tmpview, tmpcoverage;
00167 rs >> hashv
00168 >> plane
00169 >> strip
00170 >> tmpview
00171 >> tmpcoverage
00172 >> fTPosRelMdl
00173 >> fLPosRelMdl
00174 >> fZRotRelMdlRad
00175 >> fTCurvForm
00176 >> fZCurvForm
00177 >> fTCurvParm[0]
00178 >> fTCurvParm[1]
00179 >> fTCurvParm[2]
00180 >> fTCurvParm[3]
00181 >> fZCurvParm[0]
00182 >> fZCurvParm[1]
00183 >> fZCurvParm[2]
00184 >> fZCurvParm[3];
00185
00186 view = (PlaneView::PlaneView_t)tmpview;
00187 coverage = (PlaneCoverage::PlaneCoverage_t)tmpcoverage;
00188
00189 }
00190
00191 fStripId =
00192 PlexStripEndId(det,plane,strip,StripEnd::kWhole,
00193 StripEnd::kWhole,view,coverage);
00194 }
|
|
||||||||||||||||
|
Definition at line 278 of file UgliDbiStrip.cxx. References fLPosRelMdl, fStripId, fTCurvForm, fTCurvParm, fTPosRelMdl, fZCurvForm, fZCurvParm, fZRotRelMdlRad, PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), DbiValidityRec::GetSeqNo(), PlexStripEndId::GetStrip(), GetStrip(), GetTableDescr(), UgliDbiTableDescr::ParseTableDescr(), and UgliDbiTableDescr::TextTableDescrLine(). Referenced by Print(). 00281 {
00282 //
00283 //
00284 // Purpose: Print the current row
00285 //
00286 // Return: nothing
00287 //
00288 // Contact: R. Hatcher
00289 //
00290 // Specification:-
00291 // =============
00292 //
00293
00294 // Program Notes:-
00295 // =============
00296
00297 // None.
00298
00299 string opt = option;
00300
00301 if ( opt.find("H") != string::npos ) {
00302 string tabledescr = GetTableDescr();
00303 tabledescr = UgliDbiTableDescr::TextTableDescrLine(tabledescr);
00304 os << tabledescr << endl;
00305 }
00306 else if ( opt.find("h") != string::npos ) {
00307 string tabledescr = GetTableDescr();
00308 vector< pair<string,string> > components =
00309 UgliDbiTableDescr::ParseTableDescr(tabledescr);
00310 for (unsigned int ic = 0; ic < components.size(); ++ic)
00311 os << components[ic].first << '\t';
00312 os << endl;
00313 }
00314
00315 char sep = '\t';
00316 if ( opt.find(",") != string::npos ) sep = ',';
00317
00318 if ( ! dvr ) {
00319 os << "SeqNo" << sep; // no way of knowing the SEQNO?
00320 }
00321 else {
00322 os << dvr->GetSeqNo() << sep;
00323 }
00324
00325 os << GetStrip() << sep // within aggregate(=plane) strip => row_counter
00326 << -1 << sep // Hashval is obsolete
00327 << fStripId.GetPlane() << sep
00328 << fStripId.GetStrip() << sep
00329 << (int)fStripId.GetPlaneView() << sep
00330 << (int)fStripId.GetPlaneCoverage() << sep
00331 << fTPosRelMdl << sep
00332 << fLPosRelMdl << sep
00333 << fZRotRelMdlRad << sep
00334 << fTCurvForm << sep
00335 << fZCurvForm << sep
00336 << fTCurvParm[0] << sep
00337 << fTCurvParm[1] << sep
00338 << fTCurvParm[2] << sep
00339 << fTCurvParm[3] << sep
00340 << fZCurvParm[0] << sep
00341 << fZCurvParm[1] << sep
00342 << fZCurvParm[2] << sep
00343 << fZCurvParm[3] << endl;
00344
00345 return os;
00346 }
|
|
|
Reimplemented from DbiTableRow. Definition at line 67 of file UgliDbiStrip.h. References fStripId, and PlexPlaneId::GetPlane().
|
|
|
Definition at line 139 of file UgliDbiStrip.h. References fStripId, and PlexPlaneId::GetPlaneCoverage(). 00140 { return fStripId.GetPlaneCoverage(); }
|
|
|
Definition at line 105 of file UgliDbiStrip.h. 00105 { return fgDefensiveUnpkg; }
|
|
|
Definition at line 133 of file UgliDbiStrip.h. References fStripId, and PlexPlaneId::GetDetector(). 00134 { return fStripId.GetDetector(); }
|
|
|
Reimplemented from DbiTableRow. Definition at line 142 of file UgliDbiStrip.h. References fStripId, and HashToIndex(). Referenced by Store(). 00143 { return HashToIndex(fStripId); }
|
|
|
Definition at line 80 of file UgliDbiStrip.h. Referenced by GeoScintMdlVolume::Build4Corners(), and UgliStripNode::UgliStripNode(). 00080 { return fLPosRelMdl; }
|
|
|
Definition at line 75 of file UgliDbiStrip.h. References fStripId, and PlexPlaneId::GetPlane().
|
|
|
Definition at line 76 of file UgliDbiStrip.h. References fStripId, and PlexStripEndId::GetStrip(). Referenced by FormatToOStream().
|
|
|
Definition at line 78 of file UgliDbiStrip.h. Referenced by vetoStrip(). 00078 { return fStripId; }
|
|
|
Definition at line 350 of file UgliDbiStrip.cxx. Referenced by FormatToOStream(), UgliGeometryReroot::MakeTempDbiPosInfo(), and Store(). 00351 {
00352 //
00353 //
00354 // Purpose: Return a string describing rows in the table
00355 // Used in creating temporary tables
00356 //
00357 // Return: const char* to parenthesized comma separated list
00358 // of column name and type pairs
00359 //
00360 // Contact: R. Hatcher
00361 //
00362 // Specification:-
00363 // =============
00364 //
00365
00366 // Program Notes:-
00367 // =============
00368
00369 // None.
00370
00371 const char* const_tabledescr = "(\
00372 SEQNO int, \
00373 ROW_COUNTER int, \
00374 HASHVAL int, \
00375 PLANE smallint, \
00376 STRIP smallint, \
00377 PLNVIEW tinyint, \
00378 COVERAGE tinyint, \
00379 TPOSRELMDL float, \
00380 LPOSRELMDL float, \
00381 ZROTRELMDLRAD float, \
00382 TCURVFORM tinyint, \
00383 ZCURVFORM tinyint, \
00384 TCURVPARM0 float, \
00385 TCURVPARM1 float, \
00386 TCURVPARM2 float, \
00387 TCURVPARM3 float, \
00388 ZCURVPARM0 float, \
00389 ZCURVPARM1 float, \
00390 ZCURVPARM2 float, \
00391 ZCURVPARM3 float, \
00392 primary key (SEQNO,ROW_COUNTER) \
00393 )";
00394
00395 return const_tabledescr;
00396 }
|
|
|
Definition at line 83 of file UgliDbiStrip.h. 00083 { return fTCurvForm; }
|
|
|
Definition at line 85 of file UgliDbiStrip.h. 00085 { return fTCurvParm; }
|
|
|
Definition at line 79 of file UgliDbiStrip.h. Referenced by GeoScintMdlVolume::Build4Corners(), GeoScintMdlVolume::BuildHalfY(), GeoScintMdlVolume::BuildNeariXtru(), GeoScintMdlVolume::BuildNearIXtru(), and UgliStripNode::UgliStripNode(). 00079 { return fTPosRelMdl; }
|
|
|
Definition at line 136 of file UgliDbiStrip.h. References fStripId, and PlexPlaneId::GetPlaneView(). 00137 { return fStripId.GetPlaneView(); }
|
|
|
Definition at line 84 of file UgliDbiStrip.h. 00084 { return fZCurvForm; }
|
|
|
Definition at line 86 of file UgliDbiStrip.h. 00086 { return fZCurvParm; }
|
|
|
Definition at line 82 of file UgliDbiStrip.h. References fZRotRelMdlRad. 00082 { return fZRotRelMdlRad * Ugli::rad2deg; }
|
|
|
Definition at line 81 of file UgliDbiStrip.h. Referenced by UgliStripNode::UgliStripNode(). 00081 { return fZRotRelMdlRad; }
|
|
|
Definition at line 53 of file UgliDbiStrip.cxx. References PlexStripEndId::AsString(), PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), and MSG. Referenced by UgliDbiTables::GetDbiStripById(), and GetIndex(). 00054 {
00055 // make a natural index
00056
00057 UInt_t hvalue;
00058 int ierr = 0;
00059
00060 // VERY WASTEFUL
00061 // assume 191 strips/plane
00062 // all planes occupied (ie. no sparsification of near spectrometer)
00063
00064 int strip = seid.GetStrip();
00065
00066 hvalue = seid.GetPlane()*192 + strip;
00067 if ( strip > 191 ) ierr += BIT(0);
00068
00069 if (ierr) MSG("Ugli",Msg::kWarning)
00070 << seid.AsString("c")
00071 << " breaks hashing assumptions "
00072 << " err 0x" << hex << ierr << dec
00073 << endl;
00074
00075 return hvalue;
00076 }
|
|
|
Definition at line 271 of file UgliDbiStrip.cxx. References FormatToOStream(), and option. 00272 {
00273 FormatToOStream(cout,option);
00274 }
|
|
|
Definition at line 103 of file UgliDbiStrip.h. References fgDefensiveUnpkg. 00104 { fgDefensiveUnpkg = defensive; }
|
|
||||||||||||
|
Reimplemented from DbiTableRow. Definition at line 198 of file UgliDbiStrip.cxx. References fStripId, fTCurvParm, fZCurvParm, PlexPlaneId::GetDetector(), GetIndex(), PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), PlexStripEndId::GetStrip(), GetTableDescr(), MSG, and UgliDbiTableDescr::ParseTableDescr(). 00199 {
00200 //
00201 //
00202 // Purpose: Stream object to output row stream
00203 //
00204 // Arguments:
00205 // ors in Output row stream.
00206 // vrec in Associated validity record (or 0 if filling
00207 // DbiValidityRec)
00208 //
00209 // Return:
00210 //
00211 // Contact: R. Hatcher
00212 //
00213 // Specification:-
00214 // =============
00215 //
00216 // o Stream object to output row stream.
00217
00218 // Program Notes:-
00219 // =============
00220
00221 // None.
00222
00223 const char* tabledescr = GetTableDescr();
00224 vector< pair<string,string> > components =
00225 UgliDbiTableDescr::ParseTableDescr(tabledescr);
00226 int n = components.size();
00227
00228 for (int i=0; i<n; i++) {
00229 pair<string,string> colPair = components[i];
00230 string colName = colPair.first;
00231 if ( colName == "HASHVAL" ) ors << (int)GetIndex(0);
00232 // "HASH" is obsolete
00233 else if ( colName == "HASH" ) ors << (int)GetIndex(0);
00234 else if ( colName == "DETECTOR" )
00235 ors << (int)fStripId.GetDetector();
00236 else if ( colName == "PLANE" ) ors << fStripId.GetPlane();
00237 else if ( colName == "PLNVIEW" )
00238 ors << (int)fStripId.GetPlaneView();
00239 // "VIEW" is obsolete
00240 else if ( colName == "VIEW" )
00241 ors << (int)fStripId.GetPlaneView();
00242 else if ( colName == "COVERAGE" )
00243 ors << (int)fStripId.GetPlaneCoverage();
00244 else if ( colName == "STRIP" ) ors << fStripId.GetStrip();
00245 else if ( colName == "TPOSRELMDL" ) ors << fTPosRelMdl;
00246 else if ( colName == "LPOSRELMDL" ) ors << fLPosRelMdl;
00247 else if ( colName == "ZROTRELMDLRAD" ) ors << fZRotRelMdlRad;
00248 else if ( colName == "TCURVFORM" ) ors << fTCurvForm;
00249 else if ( colName == "TCURVPARM0" ) ors << fTCurvParm[0];
00250 else if ( colName == "TCURVPARM1" ) ors << fTCurvParm[1];
00251 else if ( colName == "TCURVPARM2" ) ors << fTCurvParm[2];
00252 else if ( colName == "TCURVPARM3" ) ors << fTCurvParm[3];
00253 else if ( colName == "ZCURVFORM" ) ors << fZCurvForm;
00254 else if ( colName == "ZCURVPARM0" ) ors << fZCurvParm[0];
00255 else if ( colName == "ZCURVPARM1" ) ors << fZCurvParm[1];
00256 else if ( colName == "ZCURVPARM2" ) ors << fZCurvParm[2];
00257 else if ( colName == "ZCURVPARM3" ) ors << fZCurvParm[3];
00258
00259 else if ( colName == "ROW_COUNTER" ) {;}
00260 else if ( colName == "SEQNO" ) {;}
00261 else {
00262 MSG("Ugli",Msg::kFatal)
00263 << "Column name '" << colName << "' not correctly handled" << endl;
00264 assert(0);
00265 }
00266 }
00267 }
|
|
|
Definition at line 32 of file UgliDbiStrip.cxx. Referenced by SetDefensiveUnpkg(). |
|
|
Definition at line 118 of file UgliDbiStrip.h. Referenced by Fill(), FormatToOStream(), and UgliDbiStrip(). |
|
|
Definition at line 116 of file UgliDbiStrip.h. Referenced by Fill(), FormatToOStream(), GetAggregateNo(), GetCoverage(), GetDetector(), GetIndex(), GetPlane(), GetStrip(), GetView(), Store(), and UgliDbiStrip(). |
|
|
Definition at line 120 of file UgliDbiStrip.h. Referenced by Fill(), FormatToOStream(), and UgliDbiStrip(). |
|
|
Definition at line 122 of file UgliDbiStrip.h. Referenced by Fill(), FormatToOStream(), Store(), and UgliDbiStrip(). |
|
|
Definition at line 117 of file UgliDbiStrip.h. Referenced by Fill(), FormatToOStream(), and UgliDbiStrip(). |
|
|
Definition at line 121 of file UgliDbiStrip.h. Referenced by Fill(), FormatToOStream(), and UgliDbiStrip(). |
|
|
Definition at line 123 of file UgliDbiStrip.h. Referenced by Fill(), FormatToOStream(), Store(), and UgliDbiStrip(). |
|
|
Definition at line 119 of file UgliDbiStrip.h. Referenced by Fill(), FormatToOStream(), GetZRotRelMdlDeg(), and UgliDbiStrip(). |
1.3.9.1