CMS 3D CMS Logo

Functions
DQMFileSaver.cc File Reference
#include "DQMFileSaver.h"
#include "DQMServices/Components/interface/fillJson.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 49 of file DQMFileSaver.cc.

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

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

50 {
52  if (fileFormat == DQMFileSaver::ROOT)
53  extension = ".root";
54  else if (fileFormat == DQMFileSaver::PB)
55  extension = ".pb";
56  return extension;
57 }
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 165 of file DQMFileSaver.cc.

References DQMFileSaver::PB, DQMFileSaver::ROOT, DQMStore::save(), and DQMStore::savePB().

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

176 {
177  // TODO(rovere): fix the online case. so far we simply rely on the
178  // fact that we assume we will not run multithreaded in online.
179  if (fileFormat == DQMFileSaver::ROOT)
180  store->save(filename,
181  directory,
182  rxpat,
183  rewrite,
184  enableMultiThread ? run : 0,
185  0,
186  saveref,
187  saveRefQMin);
188  else if (fileFormat == DQMFileSaver::PB)
189  store->savePB(filename,
190  filterName,
191  enableMultiThread ? run : 0);
192 }
void savePB(std::string const &filename, std::string const &path="", uint32_t run=0, uint32_t lumi=0)
Definition: DQMStore.cc:2650
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
Definition: DQMStore.cc:2465
static void getAnInt ( const edm::ParameterSet ps,
int &  value,
const std::string &  name 
)
static

Definition at line 39 of file DQMFileSaver.cc.

References Exception, edm::ParameterSet::getUntrackedParameter(), dataset::name, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

Referenced by DQMFileSaver::DQMFileSaver().

40 {
42  if (value < 1 && value != -1)
43  throw cms::Exception("DQMFileSaver")
44  << "Invalid '" << name << "' parameter '" << value
45  << "'. Must be -1 or >= 1.";
46 }
T getUntrackedParameter(std::string const &, T const &) const
Definition: value.py:1
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 60 of file DQMFileSaver.cc.

References dataFileExtension(), corrVsCorr::filename, AlCaHLTBitMon_QueryRunRegistry::string, and globaldigis_analyze_cff::workflow.

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

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