18 #include <boost/regex.hpp>
19 #include <boost/format.hpp>
20 #include <boost/range.hpp>
21 #include <boost/filesystem.hpp>
22 #include <boost/algorithm/string.hpp>
26 namespace dqmservices {
30 : StreamerInputSource(pset, desc),
59 "Waiting for the first lumi in order to initialize.");
77 "End of run reached before DQMStreamerReader was initialised.");
127 unlink(path.c_str());
146 if (boost::filesystem::exists(p)) {
163 <<
"received wrong message type: expected INIT, got " << header->
code()
253 if (!next)
return nullptr;
263 if (eview ==
nullptr) {
284 if (eview ==
nullptr) {
311 boost::erase_all(hltPath,
" \t");
325 boost::erase_all(hltPath,
" \t");
326 std::vector<Strings::const_iterator> matches =
edm::regexMatch(tnames, hltPath);
327 if (matches.empty()){
328 edm::LogWarning(
"Trigger selection does not match any trigger path!!!") << std::endl;
345 std::vector<unsigned char> hltTriggerBits_;
346 int hltTriggerCount_ = evtmsg->
hltCount();
347 if (hltTriggerCount_ > 0) {
348 hltTriggerBits_.resize(1 + (hltTriggerCount_ - 1) / 4);
361 for (
int i = 0;
i != toSkip; ++
i) {
364 if (evMsg ==
nullptr) {
374 desc.
setComment(
"Reads events from streamer files.");
376 desc.
addUntracked<std::vector<std::string> >(
"SelectEvents")
377 ->setComment(
"HLT path to select events ");
379 desc.
addUntracked<
int>(
"minEventsPerLumi", 1)->setComment(
380 "Minimum number of events to process per lumisection, "
381 "before switching to a new input file. If the next file "
382 "does not yet exist, "
383 "the number of processed events will be bigger.");
385 desc.
addUntracked<
bool>(
"skipFirstLumis",
false)->setComment(
386 "Skip (and ignore the minEventsPerLumi parameter) for the files "
387 "which have been available at the begining of the processing. "
388 "If set to true, the reader will open last available file for "
391 desc.
addUntracked<
bool>(
"deleteDatFiles",
false)->setComment(
392 "Delete data files after they have been closed, in order to "
395 desc.
addUntracked<
bool>(
"endOfRunKills",
false)->setComment(
396 "Kill the processing as soon as the end-of-run file appears, even if "
397 "there are/will be unprocessed lumisections.");
405 desc.
addUntracked<
bool>(
"inputFileTransitionsEachEvent",
false);
411 descriptions.
add(
"source", desc);
DQMFileIterator::LumiEntry lumi_
T getUntrackedParameter(std::string const &, T const &) const
std::string make_path(const std::string &fn)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
unsigned int lastLumiFound()
void hltTriggerBits(uint8 *put_here) const
void logLumiState(const LumiEntry &lumi, const std::string &msg)
virtual ~DQMStreamerReader()
std::shared_ptr< TriggerSelector > eventSelector_
EventMsgView const * getEventMsg()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
dqmservices::DQMStreamerReader DQMStreamerReader
void openFile_(const DQMFileIterator::LumiEntry &entry)
void hltTriggerNames(Strings &save_here) const
void setComment(std::string const &value)
std::unique_ptr< edm::StreamerInputFile > streamFile_
virtual void skip(int toSkip)
tuple path
else: Piece not in the list, fine.
void addParameter(std::string const &name, T const &value)
void logFileAction(const std::string &msg, const std::string &fileName="") const
unsigned int processedEventPerLs_
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, boost::regex const ®exp)
DQMStreamerReader(edm::ParameterSet const &pset, edm::InputSourceDescription const &desc)
std::vector< std::string > Strings
DQMFileIterator fiterator_
bool acceptEvent(const EventMsgView *)
InitMsgView const * getHeaderMsg()
unsigned int minEventsPerLs_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescription(ParameterSetDescription &desc)
bool matchTriggerSel(Strings const &tnames)
void advanceToLumi(unsigned int lumi, std::string reason)
EventMsgView const * prepareNextEvent()
static void fillDescription(edm::ParameterSetDescription &d)
struct dqmservices::DQMStreamerReader::OpenFile file_
virtual bool checkNextEvent()