00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __TGoodRunsList__
00010 #define __TGoodRunsList__
00011
00012 #include "GoodRunsLists/TGoodRun.h"
00013 #include "TNamed.h"
00014 #include "TString.h"
00015 #include <map>
00016 #include <vector>
00017 #include <string>
00018
00019 namespace Root {
00020
00021 class TGoodRunsList : public std::map< Int_t, TGoodRun >, public TNamed {
00022
00023 public:
00024
00025 TGoodRunsList();
00026 TGoodRunsList(const char* name);
00027 virtual ~TGoodRunsList();
00028
00029 TGoodRunsList(const Root::TGoodRunsList& other) ;
00030 TGoodRunsList& operator=(const TGoodRunsList& other) ;
00031
00032 void AddGRL(const TGoodRunsList& other);
00033 const Root::TGoodRunsList GetOverlapWith(const TGoodRunsList& other) const ;
00034 const Root::TGoodRunsList GetSumWith(const TGoodRunsList& other) const ;
00035 const Root::TGoodRunsList GetPartOnlyIn(const TGoodRunsList& other) const ;
00036 const Root::TGoodRunsList GetPartNotIn(const TGoodRunsList& other) const ;
00037
00038 Bool_t HasTriggerInfo() const;
00039 Bool_t HasRun( const Int_t& runnr ) const;
00040 Bool_t HasRunLumiBlock( const Int_t& runnr, const Int_t& lumiblocknr ) const ;
00041 Bool_t HasSameGRLInfo( const TGoodRunsList& other ) const;
00042 Bool_t HasOverlapWith( const TGoodRunsList& other, bool verb=false ) const;
00043
00044 void AddRunLumiBlock( const Int_t& runnr, const Int_t& lumiblocknr );
00045 inline void SetVersion(const TString& version) { m_version = version; }
00046 inline void AddMetaData(const TString& key, const TString& value) { m_metadata[key] = value; }
00047 inline void SetMetaData(const std::map<TString,TString>& metadata) { m_metadata = metadata; }
00048 inline void SetCheckGRLInfo(Bool_t check=kTRUE) { m_checkGRLInfo=check; }
00049
00050 inline const Bool_t& GetCheckGRLInfo() const { return m_checkGRLInfo; }
00051 inline const TString& GetVersion() const { return m_version; }
00052 inline const std::map<TString,TString>& GetMetaData() const { return m_metadata; }
00053 inline unsigned int GetMetaDataSize() const { return m_metadata.size(); }
00054
00055 void Summary(Bool_t verbose = kFALSE) const;
00056 Bool_t IsEmpty() const;
00057
00058 const std::vector<int> GetRunlist() const;
00059 const std::vector<Root::TGoodRun> GetGoodRuns() const;
00060 const std::vector<std::string> GetTriggerList() const;
00061 const std::vector<std::string> GetStreamList() const;
00062
00063 const TString GetSuggestedName() const;
00064 void Compress();
00065
00066 private:
00067
00068 TString m_version;
00069 std::map<TString,TString> m_metadata;
00070 Bool_t m_checkGRLInfo;
00071
00072 mutable Bool_t m_hasRun;
00073 mutable Bool_t m_hasLB;
00074 mutable Int_t m_prevRun;
00075 mutable Int_t m_prevLB;
00076
00077 ClassDef(TGoodRunsList,1)
00078 };
00079 }
00080
00081 #endif
00082