File indexing completed on 2024-04-06 12:12:59
0001 #ifndef FWCore_PrescaleService_PrescaleService_h
0002 #define FWCore_PrescaleService_PrescaleService_h
0003
0004 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/ServiceRegistry/interface/SaveConfiguration.h"
0007
0008 #include <string>
0009 #include <vector>
0010 #include <map>
0011
0012 namespace edm {
0013 class ActivityRegistry;
0014 class ConfigurationDescriptions;
0015 class PathsAndConsumesOfModulesBase;
0016 class ProcessContext;
0017
0018 namespace service {
0019
0020 class PrescaleService : public edm::serviceregistry::SaveConfiguration {
0021 public:
0022
0023
0024
0025
0026 PrescaleService(ParameterSet const&, ActivityRegistry&);
0027 ~PrescaleService();
0028
0029
0030
0031
0032
0033 unsigned int getPrescale(std::string const& prescaledPath) const;
0034 unsigned int getPrescale(unsigned int lvl1Index, std::string const& prescaledPath) const;
0035
0036 typedef std::vector<std::string> VString_t;
0037 typedef std::map<std::string, std::vector<unsigned int> > PrescaleTable_t;
0038 unsigned int getLvl1IndexDefault() const { return lvl1Default_; }
0039 const VString_t& getLvl1Labels() const { return lvl1Labels_; }
0040 const PrescaleTable_t& getPrescaleTable() const { return prescaleTable_; }
0041
0042 static unsigned int findDefaultIndex(std::string const& label, std::vector<std::string> const& labels);
0043 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0044
0045 private:
0046
0047
0048
0049 void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&);
0050 void postBeginJob();
0051
0052
0053
0054
0055 const bool forceDefault_;
0056 const VString_t lvl1Labels_;
0057 const unsigned int lvl1Default_;
0058 const std::vector<ParameterSet> vpsetPrescales_;
0059 PrescaleTable_t prescaleTable_;
0060 ParameterSetID processParameterSetID_;
0061 };
0062 }
0063 }
0064
0065 #endif