73 desc.setComment(
"Plugin to read payloads of type AlCaRecoTriggerBits");
82 outputType_(this->stringToEnum(
cfg.getUntrackedParameter<
std::
string>(
"outputType"))),
111 if (outputTypeStr ==
"text")
113 if (outputTypeStr ==
"twiki")
115 if (outputTypeStr ==
"python")
119 throw cms::Exception(
"BadConfig") <<
"AlCaRecoTriggerBitsRcdRead: " 120 <<
"outputType '" << outputTypeStr <<
"' not known," 121 <<
" use 'text', 'twiki' or 'python'\n";
154 typedef std::map<std::string, std::string> TriggerMap;
159 std::ostringstream
output;
162 output <<
" triggerLists = cms.VPSet(\n";
169 <<
"| *TriggerBits list key* | *HLT paths* |\n";
176 for (TriggerMap::const_iterator
i = triggerMap.begin();
i != triggerMap.end(); ++
i) {
182 output <<
" cms.PSet(listName = cms.string('" <<
i->first <<
"'),\n" 183 <<
" hltPaths = cms.vstring(";
186 output <<
"trigger list key: '" <<
i->first <<
"'\npaths:\n";
189 output <<
"| '" <<
i->first <<
"' | ";
193 const std::vector<std::string>
paths = triggerBits.
decompose(
i->second);
194 for (
unsigned int iPath = 0; iPath <
paths.size(); ++iPath) {
224 output <<
"\n ) # closing of VPSet triggerLists\n";
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
edm::ESWatcher< AlCaRecoTriggerBitsRcd > watcher_
void endRun(edm::Run const &, edm::EventSetup const &) override
void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup) override
std::map< std::string, std::string > m_alcarecoToTrig
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::vector< std::string > decompose(const std::string &concatPaths) const
Decompose one value of map from concatenated string.
AlCaRecoTriggerBitsRcdRead(const edm::ParameterSet &cfg)
void beginRun(const edm::Run &run, const edm::EventSetup &evtSetup) override
Log< level::Error, false > LogError
edm::RunNumber_t firstRun_
~AlCaRecoTriggerBitsRcdRead() override=default
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::unique_ptr< std::ofstream > output_
#define DEFINE_FWK_MODULE(type)
Log< level::Warning, true > LogPrint
Log< level::Info, false > LogInfo
edm::RunNumber_t lastRun_
bool check(const edm::EventSetup &iSetup)
const OutputType outputType_
void printMap(edm::RunNumber_t firstRun, edm::RunNumber_t lastRun, const AlCaRecoTriggerBits &triggerMap) const
const edm::ESGetToken< AlCaRecoTriggerBits, AlCaRecoTriggerBitsRcd > triggerBitsToken_
AlCaRecoTriggerBits lastTriggerBits_
OutputType stringToEnum(const std::string &outputType) const