00001
00002 #ifndef TrigConf_HLTPrescaleSetCollection
00003 #define TrigConf_HLTPrescaleSetCollection
00004
00005 #include <iosfwd>
00006 #include <string>
00007 #include <list>
00008 #include <vector>
00009 #include <utility>
00010 #include <exception>
00011
00012 #include <boost/thread/recursive_mutex.hpp>
00013
00014 namespace TrigConf {
00015 class HLTPrescaleSet;
00016 class HLTPrescaleSetCollection;
00017
00018 std::ostream & operator<<(std::ostream &, const TrigConf::HLTPrescaleSetCollection &);
00019
00021 class HLTPrescaleSetCollection {
00022 public:
00023
00024 struct cont {
00025 cont(unsigned int _lb, unsigned int _psk, HLTPrescaleSet* _pss = 0) :
00026 lb(_lb), psk(_psk), pss(_pss) {};
00027 unsigned int lb;
00028 unsigned int psk;
00029 HLTPrescaleSet* pss;
00030 };
00031
00033 HLTPrescaleSetCollection();
00034
00036 ~HLTPrescaleSetCollection();
00037
00041 HLTPrescaleSet* thePrescaleSet(unsigned int lumiblock) const;
00042
00043 const HLTPrescaleSet* prescaleSet(unsigned int lumiblock) const;
00044
00046 HLTPrescaleSet* thePrescaleSet() const { return m_currentPSS; }
00047
00048 const HLTPrescaleSet* prescaleSet() const { return m_currentPSS; }
00049
00050
00052 size_t size() const { return m_prescaleSets.size(); }
00053
00058 HLTPrescaleSet* setPrescaleSet( HLTPrescaleSet* pss );
00059
00061 HLTPrescaleSet* addPrescaleSet( unsigned int lumiblock, HLTPrescaleSet* pss );
00062
00064 bool contains(unsigned int lumiblock, unsigned int psk );
00065
00067 void clear();
00068
00069 std::list<cont>& sets() { return m_prescaleSets; }
00070
00071 const std::list<cont>& sets() const { return m_prescaleSets; }
00072
00073 std::vector<std::pair<unsigned int, unsigned int> > prescale_keys() const;
00074
00075 void set_prescale_key_to_load(unsigned int);
00076
00077 void set_prescale_keys_to_load(const std::vector<std::pair<unsigned int, unsigned int> >&);
00078
00079 void setCurrentToFirstIfUnset();
00080
00082 void print(const std::string& indent="", unsigned int detail=1) const;
00083
00084 std::string __str__() const;
00085
00086 private:
00087
00088 HLTPrescaleSetCollection & operator=( const HLTPrescaleSetCollection & );
00089
00090 HLTPrescaleSetCollection( const HLTPrescaleSetCollection & );
00091
00092 HLTPrescaleSet* addPrescaleSet( const cont& add_psinfo );
00093
00094 mutable unsigned int m_currentLB;
00095 mutable HLTPrescaleSet* m_currentPSS;
00096
00097 std::list<cont> m_prescaleSets;
00098
00099 mutable boost::recursive_mutex m_prescaleSetCollection_mutex;
00100
00101 friend std::ostream & operator<<(std::ostream &, const HLTPrescaleSetCollection &);
00102
00103 };
00104
00105 }
00106
00107 #endif