47 virtual void endJob()
override;
81 case kText: fileName +=
".txt";
break;
82 case kPython: fileName +=
".py";
break;
83 case kTwiki: fileName +=
".twiki";
break;
85 if (fileName.size()) {
86 output_.reset(
new std::ofstream(fileName.c_str()));
88 edm::LogError(
"IOproblem") <<
"Could not open output file " << fileName <<
".";
99 if (outputTypeStr ==
"text")
return kText;
100 if (outputTypeStr ==
"twiki")
return kTwiki;
101 if (outputTypeStr ==
"python")
return kPython;
104 throw cms::Exception(
"BadConfig") <<
"AlCaRecoTriggerBitsRcdRead: " 105 <<
"outputType '" << outputTypeStr <<
"' not known," 106 <<
" use 'text', 'twiki' or 'python'\n";
141 typedef std::map<std::string, std::string> TriggerMap;
146 std::ostringstream
output;
149 output <<
" triggerLists = cms.VPSet(\n";
152 output <<
"#\n# AlCaRecoTriggerBits settings for IOV " 153 << firstRun <<
"-" << lastRun <<
":\n#\n";
156 output <<
"---+++++ *IOV*: " << firstRun <<
"-" << lastRun <<
"\n" 157 <<
"| *TriggerBits list key* | *HLT paths* |\n";
164 for (TriggerMap::const_iterator
i = triggerMap.begin();
i != triggerMap.end(); ++
i) {
170 output <<
" cms.PSet(listName = cms.string('" <<
i->first <<
"'),\n" 171 <<
" hltPaths = cms.vstring(";
174 output <<
"trigger list key: '" <<
i->first <<
"'\npaths:\n";
177 output <<
"| '" <<
i->first <<
"' | ";
181 const std::vector<std::string> paths = triggerBits.
decompose(
i->second);
182 for (
unsigned int iPath = 0; iPath < paths.size(); ++iPath) {
197 output <<
"'" << paths[iPath] <<
"'";
std::map< std::string, std::string > m_alcarecoToTrig
T getUntrackedParameter(std::string const &, T const &) const
~AlCaRecoTriggerBitsRcdRead()
edm::ESWatcher< AlCaRecoTriggerBitsRcd > watcher_
#define DEFINE_FWK_MODULE(type)
AlCaRecoTriggerBitsRcdRead(const edm::ParameterSet &cfg)
std::vector< std::string > decompose(const std::string &concatPaths) const
Decompose one value of map from concatenated string.
void printMap(edm::RunNumber_t firstRun, edm::RunNumber_t lastRun, const AlCaRecoTriggerBits &triggerMap) const
virtual void beginRun(const edm::Run &run, const edm::EventSetup &evtSetup) override
edm::RunNumber_t firstRun_
std::auto_ptr< std::ofstream > output_
edm::RunNumber_t lastRun_
bool check(const edm::EventSetup &iSetup)
const OutputType outputType_
virtual void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup) override
OutputType stringToEnum(const std::string &outputType) const
virtual void endJob() override
AlCaRecoTriggerBits lastTriggerBits_