CMS 3D CMS Logo

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 electrons_cff::extension, DQMFileSaver::PB, DQMFileSaver::ROOT, and AlCaHLTBitMon_QueryRunRegistry::string.

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

49 {
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 164 of file DQMFileSaver.cc.

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

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

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

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