CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
DQMFileSaver Class Reference

#include <DQMFileSaver.h>

Inheritance diagram for DQMFileSaver:
edm::global::EDAnalyzer< edm::RunCache< saverDetails::NoCache >, edm::LuminosityBlockCache< saverDetails::NoCache > > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Types

enum  Convention { Online, Offline, FilterUnit }
 
enum  FileFormat { ROOT, PB }
 
- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 

Public Member Functions

 DQMFileSaver (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< saverDetails::NoCache >, edm::LuminosityBlockCache< saverDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual void analyze (edm::StreamID, const edm::Event &e, const edm::EventSetup &) const
 
virtual void beginJob (void)
 
virtual void endJob (void)
 
virtual std::shared_ptr
< saverDetails::NoCache
globalBeginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const
 
virtual std::shared_ptr
< saverDetails::NoCache
globalBeginRun (const edm::Run &, const edm::EventSetup &) const
 
virtual void globalEndLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const
 
virtual void globalEndRun (const edm::Run &, const edm::EventSetup &) const
 
virtual void postForkReacquireResources (unsigned int childIndex, unsigned int numberOfChildren)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

void fillJson (int run, int lumi, const std::string &dataFilePathName, boost::property_tree::ptree &pt) const
 
void saveForFilterUnit (const std::string &rewrite, int run, int lumi, const FileFormat fileFormat) const
 
void saveForOffline (const std::string &workflow, int run, int lumi) const
 
void saveForOfflinePB (const std::string &workflow, int run) const
 
void saveForOnline (int run, const std::string &suffix, const std::string &rewrite) const
 
void saveForOnlinePB (int run, const std::string &suffix) const
 
void saveJobReport (const std::string &filename) const
 

Private Attributes

std::string child_
 
Convention convention_
 
DQMStoredbe_
 
std::string dirName_
 
bool enableMultiThread_
 
bool fakeFilterUnitMode_
 
std::string fileBaseName_
 
FileFormat fileFormat_
 
std::atomic< int > fileUpdate_
 
std::string filterName_
 
evf::FastMonitoringServicefms_
 
int forceRunNumber_
 
std::atomic< int > irun_
 
std::atomic< int > nlumi_
 
std::atomic< int > nrun_
 
std::string producer_
 
bool runIsComplete_
 
bool saveAtJobEnd_
 
int saveByLumiSection_
 
int saveByRun_
 
int saveReference_
 
int saveReferenceQMin_
 
std::string stream_label_
 
int version_
 
std::string workflow_
 

Static Private Attributes

static const std::string streamPrefix_
 
static const std::string streamSuffix_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 15 of file DQMFileSaver.h.

Member Enumeration Documentation

Enumerator
Online 
Offline 
FilterUnit 

Definition at line 31 of file DQMFileSaver.h.

Enumerator
ROOT 
PB 

Definition at line 38 of file DQMFileSaver.h.

39  {
40  ROOT,
41  PB
42  };

Constructor & Destructor Documentation

DQMFileSaver::DQMFileSaver ( const edm::ParameterSet ps)

Definition at line 392 of file DQMFileSaver.cc.

References eb_dqm_sourceclient-live_cfg::convention, convention_, prof2calltree::count, dirName_, edm::hlt::Exception, fakeFilterUnitMode_, fileBaseName_, fileFormat_, filterName_, FilterUnit, fms_, forceRunNumber_, getAnInt(), edm::ParameterSet::getUntrackedParameter(), Offline, Online, PB, producer_, ROOT, runIsComplete_, alignCSCRings::s, saveAtJobEnd_, saveByLumiSection_, saveByRun_, saveReference_, saveReferenceQMin_, DQMStore::SaveWithoutReference, DQMStore::SaveWithReference, DQMStore::SaveWithReferenceForQTest, stream_label_, streamPrefix_, streamSuffix_, AlCaHLTBitMon_QueryRunRegistry::string, BeamSplash_cfg::version, version_, and workflow_.

393  : convention_ (Offline),
394  fileFormat_(ROOT),
395  workflow_ (""),
396  producer_ ("DQM"),
397  stream_label_ (""),
398  dirName_ ("."),
399  child_ (""),
400  filterName_(""),
401  version_ (1),
402  runIsComplete_ (false),
403  enableMultiThread_ (false),
404  saveByLumiSection_ (-1),
405  saveByRun_ (-1),
406  saveAtJobEnd_ (false),
409  forceRunNumber_ (-1),
410  fileBaseName_ (""),
411  fileUpdate_ (0),
413  nrun_ (0),
414  nlumi_ (0),
415  irun_ (0),
416  fms_(nullptr)
417 {
418  // Determine the file saving convention, and adjust defaults accordingly.
419  std::string convention = ps.getUntrackedParameter<std::string>("convention", "Offline");
420  fakeFilterUnitMode_ = ps.getUntrackedParameter<bool>("fakeFilterUnitMode", false);
421 
422  if (convention == "Offline")
424  else if (convention == "Online")
426  else if (convention == "FilterUnit")
428  else
429  throw cms::Exception("DQMFileSaver")
430  << "Invalid 'convention' parameter '" << convention << "'."
431  << " Expected one of 'Online' or 'Offline' or 'FilterUnit'.";
432 
433  // If this is neither online nor FU convention, check workflow.
434  // In this way, FU is treated as online, so we cannot specify a workflow. TBC
436  {
438  if (workflow_.empty()
439  || workflow_[0] != '/'
440  || *workflow_.rbegin() == '/'
441  || std::count(workflow_.begin(), workflow_.end(), '/') != 3
442  || workflow_.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
443  "abcdefghijklmnopqrstuvwxyz"
444  "0123456789"
445  "-_/") != std::string::npos)
446  throw cms::Exception("DQMFileSaver")
447  << "Invalid 'workflow' parameter '" << workflow_
448  << "'. Expected '/A/B/C'.";
449  }
450  else if (! ps.getUntrackedParameter<std::string>("workflow", "").empty())
451  throw cms::Exception("DQMFileSaver")
452  << "The 'workflow' parameter must be empty in 'Online' and 'FilterUnit' conventions.";
453  else // for online set parameters
454  {
455  workflow_="/Global/Online/P5";
456  }
457 
458  // Determine the file format, and adjust defaults accordingly.
459  std::string fileFormat = ps.getUntrackedParameter<std::string>("fileFormat", "ROOT");
460  if (fileFormat == "ROOT")
461  fileFormat_ = ROOT;
462  else if (fileFormat == "PB")
463  fileFormat_ = PB;
464  else
465  throw cms::Exception("DQMFileSaver")
466  << "Invalid 'fileFormat' parameter '" << fileFormat << "'."
467  << " Expected one of 'ROOT' or 'PB'.";
468 
469  // Allow file producer to be set to specific values in certain conditions.
471  // Setting the same constraints on file producer both for online and FilterUnit conventions
472  // TODO(diguida): limit the producer for FilterUnit to be 'DQM' or 'HLTDQM'?
473  // TODO(diguida): how to handle histograms produced in the playback for the FU case?
475  && producer_ != "DQM"
476  && producer_ != "HLTDQM"
477  && producer_ != "Playback")
478  {
479  throw cms::Exception("DQMFileSaver")
480  << "Invalid 'producer' parameter '" << producer_
481  << "'. Expected 'DQM', 'HLTDQM' or 'Playback'.";
482  }
483  else if (convention_ != Online
484  && convention != FilterUnit
485  && producer_ != "DQM")
486  {
487  throw cms::Exception("DQMFileSaver")
488  << "Invalid 'producer' parameter '" << producer_
489  << "'. Expected 'DQM'.";
490  }
491 
493 
494  // version number to be used in filename
495  version_ = ps.getUntrackedParameter<int>("version", version_);
496  // flag to signal that file contains data from complete run
497  runIsComplete_ = ps.getUntrackedParameter<bool>("runIsComplete", runIsComplete_);
498 
499  // Check how we should save the references.
500  std::string refsave = ps.getUntrackedParameter<std::string>("referenceHandling", "default");
501  if (refsave == "default")
502  ;
503  else if (refsave == "skip")
504  {
506  // std::cout << "skip saving all references" << std::endl;
507  }
508  else if (refsave == "all")
509  {
511  // std::cout << "saving all references" << std::endl;
512  }
513  else if (refsave == "qtests")
514  {
516  // std::cout << "saving qtest references" << std::endl;
517  }
518  else
519  throw cms::Exception("DQMFileSaver")
520  << "Invalid 'referenceHandling' parameter '" << refsave
521  << "'. Expected 'default', 'skip', 'all' or 'qtests'.";
522 
523  // Check minimum required quality test result for which reference is saved.
524  saveReferenceQMin_ = ps.getUntrackedParameter<int>("referenceRequireStatus", saveReferenceQMin_);
525 
526  // Get and check the output directory.
527  struct stat s;
529  if (dirName_.empty() || stat(dirName_.c_str(), &s) == -1)
530  throw cms::Exception("DQMFileSaver")
531  << "Invalid 'dirName' parameter '" << dirName_ << "'.";
532 
534  // Find out when and how to save files. The following contraints apply:
535  // - For online, filter unit, and offline, allow files to be saved per lumi
536  // - For online, allow files to be saved per run, at event and time intervals.
537  // - For offline allow files to be saved per run, at job end, and run number to be overridden (for mc data).
539  {
540  getAnInt(ps, saveByLumiSection_, "saveByLumiSection");
541  }
542 
543  if (convention_ == Online)
544  {
545  getAnInt(ps, saveByRun_, "saveByRun");
546  }
547 
548  if (convention_ == Offline)
549  {
550  getAnInt(ps, saveByRun_, "saveByRun");
551  getAnInt(ps, forceRunNumber_, "forceRunNumber");
552  saveAtJobEnd_ = ps.getUntrackedParameter<bool>("saveAtJobEnd", saveAtJobEnd_);
553  }
554 
555  // Set up base file name:
556  // - for online and offline, follow the convention <dirName>/<producer>_V<4digits>_
557  // - for FilterUnit, we need to follow the DAQ2 convention, so we need the run and lumisection:
558  // the path is provided by the DAQ director service.
559  if (convention_ != FilterUnit)
560  {
561  char version[8];
562  sprintf(version, "_V%04d_", int(version_));
563  version[7]='\0';
564  fileBaseName_ = dirName_ + "/" + producer_ + version;
565  }
566  else if (fakeFilterUnitMode_)
567  {
568  edm::LogInfo("DQMFileSaver")
569  << "Fake FU mode, files are saved under <dirname>/runXXXXXX/runXXXXXX_lsXXXX_<stream_Label>.pb.\n";
570  }
571  else
572  {
573  // For FU, dirName_ will not be considered at all
574  edm::LogInfo("DQMFileSaver")
575  << "The base dir provided in the configuration '" << dirName_ << "'\n"
576  << " will not be considered: for FU, the DAQ2 services will handle directories\n";
577  //check that DAQ2 services are available: throw if not
580 
581  if (!(fms_ && daqDirector))
582  throw cms::Exception("DQMFileSaver")
583  << "Internal error, cannot initialize DAQ services.";
584  }
585 
586  // Log some information what we will do.
587  edm::LogInfo("DQMFileSaver")
588  << "DQM file saving settings:\n"
589  << " using base file name '" << fileBaseName_ << "'\n"
590  << " forcing run number " << forceRunNumber_ << "\n"
591  << " saving every " << saveByLumiSection_ << " lumi section(s)\n"
592  << " saving every " << saveByRun_ << " run(s)\n"
593  << " saving at job end: " << (saveAtJobEnd_ ? "yes" : "no") << "\n";
594 }
T getUntrackedParameter(std::string const &, T const &) const
int forceRunNumber_
Definition: DQMFileSaver.h:73
int saveReferenceQMin_
Definition: DQMFileSaver.h:72
Convention convention_
Definition: DQMFileSaver.h:55
evf::FastMonitoringService * fms_
Definition: DQMFileSaver.h:86
DQMStore * dbe_
Definition: DQMFileSaver.h:78
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:80
std::string dirName_
Definition: DQMFileSaver.h:60
std::string fileBaseName_
Definition: DQMFileSaver.h:75
int saveByLumiSection_
Definition: DQMFileSaver.h:68
bool enableMultiThread_
Definition: DQMFileSaver.h:65
static void getAnInt(const edm::ParameterSet &ps, int &value, const std::string &name)
Definition: DQMFileSaver.cc:38
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:66
bool runIsComplete_
Definition: DQMFileSaver.h:64
std::string stream_label_
Definition: DQMFileSaver.h:59
static const std::string streamPrefix_
Definition: DQMFileSaver.h:88
std::string workflow_
Definition: DQMFileSaver.h:57
std::string producer_
Definition: DQMFileSaver.h:58
std::string child_
Definition: DQMFileSaver.h:61
int saveReference_
Definition: DQMFileSaver.h:71
std::string filterName_
Definition: DQMFileSaver.h:62
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:76
FileFormat fileFormat_
Definition: DQMFileSaver.h:56
std::atomic< int > irun_
Definition: DQMFileSaver.h:83
bool saveAtJobEnd_
Definition: DQMFileSaver.h:70
std::atomic< int > nrun_
Definition: DQMFileSaver.h:79
static const int STATUS_OK
static const std::string streamSuffix_
Definition: DQMFileSaver.h:89

Member Function Documentation

void DQMFileSaver::analyze ( edm::StreamID  ,
const edm::Event e,
const edm::EventSetup  
) const
protectedvirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 633 of file DQMFileSaver.cc.

634 {
635  //save by event and save by time are not supported
636  //anymore in the threaded framework. please use
637  //savebyLumiSection instead.
638 }
void DQMFileSaver::beginJob ( void  )
protectedvirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 598 of file DQMFileSaver.cc.

References dbe_, enableMultiThread_, DQMStore::enableMultiThread_, irun_, nlumi_, and nrun_.

599 {
600  nrun_ = nlumi_ = irun_ = 0;
601 
602  // Determine if we are running multithreading asking to the DQMStore. Not to be moved in the ctor
604 }
DQMStore * dbe_
Definition: DQMFileSaver.h:78
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:80
bool enableMultiThread_
Definition: DQMFileSaver.h:65
std::atomic< int > irun_
Definition: DQMFileSaver.h:83
std::atomic< int > nrun_
Definition: DQMFileSaver.h:79
bool enableMultiThread_
Definition: DQMStore.h:686
void DQMFileSaver::endJob ( void  )
protectedvirtual

Reimplemented from edm::global::EDAnalyzerBase.

Definition at line 758 of file DQMFileSaver.cc.

References child_, convention_, edm::hlt::Exception, fileBaseName_, fileFormat_, lut2db_cfg::filename, forceRunNumber_, irun_, Offline, onlineOfflineFileName(), saveAtJobEnd_, saveForOffline(), saveJobReport(), AlCaHLTBitMon_QueryRunRegistry::string, createPayload::suffix, and workflow_.

759 {
760  if (saveAtJobEnd_)
761  {
762  if (convention_ == Offline && forceRunNumber_ > 0)
764  else if (convention_ == Offline)
766  else
767  throw cms::Exception("DQMFileSaver")
768  << "Internal error. Can only save files at the end of the"
769  << " job in Offline mode.";
770  }
771 
772  // save JobReport once per job
773  char suffix[64];
774  sprintf(suffix, "R%09d", irun_.load());
776  saveJobReport(filename);
777 }
int forceRunNumber_
Definition: DQMFileSaver.h:73
void saveForOffline(const std::string &workflow, int run, int lumi) const
Definition: DQMFileSaver.cc:86
Convention convention_
Definition: DQMFileSaver.h:55
std::string fileBaseName_
Definition: DQMFileSaver.h:75
void saveJobReport(const std::string &filename) const
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:59
std::string workflow_
Definition: DQMFileSaver.h:57
std::string child_
Definition: DQMFileSaver.h:61
FileFormat fileFormat_
Definition: DQMFileSaver.h:56
std::atomic< int > irun_
Definition: DQMFileSaver.h:83
bool saveAtJobEnd_
Definition: DQMFileSaver.h:70
tuple filename
Definition: lut2db_cfg.py:20
void DQMFileSaver::fillJson ( int  run,
int  lumi,
const std::string &  dataFilePathName,
boost::property_tree::ptree &  pt 
) const
private

Definition at line 238 of file DQMFileSaver.cc.

References data, edm::hlt::Exception, fakeFilterUnitMode_, fms_, evf::FastMonitoringService::getEventsProcessedForLumi(), query::host, merge::inputFiles, cmsHarvester::path, sysUtil::pid, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by saveForFilterUnit().

239 {
240  namespace bpt = boost::property_tree;
241  namespace bfs = boost::filesystem;
242  int hostnameReturn;
243  char host[32];
244  hostnameReturn = gethostname(host ,sizeof(host));
245  if (hostnameReturn == -1)
246  throw cms::Exception("DQMFileSaver")
247  << "Internal error, cannot get host name";
248 
249  int pid = getpid();
250  std::ostringstream oss_pid;
251  oss_pid << pid;
252 
253  // Stat the data file: if not there, throw
254  struct stat dataFileStat;
255  if (stat(dataFilePathName.c_str(), &dataFileStat) != 0)
256  throw cms::Exception("DQMFileSaver")
257  << "Internal error, cannot get data file: "
258  << dataFilePathName;
259  // Extract only the data file name from the full path
260  std::string dataFileName = bfs::path(dataFilePathName).filename().string();
261  // The availability test of the FastMonitoringService was done in the ctor.
262  bpt::ptree data;
263  bpt::ptree processedEvents, acceptedEvents, errorEvents, bitmask, fileList, fileSize, inputFiles;
264 
265  processedEvents.put("", fms_ ? (fms_->getEventsProcessedForLumi(lumi)) : -1); // Processed events
266  acceptedEvents.put("", fms_ ? (fms_->getEventsProcessedForLumi(lumi)) : -1); // Accepted events, same as processed for our purposes
267 
268  errorEvents.put("", 0); // Error events
269  bitmask.put("", 0); // Bitmask of abs of CMSSW return code
270  fileList.put("", dataFileName); // Data file the information refers to
271  fileSize.put("", dataFileStat.st_size); // Size in bytes of the data file
272  inputFiles.put("", ""); // We do not care about input files!
273 
274  data.push_back(std::make_pair("", processedEvents));
275  data.push_back(std::make_pair("", acceptedEvents));
276  data.push_back(std::make_pair("", errorEvents));
277  data.push_back(std::make_pair("", bitmask));
278  data.push_back(std::make_pair("", fileList));
279  data.push_back(std::make_pair("", fileSize));
280  data.push_back(std::make_pair("", inputFiles));
281 
282  pt.add_child("data", data);
283 
284  if (fakeFilterUnitMode_) {
285  pt.put("definition", "/fakeDefinition.jsn");
286  } else {
287  // The availability test of the EvFDaqDirector Service was done in the ctor.
288  bfs::path outJsonDefName(edm::Service<evf::EvFDaqDirector>()->baseRunDir()); //we assume this file is written bu the EvF Output module
289  outJsonDefName /= (std::string("output_") + oss_pid.str() + std::string(".jsd"));
290  pt.put("definition", outJsonDefName.string());
291  }
292 
293  char sourceInfo[64]; //host and pid information
294  sprintf(sourceInfo, "%s_%d", host, pid);
295  pt.put("source", sourceInfo);
296 }
tuple lumi
Definition: fjr2json.py:35
evf::FastMonitoringService * fms_
Definition: DQMFileSaver.h:86
unsigned int getEventsProcessedForLumi(unsigned int lumi)
tuple path
else: Piece not in the list, fine.
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:66
string host
Definition: query.py:114
tuple pid
Definition: sysUtil.py:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple inputFiles
Definition: merge.py:5
std::shared_ptr< saverDetails::NoCache > DQMFileSaver::globalBeginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup  
) const
protectedvirtual

Definition at line 627 of file DQMFileSaver.cc.

References nlumi_.

628 {
629  ++nlumi_;
630  return nullptr;
631 }
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:80
std::shared_ptr< saverDetails::NoCache > DQMFileSaver::globalBeginRun ( const edm::Run r,
const edm::EventSetup  
) const
protectedvirtual

Definition at line 607 of file DQMFileSaver.cc.

References convention_, fakeFilterUnitMode_, mergeVDriftHistosByStation::file, FilterUnit, evf::EvFDaqDirector::getInitFilePath(), nrun_, stream_label_, and AlCaHLTBitMon_QueryRunRegistry::string.

608 {
609  ++nrun_;
610 
611  // For Filter Unit, create an empty ini file:
612  // it is needed by the HLT deamon in order to start merging
613  // The run number is established in the service
614  // TODO(diguida): check that they are the same?
616  {
618  const std::string initFileName = daqDirector->getInitFilePath(stream_label_);
619  std::ofstream file(initFileName);
620  file.close();
621  }
622 
623  return nullptr;
624 }
Convention convention_
Definition: DQMFileSaver.h:55
std::string getInitFilePath(std::string const &stream) const
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:66
std::string stream_label_
Definition: DQMFileSaver.h:59
std::atomic< int > nrun_
Definition: DQMFileSaver.h:79
void DQMFileSaver::globalEndLuminosityBlock ( const edm::LuminosityBlock iLS,
const edm::EventSetup  
) const
protectedvirtual

Definition at line 641 of file DQMFileSaver.cc.

References convention_, edm::hlt::Exception, fileFormat_, FilterUnit, fms_, evf::FastMonitoringService::getEventsProcessedForLumi(), edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), nlumi_, Offline, Online, PB, ROOT, edm::LuminosityBlockID::run(), saveByLumiSection_, saveForFilterUnit(), saveForOffline(), saveForOnline(), saveForOnlinePB(), createPayload::suffix, and workflow_.

642 {
643  int ilumi = iLS.id().luminosityBlock();
644  int irun = iLS.id().run();
645  if (ilumi > 0 && saveByLumiSection_ > 0 )
646  {
648  throw cms::Exception("DQMFileSaver")
649  << "Internal error, can save files at end of lumi block"
650  << " only in Online, FilterUnit or Offline mode.";
651 
652  if (convention_ == Online && (nlumi_ % saveByLumiSection_) == 0) // insist on lumi section ordering
653  {
654  char suffix[64];
655  char rewrite[128];
656  sprintf(suffix, "_R%09d_L%06d", irun, ilumi);
657  sprintf(rewrite, "\\1Run %d/\\2/By Lumi Section %d-%d", irun, ilumi-nlumi_, ilumi);
658  if (fileFormat_ == ROOT)
659  saveForOnline(irun, suffix, rewrite);
660  else if (fileFormat_ == PB)
661  saveForOnlinePB(irun, suffix);
662  else
663  throw cms::Exception("DQMFileSaver")
664  << "Internal error, can save files"
665  << " only in ROOT or ProtocolBuffer format.";
666  }
667  // store at every lumi section end only if some events have been processed
669  {
670  char rewrite[128];
671  sprintf(rewrite, "\\1Run %d/\\2/By Lumi Section %d-%d", irun, ilumi, ilumi);
672  saveForFilterUnit(rewrite, irun, ilumi, fileFormat_);
673  }
674  if (convention_ == Offline)
675  {
676  if (fileFormat_ == ROOT)
677  saveForOffline(workflow_, irun, ilumi);
678  else
679  // TODO(diguida): do we need to support lumisection saving in Offline for PB?
680  // In this case, for ROOT, we only save EventInfo folders: we can filter them...
681  throw cms::Exception("DQMFileSaver")
682  << "Internal error, can save files"
683  << " only in ROOT format.";
684  }
685  }
686 }
LuminosityBlockID id() const
void saveForOffline(const std::string &workflow, int run, int lumi) const
Definition: DQMFileSaver.cc:86
Convention convention_
Definition: DQMFileSaver.h:55
evf::FastMonitoringService * fms_
Definition: DQMFileSaver.h:86
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:80
unsigned int getEventsProcessedForLumi(unsigned int lumi)
int saveByLumiSection_
Definition: DQMFileSaver.h:68
RunNumber_t run() const
void saveForOnline(int run, const std::string &suffix, const std::string &rewrite) const
std::string workflow_
Definition: DQMFileSaver.h:57
void saveForOnlinePB(int run, const std::string &suffix) const
FileFormat fileFormat_
Definition: DQMFileSaver.h:56
LuminosityBlockNumber_t luminosityBlock() const
void saveForFilterUnit(const std::string &rewrite, int run, int lumi, const FileFormat fileFormat) const
void DQMFileSaver::globalEndRun ( const edm::Run iRun,
const edm::EventSetup  
) const
protectedvirtual

Definition at line 689 of file DQMFileSaver.cc.

References convention_, data, dirName_, edm::hlt::Exception, fakeFilterUnitMode_, mergeVDriftHistosByStation::file, fileFormat_, cmsPerfStripChart::format, edm::RunBase::id(), irun_, nlumi_, nrun_, Offline, Online, PB, RecoTauCleanerPlugins::pt, ROOT, edm::RunID::run(), saveByRun_, saveForOffline(), saveForOfflinePB(), saveForOnline(), saveForOnlinePB(), AlCaHLTBitMon_QueryRunRegistry::string, createPayload::suffix, and workflow_.

690 {
691  int irun = iRun.id().run();
692  irun_ = irun;
693  if (irun > 0 && saveByRun_ > 0 && (nrun_ % saveByRun_) == 0)
694  {
695  if (convention_ == Online)
696  {
697  char suffix[64];
698  sprintf(suffix, "_R%09d", irun);
699  char rewrite[64];
700  sprintf(rewrite, "\\1Run %d/\\2/Run summary", irun);
701  if (fileFormat_ == ROOT)
702  saveForOnline(irun, suffix, rewrite);
703  else if (fileFormat_ == PB)
704  saveForOnlinePB(irun, suffix);
705  else
706  throw cms::Exception("DQMFileSaver")
707  << "Internal error, can save files"
708  << " only in ROOT or ProtocolBuffer format.";
709  }
710  else if (convention_ == Offline && fileFormat_ == ROOT)
711  saveForOffline(workflow_, irun, 0);
712  else if (convention_ == Offline && fileFormat_ == PB)
714  else
715  throw cms::Exception("DQMFileSaver")
716  << "Internal error. Can only save files in endRun()"
717  << " in Online and Offline modes.";
718  }
719 
720  // create a fake EoR file for testing purposes.
721  if (fakeFilterUnitMode_) {
722  edm::LogInfo("DQMFileSaver")
723  << "Producing fake EoR file.\n";
724 
725  std::string runDir = str(boost::format("%s/run%06d") % dirName_ % irun);
726  std::string jsonFilePathName = str(boost::format("%s/run%06d_ls0000_EoR.jsn") % runDir % irun);
727  std::string openJsonFilePathName = jsonFilePathName + ".open";
728 
729  boost::filesystem::create_directories(runDir);
730 
731  using namespace boost::property_tree;
732  ptree pt;
733  ptree data;
734 
735  ptree child1, child2, child3;
736 
737  child1.put("", -1); // Processed
738  child2.put("", -1); // Accepted
739  child3.put("", nlumi_); // number of lumi
740 
741  data.push_back(std::make_pair("", child1));
742  data.push_back(std::make_pair("", child2));
743  data.push_back(std::make_pair("", child3));
744 
745  pt.add_child("data", data);
746  pt.put("definition", "/non-existant/");
747  pt.put("source", "--hostname--");
748 
749  std::ofstream file(jsonFilePathName);
750  write_json(file, pt, true);
751  file.close();
752 
753  rename(openJsonFilePathName.c_str(), jsonFilePathName.c_str());
754  }
755 }
RunID const & id() const
Definition: RunBase.h:41
void saveForOffline(const std::string &workflow, int run, int lumi) const
Definition: DQMFileSaver.cc:86
RunNumber_t run() const
Definition: RunID.h:43
Convention convention_
Definition: DQMFileSaver.h:55
string format
Some error handling for the usage.
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:80
std::string dirName_
Definition: DQMFileSaver.h:60
void saveForOnline(int run, const std::string &suffix, const std::string &rewrite) const
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:66
std::string workflow_
Definition: DQMFileSaver.h:57
void saveForOnlinePB(int run, const std::string &suffix) const
FileFormat fileFormat_
Definition: DQMFileSaver.h:56
std::atomic< int > irun_
Definition: DQMFileSaver.h:83
void saveForOfflinePB(const std::string &workflow, int run) const
Definition: DQMFileSaver.cc:77
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::atomic< int > nrun_
Definition: DQMFileSaver.h:79
void DQMFileSaver::postForkReacquireResources ( unsigned int  childIndex,
unsigned int  numberOfChildren 
)
protectedvirtual

Definition at line 780 of file DQMFileSaver.cc.

References child_, and AlCaHLTBitMon_QueryRunRegistry::string.

781 {
782  // this is copied from IOPool/Output/src/PoolOutputModule.cc, for consistency
783  unsigned int digits = 0;
784  while (numberOfChildren != 0) {
785  ++digits;
786  numberOfChildren /= 10;
787  }
788  // protect against zero numberOfChildren
789  if (digits == 0) {
790  digits = 3;
791  }
792 
793  char buffer[digits + 2];
794  snprintf(buffer, digits + 2, "_%0*d", digits, childIndex);
795  child_ = std::string(buffer);
796 }
std::string child_
Definition: DQMFileSaver.h:61
void DQMFileSaver::saveForFilterUnit ( const std::string &  rewrite,
int  run,
int  lumi,
const FileFormat  fileFormat 
) const
private

Definition at line 299 of file DQMFileSaver.cc.

References dataFileExtension(), dbe_, dirName_, enableMultiThread_, edm::hlt::Exception, fakeFilterUnitMode_, fileUpdate_, fillJson(), filterName_, cmsPerfStripChart::format, PB, RecoTauCleanerPlugins::pt, ROOT, DQMStore::save(), DQMStore::savePB(), saveReference_, saveReferenceQMin_, stream_label_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by globalEndLuminosityBlock().

300 {
301  // get from DAQ2 services where to store the files according to their format
302  namespace bpt = boost::property_tree;
303  bpt::ptree pt;
304 
305  std::string openJsonFilePathName;
306  std::string jsonFilePathName;
307  std::string openHistoFilePathName;
308  std::string histoFilePathName;
309 
310  // create the files names
311  if (fakeFilterUnitMode_) {
312  std::string runDir = str(boost::format("%s/run%06d") % dirName_ % run);
313  std::string baseName = str(boost::format("%s/run%06d_ls%04d_%s") % runDir % run % lumi % stream_label_ );
314 
315  boost::filesystem::create_directories(runDir);
316 
317  jsonFilePathName = baseName + ".jsn";
318  openJsonFilePathName = jsonFilePathName + ".open";
319 
320  histoFilePathName = baseName + dataFileExtension(fileFormat);
321  openHistoFilePathName = histoFilePathName + ".open";
322  } else {
323  openJsonFilePathName = edm::Service<evf::EvFDaqDirector>()->getOpenOutputJsonFilePath(lumi, stream_label_);
324  jsonFilePathName = edm::Service<evf::EvFDaqDirector>()->getOutputJsonFilePath(lumi, stream_label_);
325 
326  if (fileFormat == ROOT) {
327  openHistoFilePathName = edm::Service<evf::EvFDaqDirector>()->getOpenRootHistogramFilePath(lumi, stream_label_);
328  histoFilePathName = edm::Service<evf::EvFDaqDirector>()->getRootHistogramFilePath(lumi, stream_label_);
329  } else if (fileFormat == PB) {
330  openHistoFilePathName = edm::Service<evf::EvFDaqDirector>()->getOpenProtocolBufferHistogramFilePath(lumi, stream_label_);
331  histoFilePathName = edm::Service<evf::EvFDaqDirector>()->getProtocolBufferHistogramFilePath(lumi, stream_label_);
332  }
333  }
334 
335  if (fileFormat == ROOT)
336  {
337  // Save the file with the full directory tree,
338  // modifying it according to @a rewrite,
339  // but not looking for MEs inside the DQMStore, as in the online case,
340  // nor filling new MEs, as in the offline case.
341  dbe_->save(openHistoFilePathName,
342  "",
343  "^(Reference/)?([^/]+)",
344  rewrite,
345  enableMultiThread_ ? run : 0,
346  lumi,
349  fileUpdate_ ? "UPDATE" : "RECREATE",
350  true);
351  }
352  else if (fileFormat == PB)
353  {
354  // Save the file in the open directory.
355  dbe_->savePB(openHistoFilePathName,
356  filterName_,
357  enableMultiThread_ ? run : 0,
358  lumi,
359  true);
360  }
361  else
362  throw cms::Exception("DQMFileSaver")
363  << "Internal error, can save files"
364  << " only in ROOT or ProtocolBuffer format.";
365 
366  // Now move the the data and json files into the output directory.
367  rename(openHistoFilePathName.c_str(), histoFilePathName.c_str());
368 
369  // Write the json file in the open directory.
370  fillJson(run, lumi, histoFilePathName, pt);
371  write_json(openJsonFilePathName, pt);
372  rename(openJsonFilePathName.c_str(), jsonFilePathName.c_str());
373 }
int saveReferenceQMin_
Definition: DQMFileSaver.h:72
static std::string dataFileExtension(DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:48
tuple lumi
Definition: fjr2json.py:35
DQMStore * dbe_
Definition: DQMFileSaver.h:78
string format
Some error handling for the usage.
std::string dirName_
Definition: DQMFileSaver.h:60
SaveReferenceTag
Definition: DQMStore.h:76
void fillJson(int run, int lumi, const std::string &dataFilePathName, boost::property_tree::ptree &pt) const
bool enableMultiThread_
Definition: DQMFileSaver.h:65
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:66
std::string stream_label_
Definition: DQMFileSaver.h:59
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0, const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2364
int saveReference_
Definition: DQMFileSaver.h:71
std::string filterName_
Definition: DQMFileSaver.h:62
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:76
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", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2485
void DQMFileSaver::saveForOffline ( const std::string &  workflow,
int  run,
int  lumi 
) const
private

Definition at line 86 of file DQMFileSaver.cc.

References DQMStore::cd(), child_, gather_cfg::cout, dbe_, alignCSCRings::e, enableMultiThread_, fileBaseName_, lut2db_cfg::filename, fileUpdate_, DQMStore::getSubdirs(), i, onlineOfflineFileName(), ROOT, DQMStore::save(), saveReference_, saveReferenceQMin_, DQMStore::SaveWithoutReference, dqm::qstatus::STATUS_OK, AlCaHLTBitMon_QueryRunRegistry::string, and createPayload::suffix.

Referenced by endJob(), globalEndLuminosityBlock(), and globalEndRun().

87 {
88  char suffix[64];
89  sprintf(suffix, "R%09d", run);
90 
91  char rewrite[128];
92  if (lumi == 0) // save for run
93  sprintf(rewrite, "\\1Run %d/\\2/Run summary", run);
94  else
95  sprintf(rewrite, "\\1Run %d/\\2/By Lumi Section %d-%d", run, lumi, lumi);
96 
98 
99  if (lumi == 0) // save for run
100  {
101  dbe_->save(filename,
102  "",
103  "^(Reference/)?([^/]+)",
104  rewrite,
105  enableMultiThread_ ? run : 0,
106  lumi,
109  fileUpdate_ ? "UPDATE" : "RECREATE");
110  }
111  else // save EventInfo folders for luminosity sections
112  {
113  std::vector<std::string> systems = (dbe_->cd(), dbe_->getSubdirs());
114 
115  std::cout << " DQMFileSaver: storing EventInfo folders for Run: "
116  << run << ", Lumi Section: " << lumi << ", Subsystems: " ;
117 
118  for (size_t i = 0, e = systems.size(); i != e; ++i) {
119  if (systems[i] != "Reference") {
120  dbe_->cd();
121  std::cout << systems[i] << " " ;
122  dbe_->save(filename,
123  systems[i]+"/EventInfo", "^(Reference/)?([^/]+)",
124  rewrite,
125  enableMultiThread_ ? run : 0,
126  lumi,
129  fileUpdate_ ? "UPDATE" : "RECREATE");
130  // from now on update newly created file
131  if (fileUpdate_.load() == 0) fileUpdate_ = 1;
132  }
133  }
134  }
135 }
int i
Definition: DBlmapReader.cc:9
int saveReferenceQMin_
Definition: DQMFileSaver.h:72
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1644
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:632
tuple lumi
Definition: fjr2json.py:35
DQMStore * dbe_
Definition: DQMFileSaver.h:78
std::string fileBaseName_
Definition: DQMFileSaver.h:75
SaveReferenceTag
Definition: DQMStore.h:76
bool enableMultiThread_
Definition: DQMFileSaver.h:65
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:59
std::string child_
Definition: DQMFileSaver.h:61
int saveReference_
Definition: DQMFileSaver.h:71
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:76
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", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2485
tuple filename
Definition: lut2db_cfg.py:20
static const int STATUS_OK
tuple cout
Definition: gather_cfg.py:121
void DQMFileSaver::saveForOfflinePB ( const std::string &  workflow,
int  run 
) const
private

Definition at line 77 of file DQMFileSaver.cc.

References child_, dbe_, fileBaseName_, lut2db_cfg::filename, filterName_, onlineOfflineFileName(), PB, DQMStore::savePB(), AlCaHLTBitMon_QueryRunRegistry::string, and createPayload::suffix.

Referenced by globalEndRun().

78 {
79  char suffix[64];
80  sprintf(suffix, "R%09d", run);
82  dbe_->savePB(filename, filterName_);
83 }
DQMStore * dbe_
Definition: DQMFileSaver.h:78
std::string fileBaseName_
Definition: DQMFileSaver.h:75
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:59
void savePB(const std::string &filename, const std::string &path="", const uint32_t run=0, const uint32_t lumi=0, const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2364
std::string child_
Definition: DQMFileSaver.h:61
std::string filterName_
Definition: DQMFileSaver.h:62
tuple filename
Definition: lut2db_cfg.py:20
void DQMFileSaver::saveForOnline ( int  run,
const std::string &  suffix,
const std::string &  rewrite 
) const
private

Definition at line 185 of file DQMFileSaver.cc.

References DQMStore::cd(), child_, dbe_, doSaveForOnline(), alignCSCRings::e, enableMultiThread_, fileBaseName_, DQMStore::get(), DQMStore::getMatchingContents(), DQMStore::getSubdirs(), i, ROOT, saveReference_, and saveReferenceQMin_.

Referenced by globalEndLuminosityBlock(), and globalEndRun().

186 {
187  std::vector<std::string> systems = (dbe_->cd(), dbe_->getSubdirs());
188 
189  for (size_t i = 0, e = systems.size(); i != e; ++i)
190  {
191  if (systems[i] != "Reference")
192  {
193  dbe_->cd();
194  if (MonitorElement* me = dbe_->get(systems[i] + "/EventInfo/processName"))
195  {
197  fileBaseName_ + me->getStringValue() + suffix + child_ + ".root",
198  "", "^(Reference/)?([^/]+)", rewrite,
201  "", ROOT);
202  return;
203  }
204  }
205  }
206 
207  // look for EventInfo folder in an unorthodox location
208  for (size_t i = 0, e = systems.size(); i != e; ++i)
209  if (systems[i] != "Reference")
210  {
211  dbe_->cd();
212  std::vector<MonitorElement*> pNamesVector = dbe_->getMatchingContents("^" + systems[i] + "/.*/EventInfo/processName",lat::Regexp::Perl);
213  if (pNamesVector.size() > 0){
215  fileBaseName_ + systems[i] + suffix + child_ + ".root",
216  "", "^(Reference/)?([^/]+)", rewrite,
219  "", ROOT);
220  pNamesVector.clear();
221  return;
222  }
223  }
224 
225  // if no EventInfo Folder is found, then store subsystem wise
226  for (size_t i = 0, e = systems.size(); i != e; ++i)
227  if (systems[i] != "Reference")
229  fileBaseName_ + systems[i] + suffix + child_ + ".root",
230  systems[i], "^(Reference/)?([^/]+)", rewrite,
233  "", ROOT);
234 }
int i
Definition: DBlmapReader.cc:9
int saveReferenceQMin_
Definition: DQMFileSaver.h:72
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1644
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:632
std::vector< MonitorElement * > getMatchingContents(const std::string &pattern, lat::Regexp::Syntax syntaxType=lat::Regexp::Wildcard) const
Definition: DQMStore.cc:1944
DQMStore * dbe_
Definition: DQMFileSaver.h:78
std::string fileBaseName_
Definition: DQMFileSaver.h:75
SaveReferenceTag
Definition: DQMStore.h:76
bool enableMultiThread_
Definition: DQMFileSaver.h:65
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1693
std::string child_
Definition: DQMFileSaver.h:61
int saveReference_
Definition: DQMFileSaver.h:71
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)
void DQMFileSaver::saveForOnlinePB ( int  run,
const std::string &  suffix 
) const
private

Definition at line 168 of file DQMFileSaver.cc.

References child_, dbe_, doSaveForOnline(), enableMultiThread_, fileBaseName_, lut2db_cfg::filename, filterName_, onlineOfflineFileName(), PB, saveReference_, saveReferenceQMin_, AlCaHLTBitMon_QueryRunRegistry::string, and workflow_.

Referenced by globalEndLuminosityBlock(), and globalEndRun().

169 {
170  // The file name contains the Online workflow name,
171  // as we do not want to look inside the DQMStore,
172  // and the @a suffix, defined in the run/lumi transitions.
173  // TODO(diguida): add the possibility to change the dir structure with rewrite.
176  filename,
177  "", "^(Reference/)?([^/]+)", "\\1\\2",
180  filterName_,
181  PB);
182 }
int saveReferenceQMin_
Definition: DQMFileSaver.h:72
DQMStore * dbe_
Definition: DQMFileSaver.h:78
std::string fileBaseName_
Definition: DQMFileSaver.h:75
SaveReferenceTag
Definition: DQMStore.h:76
bool enableMultiThread_
Definition: DQMFileSaver.h:65
static std::string onlineOfflineFileName(const std::string &fileBaseName, const std::string &suffix, const std::string &workflow, const std::string &child, DQMFileSaver::FileFormat fileFormat)
Definition: DQMFileSaver.cc:59
std::string workflow_
Definition: DQMFileSaver.h:57
std::string child_
Definition: DQMFileSaver.h:61
int saveReference_
Definition: DQMFileSaver.h:71
std::string filterName_
Definition: DQMFileSaver.h:62
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)
tuple filename
Definition: lut2db_cfg.py:20
void DQMFileSaver::saveJobReport ( const std::string &  filename) const
private

Definition at line 376 of file DQMFileSaver.cc.

References info(), edm::Service< T >::isAvailable(), and edm::JobReport::reportAnalysisFile().

Referenced by endJob().

377 {
378 
379  // Report the file to job report service.
381  if (jr.isAvailable())
382  {
383  std::map<std::string, std::string> info;
384  info["Source"] = "DQMStore";
385  info["FileClass"] = "DQM";
386  jr->reportAnalysisFile(filename, info);
387  }
388 
389 }
static const TGPicture * info(bool iBackgroundIsBlack)
bool isAvailable() const
Definition: Service.h:46
void reportAnalysisFile(std::string const &fileName, std::map< std::string, std::string > const &fileData)
Definition: JobReport.cc:559
tuple filename
Definition: lut2db_cfg.py:20

Member Data Documentation

std::string DQMFileSaver::child_
private
Convention DQMFileSaver::convention_
private
DQMStore* DQMFileSaver::dbe_
private
std::string DQMFileSaver::dirName_
private

Definition at line 60 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), globalEndRun(), and saveForFilterUnit().

bool DQMFileSaver::enableMultiThread_
private
bool DQMFileSaver::fakeFilterUnitMode_
private
std::string DQMFileSaver::fileBaseName_
private
FileFormat DQMFileSaver::fileFormat_
private

Definition at line 56 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), endJob(), globalEndLuminosityBlock(), and globalEndRun().

std::atomic<int> DQMFileSaver::fileUpdate_
mutableprivate

Definition at line 76 of file DQMFileSaver.h.

Referenced by saveForFilterUnit(), and saveForOffline().

std::string DQMFileSaver::filterName_
private

Definition at line 62 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), saveForFilterUnit(), saveForOfflinePB(), and saveForOnlinePB().

evf::FastMonitoringService* DQMFileSaver::fms_
private

Definition at line 86 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), fillJson(), and globalEndLuminosityBlock().

int DQMFileSaver::forceRunNumber_
private

Definition at line 73 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and endJob().

std::atomic<int> DQMFileSaver::irun_
mutableprivate

Definition at line 83 of file DQMFileSaver.h.

Referenced by beginJob(), endJob(), and globalEndRun().

std::atomic<int> DQMFileSaver::nlumi_
mutableprivate
std::atomic<int> DQMFileSaver::nrun_
mutableprivate

Definition at line 79 of file DQMFileSaver.h.

Referenced by beginJob(), globalBeginRun(), and globalEndRun().

std::string DQMFileSaver::producer_
private

Definition at line 58 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

bool DQMFileSaver::runIsComplete_
private

Definition at line 64 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

bool DQMFileSaver::saveAtJobEnd_
private

Definition at line 70 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and endJob().

int DQMFileSaver::saveByLumiSection_
private

Definition at line 68 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and globalEndLuminosityBlock().

int DQMFileSaver::saveByRun_
private

Definition at line 69 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), and globalEndRun().

int DQMFileSaver::saveReference_
private
int DQMFileSaver::saveReferenceQMin_
private
std::string DQMFileSaver::stream_label_
private

Definition at line 59 of file DQMFileSaver.h.

Referenced by DQMFileSaver(), globalBeginRun(), and saveForFilterUnit().

const std::string DQMFileSaver::streamPrefix_
staticprivate

Definition at line 88 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

const std::string DQMFileSaver::streamSuffix_
staticprivate

Definition at line 89 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

int DQMFileSaver::version_
private

Definition at line 63 of file DQMFileSaver.h.

Referenced by DQMFileSaver().

std::string DQMFileSaver::workflow_
private