///////////////////////////////////////////////////////// /// $Id: IRunInfoBank.cxx,v 1.4 2010/01/16 13:37:41 mcgrew Exp $ /// /// Implement the COMET::ITripTInfoBank class... #include "IMidasBankProxyRegistry.hxx" #include "IRawDataHeader.hxx" #include "IRunInfoBank.hxx" // Register the bank MIDAS bank mask for the family of bank names that map to // this class REGISTER_MIDAS_BANK(IRunInfoBank,XRUN) const UInt_t COMET::IRunInfoBank::undefined = 0xdeadbeef; // Typically the class constructors do nothing beyond passing their arguments // to the IMidasBank base class and the destructor does nothing. //_____________________________________________________________________________ COMET::IRunInfoBank::IRunInfoBank() : IMidasBank(0,TRUN_INFO_BANK_TITLE) { // Default constructor COMETTrace("IRunInfoBank: Default ctor at:" << (void*) this); } //_____________________________________________________________________________ COMET::IRunInfoBank::IRunInfoBank(const ULong64_t *bank, const char* title /* = TRUN_INFO_BANK_TITLE */) : IMidasBank(bank,title) { // Normal constructor COMETTrace("COMET::RunInfoBank: Normal ctor at:" << (void*) this << "\n Name:'" << this->GetName() << "'; Title:" << title << "; Bank size:" << this->GetBankSize() << "; starts at:" << (void*) this->GetBank()); } //_____________________________________________________________________________ COMET::IRunInfoBank::~IRunInfoBank() { COMETTrace("COMET::IRunInfoBank: dtor at:" << (void*) this); } //_____________________________________________________________________________ void COMET::IRunInfoBank::Print(const Option_t* opt /* = "" */) const { this->COMET::IMidasBank::Print(""); char buff[1000]; int n=0; n += sprintf(buff+n,"Run %d SubRun %d DetectorMask %d RunType %d" ,this->GetRun(),this->GetSubRun(),this->GetDetectorMask(),this->GetRunType()); COMETLog(buff); n=0; n += sprintf(buff+n,"Time $%8.8x (%s) Spill %d SeqNumber %d" ,this->GetTime(),"time",this->GetSpillNumber(),this->GetSeqNumber()); COMETLog(buff); } //_____________________________________________________________________________ void COMET::IRunInfoBank::SetContext(COMET::IRawDataHeader& header) const { if ( this->IsDefined(this->GetRun()) ) header.SetRun( this->GetRun()); if ( this->IsDefined(this->GetSubRun()) ) header.SetSubRun( this->GetSubRun()); if ( this->IsDefined(this->GetRunType()) ) header.SetRunType( this->GetRunType()); if ( this->IsDefined(this->GetSeqNumber()) ) header.SetSeqNo( this->GetSeqNumber()); if ( this->IsDefined(this->GetTime()) ) header.SetTimeStamp(this->GetTime()); }