00001 #ifndef GoodRunsLists_GoodRunsListSelectorTool_H
00002 #define GoodRunsLists_GoodRunsListSelectorTool_H
00003 
00009 #include "GoodRunsLists/IGoodRunsListSelectorTool.h"
00010 #include "AthenaBaseComps/AthAlgTool.h"
00011 #include "AthenaKernel/IAthenaEvtLoopPreSelectTool.h"
00012 #include "GoodRunsLists/RegularFormula.h"
00013 
00014 #include <vector>
00015 #include <string>
00016 #include <map>
00017 
00018 
00019 
00024 class TFormula;
00025 class EventInfo;
00026 
00027 namespace Root {
00028   class TGRLCollection;
00029   class TGoodRunsListReader;
00030 }
00031 
00032 class IDetStatusSvc;
00033 class StoreGateSvc;
00034 
00035 class GoodRunsListSelectorTool : virtual public AthAlgTool, virtual public IGoodRunsListSelectorTool, virtual public IAthenaEvtLoopPreSelectTool
00036 {
00037  public:    
00038   GoodRunsListSelectorTool( const std::string&, const std::string&, const IInterface* );
00039   virtual ~GoodRunsListSelectorTool();
00040 
00042   StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
00043 
00045   StatusCode initialize();
00047   bool passEvent(const EventInfo* pEvent) ;
00049   StatusCode finalize();
00050 
00052   
00053   
00054   
00055   
00056 
00058   bool passRunLB( int runNumber, int lumiBlockNr,
00059                   const std::vector<std::string>& grlnameVec=std::vector<std::string>(),
00060                   const std::vector<std::string>& brlnameVec=std::vector<std::string>() ) ;
00062   bool passThisRunLB( const std::vector<std::string>& grlnameVec=std::vector<std::string>(), 
00063                       const std::vector<std::string>& brlnameVec=std::vector<std::string>() ) ;
00065   bool registerGRLSelector(const std::string& name, const std::vector<std::string>& grlnameVec, const std::vector<std::string>& brlnameVec);
00067   const std::map< std::string, vvPair >& getGRLSelectorRegistry() { return m_registry; }
00068 
00070   const Root::TGRLCollection* getGRLCollection() const { return m_grlcollection; } 
00071   const Root::TGRLCollection* getBRLCollection() const { return m_brlcollection; }
00072 
00073  protected:
00074 
00075   bool fileExists(const char* fileName);
00076 
00077   std::vector<std::string> m_goodrunslistVec;
00078   std::vector<std::string> m_blackrunslistVec;
00079   std::vector<std::string> m_dqflagsqueryVec;
00080 
00081   Root::TGRLCollection* m_grlcollection;
00082   Root::TGRLCollection* m_brlcollection;
00083 
00084   Root::TGoodRunsListReader* m_reader;
00085 
00086   std::map< std::string,TFormula* > m_dqformula;
00087 
00088   int  m_boolop;
00089   bool m_passthrough;
00090   bool m_usecool;
00091   bool m_verbose;
00092   bool m_rejectanybrl;
00093   bool m_eventselectormode;
00094 
00095   const IDetStatusSvc* m_detstatussvc;
00096   StoreGateSvc* m_storeGate;
00097 
00098   std::map< std::string, vvPair > m_registry;
00099 
00100   std::string  m_runrangeexpr;
00101   Root::RegularFormula m_inrunrange;
00102 };
00103 
00104 #endif
00105