Concept A concrete data type corresponding to a single row in an auxillary validity range database table. More...
#include <TDbiValidityRec.hxx>
Public Member Functions | |
TDbiValidityRec (Int_t dbNo=-1, Bool_t isGap=kTRUE) | |
TDbiValidityRec (const TDbiValidityRec &from) | |
TDbiValidityRec (const TVldRange &range, TDbi::Task task, Int_t aggNo, UInt_t seqNo, Int_t dbNo=-1, Bool_t isGap=kFALSE, TVldTimeStamp time=TVldTimeStamp(), UInt_t epoch=0) | |
virtual | ~TDbiValidityRec () |
virtual TDbiTableRow * | CreateTableRow () const |
Int_t | GetAggregateNo () const |
TVldTimeStamp | GetCreationDate () const |
UInt_t | GetDbNo () const |
UInt_t | GetEpoch () const |
TVldTimeStamp | GetInsertDate () const |
TDbi::Task | GetTask () const |
std::string | GetL2CacheName () const |
UInt_t | GetSeqNo () const |
const TDbiTableProxy * | GetTableProxy () const |
const TVldRange & | GetVldRange () const |
Bool_t | HasExpired (const TDbiValidityRec &other) const |
Bool_t | HasExpired (const TVldContext &vc, const TDbi::Task &task) const |
Bool_t | IsCompatible (const TVldContext &vc, const TDbi::Task &task) const |
Bool_t | IsGap () const |
Bool_t | IsHigherPriority (const TDbiValidityRec &that, Bool_t useCreationDate=false) const |
void | AndTimeWindow (const TVldTimeStamp &start, const TVldTimeStamp &end) |
void | SetAggregateNo (Int_t aggNo) |
void | SetDbNo (Int_t dbNo) |
void | SetEpoch (UInt_t epoch) |
void | SetTableProxy (const TDbiTableProxy *tp) |
void | SetTimeWindow (const TVldTimeStamp &start, const TVldTimeStamp &end) |
void | SetVldRange (const TVldRange &range) |
void | Trim (const TVldTimeStamp &queryTime, const TDbiValidityRec &other) |
virtual void | Fill (TDbiInRowStream &rs, const TDbiValidityRec *vrec) |
virtual void | Store (TDbiOutRowStream &ors, const TDbiValidityRec *vrec) const |
void | Streamer (TDbiBinaryFile &file) |
virtual Bool_t | CanL2Cache () const |
Replace this with a function returning true in order to use the level 2 disk cache. | |
TDbiResultSet * | GetOwner () const |
virtual UInt_t | GetIndex (UInt_t defIndex) const |
void | SetOwner (TDbiResultSet *owner) |
virtual void | Fill (TDbiInRowStream &rs, const TDbiValidityRec *vrec)=0 |
virtual void | Store (TDbiOutRowStream &, const TDbiValidityRec *) const |
Static Public Member Functions | |
static std::string | GetL2CacheName (UInt_t seqLo, UInt_t seqHi, TVldTimeStamp ts) |
Private Attributes | |
Int_t | fAggregateNo |
TVldTimeStamp | fCreationDate |
Creation date. | |
Int_t | fDbNo |
Cascade no. of source db =-1 unknown. | |
TVldTimeStamp | fInsertDate |
Insertion date. | |
Bool_t | fIsGap |
kTRUE if corresponds to a gap. | |
TDbi::Task | fTask |
Task number. | |
Int_t | fSeqNo |
Sequence number or 0 if compound. | |
const TDbiTableProxy * | fTableProxy |
TDbiTableProxy that filled this (if any). | |
TVldRange | fVldRange |
Validity range of record. | |
UInt_t | fEpoch |
Calibration Epoch. | |
UInt_t | fReality |
Reality (for possible, but improbable future use). |
Concept A concrete data type corresponding to a single row in an auxillary validity range database table.
Purpose To resolve ambiguities in the case of multiple matches to a query and to record results of validity range trimming due to neighbouring database entries. Contact: A.Finch@lancaster.ac.uk
Definition at line 39 of file TDbiValidityRec.hxx.
TDbiValidityRec::TDbiValidityRec | ( | Int_t | dbNo = -1 , |
|
Bool_t | isGap = kTRUE | |||
) |
Definition at line 121 of file TDbiValidityRec.cxx.
References SK_DBI_Trace.
00121 : 00122 00123 fAggregateNo(-2), 00124 fDbNo(dbNo), 00125 fIsGap(isGap), 00126 fTask(0), 00127 fSeqNo(0), 00128 fTableProxy(0), 00129 fEpoch(0), 00130 fReality(0) 00131 { 00132 // 00133 // 00134 // Purpose: Default constructor 00135 // 00136 // Arguments:. 00137 // dbNo in Cascade no. of database holding record. 00138 // isGap in = kTRUE if a gap. 00139 // 00140 // Return: n/a 00141 // 00142 // Contact: N. West 00143 // 00144 // Specification:- 00145 // ============= 00146 // 00147 // o Create ValidityRec. 00148 00149 00150 // Program Notes:- 00151 // ============= 00152 00153 // None. 00154 00155 00156 SK_DBI_Trace( "Creating TDbiValidityRec" << " "); 00157 } //.....................................................................
TDbiValidityRec::TDbiValidityRec | ( | const TDbiValidityRec & | from | ) |
Definition at line 160 of file TDbiValidityRec.cxx.
References SK_DBI_Trace.
00160 : TDbiTableRow(from) 00161 { 00162 // 00163 // 00164 // Purpose: Copy constructor 00165 // 00166 // Arguments: 00167 // from in Object to be copied from. 00168 // 00169 // Return: n/a 00170 // 00171 // Contact: N. West 00172 // 00173 // Specification:- 00174 // ============= 00175 // 00176 // o Create ValidityRec. 00177 00178 00179 // Program Notes:- 00180 // ============= 00181 00182 // Explicit just for leak checking. 00183 00184 00185 SK_DBI_Trace( "Creating TDbiValidityRec" << " "); 00186 00187 *this = from; 00188 00189 }
TDbiValidityRec::TDbiValidityRec | ( | const TVldRange & | range, | |
TDbi::Task | task, | |||
Int_t | aggNo, | |||
UInt_t | seqNo, | |||
Int_t | dbNo = -1 , |
|||
Bool_t | isGap = kFALSE , |
|||
TVldTimeStamp | time = TVldTimeStamp() , |
|||
UInt_t | epoch = 0 | |||
) |
Definition at line 192 of file TDbiValidityRec.cxx.
References SK_DBI_Trace.
00199 : 00200 fAggregateNo(aggNo), 00201 fCreationDate(time), 00202 fDbNo(dbNo), 00203 fIsGap(isGap), 00204 fTask(task), 00205 fSeqNo(seqNo), 00206 fTableProxy(0), 00207 fVldRange(range), 00208 fEpoch(epoch), 00209 fReality(0) 00210 { 00211 // 00212 // 00213 // Purpose: Constructor from components 00214 // 00215 // Arguments: 00216 // range in component range 00217 // task in component task 00218 // aggNo in component aggregate number 00219 // seqNo in component sequence number 00220 // dbNo in Cascade no. of database holding record. 00221 // isGap in = kTRUE if a gap. 00222 // epoch in component calibration epoch 00223 // 00224 // 00225 // 00226 // Return: n/a 00227 // 00228 // Contact: N. West 00229 // 00230 // Specification:- 00231 // ============= 00232 // 00233 // o Create ValidityRec. 00234 00235 00236 // Program Notes:- 00237 // ============= 00238 00239 // None. 00240 00241 00242 SK_DBI_Trace( "Creating TDbiValidityRec" << " "); 00243 }
TDbiValidityRec::~TDbiValidityRec | ( | ) | [virtual] |
Definition at line 247 of file TDbiValidityRec.cxx.
References SK_DBI_Trace.
00247 { 00248 // 00249 // 00250 // Purpose: Destructor 00251 // 00252 // Arguments: 00253 // None. 00254 // 00255 // Return: n/a 00256 // 00257 // Contact: N. West 00258 // 00259 // Specification:- 00260 // ============= 00261 // 00262 // o Destroy ValidityRec. 00263 00264 00265 // Program Notes:- 00266 // ============= 00267 00268 // None. 00269 00270 00271 SK_DBI_Trace( "Destroying TDbiValidityRec" << " "); 00272 00273 }
void TDbiValidityRec::AndTimeWindow | ( | const TVldTimeStamp & | start, | |
const TVldTimeStamp & | end | |||
) |
Definition at line 87 of file TDbiValidityRec.cxx.
References fVldRange, TVldRange::GetTimeEnd(), TVldRange::GetTimeStart(), and SetTimeWindow().
00088 { 00089 // 00090 // 00091 // Purpose: And in supplied start and end times. 00092 // 00093 // Arguments: 00094 // startOther in Start time to be ANDed in. 00095 // endOther in End time to be ANDed in. 00096 // 00097 // Return: None. 00098 // 00099 // Contact: N. West 00100 // 00101 // Specification:- 00102 // ============= 00103 // 00104 // o Trim time windown on current record to be the overlap (and) 00105 // with the supplied time window. 00106 00107 // Program Notes:- 00108 // ============= 00109 00110 // None. 00111 00112 TVldTimeStamp start = fVldRange.GetTimeStart(); 00113 TVldTimeStamp end = fVldRange.GetTimeEnd(); 00114 00115 SetTimeWindow( start > startOther ? start : startOther, 00116 end < endOther ? end : endOther ); 00117 }
virtual Bool_t TDbiTableRow::CanL2Cache | ( | ) | const [inline, virtual, inherited] |
Replace this with a function returning true in order to use the level 2 disk cache.
Definition at line 59 of file TDbiTableRow.hxx.
virtual TDbiTableRow* TDbiValidityRec::CreateTableRow | ( | ) | const [inline, virtual] |
Implements TDbiTableRow.
Definition at line 60 of file TDbiValidityRec.hxx.
00060 { 00061 return new TDbiValidityRec; }
virtual void TDbiTableRow::Fill | ( | TDbiInRowStream & | rs, | |
const TDbiValidityRec * | vrec | |||
) | [pure virtual, inherited] |
Implemented in TDbiConfigSet, TDbiLogEntry, and TTableRow.
Referenced by ClassImp().
void TDbiValidityRec::Fill | ( | TDbiInRowStream & | rs, | |
const TDbiValidityRec * | vrec | |||
) | [virtual] |
Definition at line 277 of file TDbiValidityRec.cxx.
References TVldRange::AsString(), TDbiInRowStream::CurRowNum(), fAggregateNo, fCreationDate, fDbNo, fEpoch, fInsertDate, fIsGap, fReality, fSeqNo, fTableProxy, fTask, fVldRange, TDbiInRowStream::GetDbNo(), TDbiInRowStream::GetTableProxy(), TDbiRowStream::HasEpoch(), and SK_DBI_Verbose.
00278 { 00279 // 00280 // 00281 // Purpose: Fill oject from Result Set 00282 // 00283 // Arguments: 00284 // rs in Result Set used to fill object 00285 // vrec in =0. If filling other table rows it points 00286 // to the associated validity record. 00287 // 00288 // Return: 00289 // 00290 // Contact: N. West 00291 // 00292 // Specification:- 00293 // ============= 00294 // 00295 // o Fill object from current row of Result Set. 00296 00297 // Program Notes:- 00298 // ============= 00299 00300 // None. 00301 00302 TVldTimeStamp start, end; 00303 Int_t detMask, simMask; 00304 00305 // Establish source TDbiTableProxy and cascade no. 00306 00307 fTableProxy = rs.GetTableProxy(); 00308 fDbNo = rs.GetDbNo(); 00309 00310 // Read data from row. 00311 00312 rs >> fSeqNo >> start >> end; 00313 00314 if ( rs.HasEpoch() ) rs >> fEpoch >> fReality; 00315 else fEpoch = fReality = 0; 00316 00317 rs >> detMask >> simMask >> fTask 00318 >> fAggregateNo >> fCreationDate >> fInsertDate; 00319 00320 fIsGap = kFALSE; 00321 00322 TVldRange vr(detMask, simMask, start, end, "From Database"); 00323 fVldRange = vr; 00324 00325 SK_DBI_Verbose( "TDbiValidityRec for row " << rs.CurRowNum() 00326 << ": " << fVldRange.AsString() 00327 << " seq num: " << fSeqNo 00328 << " agg no: " << fAggregateNo 00329 << " task: " << " "); 00330 }
Int_t TDbiValidityRec::GetAggregateNo | ( | ) | const [inline, virtual] |
Reimplemented from TDbiTableRow.
Definition at line 62 of file TDbiValidityRec.hxx.
References fAggregateNo.
Referenced by TDbiCache::Adopt(), ClassImp(), TDbiConfigSet::Fill(), operator<<(), TDbiConfigStream::operator<<(), TDbiTableProxy::QueryOverlayCreationDate(), TDbiCache::Search(), TDbiValidityRecBuilder::TDbiValidityRecBuilder(), and TDbiConfigStream::Write().
00062 { return fAggregateNo; }
TVldTimeStamp TDbiValidityRec::GetCreationDate | ( | ) | const [inline] |
Definition at line 65 of file TDbiValidityRec.hxx.
References fCreationDate.
Referenced by TDbiResultSetNonAgg::CreateKey(), TDbiResultSetAgg::CreateKey(), TDbiDBProxy::FindTimeBoundaries(), TDbiValidityRecBuilder::GetL2CacheName(), GetL2CacheName(), TDbiResultSetNonAgg::Satisfies(), and TDbiLogEntry::Write().
00065 { return fCreationDate; }
UInt_t TDbiValidityRec::GetDbNo | ( | ) | const [inline] |
Definition at line 66 of file TDbiValidityRec.hxx.
References fDbNo.
Referenced by fCreationDate(), operator<<(), and TDbiTableProxy::Query().
00066 { return fDbNo; }
UInt_t TDbiValidityRec::GetEpoch | ( | ) | const [inline] |
Definition at line 67 of file TDbiValidityRec.hxx.
References fEpoch.
Referenced by TDbiDBProxy::FindTimeBoundaries(), and operator<<().
00067 { return fEpoch; }
virtual UInt_t TDbiTableRow::GetIndex | ( | UInt_t | defIndex | ) | const [inline, virtual, inherited] |
Reimplemented in TDemo2_DB_Table, and TDemo_DB_Table.
Definition at line 65 of file TDbiTableRow.hxx.
Referenced by TDbiResultSet::BuildLookUpTable().
TVldTimeStamp TDbiValidityRec::GetInsertDate | ( | ) | const [inline] |
Definition at line 68 of file TDbiValidityRec.hxx.
References fInsertDate.
00068 { return fInsertDate; }
std::string TDbiValidityRec::GetL2CacheName | ( | UInt_t | seqLo, | |
UInt_t | seqHi, | |||
TVldTimeStamp | ts | |||
) | [static] |
Definition at line 351 of file TDbiValidityRec.cxx.
References TVldTimeStamp::AsString().
00353 { 00354 // 00355 // 00356 // Purpose: Return the associated Level 2 Cache Name. 00357 // 00358 // Specification:- 00359 // ============= 00360 // 00361 // o For unaggregated queries name format: <Seqno>_<CreationDate> 00362 // 00363 // o For aggregated queries name format: <LowSeqno>_<HighSeqNo>_<MaxCreationDate> 00364 00365 // Program Notes:- 00366 // ============= 00367 00368 // The static routine centralises the definition of cache names both for 00369 // TDbiValidityRec and TDbiValidityRecBuilder. 00370 00371 ostringstream oss; 00372 oss << seqLo << "_"; 00373 if ( seqLo != seqHi ) oss << seqHi << "_"; 00374 oss << ts.AsString("s"); 00375 std::string str(oss.str()); 00376 // Convert white space to underscore. 00377 int i = str.size(); 00378 while ( i-- ) if ( str[i] == ' ' ) str[i] = '_'; 00379 return str; 00380 00381 }
std::string TDbiValidityRec::GetL2CacheName | ( | ) | const |
Definition at line 334 of file TDbiValidityRec.cxx.
References GetCreationDate(), and GetSeqNo().
Referenced by TDbiTableProxy::Query().
00334 { 00335 // 00336 // 00337 // Purpose: Return the associated Level 2 Cache Name. 00338 // 00339 // Specification:- 00340 // ============= 00341 // 00342 // o See GetL2CacheName(UInt_t seqLo, UInt_t seqHi, TVldTimeStamp ts); 00343 00344 return TDbiValidityRec::GetL2CacheName(this->GetSeqNo(), 00345 this->GetSeqNo(), 00346 this->GetCreationDate()); 00347 00348 }
TDbiResultSet* TDbiTableRow::GetOwner | ( | ) | const [inline, inherited] |
Definition at line 63 of file TDbiTableRow.hxx.
References TDbiTableRow::fOwner.
Referenced by TDbiResultSet::BuildLookUpTable(), and TDbiResultSetAgg::GetValidityRec().
00063 { return fOwner; }
UInt_t TDbiValidityRec::GetSeqNo | ( | ) | const [inline] |
Definition at line 71 of file TDbiValidityRec.hxx.
References fSeqNo.
Referenced by TDbiResultSet::BuildLookUpTable(), TDbiResultSetNonAgg::CreateKey(), TDbiResultSetAgg::CreateKey(), fCreationDate(), TDbiValidityRecBuilder::GetL2CacheName(), GetL2CacheName(), TDbiValRecSet::GetTableRowBySeqNo(), operator<<(), TDbiTableProxy::Query(), TDbiTableProxy::RestoreFromL2Cache(), and TDbiResultSetNonAgg::Satisfies().
00071 { return fSeqNo; }
const TDbiTableProxy* TDbiValidityRec::GetTableProxy | ( | ) | const [inline] |
Definition at line 72 of file TDbiValidityRec.hxx.
References fTableProxy.
Referenced by fCreationDate(), TDbiTableProxy::Query(), and TDbiConfigStream::Write().
00072 { return fTableProxy; }
TDbi::Task TDbiValidityRec::GetTask | ( | ) | const [inline] |
Definition at line 69 of file TDbiValidityRec.hxx.
References fTask.
Referenced by TDbiLogEntry::Fill(), HasExpired(), operator<<(), TDbiTableProxy::QueryOverlayCreationDate(), and TDbiLogEntry::Write().
00069 { return fTask; }
const TVldRange& TDbiValidityRec::GetVldRange | ( | ) | const [inline] |
Definition at line 73 of file TDbiValidityRec.hxx.
References fVldRange.
Referenced by ClassImp(), TDbiLogEntry::Fill(), HasExpired(), operator<<(), TDbiTableProxy::QueryOverlayCreationDate(), TDbiValidityRecBuilder::TDbiValidityRecBuilder(), Trim(), and TDbiLogEntry::Write().
00073 { return fVldRange;}
Bool_t TDbiValidityRec::HasExpired | ( | const TVldContext & | vc, | |
const TDbi::Task & | task | |||
) | const |
Definition at line 424 of file TDbiValidityRec.cxx.
References TVldContext::GetDetector(), TVldRange::GetDetectorMask(), TVldContext::GetSimFlag(), TVldRange::GetSimMask(), GetTask(), TVldRange::GetTimeEnd(), TVldContext::GetTimeStamp(), TVldRange::GetTimeStart(), and GetVldRange().
00425 { 00426 // 00427 // 00428 // Purpose: See if validity record has expired i.e. is compatible with 00429 // this context query except for date. 00430 // 00431 // Arguments: 00432 // vc in Context of query 00433 // task in Task of query 00434 // 00435 // 00436 // Contact: N. West 00437 00438 // Program Notes:- 00439 // ============= 00440 00441 // This method is used by TDbiResultSet to identify when ready for 00442 // purging. 00443 00444 TVldTimeStamp ts = vc.GetTimeStamp(); 00445 const TVldRange& vr = this->GetVldRange(); 00446 00447 return 00448 ( task == this->GetTask() 00449 && ( vc.GetDetector() & vr.GetDetectorMask() ) 00450 && ( vc.GetSimFlag() & vr.GetSimMask() ) 00451 && ( ts >= vr.GetTimeEnd() 00452 || ts < vr.GetTimeStart() ) 00453 ); 00454 00455 }
Bool_t TDbiValidityRec::HasExpired | ( | const TDbiValidityRec & | other | ) | const |
Definition at line 385 of file TDbiValidityRec.cxx.
References fTask, fVldRange, TVldRange::GetDetectorMask(), TVldRange::GetSimMask(), GetTask(), TVldRange::GetTimeEnd(), TVldRange::GetTimeStart(), and GetVldRange().
Referenced by TDbiResultSet::Satisfies().
00385 { 00386 // 00387 // 00388 // Purpose: See if validity record has expired i.e. is compatible with 00389 // this one except for date. 00390 // 00391 // Arguments: 00392 // other in Other TDbiValidityRec to be compared with 00393 // 00394 // Return: 00395 // 00396 // Contact: N. West 00397 // 00398 // Specification:- 00399 // ============= 00400 // 00401 // o See if validity record has expired i.e. is compatible with 00402 // this one except for date. 00403 00404 // Program Notes:- 00405 // ============= 00406 00407 // This method is used by TDbiCache to select candidates for 00408 // purging. 00409 00410 const TVldRange& otherVR =other.GetVldRange(); 00411 00412 return 00413 ( other.GetTask() == fTask 00414 && ( otherVR.GetDetectorMask() & fVldRange.GetDetectorMask() ) 00415 && ( otherVR.GetSimMask() & fVldRange.GetSimMask() ) 00416 && ( otherVR.GetTimeStart() >= fVldRange.GetTimeEnd() 00417 || otherVR.GetTimeEnd() <= fVldRange.GetTimeStart() ) 00418 ); 00419 00420 }
Bool_t TDbiValidityRec::IsCompatible | ( | const TVldContext & | vc, | |
const TDbi::Task & | task | |||
) | const |
Definition at line 460 of file TDbiValidityRec.cxx.
References TVldContext::AsString(), TVldRange::AsString(), fTask, fVldRange, TVldRange::IsCompatible(), and SK_DBI_Debug.
Referenced by TDbiResultSet::Satisfies().
00461 { 00462 // 00463 // 00464 // Purpose: See if result is compatible with query. 00465 // 00466 // Arguments: 00467 // vc in Context of new query 00468 // task in Task of new query 00469 // 00470 // Return: 00471 // 00472 // Contact: N. West 00473 // 00474 // Specification:- 00475 // ============= 00476 // 00477 // o See if result is compatible with query. 00478 00479 // Program Notes:- 00480 // ============= 00481 00482 // None. 00483 00484 SK_DBI_Debug( " TDbiValidityRec::IsCompatible : tasks:" 00485 << task << "," << fTask 00486 << " is compat: " << fVldRange.IsCompatible(vc) << " " 00487 << " range " << fVldRange.AsString() << " " 00488 << " context " << vc.AsString() << " "); 00489 00490 return task == fTask && fVldRange.IsCompatible(vc); 00491 00492 }
Bool_t TDbiValidityRec::IsGap | ( | ) | const [inline] |
Definition at line 79 of file TDbiValidityRec.hxx.
References fIsGap.
Referenced by ClassImp(), TDbiValidityRecBuilder::GetL2CacheName(), operator<<(), TDbiTableProxy::Query(), TDbiResultSetAgg::Streamer(), and Trim().
00079 { return fIsGap; }
Bool_t TDbiValidityRec::IsHigherPriority | ( | const TDbiValidityRec & | that, | |
Bool_t | useCreationDate = false | |||
) | const |
Definition at line 497 of file TDbiValidityRec.cxx.
References fCreationDate, fEpoch, fInsertDate, fVldRange, and TVldRange::GetTimeStart().
Referenced by ClassImp().
00498 { 00499 // 00500 // Purpose: Compare priorities (used in context queries to resolve ambiguities between VLD entries). 00501 // 00502 // Arguments: 00503 // that in The TDbiValidityRec to be compared with 00504 // useCreationDate in If false (the default value) use the T2K resolution scheme 00505 // which is resolved, in order, by EPOCH, STARTTIME, INSERTDATE 00506 // If true use the MINOS resolution scheme which is resolved by CREATIONDATE. 00507 // 00508 // Return: True if this is of higher priority than that. 00509 00510 if ( useCreationDate) return fCreationDate > that.fCreationDate; 00511 00512 if ( fEpoch != that.fEpoch ) return fEpoch > that.fEpoch; 00513 if ( fVldRange.GetTimeStart() != that.fVldRange.GetTimeStart() ) 00514 return fVldRange.GetTimeStart() > that.fVldRange.GetTimeStart(); 00515 return fInsertDate > that.fInsertDate; 00516 00517 }
void TDbiValidityRec::SetAggregateNo | ( | Int_t | aggNo | ) | [inline] |
Definition at line 88 of file TDbiValidityRec.hxx.
References fAggregateNo.
Referenced by TDbiConfigStream::Write().
00088 { fAggregateNo = aggNo; }
void TDbiValidityRec::SetDbNo | ( | Int_t | dbNo | ) | [inline] |
Definition at line 89 of file TDbiValidityRec.hxx.
References fDbNo.
Referenced by ClassImp().
00089 { fDbNo = dbNo; }
void TDbiValidityRec::SetEpoch | ( | UInt_t | epoch | ) | [inline] |
void TDbiTableRow::SetOwner | ( | TDbiResultSet * | owner | ) | [inline, inherited] |
Definition at line 68 of file TDbiTableRow.hxx.
References TDbiTableRow::fOwner.
Referenced by ClassImp().
00068 {fOwner = owner;}
void TDbiValidityRec::SetTableProxy | ( | const TDbiTableProxy * | tp | ) | [inline] |
Definition at line 91 of file TDbiValidityRec.hxx.
References fTableProxy.
00091 { fTableProxy = tp; }
void TDbiValidityRec::SetTimeWindow | ( | const TVldTimeStamp & | start, | |
const TVldTimeStamp & | end | |||
) |
Definition at line 522 of file TDbiValidityRec.cxx.
References fVldRange, TVldRange::GetDataSource(), TVldRange::GetDetectorMask(), and TVldRange::GetSimMask().
Referenced by AndTimeWindow(), and Trim().
00523 { 00524 // 00525 // 00526 // Purpose: Set supplied start and end times. 00527 // 00528 // Arguments: 00529 // start in Start time to be set, 00530 // end in End time to be set. 00531 // 00532 // Return: None. 00533 // 00534 // Contact: N. West 00535 // 00536 // Specification:- 00537 // ============= 00538 // 00539 // o Set time windown on current record. 00540 00541 // Program Notes:- 00542 // ============= 00543 00544 // The method here is rather clumsy, but I don't know of anything 00545 // better! 00546 00547 TVldRange range(fVldRange.GetDetectorMask(), 00548 fVldRange.GetSimMask(), 00549 start, 00550 end, 00551 fVldRange.GetDataSource() ); 00552 fVldRange = range; 00553 00554 }
void TDbiValidityRec::SetVldRange | ( | const TVldRange & | range | ) | [inline] |
Definition at line 94 of file TDbiValidityRec.hxx.
References fVldRange.
Referenced by ClassImp().
00094 { fVldRange=range;}
virtual void TDbiTableRow::Store | ( | TDbiOutRowStream & | , | |
const TDbiValidityRec * | ||||
) | const [inline, virtual, inherited] |
Reimplemented in TDbiConfigSet, and TDbiLogEntry.
Definition at line 73 of file TDbiTableRow.hxx.
Referenced by TDbiSqlValPacket::AddRow().
void TDbiValidityRec::Store | ( | TDbiOutRowStream & | ors, | |
const TDbiValidityRec * | vrec | |||
) | const [virtual] |
Definition at line 558 of file TDbiValidityRec.cxx.
References fAggregateNo, fCreationDate, fEpoch, fInsertDate, fReality, fSeqNo, fTask, fVldRange, TVldRange::GetDetectorMask(), TVldRange::GetSimMask(), TVldRange::GetTimeEnd(), TVldRange::GetTimeStart(), and TDbiRowStream::HasEpoch().
Referenced by TDbiSqlValPacket::Recreate().
00559 { 00560 // 00561 // 00562 // Purpose: Stream object to output row stream 00563 // 00564 // Arguments: 00565 // ors in Output row stream. 00566 // vrec in =0. If filling other table rows it points 00567 // to the associated validity record. 00568 // 00569 // Return: 00570 // 00571 // Contact: N. West 00572 // 00573 // Specification:- 00574 // ============= 00575 // 00576 // o Stream object to output row stream. 00577 00578 // Program Notes:- 00579 // ============= 00580 00581 // None. 00582 00583 // Write data to row. 00584 00585 ors << fSeqNo 00586 << fVldRange.GetTimeStart() 00587 << fVldRange.GetTimeEnd(); 00588 if ( ors.HasEpoch() ) ors << fEpoch << fReality; 00589 ors << fVldRange.GetDetectorMask() 00590 << fVldRange.GetSimMask() 00591 << fTask 00592 << fAggregateNo 00593 << fCreationDate 00594 << fInsertDate; 00595 }
void TDbiValidityRec::Streamer | ( | TDbiBinaryFile & | file | ) |
Definition at line 598 of file TDbiValidityRec.cxx.
References fAggregateNo, fCreationDate, fDbNo, fEpoch, fInsertDate, fIsGap, fReality, fSeqNo, fTableProxy, fTask, fVldRange, TDbiBinaryFile::IsReading(), and TDbiBinaryFile::IsWriting().
Referenced by TDbiResultSet::Streamer().
00598 { 00599 // 00600 // 00601 // Purpose: I/O to binary file 00602 // 00603 // Program Notes:- 00604 // ============= 00605 00606 // Don't store the pointer fTableProxy (don't want to get into storing 00607 // pointers!); the TDbiCache will fix it up on input 00608 00609 if ( file.IsReading() ) { 00610 file >> fAggregateNo 00611 >> fCreationDate 00612 >> fEpoch 00613 >> fReality 00614 >> fDbNo 00615 >> fInsertDate 00616 >> fIsGap 00617 >> fTask 00618 >> fSeqNo 00619 >> fVldRange; 00620 fTableProxy = 0; 00621 } 00622 else if ( file.IsWriting() ) { 00623 file << fAggregateNo 00624 << fCreationDate 00625 << fEpoch 00626 << fReality 00627 << fDbNo 00628 << fInsertDate 00629 << fIsGap 00630 << fTask 00631 << fSeqNo 00632 << fVldRange; 00633 } 00634 }
void TDbiValidityRec::Trim | ( | const TVldTimeStamp & | queryTime, | |
const TDbiValidityRec & | other | |||
) |
Definition at line 638 of file TDbiValidityRec.cxx.
References fAggregateNo, fVldRange, TVldRange::GetTimeEnd(), TVldRange::GetTimeStart(), GetVldRange(), IsGap(), and SetTimeWindow().
Referenced by ClassImp().
00639 { 00640 // 00641 // 00642 // Purpose: Trim this validity record so that represents 00643 // best validity record for query. 00644 // 00645 // Arguments: 00646 // queryTime in Time of query 00647 // other in TDbiValidity record satisfying query 00648 // 00649 // Return: None. 00650 // 00651 // Contact: N. West 00652 // 00653 // Specification:- 00654 // ============= 00655 // 00656 // o Update this validity record so that it remains the best 00657 // validity record taking into account the supplied record. 00658 00659 00660 // Program Notes:- 00661 // ============= 00662 00663 // This is the function that deal with validity management. 00664 // It takes into account that several validity records may 00665 // overlap and that the best one is the one with:- 00666 // For MINOS: the latest creation date 00667 // For T2K: the highest EPOCH,TIMESTART,INSERTDATE 00668 // that brackets the query date. Other higher priority entries 00669 // may trim start or end times. 00670 00671 // Assumptions:- 00672 // =========== 00673 // 00674 // That entries are submitted in strict descending priority i.e.:- 00675 // 00676 // 1) Entries for a higher priority database precede those from a 00677 // lower priority one. 00678 // 00679 // 2) Within a database entries are in descending CREATIONDATE or 00680 // EPOCH,TIMESTART,INSERTDATE order. 00681 // 00682 // This means that, until an entry that overlaps the supplied query time 00683 // is reach, the entries just restrict the possible time window. The first 00684 // entry that overlaps the supplied time is accepted with a trimmed window 00685 // and all subsequent entries ignored. 00686 00687 // Ignore other records that are either gaps or have wrong 00688 // aggregate number. 00689 00690 if ( fAggregateNo != other.fAggregateNo || other.IsGap() ) return; 00691 00692 // If this record is not a gap then the other record can be ignore 00693 // as it is of lower priority. 00694 00695 if ( ! IsGap() ) return; 00696 00697 TVldTimeStamp start = fVldRange.GetTimeStart(); 00698 TVldTimeStamp end = fVldRange.GetTimeEnd(); 00699 TVldTimeStamp startOther = other.GetVldRange().GetTimeStart(); 00700 TVldTimeStamp endOther = other.GetVldRange().GetTimeEnd(); 00701 00702 // If entry brackets query date, then use it but with a validity that 00703 // is trimmed by the current record. 00704 00705 if ( startOther <= queryTime && endOther > queryTime ) { 00706 if ( start < startOther ) start = startOther; 00707 if ( end > endOther ) end = endOther; 00708 *this = other; 00709 SetTimeWindow(start,end); 00710 } 00711 00712 // It doesn't bracket, so use it to trim the window 00713 00714 else { 00715 00716 if ( endOther <= queryTime ) { 00717 if ( start < endOther ) SetTimeWindow(endOther,end); 00718 } 00719 else if ( startOther > queryTime ) { 00720 if ( end > startOther ) SetTimeWindow(start, startOther); 00721 } 00722 } 00723 00724 }
Int_t TDbiValidityRec::fAggregateNo [private] |
Aggregate number or:- -1 Non-aggregated data or multiple aggregates -2 undefined aggregates
Definition at line 113 of file TDbiValidityRec.hxx.
Referenced by Fill(), GetAggregateNo(), SetAggregateNo(), Store(), Streamer(), and Trim().
TVldTimeStamp TDbiValidityRec::fCreationDate [private] |
Creation date.
Definition at line 116 of file TDbiValidityRec.hxx.
Referenced by Fill(), GetCreationDate(), IsHigherPriority(), Store(), and Streamer().
Int_t TDbiValidityRec::fDbNo [private] |
Cascade no. of source db =-1 unknown.
Definition at line 119 of file TDbiValidityRec.hxx.
Referenced by Fill(), GetDbNo(), SetDbNo(), and Streamer().
UInt_t TDbiValidityRec::fEpoch [private] |
Calibration Epoch.
Definition at line 141 of file TDbiValidityRec.hxx.
Referenced by Fill(), GetEpoch(), IsHigherPriority(), SetEpoch(), Store(), and Streamer().
TVldTimeStamp TDbiValidityRec::fInsertDate [private] |
Insertion date.
Definition at line 122 of file TDbiValidityRec.hxx.
Referenced by Fill(), GetInsertDate(), IsHigherPriority(), Store(), and Streamer().
Bool_t TDbiValidityRec::fIsGap [private] |
kTRUE if corresponds to a gap.
Definition at line 125 of file TDbiValidityRec.hxx.
Referenced by Fill(), IsGap(), and Streamer().
UInt_t TDbiValidityRec::fReality [private] |
Reality (for possible, but improbable future use).
Definition at line 144 of file TDbiValidityRec.hxx.
Referenced by Fill(), Store(), and Streamer().
Int_t TDbiValidityRec::fSeqNo [private] |
Sequence number or 0 if compound.
Definition at line 131 of file TDbiValidityRec.hxx.
Referenced by Fill(), GetSeqNo(), Store(), and Streamer().
const TDbiTableProxy* TDbiValidityRec::fTableProxy [private] |
TDbiTableProxy that filled this (if any).
Definition at line 135 of file TDbiValidityRec.hxx.
Referenced by Fill(), GetTableProxy(), SetTableProxy(), and Streamer().
TDbi::Task TDbiValidityRec::fTask [private] |
Task number.
Definition at line 128 of file TDbiValidityRec.hxx.
Referenced by Fill(), GetTask(), HasExpired(), IsCompatible(), Store(), and Streamer().
TVldRange TDbiValidityRec::fVldRange [private] |
Validity range of record.
Definition at line 138 of file TDbiValidityRec.hxx.
Referenced by AndTimeWindow(), Fill(), GetVldRange(), HasExpired(), IsCompatible(), IsHigherPriority(), SetTimeWindow(), SetVldRange(), Store(), Streamer(), and Trim().