// -*- mode: c++ -*- #ifndef BRAT_BrRunInfoManager #define BRAT_BrRunInfoManager // // $Id: BrRunInfoManager.h,v 1.2 2001/08/10 13:49:00 ouerdane Exp $ // $Author: ouerdane $ // $Date: 2001/08/10 13:49:00 $ // $Copyright: 2001 BRAHMS Collaboration // // Root Classes #ifndef ROOT_TObject #include "TObject.h" #endif #ifndef ROOT_TObjArray #include "TObjArray.h" #endif // BRAHMS Classes #ifndef BRAT_BrDbRun # include "BrDbRun.h" #endif #ifndef BRAT_BrDbFile # include "BrDbFile.h" #endif #ifndef BRAT_BrDbMagnet # include "BrDbMagnet.h" #endif #ifndef BRAT_BrDbShiftReport # include "BrDbShiftReport.h" #endif #ifndef BRAT_BrRunsDb # include "BrDbShiftReport.h" #endif #ifndef BRAT_BrRunInfo # include "BrRunInfo.h" #endif class BrRunInfoManager : public TObject { private: enum EDbStatus { kInit, kOpen, kDefaultParameterSet } fStatus; static BrRunInfoManager* fgInstance; BrRunInfo fCurrentRun; Int_t fNumberOfRuns; Int_t fSize; Int_t* fRunNumbers; //[fSize] Int_t fCurrent; Int_t fDebugLevel; public: BrRunInfoManager(); ~BrRunInfoManager(); static BrRunInfoManager* Instance(); BrRunInfo* Register(Int_t runNo); void Init(); void List() { fCurrentRun.Print(); } void Update(); void Update(Int_t runNo); void Commit(Int_t, Int_t) {} const BrRunInfo* GetCurrentRun() const { return &fCurrentRun; } Int_t DebugLevel() const { return fDebugLevel; } void SetDebugLevel(Int_t level) { fDebugLevel = level; } Int_t* GetRunNumbers() const { return fRunNumbers; } Int_t GetNumberOfRuns() const { return fNumberOfRuns; } ClassDef(BrRunInfoManager, 0) // BRAHMS Run Manager object } ; #endif // // $Log: BrRunInfoManager.h,v $ // Revision 1.2 2001/08/10 13:49:00 ouerdane // Added 2 methods in BrRunInfoManager: // Int_t* GetRunNumbers -> returns the array of registered runs // Int_t GetNumberOfRuns -> returns the number of runs registered // // Added a check in BrDbUpdateModule::Event: // if the user has not registered initially the run number // returned by the event header, then the job will abort. // It forces the user to know exactly which runs he wants // to analyze at registration time (brRunInfoManager::Register(runNo)) // // Removed in the same class a reference to BrMainModule in Begin since // BrDbUpdateModule might be used in another context (if possible). // // Revision 1.1.1.1 2001/06/21 14:55:18 hagel // Initial revision of brat2 // // Revision 1.3 2001/03/01 23:22:51 cholm // Added support for ~/.brahmsdbrc file // // Revision 1.2 2001/01/29 20:02:34 cholm // Corrected a few bugs // // Revision 1.1 2001/01/19 18:40:45 cholm // Added the classes BrRunInfo and BrRunInfoManager for user space application // access to the run database. They are not fully tested yet. I'll do that, // modify as need and then write to brahms-dev-l explaing what I did and usage. // //