CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/HiggsAnalysis/CombinedLimit/interface/ProfilingTools.h

Go to the documentation of this file.
00001 #ifndef HiggsAnalysis_CombinedLimit_ProfilingTools_
00002 #define HiggsAnalysis_CombinedLimit_ProfilingTools_
00003 #include <string>
00004 
00005 bool setupIgProfDumpHook() ;
00006 
00007 //#include <boost/unordered_map.hpp>
00008 class PerfCounter {
00009     public:
00010         PerfCounter() : value_(0) {}
00011         static PerfCounter & get(const char *name) ;
00012 
00013         void   add(double increment=1.0) { value_ += increment; }
00014         double get() const { return value_; }
00015 
00016         static void add(const char *name, double increment=1.0) { PerfCounter::get(name).add(increment); }
00017         static void enable() ;
00018         static void printAll() ;
00019     private:
00020         double value_;
00021 };
00022 
00023 namespace runtimedef {
00024     // get the flag. name MUST BE a compile-time string
00025     int  get(const char *name);
00026 
00027     // get the flag, with a run-time name
00028     int  get(const std::string & name);
00029 
00031     void set(const std::string & name, int value);
00032 }
00033 #endif