6 #include <fmt/printf.h>
7 #include <boost/algorithm/string/predicate.hpp>
8 #include <boost/range.hpp>
9 #include <boost/regex.hpp>
58 static constexpr
double LUMI = 23.310893056;
83 ib.
book1D(
"DeliveryDelayMTime",
"Observed delivery delay for the data file (mtime).", 4, 0., 4.);
85 ib.
book1D(
"DeliveryDelayCTime",
"Observed delivery delay for the data file (ctime).", 4, 0., 4.);
112 if (::
stat(run_global.c_str(), &st) != 0) {
129 auto itStream =
streams_.find(label);
131 edm::LogPrint(
"RamdiskMonitor") <<
"Stream not monitored [" << label <<
"]: " <<
fn;
138 LumiEntry lumi_jsn = LumiEntry::load_json(
runPath_, fn, lumi, -1);
144 if (::
stat(fn.c_str(), &st) != 0) {
152 if (start_offset <= 0)
157 double mtime = st.st_mtime;
158 double ctime = st.st_ctime;
161 double start_offset_mtime = mtime - start_offset -
LUMI;
162 double start_offset_ctime = ctime - start_offset -
LUMI;
163 double lumi_offset = (lumi - 1) * LUMI;
166 double delay_mtime = start_offset_mtime - lumi_offset;
167 double delay_ctime = start_offset_ctime - lumi_offset;
176 using std::filesystem::directory_entry;
177 using std::filesystem::directory_iterator;
179 directory_iterator dend;
180 for (directory_iterator di(
runPath_); di != dend; ++di) {
181 const boost::regex fn_re(
"run(\\d+)_ls(\\d+)_([a-zA-Z0-9]+)(_.*)?\\.jsn");
191 if (boost::regex_match(filename, result, fn_re)) {
192 unsigned int run = std::stoi(result[1]);
193 unsigned int lumi = std::stoi(result[2]);
202 if ((lumi == 0) && (label ==
"EoR")) {
222 return std::shared_ptr<dqm::rdm::Empty>();
229 "Analyses file timestams in the /fff/ramdisk and creates monitor "
232 desc.
addUntracked<std::vector<std::string>>(
"streamLabels")->setComment(
"List of streams to monitor.");
234 desc.
addUntracked<
unsigned int>(
"runNumber")->setComment(
"Run number passed via configuration file.");
238 d.
add(
"RamdiskMonitor", desc);
static const char runNumber_[]
void globalEndLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup) final
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, StreamME > streams_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
const std::string runPath_
void analyzeFile(std::string fn, unsigned int run, unsigned int lumi, std::string label) const
MonitorElement * eventsAccepted
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
MonitorElement * eventsProcessed
void setComment(std::string const &value)
MonitorElement * deliveryDelayCTime
~RamdiskMonitor() override
double getRunTimestamp() const
std::shared_ptr< rdm::Empty > globalBeginLuminosityBlock(edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup) const override
Log< level::Warning, true > LogPrint
Log< level::Info, false > LogInfo
const std::vector< std::string > streamLabels_
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * deliveryDelayMTime
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
RamdiskMonitor(const edm::ParameterSet &ps)
const std::string runInputDir_
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::set< std::string > filesSeen_
const unsigned int runNumber_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
static constexpr double LUMI