CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
DQMFileSaver.cc File Reference
#include "DQMServices/Components/src/DQMFileSaver.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Version/interface/GetReleaseVersion.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/MessageLogger/interface/JobReport.h"
#include "EventFilter/Utilities/interface/EvFDaqDirector.h"
#include "EventFilter/Utilities/interface/FastMonitoringService.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <utility>
#include <TString.h>
#include <TSystem.h>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>

Go to the source code of this file.

Functions

static std::string dataFileExtension (DQMFileSaver::FileFormat fileFormat)
 
static void doSaveForOnline (DQMStore *store, int run, bool enableMultiThread, const std::string &filename, const std::string &directory, const std::string &rxpat, const std::string &rewrite, DQMStore::SaveReferenceTag saveref, int saveRefQMin, const std::string &filterName, DQMFileSaver::FileFormat fileFormat)
 
static void getAnInt (const edm::ParameterSet &ps, int &value, const std::string &name)
 
static std::string onlineOfflineFileName (const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
 

Function Documentation

static std::string dataFileExtension ( DQMFileSaver::FileFormat  fileFormat)
static

Definition at line 48 of file DQMFileSaver.cc.

References DQMFileSaver::PB, DQMFileSaver::ROOT, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by onlineOfflineFileName(), and DQMFileSaver::saveForFilterUnit().

49 {
50  std::string extension;
51  if (fileFormat == DQMFileSaver::ROOT)
52  extension = ".root";
53  else if (fileFormat == DQMFileSaver::PB)
54  extension = ".pb";
55  return extension;
56 }
static void doSaveForOnline ( DQMStore store,
int  run,
bool  enableMultiThread,
const std::string &  filename,
const std::string &  directory,
const std::string &  rxpat,
const std::string &  rewrite,
DQMStore::SaveReferenceTag  saveref,
int  saveRefQMin,
const std::string &  filterName,
DQMFileSaver::FileFormat  fileFormat 
)
static

Definition at line 160 of file DQMFileSaver.cc.

References DQMFileSaver::PB, and DQMFileSaver::ROOT.

Referenced by DQMFileSaver::saveForOnline(), and DQMFileSaver::saveForOnlinePB().

171 {
172  // TODO(rovere): fix the online case. so far we simply rely on the
173  // fact that we assume we will not run multithreaded in online.
174  if (fileFormat == DQMFileSaver::ROOT)
175  store->save(filename,
176  directory,
177  rxpat,
178  rewrite,
179  enableMultiThread ? run : 0,
180  0,
181  saveref,
182  saveRefQMin);
183  else if (fileFormat == DQMFileSaver::PB)
184  store->savePB(filename,
185  filterName,
186  enableMultiThread ? run : 0);
187 }
tuple filename
Definition: lut2db_cfg.py:20
static void getAnInt ( const edm::ParameterSet ps,
int &  value,
const std::string &  name 
)
static

Definition at line 38 of file DQMFileSaver.cc.

References Exception, edm::ParameterSet::getUntrackedParameter(), mergeVDriftHistosByStation::name, and relativeConstraints::value.

Referenced by DQMFileSaver::DQMFileSaver().

39 {
41  if (value < 1 && value != -1)
42  throw cms::Exception("DQMFileSaver")
43  << "Invalid '" << name << "' parameter '" << value
44  << "'. Must be -1 or >= 1.";
45 }
T getUntrackedParameter(std::string const &, T const &) const
static std::string onlineOfflineFileName ( const std::string &  fileBaseName,
const std::string &  suffix,
const std::string &  workflow,
const std::string &  child,
DQMFileSaver::FileFormat  fileFormat 
)
static

Definition at line 59 of file DQMFileSaver.cc.

References dataFileExtension(), lut2db_cfg::filename, AlCaHLTBitMon_QueryRunRegistry::string, and reco_calib_source_client_cfg::workflow.

Referenced by DQMFileSaver::endJob(), DQMFileSaver::saveForOffline(), DQMFileSaver::saveForOfflinePB(), and DQMFileSaver::saveForOnlinePB().

64 {
65  size_t pos = 0;
66  std::string wflow;
67  wflow.reserve(workflow.size() + 3);
68  wflow = workflow;
69  while ((pos = wflow.find('/', pos)) != std::string::npos)
70  wflow.replace(pos++, 1, "__");
71 
72  std::string filename = fileBaseName + suffix + wflow + child + dataFileExtension(fileFormat);
73  return filename;
74 }
static std::string dataFileExtension(DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:48
tuple filename
Definition: lut2db_cfg.py:20