00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _TGoodRunsListReader
00009 #define _TGoodRunsListReader
00010
00011 #include <vector>
00012
00013 #include "TROOT.h"
00014 #include "TList.h"
00015 #include "TObject.h"
00016 #include "TString.h"
00017
00018 #include "GoodRunsLists/TMsgLogger.h"
00019 #include "GoodRunsLists/TGRLCollection.h"
00020
00021 #include <vector>
00022
00023 class TXMLNode;
00024
00025 namespace Root {
00026
00027 class TStringList;
00028 class TLumiBlockRange;
00029 class TGoodRun;
00030 class TGoodRunsList;
00031
00032 class TGoodRunsListReader : public TObject {
00033
00034 public:
00035
00036 TGoodRunsListReader( Bool_t checkGRLInfo=kFALSE );
00037 TGoodRunsListReader( const TString& dataCardName, Bool_t checkGRLInfo=kFALSE );
00038 ~TGoodRunsListReader();
00039
00040 Bool_t Interpret();
00041
00042
00043 inline const TString& GetXMLString() const { return m_xmlstring; }
00044 inline const TString& GetXMLFilename() const { return m_dataCardName; }
00045
00046 inline void AddXMLFile( const TString& xmlfile ) { m_dataCardList.push_back(xmlfile); }
00047 inline void AddXMLString( const TString& xmlstring ) { m_xmlstringList.push_back(xmlstring); }
00048 inline void SetXMLString( const TString& xmlstring ) { Reset(); m_xmlstringList.push_back(xmlstring); }
00049 inline void SetXMLFile( const TString& xmlfile ) { Reset(); m_dataCardList.push_back(xmlfile); }
00050 inline void SetCheckGRLInfo( Bool_t check=kTRUE ) { m_grlvec.SetCheckGRLInfo( check ); }
00051
00052 const TGoodRunsList GetMergedGoodRunsList( const Root::BoolOperation& operation = OR ) const ;
00053 const TGoodRunsList GetGoodRunsList( unsigned int idx ) const ;
00054 inline const TGRLCollection GetGRLCollection() const { return m_grlvec; }
00055 const TGRLCollection GetMergedGRLCollection( const Root::BoolOperation& operation = OR ) const ;
00056
00057 void Reset();
00058
00059 private:
00060
00061 void ReadNamedLumiRange ( TXMLNode* );
00062 void ReadLumiBlockCollection ( TXMLNode* );
00063 void ReadAttribs ( TXMLNode* );
00064
00065 TGoodRun GetLumiBlockCollection( TXMLNode* dataNode ) ;
00066
00067 TString m_xmlstring;
00068 TString m_dataCardName;
00069 std::vector<TString> m_dataCardList;
00070 std::vector<TString> m_xmlstringList;
00071 TMsgLogger m_logger;
00072 TGRLCollection m_grlvec;
00073
00074 ClassDef(TGoodRunsListReader,0)
00075 };
00076 }
00077
00078 #endif