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),
33 eventSkipperByID_(edm::EventSkipperByID::
create(pset).
release()) {
61 "Waiting for the first lumi in order to initialize.");
79 "End of run reached before DQMStreamerReader was initialised.");
113 header->hltTriggerNames(tnames);
127 unlink(newStreamerFile_.c_str());
145 if (boost::filesystem::exists(p)) {
161 <<
"received wrong message type: expected INIT, got " << header->
code()
254 if (!next)
return nullptr;
264 if (eview ==
nullptr) {
285 if (eview ==
nullptr) {
301 if (
mon_.isAvailable()) {
302 mon_->reportEvents(1);
316 boost::erase_all(hltPath,
" \t");
330 boost::erase_all(hltPath,
" \t");
331 std::vector<Strings::const_iterator> matches =
edm::regexMatch(tnames, hltPath);
332 if (matches.empty()){
333 edm::LogWarning(
"Trigger selection does not match any trigger path!!!") << std::endl;
350 std::vector<unsigned char> hltTriggerBits_;
351 int hltTriggerCount_ = evtmsg->
hltCount();
352 if (hltTriggerCount_ > 0) {
353 hltTriggerBits_.resize(1 + (hltTriggerCount_ - 1) / 4);
366 for (
int i = 0;
i != toSkip; ++
i) {
369 if (evMsg ==
nullptr) {
386 desc.
setComment(
"Reads events from streamer files.");
388 desc.
addUntracked<std::vector<std::string> >(
"SelectEvents")
389 ->setComment(
"HLT path to select events ");
391 desc.
addUntracked<
int>(
"minEventsPerLumi", 1)->setComment(
392 "Minimum number of events to process per lumisection, "
393 "before switching to a new input file. If the next file "
394 "does not yet exist, "
395 "the number of processed events will be bigger.");
397 desc.
addUntracked<
bool>(
"skipFirstLumis",
false)->setComment(
398 "Skip (and ignore the minEventsPerLumi parameter) for the files "
399 "which have been available at the begining of the processing. "
400 "If set to true, the reader will open last available file for "
403 desc.
addUntracked<
bool>(
"deleteDatFiles",
false)->setComment(
404 "Delete data files after they have been closed, in order to "
407 desc.
addUntracked<
bool>(
"endOfRunKills",
false)->setComment(
408 "Kill the processing as soon as the end-of-run file appears, even if "
409 "there are/will be unprocessed lumisections.");
417 desc.
addUntracked<
bool>(
"inputFileTransitionsEachEvent",
false);
423 descriptions.
add(
"source", desc);
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
unsigned int lastLumiFound()
void hltTriggerBits(uint8 *put_here) const
const LumiEntry & front()
virtual ~DQMStreamerReader()
std::shared_ptr< TriggerSelector > eventSelector_
EventMsgView const * getEventMsg()
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
dqmservices::DQMStreamerReader DQMStreamerReader
std::unique_ptr< edm::StreamerInputFile > streamReader_
void advanceToLumi(unsigned int lumi)
std::string make_path_data(const LumiEntry &lumi)
void setComment(std::string const &value)
virtual void skip(int toSkip)
void openFile_(std::string filename)
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
boost::shared_ptr< edm::EventSkipperByID > eventSkipperByID_
DQMFileIterator fiterator_
bool acceptEvent(const EventMsgView *)
InitMsgView const * getHeaderMsg()
edm::Service< DQMMonitoringService > mon_
unsigned int minEventsPerLs_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescription(ParameterSetDescription &desc)
bool matchTriggerSel(Strings const &tnames)
EventMsgView const * prepareNextEvent()
static void fillDescription(edm::ParameterSetDescription &d)
virtual bool checkNextEvent()