21 namespace saverDetails {
76 if (value < 1 && value != -1)
77 throw cms::Exception(
"DQMFileSaver") <<
"Invalid '" << name <<
"' parameter '" << value
78 <<
"'. Must be -1 or >= 1.";
87 wflow.reserve(workflow.size() + 3);
89 while ((pos = wflow.find(
'/', pos)) != std::string::npos)
90 wflow.replace(pos++, 1,
"__");
98 sprintf(suffix,
"R%09d", run);
112 me =
dbe_->
get(
"Info/ProvInfo/runIsComplete");
124 h.
save(filename,
"", run,
true,
"RECREATE");
134 std::map<std::string, std::string>
info;
135 info[
"Source"] =
"DQMStore";
136 info[
"FileClass"] =
"DQM";
150 runIsComplete_(
false),
152 saveAtJobEnd_(
false),
159 jobmegetter_(edm::GetterOfProducts<
DQMToken>(edm::ProcessMatch(
"*"), this, edm::
InProcess)),
160 runmegetter_(edm::GetterOfProducts<
DQMToken>(edm::ProcessMatch(
"*"), this, edm::
InRun)) {
167 if (workflow_.empty() || workflow_[0] !=
'/' || *workflow_.rbegin() ==
'/' ||
168 std::count(workflow_.begin(), workflow_.end(),
'/') != 3 ||
169 workflow_.find_first_not_of(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
170 "abcdefghijklmnopqrstuvwxyz"
172 "-_/") != std::string::npos)
173 throw cms::Exception(
"DQMFileSaver") <<
"Invalid 'workflow' parameter '" << workflow_ <<
"'. Expected '/A/B/C'.";
184 if (dirName_.empty() ||
stat(dirName_.c_str(), &
s) == -1)
185 throw cms::Exception(
"DQMFileSaver") <<
"Invalid 'dirName' parameter '" << dirName_ <<
"'.";
197 sprintf(version,
"_V%04d_",
int(
version_));
202 edm::LogInfo(
"DQMFileSaver") <<
"DQM file saving settings:\n"
205 <<
" saving every " <<
saveByRun_ <<
" run(s)\n"
206 <<
" saving at job end: " << (
saveAtJobEnd_ ?
"yes" :
"no") <<
"\n";
216 int irun = iRun.
id().
run();
void beginRun(edm::Run const &, edm::EventSetup const &) override
T getUntrackedParameter(std::string const &, T const &) const
DQMFileSaver(const edm::ParameterSet &ps)
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
void analyze(const edm::Event &e, const edm::EventSetup &) override
void save(std::string const &filename, std::string const &path="", uint32_t const run=0, bool saveall=true, std::string const &fileupdate="RECREATE")
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath) override
void saveJobReport(const std::string &filename)
std::string fileBaseName_
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
void endRun(const edm::Run &, const edm::EventSetup &) override
static void getAnInt(const edm::ParameterSet &ps, int &value, const std::string &name)
virtual MonitorElement * get(std::string const &fullpath) const
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
dqm::legacy::MonitorElement MonitorElement
std::string stream_label_
dqm::legacy::DQMStore DQMStore
Log< level::Info, false > LogInfo
std::string getReleaseVersion()
void endProcessBlock(const edm::ProcessBlock &) override
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child)
edm::GetterOfProducts< DQMToken > runmegetter_
void reportAnalysisFile(std::string const &fileName, std::map< std::string, std::string > const &fileData)
void saveForOffline(const std::string &workflow, int run, int lumi)
edm::GetterOfProducts< DQMToken > jobmegetter_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.