00001 #ifndef TrigConf_HLTPrescaleSet
00002 #define TrigConf_HLTPrescaleSet
00003
00004 #include <iosfwd>
00005 #include <string>
00006 #include <map>
00007 #include <vector>
00008 #include <utility>
00009 #include <stdint.h>
00010
00011 #include "TrigConfHLTData/HLTPrescale.h"
00012 #include "TrigConfHLTData/HLTLevel.h"
00013 #include "TrigConfL1Data/TrigConfData.h"
00014
00015 #include <boost/unordered_map.hpp>
00016
00017
00018 namespace TrigConf {
00019 class HLTPrescaleSet;
00020 }
00021
00022 namespace TrigConf {
00023
00024 std::ostream & operator<<(std::ostream &, const TrigConf::HLTPrescaleSet &);
00025
00027 class HLTPrescaleSet : public TrigConfData {
00028 public:
00029
00030 typedef boost::unordered_map<unsigned int, HLTPrescale> ScalingMap_t;
00031
00033 HLTPrescaleSet();
00034
00036 ~HLTPrescaleSet();
00037
00038 HLTPrescale& setPrescale(const HLTPrescale& sc, unsigned int chain_counter, HLTLevel level = HLT);
00039
00040 const HLTPrescale& getPrescale(unsigned int chain_counter, HLTLevel level = HLT) const;
00041
00042 bool hasPrescale( unsigned int counter, TrigConf::HLTLevel level = HLT ) const;
00043
00044 HLTPrescale& thePrescale(unsigned int chain_counter, HLTLevel level);
00045
00046 const ScalingMap_t& getPrescales(HLTLevel level) const { return m_scalers[static_cast<unsigned int>(level)]; }
00047
00048 size_t size(HLTLevel level=HLT) const { return m_scalers[static_cast<unsigned int>(level)].size(); }
00049
00050 void reset();
00051
00053 void print(const std::string& indent="", unsigned int detail=1) const;
00054
00056 void setIOV(uint32_t start_run, uint32_t start_lb, uint32_t end_run, uint32_t end_lb );
00057 void setIOV(uint64_t start, uint64_t end );
00058
00060 void getIOV(uint32_t& start_run, uint32_t& start_lb, uint32_t& end_run, uint32_t& end_lb ) const;
00061
00063 bool isValid(uint32_t run, uint32_t lb ) const;
00064
00065 std::string __str__() const;
00066
00067 private:
00068 std::vector<ScalingMap_t> m_scalers;
00069
00070 uint64_t m_iovstart;
00071 uint64_t m_iovend;
00072
00073 friend std::ostream & operator<<(std::ostream &, const TrigConf::HLTPrescaleSet &);
00074 };
00075
00076 }
00077
00078 #endif