85 produces<APVCyclePhaseCollection,edm::InEvent>();
91 throw cms::Exception(
"InvalidAPVCyclePhases") <<
" Inconsistent default phases/partitions vector sizes: " 96 std::vector<edm::ParameterSet> vps(iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"runPhases"));
98 for(std::vector<edm::ParameterSet>::const_iterator ps = vps.begin();ps!=vps.end();ps++) {
99 _runphases[ps->getParameter<
int>(
"runNumber")] = ps->getUntrackedParameter<std::vector<int> >(
"phases",
_defphases);
100 _runpartnames[ps->getParameter<
int>(
"runNumber")] = ps->getUntrackedParameter<std::vector<std::string> >(
"partitions",
_defpartnames);
104 throw cms::Exception(
"InvalidAPVCyclePhases") <<
" Inconsistent run " << ps->getParameter<
int>(
"runNumber")
105 <<
" phases/partitions vector sizes: " 106 <<
_runphases[ps->getParameter<
int>(
"runNumber")].size() <<
" " 139 const std::map<int,std::vector<std::string> >& _crunpartnames =
_runpartnames;
140 const std::map<int,std::vector<int> >& _crunphases =
_runphases;
142 std::map<int,std::vector<int> >::const_iterator trphases = _crunphases.find(iRun.
run());
143 std::map<int,std::vector<std::string> >::const_iterator trpartnames = _crunpartnames.find(iRun.
run());
148 if(trphases != _crunphases.end()) {
149 phases = trphases->second;
151 if(trpartnames != _crunpartnames.end()) {
152 partnames = trpartnames->second;
155 if(phases.size() < partnames.size() ) {
157 throw cms::Exception(
"InvalidAPVCyclePhases") <<
" Inconsistent phases/partitions vector sizes: " 158 << phases.size() <<
" " 162 for(
unsigned int ipart=0;ipart<partnames.size();++ipart) {
163 if(phases[ipart]>=0) {
171 edm::LogInfo(
"APVCyclePhaseProducerDebug") <<
"partition " << it->first <<
" phase " << it->second;
void produce(edm::Event &, const edm::EventSetup &) override
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~ConfigurableAPVCyclePhaseProducer() override
std::map< int, std::vector< std::string > > _runpartnames
const std::vector< int > _defphases
const std::map< std::string, int > & get() const
void beginRun(const edm::Run &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
ConfigurableAPVCyclePhaseProducer(const edm::ParameterSet &)
const std::vector< std::string > _defpartnames
APVCyclePhaseCollection _currapvphases
std::vector< int > phases
std::map< int, std::vector< int > > _runphases