File indexing completed on 2025-04-13 22:49:51
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 ProcessContext;
0016
0017 namespace service {
0018
0019 class PrescaleService : public edm::serviceregistry::SaveConfiguration {
0020 public:
0021
0022
0023
0024
0025 PrescaleService(ParameterSet const&, ActivityRegistry&);
0026 ~PrescaleService();
0027
0028
0029
0030
0031
0032 unsigned int getPrescale(std::string const& prescaledPath) const;
0033 unsigned int getPrescale(unsigned int lvl1Index, std::string const& prescaledPath) const;
0034
0035 typedef std::vector<std::string> VString_t;
0036 typedef std::map<std::string, std::vector<unsigned int> > PrescaleTable_t;
0037 unsigned int getLvl1IndexDefault() const { return lvl1Default_; }
0038 const VString_t& getLvl1Labels() const { return lvl1Labels_; }
0039 const PrescaleTable_t& getPrescaleTable() const { return prescaleTable_; }
0040
0041 static unsigned int findDefaultIndex(std::string const& label, std::vector<std::string> const& labels);
0042 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0043
0044 private:
0045
0046
0047
0048 void preBeginJob(ProcessContext const&);
0049 void postBeginJob();
0050
0051
0052
0053
0054 const bool forceDefault_;
0055 const VString_t lvl1Labels_;
0056 const unsigned int lvl1Default_;
0057 const std::vector<ParameterSet> vpsetPrescales_;
0058 PrescaleTable_t prescaleTable_;
0059 ParameterSetID processParameterSetID_;
0060 };
0061 }
0062 }
0063
0064 #endif